From bf461c6f985b8aa56bd052c4d3c3ec5fe8cd2f86 Mon Sep 17 00:00:00 2001
From: Riccardo Piccoli
Date: Thu, 30 Jul 2026 19:34:24 +0200
Subject: [PATCH 1/4] NO-ISSUE: Bump controller-runtime v0.16.3 to v0.23.3
(vendor)
Update controller-runtime and all k8s.io dependencies to align
with Kubernetes 1.35. Remove k8s.io/api, apimachinery, and
kube-openapi replace directives that pinned to v0.29.9. Remove
gnostic-models version pin. Update vendored dependencies to
versions compatible with controller-runtime 0.23.3:
- openshift/baremetal-operator (main, 2026-07-30)
- openshift/cluster-baremetal-operator (main, 2026-07-30)
- openshift/hive (master, 2026-07-29)
- openshift/generic-admission-server (master, 2026-03-05)
Key version changes:
- sigs.k8s.io/controller-runtime: v0.16.3 -> v0.23.3
- k8s.io/client-go: v0.29.9 -> v0.35.6
- k8s.io/api, apimachinery, apiextensions: -> v0.35.6
Assisted-by: Claude Code
---
api/go.mod | 36 +-
api/go.sum | 97 +-
.../go-openapi/analysis/.golangci.yml | 53 +-
.../github.com/go-openapi/analysis/README.md | 10 +-
.../go-openapi/analysis/appveyor.yml | 32 -
.../github.com/go-openapi/analysis/doc.go | 10 +-
.../github.com/go-openapi/analysis/flatten.go | 64 +-
.../go-openapi/analysis/flatten_name.go | 39 +-
.../go-openapi/analysis/flatten_options.go | 1 +
.../analysis/internal/debug/debug.go | 4 +-
.../internal/flatten/replace/replace.go | 42 +-
.../analysis/internal/flatten/sortref/keys.go | 2 +-
.../github.com/go-openapi/analysis/mixin.go | 16 +-
.../github.com/go-openapi/analysis/schema.go | 12 +-
.../go-openapi/errors/.golangci.yml | 61 +-
.../github.com/go-openapi/errors/README.md | 5 +-
.../github.com/go-openapi/errors/api.go | 20 +-
.../github.com/go-openapi/errors/headers.go | 2 +-
.../go-openapi/errors/middleware.go | 2 +-
.../github.com/go-openapi/errors/parsing.go | 3 +-
.../github.com/go-openapi/errors/schema.go | 116 +-
.../go-openapi/jsonpointer/.golangci.yml | 31 +-
.../go-openapi/jsonpointer/errors.go | 18 +
.../go-openapi/jsonpointer/pointer.go | 49 +-
.../go-openapi/jsonreference/.golangci.yml | 57 +-
.../go-openapi/jsonreference/README.md | 14 +-
.../github.com/go-openapi/loads/.golangci.yml | 49 +-
.../github.com/go-openapi/loads/README.md | 2 +-
api/vendor/github.com/go-openapi/loads/doc.go | 9 +-
.../github.com/go-openapi/loads/loaders.go | 9 +-
.../github.com/go-openapi/loads/spec.go | 35 +-
.../github.com/go-openapi/spec/.gitignore | 3 +-
.../github.com/go-openapi/spec/.golangci.yml | 21 +-
.../github.com/go-openapi/spec/README.md | 28 +-
.../github.com/go-openapi/spec/appveyor.yml | 32 -
.../github.com/go-openapi/spec/bindata.go | 297 -
.../github.com/go-openapi/spec/embed.go | 17 +
.../github.com/go-openapi/spec/expander.go | 75 +-
.../go-openapi/spec/normalizer_nonwindows.go | 2 +-
.../github.com/go-openapi/spec/operation.go | 5 +-
.../github.com/go-openapi/spec/parameter.go | 42 +-
.../go-openapi/spec/schema_loader.go | 9 +-
.../spec/schemas/jsonschema-draft-04.json | 149 +
.../go-openapi/spec/schemas/v2/schema.json | 1607 ++
api/vendor/github.com/go-openapi/spec/spec.go | 6 +-
.../github.com/go-openapi/spec/swagger.go | 4 +-
.../github.com/go-openapi/spec/url_go18.go | 8 -
.../github.com/go-openapi/spec/url_go19.go | 3 -
.../go-openapi/strfmt/.golangci.yml | 92 +-
.../github.com/go-openapi/strfmt/README.md | 5 +-
.../github.com/go-openapi/strfmt/bson.go | 6 +-
.../github.com/go-openapi/strfmt/default.go | 52 +-
.../github.com/go-openapi/strfmt/format.go | 5 +-
.../github.com/go-openapi/strfmt/time.go | 8 +-
.../github.com/go-openapi/swag/.golangci.yml | 34 +-
.../github.com/go-openapi/swag/errors.go | 15 +
api/vendor/github.com/go-openapi/swag/json.go | 3 +-
.../github.com/go-openapi/swag/loading.go | 2 +-
api/vendor/github.com/go-openapi/swag/yaml.go | 32 +-
.../go-openapi/validate/.golangci.yml | 56 +-
.../go-openapi/validate/BENCHMARK.md | 31 +
.../github.com/go-openapi/validate/README.md | 8 +-
.../go-openapi/validate/default_validator.go | 108 +-
.../go-openapi/validate/example_validator.go | 66 +-
.../github.com/go-openapi/validate/formats.go | 78 +-
.../github.com/go-openapi/validate/helpers.go | 21 +-
.../go-openapi/validate/object_validator.go | 448 +-
.../github.com/go-openapi/validate/options.go | 1 +
.../github.com/go-openapi/validate/pools.go | 366 +
.../go-openapi/validate/pools_debug.go | 1012 +
.../github.com/go-openapi/validate/result.go | 131 +-
.../github.com/go-openapi/validate/schema.go | 258 +-
.../go-openapi/validate/schema_option.go | 31 +-
.../go-openapi/validate/schema_props.go | 412 +-
.../go-openapi/validate/slice_validator.go | 57 +-
.../github.com/go-openapi/validate/spec.go | 133 +-
.../go-openapi/validate/spec_messages.go | 5 +
.../github.com/go-openapi/validate/type.go | 72 +-
.../go-openapi/validate/validator.go | 934 +-
.../github.com/go-openapi/validate/values.go | 26 +-
api/vendor/github.com/gogo/protobuf/AUTHORS | 15 -
.../github.com/gogo/protobuf/CONTRIBUTORS | 23 -
api/vendor/github.com/gogo/protobuf/LICENSE | 35 -
.../github.com/gogo/protobuf/proto/Makefile | 43 -
.../github.com/gogo/protobuf/proto/clone.go | 258 -
.../gogo/protobuf/proto/custom_gogo.go | 39 -
.../github.com/gogo/protobuf/proto/decode.go | 427 -
.../gogo/protobuf/proto/deprecated.go | 63 -
.../github.com/gogo/protobuf/proto/discard.go | 350 -
.../gogo/protobuf/proto/duration.go | 100 -
.../gogo/protobuf/proto/duration_gogo.go | 49 -
.../github.com/gogo/protobuf/proto/encode.go | 205 -
.../gogo/protobuf/proto/encode_gogo.go | 33 -
.../github.com/gogo/protobuf/proto/equal.go | 300 -
.../gogo/protobuf/proto/extensions.go | 605 -
.../gogo/protobuf/proto/extensions_gogo.go | 389 -
.../github.com/gogo/protobuf/proto/lib.go | 973 -
.../gogo/protobuf/proto/lib_gogo.go | 50 -
.../gogo/protobuf/proto/message_set.go | 181 -
.../gogo/protobuf/proto/pointer_reflect.go | 357 -
.../protobuf/proto/pointer_reflect_gogo.go | 59 -
.../gogo/protobuf/proto/pointer_unsafe.go | 308 -
.../protobuf/proto/pointer_unsafe_gogo.go | 56 -
.../gogo/protobuf/proto/properties.go | 610 -
.../gogo/protobuf/proto/properties_gogo.go | 36 -
.../gogo/protobuf/proto/skip_gogo.go | 119 -
.../gogo/protobuf/proto/table_marshal.go | 3009 ---
.../gogo/protobuf/proto/table_marshal_gogo.go | 388 -
.../gogo/protobuf/proto/table_merge.go | 676 -
.../gogo/protobuf/proto/table_unmarshal.go | 2249 ---
.../protobuf/proto/table_unmarshal_gogo.go | 385 -
.../github.com/gogo/protobuf/proto/text.go | 930 -
.../gogo/protobuf/proto/text_gogo.go | 57 -
.../gogo/protobuf/proto/text_parser.go | 1018 -
.../gogo/protobuf/proto/timestamp.go | 113 -
.../gogo/protobuf/proto/timestamp_gogo.go | 49 -
.../gogo/protobuf/proto/wrappers.go | 1888 --
.../gogo/protobuf/proto/wrappers_gogo.go | 113 -
.../gogo/protobuf/sortkeys/sortkeys.go | 101 -
.../github.com/google/uuid/CHANGELOG.md | 41 +
.../github.com/google/uuid/CONTRIBUTING.md | 26 +
.../github.com/google/uuid/CONTRIBUTORS | 9 +
.../vendor/github.com/google/uuid}/LICENSE | 3 +-
api/vendor/github.com/google/uuid/README.md | 21 +
api/vendor/github.com/google/uuid/dce.go | 80 +
api/vendor/github.com/google/uuid/doc.go | 12 +
api/vendor/github.com/google/uuid/hash.go | 59 +
api/vendor/github.com/google/uuid/marshal.go | 38 +
api/vendor/github.com/google/uuid/node.go | 90 +
api/vendor/github.com/google/uuid/node_js.go | 12 +
api/vendor/github.com/google/uuid/node_net.go | 33 +
api/vendor/github.com/google/uuid/null.go | 118 +
api/vendor/github.com/google/uuid/sql.go | 59 +
api/vendor/github.com/google/uuid/time.go | 134 +
api/vendor/github.com/google/uuid/util.go | 43 +
api/vendor/github.com/google/uuid/uuid.go | 365 +
api/vendor/github.com/google/uuid/version1.go | 44 +
api/vendor/github.com/google/uuid/version4.go | 76 +
api/vendor/github.com/google/uuid/version6.go | 56 +
api/vendor/github.com/google/uuid/version7.go | 104 +
.../mailru/easyjson/jlexer/bytestostr.go | 5 +-
.../mailru/easyjson/jlexer/lexer.go | 113 +-
.../mailru/easyjson/jwriter/writer.go | 12 +
.../api/config/v1/types_apiserver.go | 64 +
.../api/config/v1/types_authentication.go | 397 +-
.../config/v1/types_cluster_image_policy.go | 2 +-
.../api/config/v1/types_cluster_version.go | 95 +-
.../openshift/api/config/v1/types_feature.go | 9 +-
.../api/config/v1/types_image_policy.go | 26 +-
.../api/config/v1/types_infrastructure.go | 105 +-
.../openshift/api/config/v1/types_ingress.go | 1 +
.../openshift/api/config/v1/types_insights.go | 1 +
.../openshift/api/config/v1/types_network.go | 4 +-
.../api/config/v1/types_scheduling.go | 4 +-
.../api/config/v1/types_tlssecurityprofile.go | 181 +-
.../api/config/v1/zz_generated.deepcopy.go | 311 +-
..._generated.featuregated-crd-manifests.yaml | 13 +-
.../v1/zz_generated.swagger_doc_generated.go | 205 +-
.../v1/types_controlplanemachineset.go | 3 +-
..._generated.featuregated-crd-manifests.yaml | 1 -
.../api/machine/v1beta1/types_awsprovider.go | 118 +-
.../api/machine/v1beta1/types_machine.go | 21 +
.../api/machine/v1beta1/types_machineset.go | 9 +
.../machine/v1beta1/zz_generated.deepcopy.go | 70 +-
.../zz_generated.swagger_doc_generated.go | 39 +-
.../api/operator/v1/types_console.go | 11 +-
.../operator/v1/types_machineconfiguration.go | 11 +-
.../api/operator/v1/types_network.go | 121 +-
.../api/operator/v1/zz_generated.deepcopy.go | 34 +
..._generated.featuregated-crd-manifests.yaml | 7 +-
.../v1/zz_generated.swagger_doc_generated.go | 27 +-
.../apis/hive/v1/clusterdeprovision_types.go | 9 +-
.../hive/apis/hive/v1/clusterpool_types.go | 2 +-
.../hive/apis/hive/v1/vsphere/machinepools.go | 23 +-
.../hive/apis/hive/v1/vsphere/platform.go | 34 +-
.../hive/v1/vsphere/zz_generated.deepcopy.go | 27 +-
.../apis/hive/v1/zz_generated.deepcopy.go | 9 +-
.../github.com/openshift/installer/LICENSE | 202 +
.../github.com/openshift/installer/NOTICE | 5 +
.../installer/pkg/types/vsphere/OWNERS | 7 +
.../installer/pkg/types/vsphere/doc.go | 7 +
.../pkg/types/vsphere/machinepool.go | 122 +
.../installer/pkg/types/vsphere/metadata.go | 25 +
.../installer/pkg/types/vsphere/platform.go | 370 +
.../types/vsphere/zz_generated.deepcopy.go | 283 +
.../bson/bsoncodec/array_codec.go | 7 +-
.../bson/bsoncodec/byte_slice_codec.go | 25 +-
.../bson/bsoncodec/codec_cache.go | 166 +
.../bson/bsoncodec/default_value_decoders.go | 48 +-
.../bson/bsoncodec/default_value_encoders.go | 68 +-
.../bson/bsoncodec/empty_interface_codec.go | 24 +-
.../mongo-driver/bson/bsoncodec/map_codec.go | 38 +-
.../bson/bsoncodec/pointer_codec.go | 75 +-
.../mongo-driver/bson/bsoncodec/registry.go | 163 +-
.../bson/bsoncodec/slice_codec.go | 29 +-
.../bson/bsoncodec/string_codec.go | 16 +-
.../bson/bsoncodec/struct_codec.go | 151 +-
.../mongo-driver/bson/bsoncodec/time_codec.go | 24 +-
.../mongo-driver/bson/bsoncodec/types.go | 1 +
.../mongo-driver/bson/bsoncodec/uint_codec.go | 32 +-
.../mongo-driver/bson/bsonrw/copier.go | 13 +-
.../bson/bsonrw/extjson_parser.go | 4 +-
.../bson/bsonrw/extjson_reader.go | 5 +-
.../bson/bsonrw/extjson_wrappers.go | 4 +-
.../bson/bsonrw/extjson_writer.go | 20 +-
.../mongo-driver/bson/bsonrw/json_scanner.go | 53 +-
.../mongo-driver/bson/bsonrw/value_reader.go | 24 +-
.../mongo-driver/bson/bsonrw/value_writer.go | 74 +-
.../mongo-driver/bson/bsontype/bsontype.go | 12 +
.../go.mongodb.org/mongo-driver/bson/doc.go | 94 +-
.../mongo-driver/bson/marshal.go | 32 +-
.../mongo-driver/bson/primitive/decimal.go | 9 +-
.../mongo-driver/bson/primitive/objectid.go | 4 +-
.../mongo-driver/bson/primitive_codecs.go | 18 +-
.../go.mongodb.org/mongo-driver/bson/raw.go | 11 +-
.../mongo-driver/bson/raw_value.go | 14 +-
.../mongo-driver/bson/registry.go | 18 +-
.../go.mongodb.org/mongo-driver/bson/types.go | 1 +
.../mongo-driver/bson/unmarshal.go | 3 +
.../mongo-driver/x/bsonx/bsoncore/bsoncore.go | 45 +-
.../mongo-driver/x/bsonx/bsoncore/doc.go | 23 +-
.../mongo-driver/x/bsonx/bsoncore/element.go | 8 +-
.../mongo-driver/x/bsonx/bsoncore/value.go | 13 +-
api/vendor/k8s.io/api/authorization/v1/doc.go | 2 +
.../api/authorization/v1/generated.pb.go | 573 +-
.../v1/generated.protomessage.pb.go | 54 +
.../v1/zz_generated.model_name.go | 97 +
api/vendor/k8s.io/api/core/v1/doc.go | 2 +
api/vendor/k8s.io/api/core/v1/generated.pb.go | 9343 ++--------
api/vendor/k8s.io/api/core/v1/generated.proto | 113 +-
.../api/core/v1/generated.protomessage.pb.go | 498 +
api/vendor/k8s.io/api/core/v1/toleration.go | 57 +-
api/vendor/k8s.io/api/core/v1/types.go | 171 +-
.../core/v1/types_swagger_doc_generated.go | 62 +-
.../api/core/v1/zz_generated.deepcopy.go | 45 +
.../api/core/v1/zz_generated.model_name.go | 1212 ++
api/vendor/k8s.io/api/rbac/v1/doc.go | 2 +
api/vendor/k8s.io/api/rbac/v1/generated.pb.go | 422 +-
api/vendor/k8s.io/api/rbac/v1/generated.proto | 4 +
.../api/rbac/v1/generated.protomessage.pb.go | 46 +
api/vendor/k8s.io/api/rbac/v1/types.go | 4 +
.../api/rbac/v1/zz_generated.model_name.go | 82 +
.../pkg/api/resource/generated.pb.go | 93 +-
.../pkg/api/resource/generated.proto | 2 +
.../api/resource/generated.protomessage.pb.go | 26 +
.../apimachinery/pkg/api/resource/quantity.go | 2 +
.../pkg/api/resource/quantity_proto.go | 4 -
.../api/resource/zz_generated.model_name.go | 32 +
.../api/validate/constraints/constraints.go | 32 +
.../pkg/api/validate/content/decimal_int.go | 62 +
.../pkg/api/validate/content/dns.go | 101 +
.../pkg/api/validate/content/errors.go | 66 +
.../pkg/api/validate/content/identifier.go | 35 +
.../pkg/api/validate/content/kube.go | 101 +
.../apimachinery/pkg/apis/meta/v1/doc.go | 1 +
.../pkg/apis/meta/v1/generated.pb.go | 1520 +-
.../pkg/apis/meta/v1/generated.proto | 2 +-
.../apis/meta/v1/generated.protomessage.pb.go | 112 +
.../apimachinery/pkg/apis/meta/v1/types.go | 1 -
.../apis/meta/v1/zz_generated.model_name.go | 267 +
.../apimachinery/pkg/labels/selector.go | 4 +-
.../k8s.io/apimachinery/pkg/runtime/doc.go | 2 +
.../apimachinery/pkg/runtime/generated.pb.go | 135 +-
.../pkg/runtime/generated.protomessage.pb.go | 28 +
.../pkg/runtime/schema/generated.pb.go | 38 -
.../schema/generated.protomessage.pb.go | 22 +
.../k8s.io/apimachinery/pkg/runtime/scheme.go | 10 +
.../apimachinery/pkg/runtime/types_proto.go | 10 +
.../pkg/runtime/zz_generated.model_name.go | 92 +
.../pkg/util/intstr/generated.pb.go | 72 +-
.../pkg/util/intstr/generated.proto | 1 +
.../util/intstr/generated.protomessage.pb.go | 24 +
.../apimachinery/pkg/util/intstr/intstr.go | 1 +
.../util/intstr/zz_generated.model_name.go | 27 +
.../k8s.io/apimachinery/pkg/util/sets/set.go | 19 +-
.../util/validation/field/error_matcher.go | 135 +-
.../pkg/util/validation/field/errors.go | 8 +
.../pkg/util/validation/validation.go | 105 +-
.../vendor/k8s.io/kube-openapi}/LICENSE | 0
.../k8s.io/kube-openapi/pkg/util/trie.go | 79 +
.../k8s.io/kube-openapi/pkg/util/util.go | 126 +
api/vendor/modules.txt | 73 +-
go.mod | 198 +-
go.sum | 833 +-
vendor/cel.dev/expr/.bazelversion | 2 +
vendor/cel.dev/expr/.gitattributes | 2 +
vendor/cel.dev/expr/.gitignore | 2 +
vendor/cel.dev/expr/BUILD.bazel | 33 +
vendor/cel.dev/expr/CODE_OF_CONDUCT.md | 25 +
vendor/cel.dev/expr/CONTRIBUTING.md | 32 +
vendor/cel.dev/expr/GOVERNANCE.md | 43 +
.../moby/spdystream => cel.dev/expr}/LICENSE | 0
vendor/cel.dev/expr/MAINTAINERS.md | 13 +
vendor/cel.dev/expr/MODULE.bazel | 56 +
vendor/cel.dev/expr/README.md | 71 +
vendor/cel.dev/expr/WORKSPACE | 145 +
vendor/cel.dev/expr/WORKSPACE.bzlmod | 0
vendor/cel.dev/expr/checked.pb.go | 1231 ++
vendor/cel.dev/expr/cloudbuild.yaml | 9 +
vendor/cel.dev/expr/eval.pb.go | 468 +
vendor/cel.dev/expr/explain.pb.go | 195 +
vendor/cel.dev/expr/regen_go_proto.sh | 9 +
.../expr/regen_go_proto_canonical_protos.sh | 10 +
vendor/cel.dev/expr/syntax.pb.go | 1394 ++
vendor/cel.dev/expr/value.pb.go | 575 +
.../alecthomas/units/renovate.json5 | 15 +
.../antlr/antlr4/runtime/Go/antlr/v4/LICENSE | 26 -
.../antlr4/runtime/Go/antlr/v4/antlrdoc.go | 68 -
.../antlr4/runtime/Go/antlr/v4/atn_config.go | 303 -
.../runtime/Go/antlr/v4/atn_config_set.go | 441 -
.../runtime/Go/antlr/v4/input_stream.go | 113 -
.../antlr4/runtime/Go/antlr/v4/jcollect.go | 198 -
.../runtime/Go/antlr/v4/prediction_context.go | 806 -
.../runtime/Go/antlr/v4/prediction_mode.go | 529 -
.../runtime/Go/antlr/v4/rule_context.go | 114 -
.../antlr4/runtime/Go/antlr/v4/utils_set.go | 235 -
.../github.com/antlr4-go/antlr/v4/.gitignore | 18 +
vendor/github.com/antlr4-go/antlr/v4/LICENSE | 28 +
.../github.com/antlr4-go/antlr/v4/README.md | 54 +
.../github.com/antlr4-go/antlr/v4/antlrdoc.go | 102 +
.../runtime/Go => antlr4-go}/antlr/v4/atn.go | 9 +-
.../antlr4-go/antlr/v4/atn_config.go | 335 +
.../antlr4-go/antlr/v4/atn_config_set.go | 301 +
.../antlr/v4/atn_deserialization_options.go | 7 +-
.../antlr/v4/atn_deserializer.go | 9 +-
.../antlr/v4/atn_simulator.go | 17 +-
.../Go => antlr4-go}/antlr/v4/atn_state.go | 224 +-
.../Go => antlr4-go}/antlr/v4/atn_type.go | 0
.../Go => antlr4-go}/antlr/v4/char_stream.go | 2 +-
.../antlr/v4/common_token_factory.go | 0
.../antlr/v4/common_token_stream.go | 39 +-
.../Go => antlr4-go}/antlr/v4/comparators.go | 33 +-
.../antlr4-go/antlr/v4/configuration.go | 214 +
.../runtime/Go => antlr4-go}/antlr/v4/dfa.go | 47 +-
.../antlr/v4/dfa_serializer.go | 2 +-
.../Go => antlr4-go}/antlr/v4/dfa_state.go | 29 +-
.../antlr/v4/diagnostic_error_listener.go | 11 +-
.../antlr/v4/error_listener.go | 40 +-
.../antlr/v4/error_strategy.go | 450 +-
.../Go => antlr4-go}/antlr/v4/errors.go | 73 +-
.../Go => antlr4-go}/antlr/v4/file_stream.go | 46 +-
.../antlr4-go/antlr/v4/input_stream.go | 157 +
.../Go => antlr4-go}/antlr/v4/int_stream.go | 0
.../Go => antlr4-go}/antlr/v4/interval_set.go | 60 +-
.../github.com/antlr4-go/antlr/v4/jcollect.go | 685 +
.../Go => antlr4-go}/antlr/v4/lexer.go | 68 +-
.../Go => antlr4-go}/antlr/v4/lexer_action.go | 100 +-
.../antlr/v4/lexer_action_executor.go | 61 +-
.../antlr/v4/lexer_atn_simulator.go | 185 +-
.../Go => antlr4-go}/antlr/v4/ll1_analyzer.go | 62 +-
.../antlr4-go/antlr/v4/nostatistics.go | 47 +
.../Go => antlr4-go}/antlr/v4/parser.go | 160 +-
.../antlr/v4/parser_atn_simulator.go | 787 +-
.../antlr/v4/parser_rule_context.go | 85 +-
.../antlr4-go/antlr/v4/prediction_context.go | 727 +
.../antlr/v4/prediction_context_cache.go | 48 +
.../antlr4-go/antlr/v4/prediction_mode.go | 536 +
.../Go => antlr4-go}/antlr/v4/recognizer.go | 65 +-
.../antlr4-go/antlr/v4/rule_context.go | 40 +
.../antlr/v4/semantic_context.go | 33 +-
.../antlr4-go/antlr/v4/statistics.go | 281 +
.../antlr4-go/antlr/v4/stats_data.go | 23 +
.../Go => antlr4-go}/antlr/v4/token.go | 36 +-
.../Go => antlr4-go}/antlr/v4/token_source.go | 0
.../Go => antlr4-go}/antlr/v4/token_stream.go | 3 +-
.../antlr/v4/tokenstream_rewriter.go | 221 +-
.../antlr/v4/trace_listener.go | 0
.../Go => antlr4-go}/antlr/v4/transition.go | 229 +-
.../runtime/Go => antlr4-go}/antlr/v4/tree.go | 109 +-
.../Go => antlr4-go}/antlr/v4/trees.go | 22 +-
.../Go => antlr4-go}/antlr/v4/utils.go | 84 +-
vendor/github.com/coreos/go-json/README.md | 18 +-
vendor/github.com/coreos/go-json/decode.go | 99 +-
vendor/github.com/coreos/go-json/encode.go | 104 +-
vendor/github.com/coreos/go-json/fuzz.go | 10 +-
vendor/github.com/coreos/go-json/scanner.go | 2 +-
vendor/github.com/coreos/go-json/stream.go | 8 +-
vendor/github.com/coreos/go-json/tags.go | 16 +-
.../coreos/go-systemd/v22/journal/journal.go | 2 +-
.../go-systemd/v22/journal/journal_unix.go | 8 +-
.../coreos/go-systemd/v22/unit/deserialize.go | 41 +-
.../coreos/go-systemd/v22/unit/doc.go | 12 +
.../coreos/go-systemd/v22/unit/option.go | 2 +-
.../coreos/go-systemd/v22/unit/serialize.go | 1 -
.../v2/config/shared/errors/errors.go | 15 +-
.../ignition/v2/config/shared/parse/unit.go | 37 +
.../coreos/ignition/v2/config/util/config.go | 1 +
.../ignition/v2/config/v3_0/types/config.go | 38 +
.../ignition/v2/config/v3_0/types/storage.go | 42 +-
.../ignition/v2/config/v3_0/types/systemd.go | 61 +
.../ignition/v2/config/v3_0/types/unit.go | 20 +-
.../ignition/v2/config/v3_1/types/config.go | 38 +
.../ignition/v2/config/v3_1/types/storage.go | 42 +-
.../ignition/v2/config/v3_1/types/systemd.go | 61 +
.../ignition/v2/config/v3_1/types/unit.go | 20 +-
.../ignition/v2/config/v3_2/types/config.go | 38 +
.../ignition/v2/config/v3_2/types/storage.go | 42 +-
.../ignition/v2/config/v3_2/types/systemd.go | 61 +
.../ignition/v2/config/v3_2/types/unit.go | 20 +-
.../ignition/v2/config/validate/validate.go | 4 +-
.../github.com/diskfs/go-diskfs/.golangci.yml | 4 -
vendor/github.com/diskfs/go-diskfs/Makefile | 2 +-
vendor/github.com/diskfs/go-diskfs/README.md | 45 +-
.../github.com/diskfs/go-diskfs/disk/disk.go | 18 +
.../diskfs/go-diskfs/disk/disk_wasip1.go | 10 +
vendor/github.com/diskfs/go-diskfs/diskfs.go | 6 +-
.../diskfs/go-diskfs/diskfs_other.go | 4 +-
.../go-diskfs/filesystem/ext4/blockgroup.go | 55 +
.../go-diskfs/filesystem/ext4/checksum.go | 50 +
.../go-diskfs/filesystem/ext4/consts.go | 5 +
.../go-diskfs/filesystem/ext4/crc/crc16.go | 44 +
.../go-diskfs/filesystem/ext4/crc/crc32.go | 74 +
.../go-diskfs/filesystem/ext4/directory.go | 211 +
.../filesystem/ext4/directoryentry.go | 176 +
.../go-diskfs/filesystem/ext4/dirhash.go | 157 +
.../diskfs/go-diskfs/filesystem/ext4/ext4.go | 1748 ++
.../diskfs/go-diskfs/filesystem/ext4/ext4.md | 335 +
.../go-diskfs/filesystem/ext4/extent.go | 733 +
.../go-diskfs/filesystem/ext4/features.go | 451 +
.../diskfs/go-diskfs/filesystem/ext4/file.go | 208 +
.../go-diskfs/filesystem/ext4/fileinfo.go | 48 +
.../filesystem/ext4/groupdescriptors.go | 327 +
.../diskfs/go-diskfs/filesystem/ext4/inode.go | 588 +
.../filesystem/ext4/journaldevice_other.go | 12 +
.../filesystem/ext4/journaldevice_shared.go | 40 +
.../filesystem/ext4/journaldevice_windows.go | 11 +
.../go-diskfs/filesystem/ext4/md4/md4.go | 73 +
.../go-diskfs/filesystem/ext4/miscflags.go | 34 +
.../go-diskfs/filesystem/ext4/mountoptions.go | 182 +
.../go-diskfs/filesystem/ext4/superblock.go | 768 +
.../diskfs/go-diskfs/filesystem/ext4/util.go | 106 +
.../go-diskfs/filesystem/fat32/fat32.go | 34 +-
.../diskfs/go-diskfs/filesystem/filesystem.go | 2 +
.../filesystem/iso9660/directoryentry.go | 51 +-
.../directoryentrysystemuseextension.go | 2 +-
.../go-diskfs/filesystem/iso9660/eltorito.go | 12 +-
.../go-diskfs/filesystem/iso9660/file.go | 2 +-
.../go-diskfs/filesystem/iso9660/finalize.go | 259 +-
.../go-diskfs/filesystem/iso9660/iso9660.go | 56 +-
.../go-diskfs/filesystem/iso9660/rockridge.go | 51 +-
.../filesystem/squashfs/compressor.go | 34 +-
.../filesystem/squashfs/directory.go | 13 +-
.../filesystem/squashfs/directoryentry.go | 175 +-
.../go-diskfs/filesystem/squashfs/file.go | 86 +-
.../go-diskfs/filesystem/squashfs/finalize.go | 29 +-
.../filesystem/squashfs/finalize_wasip1.go | 18 +
.../go-diskfs/filesystem/squashfs/inode.go | 23 +-
.../go-diskfs/filesystem/squashfs/lru.go | 138 +
.../filesystem/squashfs/metadatablock.go | 59 +-
.../go-diskfs/filesystem/squashfs/squashfs.go | 174 +-
.../go-diskfs/filesystem/squashfs/xattr.go | 4 +-
.../go-diskfs/partition/gpt/partition.go | 11 +
.../diskfs/go-diskfs/partition/gpt/table.go | 153 +-
.../go-diskfs/partition/mbr/partition.go | 10 +-
.../diskfs/go-diskfs/partition/mbr/table.go | 62 +-
.../go-diskfs/partition/part/partition.go | 1 +
.../diskfs/go-diskfs/partition/table.go | 3 +
.../diskfs/go-diskfs/util/bitmap.go | 171 +
.../diskfs/go-diskfs/util/uniqify.go | 13 +
.../djherbis/times}/LICENSE | 0
.../djherbis/times}/README.md | 11 +-
.../djherbis/times}/ctime_windows.go | 0
.../djherbis/times}/js.cover.dockerfile | 4 +-
.../djherbis/times}/js.cover.sh | 0
.../djherbis/times/linux.cover.dockerfile | 6 +
.../github.com/djherbis/times/linux.cover.sh | 7 +
.../djherbis/times}/times.go | 0
.../djherbis/times}/times_aix.go | 0
.../djherbis/times}/times_darwin.go | 0
.../djherbis/times}/times_dragonfly.go | 0
.../djherbis/times}/times_freebsd.go | 0
.../djherbis/times}/times_js.go | 0
.../github.com/djherbis/times/times_linux.go | 185 +
.../djherbis/times}/times_nacl.go | 0
.../djherbis/times}/times_netbsd.go | 0
.../djherbis/times}/times_openbsd.go | 0
.../djherbis/times}/times_plan9.go | 0
.../djherbis/times}/times_solaris.go | 0
.../djherbis/times/times_wasip1.go} | 15 +-
.../djherbis/times}/times_windows.go | 0
.../djherbis/times}/use_generic_stat.go | 11 +-
.../emicklei/go-restful/v3/.travis.yml | 13 -
.../emicklei/go-restful/v3/CHANGES.md | 4 +
.../emicklei/go-restful/v3/README.md | 1 +
.../emicklei/go-restful/v3/curly.go | 50 +-
.../emicklei/go-restful/v3/custom_verb.go | 34 +-
.../github.com/emicklei/go-restful/v3/doc.go | 42 +-
.../json-patch/v5/internal/json/encode.go | 13 +
.../json-patch/v5/internal/json/stream.go | 24 +-
.../github.com/evanphx/json-patch/v5/merge.go | 78 +-
.../github.com/evanphx/json-patch/v5/patch.go | 188 +-
.../exponent-io/jsonpath/.travis.yml | 6 +-
.../exponent-io/jsonpath/decoder.go | 13 +-
.../github.com/fsnotify/fsnotify/.cirrus.yml | 7 +-
.../fsnotify/fsnotify/.editorconfig | 12 -
.../fsnotify/fsnotify/.gitattributes | 1 -
.../github.com/fsnotify/fsnotify/.gitignore | 3 +
.../github.com/fsnotify/fsnotify/CHANGELOG.md | 67 +-
.../fsnotify/fsnotify/CONTRIBUTING.md | 121 +-
vendor/github.com/fsnotify/fsnotify/README.md | 2 -
.../fsnotify/fsnotify/backend_fen.go | 401 +-
.../fsnotify/fsnotify/backend_inotify.go | 735 +-
.../fsnotify/fsnotify/backend_kqueue.go | 783 +-
.../fsnotify/fsnotify/backend_other.go | 203 +-
.../fsnotify/fsnotify/backend_windows.go | 321 +-
.../github.com/fsnotify/fsnotify/fsnotify.go | 370 +-
.../fsnotify/fsnotify/internal/darwin.go | 39 +
.../fsnotify/internal/debug_darwin.go | 57 +
.../fsnotify/internal/debug_dragonfly.go | 33 +
.../fsnotify/internal/debug_freebsd.go | 42 +
.../fsnotify/internal/debug_kqueue.go | 32 +
.../fsnotify/fsnotify/internal/debug_linux.go | 56 +
.../fsnotify/internal/debug_netbsd.go | 25 +
.../fsnotify/internal/debug_openbsd.go | 28 +
.../fsnotify/internal/debug_solaris.go | 45 +
.../fsnotify/internal/debug_windows.go | 40 +
.../fsnotify/fsnotify/internal/freebsd.go | 31 +
.../fsnotify/fsnotify/internal/internal.go | 2 +
.../fsnotify/fsnotify/internal/unix.go | 31 +
.../fsnotify/fsnotify/internal/unix2.go | 7 +
.../fsnotify/fsnotify/internal/windows.go | 41 +
vendor/github.com/fsnotify/fsnotify/mkdoc.zsh | 259 -
vendor/github.com/fsnotify/fsnotify/shared.go | 64 +
.../fsnotify/fsnotify/staticcheck.conf | 3 +
.../fsnotify/fsnotify/system_bsd.go | 1 -
.../fsnotify/fsnotify/system_darwin.go | 1 -
.../github.com/fxamacker/cbor/v2/.gitignore | 12 +
.../fxamacker/cbor/v2/.golangci.yml | 104 +
.../fxamacker/cbor/v2/CODE_OF_CONDUCT.md | 133 +
.../fxamacker/cbor/v2/CONTRIBUTING.md | 41 +
.../license.md => fxamacker/cbor/v2/LICENSE} | 4 +-
vendor/github.com/fxamacker/cbor/v2/README.md | 934 +
.../github.com/fxamacker/cbor/v2/SECURITY.md | 7 +
.../fxamacker/cbor/v2/bytestring.go | 90 +
vendor/github.com/fxamacker/cbor/v2/cache.go | 370 +
vendor/github.com/fxamacker/cbor/v2/common.go | 191 +
vendor/github.com/fxamacker/cbor/v2/decode.go | 3318 ++++
.../github.com/fxamacker/cbor/v2/diagnose.go | 724 +
vendor/github.com/fxamacker/cbor/v2/doc.go | 152 +
vendor/github.com/fxamacker/cbor/v2/encode.go | 2299 +++
.../fxamacker/cbor/v2/encode_map.go | 92 +
.../fxamacker/cbor/v2/omitzero_go124.go | 8 +
.../fxamacker/cbor/v2/omitzero_pre_go124.go | 8 +
.../fxamacker/cbor/v2/simplevalue.go | 98 +
vendor/github.com/fxamacker/cbor/v2/stream.go | 277 +
.../fxamacker/cbor/v2/structfields.go | 268 +
vendor/github.com/fxamacker/cbor/v2/tag.go | 329 +
vendor/github.com/fxamacker/cbor/v2/valid.go | 394 +
vendor/github.com/ghodss/yaml/.gitignore | 20 -
vendor/github.com/ghodss/yaml/.travis.yml | 7 -
vendor/github.com/ghodss/yaml/LICENSE | 50 -
vendor/github.com/ghodss/yaml/README.md | 121 -
vendor/github.com/ghodss/yaml/fields.go | 501 -
vendor/github.com/ghodss/yaml/yaml.go | 277 -
.../github.com/go-errors/errors/.travis.yml | 5 +-
vendor/github.com/go-errors/errors/README.md | 4 +-
.../github.com/go-errors/errors/error_1_13.go | 8 +-
.../go-errors/errors/error_backward.go | 68 +
.../go-errors/errors/join_unwrap_1_20.go | 32 +
.../go-errors/errors/join_unwrap_backward.go | 71 +
.../go-openapi/errors/.golangci.yml | 31 +-
vendor/github.com/go-openapi/errors/api.go | 2 +-
.../github.com/go-openapi/errors/headers.go | 2 +-
.../go-openapi/errors/middleware.go | 2 +-
.../github.com/go-openapi/errors/parsing.go | 3 +-
vendor/github.com/go-openapi/errors/schema.go | 110 +-
.../go-openapi/jsonpointer/.golangci.yml | 31 +-
.../go-openapi/jsonpointer/errors.go | 18 +
.../go-openapi/jsonpointer/pointer.go | 49 +-
.../go-openapi/runtime/.gitattributes | 1 +
.../go-openapi/runtime/.golangci.yml | 62 +
.../github.com/go-openapi/runtime/.travis.yml | 13 -
.../github.com/go-openapi/runtime/README.md | 11 +-
.../go-openapi/runtime/bytestream.go | 141 +-
.../go-openapi/runtime/client/auth_info.go | 20 +-
.../go-openapi/runtime/client/keepalive.go | 7 +-
.../runtime/client/opentelemetry.go | 211 +
.../go-openapi/runtime/client/opentracing.go | 99 +
.../go-openapi/runtime/client/request.go | 107 +-
.../go-openapi/runtime/client/response.go | 6 +
.../go-openapi/runtime/client/runtime.go | 174 +-
.../go-openapi/runtime/client_operation.go | 4 +-
.../go-openapi/runtime/client_request.go | 57 +-
.../go-openapi/runtime/client_response.go | 54 +-
.../go-openapi/runtime/constants.go | 2 +
vendor/github.com/go-openapi/runtime/csv.go | 327 +-
.../go-openapi/runtime/csv_options.go | 121 +
vendor/github.com/go-openapi/runtime/file.go | 18 +-
.../go-openapi/runtime/logger/standard.go | 2 +
.../go-openapi/runtime/middleware/context.go | 188 +-
.../runtime/middleware/denco/router.go | 37 +-
.../go-openapi/runtime/middleware/doc.go | 87 +-
.../go-openapi/runtime/middleware/go18.go | 9 -
.../runtime/middleware/header/header.go | 16 +-
.../runtime/middleware/parameter.go | 24 +-
.../go-openapi/runtime/middleware/pre_go18.go | 9 -
.../go-openapi/runtime/middleware/rapidoc.go | 72 +-
.../go-openapi/runtime/middleware/redoc.go | 69 +-
.../go-openapi/runtime/middleware/request.go | 23 +-
.../go-openapi/runtime/middleware/router.go | 119 +-
.../go-openapi/runtime/middleware/spec.go | 76 +-
.../runtime/middleware/swaggerui.go | 95 +-
.../runtime/middleware/swaggerui_oauth2.go | 105 +
.../runtime/middleware/ui_options.go | 173 +
.../runtime/middleware/untyped/api.go | 15 +-
.../runtime/middleware/validation.go | 12 +-
.../github.com/go-openapi/runtime/request.go | 16 +-
.../runtime/security/authenticator.go | 23 +-
vendor/github.com/go-openapi/runtime/text.go | 1 -
.../go-openapi/runtime/yamlpc/yaml.go | 3 +-
.../github.com/go-openapi/swag/.codecov.yml | 4 +
.../github.com/go-openapi/swag/.golangci.yml | 122 +-
.../github.com/go-openapi/swag/.mockery.yml | 30 +
vendor/github.com/go-openapi/swag/README.md | 238 +-
vendor/github.com/go-openapi/swag/SECURITY.md | 19 +
.../swag/cmdutils/LICENSE} | 0
.../go-openapi/swag/cmdutils/cmd_utils.go | 13 +
.../go-openapi/swag/cmdutils/doc.go | 5 +
.../go-openapi/swag/cmdutils_iface.go | 11 +
.../swag/conv}/LICENSE | 1 +
.../go-openapi/swag/conv/convert.go | 161 +
.../go-openapi/swag/conv/convert_types.go | 72 +
vendor/github.com/go-openapi/swag/conv/doc.go | 15 +
.../github.com/go-openapi/swag/conv/format.go | 28 +
.../github.com/go-openapi/swag/conv/sizeof.go | 20 +
.../go-openapi/swag/conv/type_constraints.go | 29 +
.../github.com/go-openapi/swag/conv_iface.go | 486 +
vendor/github.com/go-openapi/swag/convert.go | 208 -
.../go-openapi/swag/convert_types.go | 730 -
vendor/github.com/go-openapi/swag/doc.go | 70 +-
.../go-openapi/swag/fileutils/LICENSE | 202 +
.../go-openapi/swag/fileutils/doc.go | 10 +
.../go-openapi/swag/fileutils/file.go | 22 +
.../go-openapi/swag/{ => fileutils}/path.go | 29 +-
.../go-openapi/swag/fileutils_iface.go | 33 +
.../go-openapi/swag/initialism_index.go | 202 -
vendor/github.com/go-openapi/swag/json.go | 312 -
.../go-openapi/swag/jsonname/LICENSE | 202 +
.../go-openapi/swag/jsonname/doc.go | 5 +
.../go-openapi/swag/jsonname/name_provider.go | 138 +
.../go-openapi/swag/jsonname_iface.go | 24 +
.../go-openapi/swag/jsonutils/LICENSE | 202 +
.../go-openapi/swag/jsonutils/README.md | 108 +
.../go-openapi/swag/jsonutils/adapters/doc.go | 8 +
.../swag/jsonutils/adapters/ifaces/doc.go | 5 +
.../swag/jsonutils/adapters/ifaces/ifaces.go | 84 +
.../adapters/ifaces/registry_iface.go | 91 +
.../swag/jsonutils/adapters/registry.go | 229 +
.../jsonutils/adapters/stdlib/json/adapter.go | 115 +
.../jsonutils/adapters/stdlib/json/doc.go | 5 +
.../jsonutils/adapters/stdlib/json/lexer.go | 320 +
.../adapters/stdlib/json/ordered_map.go | 266 +
.../jsonutils/adapters/stdlib/json/pool.go | 143 +
.../adapters/stdlib/json/register.go | 26 +
.../jsonutils/adapters/stdlib/json/writer.go | 75 +
.../go-openapi/swag/jsonutils/concat.go | 92 +
.../go-openapi/swag/jsonutils/doc.go | 7 +
.../go-openapi/swag/jsonutils/json.go | 116 +
.../go-openapi/swag/jsonutils/ordered_map.go | 114 +
.../go-openapi/swag/jsonutils_iface.go | 65 +
.../go-openapi/swag/loading/LICENSE | 202 +
.../github.com/go-openapi/swag/loading/doc.go | 5 +
.../go-openapi/swag/loading/errors.go | 15 +
.../go-openapi/swag/loading/json.go | 25 +
.../go-openapi/swag/{ => loading}/loading.go | 90 +-
.../go-openapi/swag/loading/options.go | 125 +
.../go-openapi/swag/loading/yaml.go | 37 +
.../go-openapi/swag/loading_iface.go | 91 +
.../swag/{ => mangling}/BENCHMARK.md | 48 +-
.../go-openapi/swag/mangling/LICENSE | 202 +
.../go-openapi/swag/mangling/doc.go | 25 +
.../swag/mangling/initialism_index.go | 270 +
.../go-openapi/swag/mangling/name_lexem.go | 186 +
.../go-openapi/swag/mangling/name_mangler.go | 370 +
.../go-openapi/swag/mangling/options.go | 150 +
.../go-openapi/swag/mangling/pools.go | 123 +
.../go-openapi/swag/mangling/split.go | 341 +
.../swag/{ => mangling}/string_bytes.go | 5 +-
.../go-openapi/swag/mangling/util.go | 118 +
.../go-openapi/swag/mangling_iface.go | 69 +
.../github.com/go-openapi/swag/name_lexem.go | 93 -
vendor/github.com/go-openapi/swag/net.go | 38 -
.../go-openapi/swag/netutils/LICENSE | 202 +
.../go-openapi/swag/netutils/doc.go | 5 +
.../go-openapi/swag/netutils/net.go | 31 +
.../go-openapi/swag/netutils_iface.go | 13 +
vendor/github.com/go-openapi/swag/split.go | 508 -
.../go-openapi/swag/stringutils/LICENSE | 202 +
.../swag/stringutils/collection_formats.go | 74 +
.../go-openapi/swag/stringutils/doc.go | 5 +
.../go-openapi/swag/stringutils/strings.go | 23 +
.../go-openapi/swag/stringutils_iface.go | 34 +
.../go-openapi/swag/typeutils/LICENSE | 202 +
.../go-openapi/swag/typeutils/doc.go | 5 +
.../go-openapi/swag/typeutils/types.go | 80 +
.../go-openapi/swag/typeutils_iface.go | 12 +
vendor/github.com/go-openapi/swag/util.go | 364 -
vendor/github.com/go-openapi/swag/yaml.go | 481 -
.../go-openapi/swag/yamlutils/LICENSE | 202 +
.../go-openapi/swag/yamlutils/doc.go | 13 +
.../go-openapi/swag/yamlutils/errors.go | 15 +
.../go-openapi/swag/yamlutils/ordered_map.go | 316 +
.../go-openapi/swag/yamlutils/yaml.go | 211 +
.../go-openapi/swag/yamlutils_iface.go | 20 +
.../gogo/protobuf/sortkeys/sortkeys.go | 101 -
vendor/github.com/golang/groupcache/LICENSE | 191 -
.../github.com/golang/groupcache/lru/lru.go | 133 -
vendor/github.com/golang/mock/gomock/call.go | 46 +-
.../golang/mock/gomock/controller.go | 38 -
vendor/github.com/golang/mock/gomock/doc.go | 59 +
.../github.com/golang/protobuf/ptypes/any.go | 180 -
.../golang/protobuf/ptypes/any/any.pb.go | 62 -
.../github.com/golang/protobuf/ptypes/doc.go | 10 -
.../golang/protobuf/ptypes/duration.go | 76 -
.../protobuf/ptypes/duration/duration.pb.go | 63 -
.../golang/protobuf/ptypes/timestamp.go | 112 -
.../protobuf/ptypes/timestamp/timestamp.pb.go | 64 -
.../github.com/google/cel-go/cel/BUILD.bazel | 19 +-
vendor/github.com/google/cel-go/cel/decls.go | 137 +-
vendor/github.com/google/cel-go/cel/env.go | 398 +-
.../github.com/google/cel-go/cel/folding.go | 603 +
.../github.com/google/cel-go/cel/inlining.go | 228 +
vendor/github.com/google/cel-go/cel/io.go | 223 +-
.../github.com/google/cel-go/cel/library.go | 540 +-
vendor/github.com/google/cel-go/cel/macro.go | 470 +-
.../github.com/google/cel-go/cel/optimizer.go | 535 +
.../github.com/google/cel-go/cel/options.go | 271 +-
.../github.com/google/cel-go/cel/program.go | 337 +-
vendor/github.com/google/cel-go/cel/prompt.go | 155 +
.../cel-go/cel/templates/authoring.tmpl | 56 +
.../github.com/google/cel-go/cel/validator.go | 117 +-
.../google/cel-go/checker/BUILD.bazel | 2 -
.../google/cel-go/checker/checker.go | 398 +-
.../github.com/google/cel-go/checker/cost.go | 794 +-
.../google/cel-go/checker/decls/decls.go | 39 +-
.../github.com/google/cel-go/checker/env.go | 8 +
.../google/cel-go/checker/errors.go | 22 +-
.../google/cel-go/checker/printer.go | 34 +-
.../google/cel-go/checker/standard.go | 35 -
.../github.com/google/cel-go/checker/types.go | 13 +-
.../google/cel-go/common/BUILD.bazel | 3 +-
.../google/cel-go/common/ast/BUILD.bazel | 23 +-
.../google/cel-go/common/ast/ast.go | 557 +-
.../google/cel-go/common/ast/conversion.go | 659 +
.../google/cel-go/common/ast/expr.go | 989 +-
.../google/cel-go/common/ast/factory.go | 332 +
.../google/cel-go/common/ast/navigable.go | 665 +
.../cel-go/common/containers/BUILD.bazel | 4 +-
.../cel-go/common/containers/container.go | 48 +-
.../google/cel-go/common/debug/BUILD.bazel | 4 +-
.../google/cel-go/common/debug/debug.go | 161 +-
.../google/cel-go/common/decls/BUILD.bazel | 2 +
.../google/cel-go/common/decls/decls.go | 317 +-
vendor/github.com/google/cel-go/common/doc.go | 154 +
.../google/cel-go/common/env/BUILD.bazel | 50 +
.../google/cel-go/common/env/env.go | 887 +
.../github.com/google/cel-go/common/error.go | 13 +-
.../github.com/google/cel-go/common/errors.go | 13 +-
.../google/cel-go/common/runes/buffer.go | 60 +-
.../github.com/google/cel-go/common/source.go | 18 +-
.../google/cel-go/common/stdlib/BUILD.bazel | 3 +-
.../google/cel-go/common/stdlib/standard.go | 743 +-
.../google/cel-go/common/types/BUILD.bazel | 3 +
.../google/cel-go/common/types/bool.go | 9 +
.../google/cel-go/common/types/bytes.go | 27 +-
.../google/cel-go/common/types/double.go | 22 +
.../google/cel-go/common/types/duration.go | 5 +
.../google/cel-go/common/types/err.go | 31 +-
.../google/cel-go/common/types/format.go | 42 +
.../google/cel-go/common/types/int.go | 17 +
.../google/cel-go/common/types/list.go | 73 +-
.../google/cel-go/common/types/map.go | 184 +
.../google/cel-go/common/types/null.go | 15 +-
.../google/cel-go/common/types/object.go | 31 +-
.../google/cel-go/common/types/optional.go | 13 +-
.../google/cel-go/common/types/overflow.go | 40 +
.../google/cel-go/common/types/pb/type.go | 27 +
.../google/cel-go/common/types/provider.go | 59 +-
.../google/cel-go/common/types/string.go | 11 +-
.../google/cel-go/common/types/timestamp.go | 4 +
.../cel-go/common/types/traits/iterator.go | 13 +
.../cel-go/common/types/traits/lister.go | 3 +
.../cel-go/common/types/traits/mapper.go | 15 +
.../cel-go/common/types/traits/traits.go | 17 +-
.../google/cel-go/common/types/types.go | 138 +-
.../google/cel-go/common/types/uint.go | 18 +
.../github.com/google/cel-go/ext/BUILD.bazel | 29 +-
vendor/github.com/google/cel-go/ext/README.md | 557 +-
.../github.com/google/cel-go/ext/bindings.go | 278 +-
.../google/cel-go/ext/comprehensions.go | 428 +
.../github.com/google/cel-go/ext/encoders.go | 41 +-
.../cel-go/ext/extension_option_factory.go | 75 +
.../google/cel-go/ext/formatting.go | 927 +
.../google/cel-go/ext/formatting_v2.go | 788 +
vendor/github.com/google/cel-go/ext/guards.go | 31 +-
vendor/github.com/google/cel-go/ext/lists.go | 699 +-
vendor/github.com/google/cel-go/ext/math.go | 669 +-
vendor/github.com/google/cel-go/ext/native.go | 284 +-
vendor/github.com/google/cel-go/ext/protos.go | 70 +-
vendor/github.com/google/cel-go/ext/regex.go | 332 +
vendor/github.com/google/cel-go/ext/sets.go | 101 +-
.../github.com/google/cel-go/ext/strings.go | 503 +-
.../google/cel-go/interpreter/BUILD.bazel | 1 -
.../google/cel-go/interpreter/activation.go | 47 +-
.../cel-go/interpreter/attribute_patterns.go | 19 +-
.../google/cel-go/interpreter/attributes.go | 239 +-
.../google/cel-go/interpreter/formatting.go | 383 -
.../cel-go/interpreter/interpretable.go | 427 +-
.../google/cel-go/interpreter/interpreter.go | 212 +-
.../google/cel-go/interpreter/planner.go | 316 +-
.../google/cel-go/interpreter/prune.go | 545 +-
.../google/cel-go/interpreter/runtimecost.go | 253 +-
.../google/cel-go/parser/BUILD.bazel | 9 +-
.../github.com/google/cel-go/parser/errors.go | 6 +-
.../google/cel-go/parser/gen/BUILD.bazel | 4 +-
.../google/cel-go/parser/gen/CEL.g4 | 13 +-
.../google/cel-go/parser/gen/CEL.interp | 5 +-
.../google/cel-go/parser/gen/CEL.tokens | 1 +
.../google/cel-go/parser/gen/CELLexer.interp | 5 +-
.../google/cel-go/parser/gen/CELLexer.tokens | 1 +
.../cel-go/parser/gen/cel_base_listener.go | 30 +-
.../cel-go/parser/gen/cel_base_visitor.go | 18 +-
.../google/cel-go/parser/gen/cel_lexer.go | 438 +-
.../google/cel-go/parser/gen/cel_listener.go | 30 +-
.../google/cel-go/parser/gen/cel_parser.go | 2299 ++-
.../google/cel-go/parser/gen/cel_visitor.go | 17 +-
.../google/cel-go/parser/gen/generate.sh | 2 +-
.../github.com/google/cel-go/parser/helper.go | 621 +-
.../github.com/google/cel-go/parser/input.go | 4 +-
.../github.com/google/cel-go/parser/macro.go | 423 +-
.../google/cel-go/parser/options.go | 23 +
.../github.com/google/cel-go/parser/parser.go | 280 +-
.../google/cel-go/parser/unescape.go | 42 +-
.../google/cel-go/parser/unparser.go | 260 +-
.../google/gnostic-models/compiler/context.go | 2 +-
.../gnostic-models/compiler/extensions.go | 10 +-
.../google/gnostic-models/compiler/helpers.go | 2 +-
.../google/gnostic-models/compiler/reader.go | 2 +-
.../gnostic-models/extensions/extension.pb.go | 96 +-
.../gnostic-models/extensions/extensions.go | 6 +-
.../gnostic-models/jsonschema/models.go | 2 +-
.../gnostic-models/jsonschema/reader.go | 2 +-
.../gnostic-models/jsonschema/writer.go | 2 +-
.../gnostic-models/openapiv2/OpenAPIv2.go | 80 +-
.../gnostic-models/openapiv2/OpenAPIv2.pb.go | 1349 +-
.../gnostic-models/openapiv2/document.go | 2 +-
.../gnostic-models/openapiv3/OpenAPIv3.go | 24 +-
.../gnostic-models/openapiv3/OpenAPIv3.pb.go | 1763 +-
.../openapiv3/annotations.pb.go | 182 +
.../openapiv3/annotations.proto | 56 +
.../gnostic-models/openapiv3/document.go | 2 +-
vendor/github.com/google/gofuzz/.travis.yml | 10 -
.../github.com/google/gofuzz/CONTRIBUTING.md | 67 -
vendor/github.com/google/gofuzz/fuzz.go | 605 -
vendor/github.com/google/shlex/README | 2 -
vendor/github.com/google/shlex/shlex.go | 416 -
.../github.com/gorilla/websocket/.gitignore | 25 -
vendor/github.com/gorilla/websocket/AUTHORS | 9 -
vendor/github.com/gorilla/websocket/LICENSE | 22 -
vendor/github.com/gorilla/websocket/README.md | 32 -
vendor/github.com/gorilla/websocket/client.go | 517 -
.../gorilla/websocket/compression.go | 152 -
vendor/github.com/gorilla/websocket/conn.go | 1246 --
vendor/github.com/gorilla/websocket/doc.go | 227 -
vendor/github.com/gorilla/websocket/join.go | 42 -
vendor/github.com/gorilla/websocket/json.go | 60 -
vendor/github.com/gorilla/websocket/mask.go | 55 -
.../github.com/gorilla/websocket/mask_safe.go | 16 -
.../github.com/gorilla/websocket/prepared.go | 102 -
vendor/github.com/gorilla/websocket/proxy.go | 104 -
vendor/github.com/gorilla/websocket/server.go | 373 -
vendor/github.com/gorilla/websocket/util.go | 298 -
.../protoc-gen-openapiv2/options/BUILD.bazel | 44 +
.../options/annotations.pb.go | 269 +
.../options/annotations.proto | 51 +
.../options/annotations_protoopaque.pb.go | 269 +
.../protoc-gen-openapiv2/options/buf.gen.yaml | 7 +
.../options/openapiv2.pb.go | 4263 +++++
.../options/openapiv2.proto | 759 +
.../options/openapiv2_protoopaque.pb.go | 4055 ++++
.../grpc-gateway/v2/runtime/BUILD.bazel | 2 +-
.../grpc-gateway/v2/runtime/context.go | 28 +-
.../grpc-gateway/v2/runtime/convert.go | 6 +-
.../grpc-gateway/v2/runtime/errors.go | 73 +-
.../grpc-gateway/v2/runtime/fieldmask.go | 6 +-
.../grpc-gateway/v2/runtime/handler.go | 113 +-
.../grpc-gateway/v2/runtime/marshal_json.go | 5 +
.../grpc-gateway/v2/runtime/marshal_jsonpb.go | 15 +-
.../grpc-gateway/v2/runtime/marshaler.go | 8 +
.../v2/runtime/marshaler_registry.go | 6 +-
.../grpc-gateway/v2/runtime/mux.go | 111 +-
.../grpc-gateway/v2/runtime/pattern.go | 18 +-
.../grpc-gateway/v2/runtime/proto2_convert.go | 4 +-
.../grpc-gateway/v2/runtime/query.go | 60 +-
.../grpc-gateway/v2/utilities/pattern.go | 2 +-
.../v2/utilities/string_array_flag.go | 2 +-
.../hashicorp/go-version/CHANGELOG.md | 19 +
.../github.com/hashicorp/go-version/LICENSE | 2 +
.../github.com/hashicorp/go-version/README.md | 2 +-
.../hashicorp/go-version/constraint.go | 6 +-
.../hashicorp/go-version/version.go | 46 +-
.../go-version/version_collection.go | 3 +
.../github.com/imdario/mergo/.deepsource.toml | 12 -
vendor/github.com/imdario/mergo/.gitignore | 33 -
vendor/github.com/imdario/mergo/.travis.yml | 12 -
.../imdario/mergo/CODE_OF_CONDUCT.md | 46 -
.../github.com/imdario/mergo/CONTRIBUTING.md | 112 -
vendor/github.com/imdario/mergo/README.md | 242 -
vendor/github.com/imdario/mergo/SECURITY.md | 14 -
vendor/github.com/imdario/mergo/doc.go | 143 -
vendor/github.com/imdario/mergo/map.go | 178 -
vendor/github.com/imdario/mergo/merge.go | 409 -
vendor/github.com/imdario/mergo/mergo.go | 81 -
vendor/github.com/itchyny/gojq/CHANGELOG.md | 5 +
vendor/github.com/itchyny/gojq/Dockerfile | 2 +-
vendor/github.com/itchyny/gojq/Makefile | 19 +-
vendor/github.com/itchyny/gojq/README.md | 4 +-
vendor/github.com/itchyny/gojq/compare.go | 6 +-
vendor/github.com/itchyny/gojq/compiler.go | 7 +-
vendor/github.com/itchyny/gojq/error.go | 2 +-
vendor/github.com/itchyny/gojq/func.go | 16 +-
vendor/github.com/itchyny/gojq/go.dev.mod | 4 +-
vendor/github.com/itchyny/gojq/go.dev.sum | 4 +-
vendor/github.com/itchyny/gojq/gojq.go | 6 +-
vendor/github.com/itchyny/gojq/iter.go | 2 +-
vendor/github.com/itchyny/gojq/math.go | 8 -
.../github.com/itchyny/gojq/module_loader.go | 14 +-
vendor/github.com/itchyny/gojq/normalize.go | 12 +-
vendor/github.com/itchyny/gojq/operator.go | 4 +-
vendor/github.com/itchyny/gojq/option.go | 20 +-
vendor/github.com/itchyny/gojq/parser.go | 76 +-
vendor/github.com/itchyny/gojq/preview.go | 4 +-
vendor/github.com/itchyny/gojq/query.go | 3 +-
vendor/github.com/itchyny/gojq/term_type.go | 4 +-
.../itchyny/timefmt-go/CHANGELOG.md | 4 +
vendor/github.com/itchyny/timefmt-go/LICENSE | 2 +-
vendor/github.com/itchyny/timefmt-go/Makefile | 11 +-
.../github.com/itchyny/timefmt-go/README.md | 7 +-
.../github.com/itchyny/timefmt-go/format.go | 6 +-
vendor/github.com/itchyny/timefmt-go/parse.go | 8 +-
vendor/github.com/josharian/intern/README.md | 5 -
vendor/github.com/josharian/intern/intern.go | 44 -
vendor/github.com/kylelemons/godebug/LICENSE | 202 +
.../kylelemons/godebug/diff/diff.go | 186 +
vendor/github.com/mailru/easyjson/LICENSE | 7 -
.../github.com/mailru/easyjson/buffer/pool.go | 278 -
.../mailru/easyjson/jlexer/bytestostr.go | 24 -
.../easyjson/jlexer/bytestostr_nounsafe.go | 13 -
.../mailru/easyjson/jlexer/error.go | 15 -
.../mailru/easyjson/jlexer/lexer.go | 1244 --
.../mailru/easyjson/jwriter/writer.go | 405 -
.../golang_protobuf_extensions/v2/NOTICE | 1 -
.../v2/pbutil/.gitignore | 1 -
.../v2/pbutil/Makefile | 7 -
.../v2/pbutil/decode.go | 81 -
.../v2/pbutil/encode.go | 49 -
.../metal3.io/v1alpha1/baremetalhost_types.go | 762 +-
.../v1alpha1/baremetalhost_validation.go | 323 -
.../v1alpha1/baremetalhost_webhook.go | 50 -
.../v1alpha1/baremetalswitch_types.go | 127 +
.../v1alpha1/bmceventsubscription_types.go | 2 +-
.../bmceventsubscription_validation.go | 54 -
.../v1alpha1/bmceventsubscription_webhook.go | 58 -
.../metal3.io/v1alpha1/dataimage_types.go | 79 +
.../apis/metal3.io/v1alpha1/doc.go | 20 +
.../v1alpha1/firmwareschema_types.go | 27 +-
.../metal3.io/v1alpha1/groupversion_info.go | 4 +-
.../metal3.io/v1alpha1/hardwaredata_types.go | 211 +-
.../metal3.io/v1alpha1/hostclaim_types.go | 211 +
.../v1alpha1/hostdeploypolicy_types.go | 76 +
.../v1alpha1/hostfirmwarecomponents_types.go | 121 +
.../v1alpha1/hostfirmwaresettings_types.go | 14 +-
.../v1alpha1/hostnetworkattachment_types.go | 101 +
.../v1alpha1/hostupdatepolicy_types.go | 67 +
.../v1alpha1/preprovisioningimage_types.go | 14 +-
.../v1alpha1/zz_generated.deepcopy.go | 1056 +-
.../pkg/hardwareutils/bmc/access.go | 179 -
.../pkg/hardwareutils/bmc/credentials.go | 18 -
.../pkg/hardwareutils/bmc/errors.go | 28 -
.../pkg/hardwareutils/bmc/ibmc.go | 123 -
.../pkg/hardwareutils/bmc/idrac.go | 164 -
.../hardwareutils/bmc/idrac_virtualmedia.go | 115 -
.../pkg/hardwareutils/bmc/ilo4.go | 172 -
.../pkg/hardwareutils/bmc/ilo5.go | 158 -
.../pkg/hardwareutils/bmc/ipmi.go | 133 -
.../pkg/hardwareutils/bmc/irmc.go | 156 -
.../pkg/hardwareutils/bmc/redfish.go | 182 -
.../hardwareutils/bmc/redfish_virtualmedia.go | 111 -
.../moby/spdystream/CONTRIBUTING.md | 13 -
vendor/github.com/moby/spdystream/MAINTAINERS | 40 -
vendor/github.com/moby/spdystream/NOTICE | 17 -
vendor/github.com/moby/spdystream/README.md | 77 -
.../github.com/moby/spdystream/connection.go | 1000 -
vendor/github.com/moby/spdystream/handlers.go | 52 -
vendor/github.com/moby/spdystream/priority.go | 114 -
.../github.com/moby/spdystream/spdy/PATENTS | 22 -
.../moby/spdystream/spdy/dictionary.go | 187 -
.../moby/spdystream/spdy/options.go | 25 -
.../github.com/moby/spdystream/spdy/read.go | 382 -
.../github.com/moby/spdystream/spdy/types.go | 308 -
.../github.com/moby/spdystream/spdy/write.go | 355 -
vendor/github.com/moby/spdystream/stream.go | 345 -
vendor/github.com/moby/spdystream/utils.go | 32 -
vendor/github.com/mxk/go-flowrate/LICENSE | 29 -
.../mxk/go-flowrate/flowrate/flowrate.go | 267 -
.../github.com/mxk/go-flowrate/flowrate/io.go | 133 -
.../mxk/go-flowrate/flowrate/util.go | 67 -
vendor/github.com/onsi/gomega/CHANGELOG.md | 85 +-
.../github.com/onsi/gomega/format/format.go | 10 +-
.../github.com/onsi/gomega/ghttp/handlers.go | 30 +-
.../onsi/gomega/ghttp/test_server.go | 2 +-
vendor/github.com/onsi/gomega/gomega_dsl.go | 26 +-
.../onsi/gomega/internal/assertion.go | 32 +-
.../onsi/gomega/internal/async_assertion.go | 46 +-
.../onsi/gomega/internal/duration_bundle.go | 2 +-
.../github.com/onsi/gomega/internal/gomega.go | 20 +-
.../gomega/internal/polling_signal_error.go | 2 +-
.../onsi/gomega/internal/vetoptdesc.go | 2 +-
vendor/github.com/onsi/gomega/matchers.go | 72 +-
vendor/github.com/onsi/gomega/matchers/and.go | 8 +-
.../matchers/assignable_to_type_of_matcher.go | 8 +-
.../onsi/gomega/matchers/be_a_directory.go | 8 +-
.../onsi/gomega/matchers/be_a_regular_file.go | 8 +-
.../gomega/matchers/be_an_existing_file.go | 8 +-
.../onsi/gomega/matchers/be_closed_matcher.go | 6 +-
.../matchers/be_comparable_to_matcher.go | 11 +-
.../gomega/matchers/be_element_of_matcher.go | 8 +-
.../onsi/gomega/matchers/be_empty_matcher.go | 22 +-
.../matchers/be_equivalent_to_matcher.go | 8 +-
.../onsi/gomega/matchers/be_false_matcher.go | 6 +-
.../onsi/gomega/matchers/be_identical_to.go | 8 +-
.../onsi/gomega/matchers/be_key_of_matcher.go | 8 +-
.../onsi/gomega/matchers/be_nil_matcher.go | 6 +-
.../gomega/matchers/be_numerically_matcher.go | 10 +-
.../onsi/gomega/matchers/be_sent_matcher.go | 10 +-
.../gomega/matchers/be_temporally_matcher.go | 8 +-
.../onsi/gomega/matchers/be_true_matcher.go | 6 +-
.../onsi/gomega/matchers/be_zero_matcher.go | 6 +-
.../onsi/gomega/matchers/consist_of.go | 66 +-
.../matchers/contain_element_matcher.go | 251 +-
.../matchers/contain_elements_matcher.go | 15 +-
.../matchers/contain_substring_matcher.go | 8 +-
.../onsi/gomega/matchers/equal_matcher.go | 8 +-
.../onsi/gomega/matchers/have_cap_matcher.go | 6 +-
.../onsi/gomega/matchers/have_each_matcher.go | 54 +-
.../gomega/matchers/have_exact_elements.go | 61 +-
.../matchers/have_existing_field_matcher.go | 6 +-
.../onsi/gomega/matchers/have_field.go | 17 +-
.../gomega/matchers/have_http_body_matcher.go | 12 +-
.../have_http_header_with_value_matcher.go | 10 +-
.../matchers/have_http_status_matcher.go | 10 +-
.../onsi/gomega/matchers/have_key_matcher.go | 27 +-
.../matchers/have_key_with_value_matcher.go | 38 +-
.../onsi/gomega/matchers/have_len_matcher.go | 8 +-
.../gomega/matchers/have_occurred_matcher.go | 6 +-
.../gomega/matchers/have_prefix_matcher.go | 8 +-
.../gomega/matchers/have_suffix_matcher.go | 8 +-
.../onsi/gomega/matchers/have_value.go | 8 +-
.../internal/miter/type_support_iter.go | 128 +
.../internal/miter/type_support_noiter.go | 44 +
.../gomega/matchers/match_error_matcher.go | 4 +-
.../gomega/matchers/match_json_matcher.go | 16 +-
.../gomega/matchers/match_regexp_matcher.go | 8 +-
.../onsi/gomega/matchers/match_xml_matcher.go | 10 +-
.../gomega/matchers/match_yaml_matcher.go | 22 +-
vendor/github.com/onsi/gomega/matchers/not.go | 8 +-
vendor/github.com/onsi/gomega/matchers/or.go | 8 +-
.../onsi/gomega/matchers/panic_matcher.go | 10 +-
.../onsi/gomega/matchers/receive_matcher.go | 16 +-
.../onsi/gomega/matchers/satisfy_matcher.go | 10 +-
.../matchers/semi_structured_data_support.go | 32 +-
.../onsi/gomega/matchers/succeed_matcher.go | 6 +-
.../goraph/bipartitegraph/bipartitegraph.go | 4 +-
.../matchers/support/goraph/node/node.go | 2 +-
.../onsi/gomega/matchers/type_support.go | 53 +-
.../onsi/gomega/matchers/with_transform.go | 14 +-
vendor/github.com/onsi/gomega/types/types.go | 49 +-
.../openshift/api/.ci-operator.yaml | 2 +-
.../github.com/openshift/api/.coderabbit.yaml | 30 +
.../openshift/api/.golangci.go-validated.yaml | 1 +
.../github.com/openshift/api/.golangci.yaml | 31 +-
vendor/github.com/openshift/api/AGENTS.md | 32 +-
.../github.com/openshift/api/Dockerfile.ocp | 4 +-
vendor/github.com/openshift/api/Makefile | 27 +-
.../openshift/api/annotations/annotations.go | 34 +
.../openshift/api/apiextensions/install.go | 26 +
.../api/apiextensions/v1alpha1/Makefile | 3 +
.../api/apiextensions/v1alpha1/doc.go | 9 +
.../api/apiextensions/v1alpha1/register.go | 39 +
.../types_compatibilityrequirement.go | 390 +
.../v1alpha1/zz_generated.deepcopy.go | 254 +
..._generated.featuregated-crd-manifests.yaml | 24 +
.../v1alpha1/zz_generated.model_name.go | 61 +
.../zz_generated.swagger_doc_generated.go | 129 +
.../openshift/api/apiserver/v1/doc.go | 1 +
.../apiserver/v1/zz_generated.model_name.go | 46 +
.../github.com/openshift/api/apps/v1/doc.go | 1 +
.../openshift/api/apps/v1/generated.pb.go | 871 +-
.../api/apps/v1/generated.protomessage.pb.go | 52 +
.../github.com/openshift/api/apps/v1/types.go | 12 +-
.../api/apps/v1/zz_generated.model_name.go | 116 +
.../v1/zz_prerelease_lifecycle_generated.go | 12 +-
.../openshift/api/authorization/v1/doc.go | 1 +
.../api/authorization/v1/generated.pb.go | 1155 +-
.../v1/generated.protomessage.pb.go | 76 +
.../v1/zz_generated.model_name.go | 171 +
.../github.com/openshift/api/build/v1/doc.go | 1 +
.../openshift/api/build/v1/generated.pb.go | 2051 +--
.../api/build/v1/generated.protomessage.pb.go | 126 +
.../api/build/v1/zz_generated.model_name.go | 301 +
.../openshift/api/cloudnetwork/v1/doc.go | 1 +
.../api/cloudnetwork/v1/generated.pb.go | 171 +-
.../v1/generated.protomessage.pb.go | 14 +
.../v1/zz_generated.model_name.go | 26 +
.../github.com/openshift/api/config/v1/doc.go | 1 +
.../openshift/api/config/v1/register.go | 2 +
.../openshift/api/config/v1/types.go | 5 +
.../api/config/v1/types_apiserver.go | 71 +-
.../api/config/v1/types_authentication.go | 789 +-
.../config/v1/types_cluster_image_policy.go | 2 +-
.../api/config/v1/types_cluster_operator.go | 5 +-
.../api/config/v1/types_cluster_version.go | 95 +-
.../openshift/api/config/v1/types_dns.go | 9 +-
.../openshift/api/config/v1/types_feature.go | 9 +-
.../openshift/api/config/v1/types_image.go | 30 +
.../api/config/v1/types_image_policy.go | 26 +-
.../api/config/v1/types_infrastructure.go | 34 +-
.../openshift/api/config/v1/types_ingress.go | 1 +
.../openshift/api/config/v1/types_insights.go | 231 +
.../api/config/v1/types_kmsencryption.go | 264 +-
.../openshift/api/config/v1/types_network.go | 34 +-
.../api/config/v1/types_scheduling.go | 1 -
.../api/config/v1/types_tlssecurityprofile.go | 269 +-
.../api/config/v1/zz_generated.deepcopy.go | 833 +-
..._generated.featuregated-crd-manifests.yaml | 41 +-
.../api/config/v1/zz_generated.model_name.go | 1546 ++
.../v1/zz_generated.swagger_doc_generated.go | 494 +-
.../openshift/api/config/v1alpha1/doc.go | 1 +
.../openshift/api/config/v1alpha1/register.go | 8 +-
.../api/config/v1alpha1/types_backup.go | 3 +-
.../v1alpha1/types_cluster_image_policy.go | 80 -
.../v1alpha1/types_cluster_monitoring.go | 2611 ++-
.../types_crio_credential_provider_config.go | 186 +
.../api/config/v1alpha1/types_image_policy.go | 289 -
.../api/config/v1alpha1/types_insights.go | 2 +
.../api/config/v1alpha1/types_pki.go | 274 +
.../config/v1alpha1/zz_generated.deepcopy.go | 1490 +-
..._generated.featuregated-crd-manifests.yaml | 50 +-
.../v1alpha1/zz_generated.model_name.go | 461 +
.../zz_generated.swagger_doc_generated.go | 817 +-
.../openshift/api/config/v1alpha2/doc.go | 1 +
.../api/config/v1alpha2/types_insights.go | 1 +
..._generated.featuregated-crd-manifests.yaml | 2 +-
.../v1alpha2/zz_generated.model_name.go | 61 +
.../openshift/api/console/v1/doc.go | 1 +
.../api/console/v1/types_console_plugin.go | 1 -
.../api/console/v1/types_console_sample.go | 4 +-
..._generated.featuregated-crd-manifests.yaml | 3 +-
.../api/console/v1/zz_generated.model_name.go | 226 +
.../openshift/api/envtest-releases.yaml | 39 +
.../github.com/openshift/api/etcd/README.md | 211 +
.../github.com/openshift/api/etcd/install.go | 27 +
.../github.com/openshift/api/etcd/v1/Makefile | 3 +
.../github.com/openshift/api/etcd/v1/doc.go | 7 +
.../openshift/api/etcd/v1/register.go | 39 +
.../api/etcd/v1/types_pacemakercluster.go | 737 +
.../api/etcd/v1/zz_generated.deepcopy.go | 210 +
..._generated.featuregated-crd-manifests.yaml | 23 +
.../api/etcd/v1/zz_generated.model_name.go | 41 +
.../v1/zz_generated.swagger_doc_generated.go | 89 +
.../openshift/api/etcd/v1alpha1/Makefile | 3 +
.../openshift/api/etcd/v1alpha1/doc.go | 7 +
.../openshift/api/etcd/v1alpha1/register.go | 39 +
.../etcd/v1alpha1/types_pacemakercluster.go | 737 +
.../etcd/v1alpha1/zz_generated.deepcopy.go | 210 +
..._generated.featuregated-crd-manifests.yaml | 23 +
.../etcd/v1alpha1/zz_generated.model_name.go | 41 +
.../zz_generated.swagger_doc_generated.go | 89 +
vendor/github.com/openshift/api/features.md | 239 +-
.../openshift/api/helm/v1beta1/doc.go | 1 +
.../helm/v1beta1/zz_generated.model_name.go | 51 +
.../github.com/openshift/api/image/v1/doc.go | 1 +
.../openshift/api/image/v1/generated.pb.go | 1317 +-
.../api/image/v1/generated.protomessage.pb.go | 82 +
.../api/image/v1/zz_generated.model_name.go | 196 +
.../openshift/api/imageregistry/v1/doc.go | 1 +
.../v1/zz_generated.model_name.go | 141 +
vendor/github.com/openshift/api/install.go | 10 +-
.../openshift/api/kubecontrolplane/v1/doc.go | 1 +
.../v1/zz_generated.model_name.go | 76 +
.../openshift/api/legacyconfig/v1/doc.go | 1 +
.../v1/zz_generated.model_name.go | 406 +
.../openshift/api/machine/v1/doc.go | 1 +
.../v1/types_controlplanemachineset.go | 3 +-
..._generated.featuregated-crd-manifests.yaml | 1 -
.../api/machine/v1/zz_generated.model_name.go | 211 +
.../openshift/api/machine/v1alpha1/doc.go | 1 +
.../v1alpha1/zz_generated.model_name.go | 76 +
.../openshift/api/machine/v1beta1/doc.go | 1 +
.../api/machine/v1beta1/types_awsprovider.go | 118 +-
.../api/machine/v1beta1/types_machine.go | 21 +
.../api/machine/v1beta1/types_machineset.go | 17 +
.../machine/v1beta1/zz_generated.deepcopy.go | 70 +-
.../v1beta1/zz_generated.model_name.go | 376 +
.../zz_generated.swagger_doc_generated.go | 40 +-
.../openshift/api/monitoring/v1/doc.go | 1 +
.../monitoring/v1/zz_generated.model_name.go | 66 +
.../openshift/api/network/v1/doc.go | 1 +
.../openshift/api/network/v1/generated.pb.go | 436 +-
.../network/v1/generated.protomessage.pb.go | 30 +
.../api/network/v1/zz_generated.model_name.go | 66 +
.../openshift/api/network/v1alpha1/doc.go | 1 +
.../v1alpha1/zz_generated.model_name.go | 36 +
.../openshift/api/networkoperator/v1/doc.go | 1 +
.../api/networkoperator/v1/generated.pb.go | 375 +-
.../v1/generated.protomessage.pb.go | 26 +
.../v1/zz_generated.model_name.go | 56 +
.../github.com/openshift/api/oauth/v1/doc.go | 1 +
.../openshift/api/oauth/v1/generated.pb.go | 511 +-
.../api/oauth/v1/generated.protomessage.pb.go | 34 +
.../api/oauth/v1/zz_generated.model_name.go | 76 +
.../api/openshiftcontrolplane/v1/doc.go | 1 +
.../v1/zz_generated.model_name.go | 131 +
.../openshift/api/operator/v1/doc.go | 1 +
.../api/operator/v1/types_authentication.go | 5 +
.../api/operator/v1/types_console.go | 11 +-
.../operator/v1/types_csi_cluster_driver.go | 10 +-
.../openshift/api/operator/v1/types_etcd.go | 4 +-
..._ingress.go => types_ingresscontroller.go} | 44 +
.../api/operator/v1/types_kmsencryption.go | 80 +
.../api/operator/v1/types_kubeapiserver.go | 5 +
.../operator/v1/types_machineconfiguration.go | 11 +-
.../api/operator/v1/types_network.go | 121 +-
.../operator/v1/types_openshiftapiserver.go | 5 +
.../api/operator/v1/zz_generated.deepcopy.go | 79 +-
..._generated.featuregated-crd-manifests.yaml | 19 +-
.../operator/v1/zz_generated.model_name.go | 1196 ++
.../v1/zz_generated.swagger_doc_generated.go | 63 +-
.../openshift/api/operator/v1alpha1/doc.go | 1 +
.../api/operator/v1alpha1/register.go | 2 +
.../api/operator/v1alpha1/types_clusterapi.go | 290 +
.../v1alpha1/zz_generated.deepcopy.go | 213 +
..._generated.featuregated-crd-manifests.yaml | 24 +
.../v1alpha1/zz_generated.model_name.go | 191 +
.../zz_generated.swagger_doc_generated.go | 94 +
.../api/operatorcontrolplane/v1alpha1/doc.go | 1 +
.../v1alpha1/zz_generated.model_name.go | 41 +
.../github.com/openshift/api/osin/v1/doc.go | 1 +
.../api/osin/v1/zz_generated.model_name.go | 121 +
.../openshift/api/project/v1/doc.go | 1 +
.../openshift/api/project/v1/generated.pb.go | 205 +-
.../project/v1/generated.protomessage.pb.go | 16 +
.../api/project/v1/zz_generated.model_name.go | 31 +
.../github.com/openshift/api/quota/v1/doc.go | 1 +
.../openshift/api/quota/v1/generated.pb.go | 308 +-
.../openshift/api/quota/v1/generated.proto | 2 +-
.../api/quota/v1/generated.protomessage.pb.go | 22 +
.../openshift/api/quota/v1/types.go | 2 +-
..._generated.featuregated-crd-manifests.yaml | 4 +-
.../api/quota/v1/zz_generated.model_name.go | 46 +
.../github.com/openshift/api/route/v1/doc.go | 1 +
.../openshift/api/route/v1/generated.pb.go | 578 +-
.../api/route/v1/generated.protomessage.pb.go | 38 +
.../api/route/v1/zz_generated.model_name.go | 86 +
.../openshift/api/samples/v1/doc.go | 1 +
.../openshift/api/samples/v1/generated.pb.go | 222 +-
.../samples/v1/generated.protomessage.pb.go | 16 +
.../api/samples/v1/zz_generated.model_name.go | 31 +
.../openshift/api/security/v1/doc.go | 1 +
.../openshift/api/security/v1/generated.pb.go | 684 +-
.../openshift/api/security/v1/generated.proto | 5 +-
.../security/v1/generated.protomessage.pb.go | 44 +
.../openshift/api/security/v1/types.go | 6 +-
..._generated.featuregated-crd-manifests.yaml | 3 +-
.../security/v1/zz_generated.model_name.go | 101 +
.../v1/zz_generated.swagger_doc_generated.go | 4 +-
.../api/servicecertsigner/v1alpha1/doc.go | 1 +
.../v1alpha1/zz_generated.model_name.go | 26 +
.../api/sharedresource/v1alpha1/doc.go | 1 +
.../v1alpha1/zz_generated.model_name.go | 56 +
.../openshift/api/template/v1/doc.go | 1 +
.../openshift/api/template/v1/generated.pb.go | 520 +-
.../template/v1/generated.protomessage.pb.go | 34 +
.../template/v1/zz_generated.model_name.go | 71 +
.../github.com/openshift/api/user/v1/doc.go | 1 +
.../openshift/api/user/v1/generated.pb.go | 310 +-
.../api/user/v1/generated.protomessage.pb.go | 22 +
.../api/user/v1/zz_generated.model_name.go | 41 +
.../internal/common/version.go | 17 +
.../pkg/isoeditor/ignition.go | 51 +-
.../pkg/isoeditor/ignition_image.go | 43 +
.../pkg/isoeditor/initramfs.go | 10 +-
.../pkg/isoeditor/initrd_addrsize.go | 50 +
.../pkg/isoeditor/isolate_file.go | 38 +
.../pkg/isoeditor/isoutil.go | 128 +-
.../pkg/isoeditor/kargs.go | 54 +
.../pkg/isoeditor/mock_editor.go | 8 +-
.../pkg/isoeditor/mock_executer.go | 49 +
.../pkg/isoeditor/mock_nmstate_handler.go | 49 +
.../pkg/isoeditor/nmstate_handler.go | 135 +
.../pkg/isoeditor/rhcos.go | 94 +-
.../pkg/isoeditor/stream.go | 114 +-
.../config/v1/acceptrisk.go | 27 +
.../config/v1/alibabacloudplatformstatus.go | 15 +-
.../config/v1/alibabacloudresourcetag.go | 10 +-
.../config/v1/apiserver.go | 145 +-
.../config/v1/apiserverencryption.go | 41 +-
.../config/v1/apiservernamedservingcert.go | 15 +-
.../config/v1/apiserverservingcerts.go | 7 +-
.../config/v1/apiserverspec.go | 77 +-
.../applyconfigurations/config/v1/audit.go | 34 +-
.../config/v1/auditcustomrule.go | 28 +-
.../config/v1/authentication.go | 142 +-
.../config/v1/authenticationspec.go | 64 +-
.../config/v1/authenticationstatus.go | 32 +-
.../config/v1/awsdnsspec.go | 14 +-
.../config/v1/awsingressspec.go | 28 +-
.../config/v1/awsplatformspec.go | 10 +-
.../config/v1/awsplatformstatus.go | 50 +-
.../config/v1/awsresourcetag.go | 16 +-
.../config/v1/awsserviceendpoint.go | 15 +-
.../config/v1/azureplatformstatus.go | 59 +-
.../config/v1/azureresourcetag.go | 13 +-
.../v1/baremetalplatformloadbalancer.go | 21 +-
.../config/v1/baremetalplatformspec.go | 74 +
.../config/v1/baremetalplatformstatus.go | 83 +-
.../config/v1/basicauthidentityprovider.go | 15 +-
.../applyconfigurations/config/v1/build.go | 135 +-
.../config/v1/builddefaults.go | 29 +-
.../config/v1/buildoverrides.go | 22 +-
.../config/v1/buildspec.go | 16 +-
.../config/v1/clientcredentialconfig.go | 98 +
.../config/v1/clientsecretsecretreference.go | 32 +
.../config/v1/cloudcontrollermanagerstatus.go | 21 +-
.../config/v1/cloudloadbalancerconfig.go | 55 +
.../config/v1/cloudloadbalancerips.go | 69 +
.../config/v1/clustercondition.go | 14 +-
.../config/v1/clusterimagepolicy.go | 277 +
.../config/v1/clusterimagepolicyspec.go | 53 +
.../config/v1/clusterimagepolicystatus.go | 33 +
.../config/v1/clusternetworkentry.go | 12 +-
.../config/v1/clusteroperator.go | 137 +-
.../config/v1/clusteroperatorstatus.go | 24 +-
.../v1/clusteroperatorstatuscondition.go | 30 +-
.../config/v1/clusterversion.go | 144 +-
.../v1/clusterversioncapabilitiesspec.go | 25 +-
.../v1/clusterversioncapabilitiesstatus.go | 19 +-
.../config/v1/clusterversionspec.go | 88 +-
.../config/v1/clusterversionstatus.go | 81 +-
.../config/v1/componentoverride.go | 23 +-
.../config/v1/componentroutespec.go | 29 +-
.../config/v1/componentroutestatus.go | 64 +-
.../config/v1/conditionalupdate.go | 49 +-
.../config/v1/conditionalupdaterisk.go | 51 +-
.../config/v1/configmapfilereference.go | 10 +-
.../config/v1/configmapnamereference.go | 8 +-
.../applyconfigurations/config/v1/console.go | 143 +-
.../config/v1/consoleauthentication.go | 16 +-
.../config/v1/consolespec.go | 6 +-
.../config/v1/consolestatus.go | 8 +-
.../applyconfigurations/config/v1/custom.go | 36 +
.../config/v1/customfeaturegates.go | 16 +-
.../config/v1/customtlsprofile.go | 21 +-
.../v1/deprecatedwebhooktokenauthenticator.go | 14 +-
.../applyconfigurations/config/v1/dns.go | 143 +-
.../config/v1/dnsplatformspec.go | 21 +-
.../applyconfigurations/config/v1/dnsspec.go | 35 +-
.../applyconfigurations/config/v1/dnszone.go | 23 +-
.../config/v1/equinixmetalplatformstatus.go | 14 +-
.../config/v1/externalclaimssource.go | 97 +
.../config/v1/externalipconfig.go | 20 +-
.../config/v1/externalippolicy.go | 13 +-
.../config/v1/externalplatformspec.go | 8 +-
.../config/v1/externalplatformstatus.go | 9 +-
.../config/v1/externalsourceauthentication.go | 57 +
...ecertificateauthorityconfigmapreference.go | 34 +
.../config/v1/externalsourcepredicate.go | 43 +
.../config/v1/externalsourcetls.go | 30 +
.../config/v1/extramapping.go | 62 +
.../config/v1/featuregate.go | 141 +-
.../config/v1/featuregateattributes.go | 11 +-
.../config/v1/featuregatedetails.go | 11 +-
.../config/v1/featuregateselection.go | 15 +-
.../config/v1/featuregatespec.go | 8 +-
.../config/v1/featuregatestatus.go | 25 +-
.../config/v1/gatherconfig.go | 58 +
.../config/v1/gathererconfig.go | 49 +
.../config/v1/gatherers.go | 46 +
.../config/v1/gcpplatformstatus.go | 36 +-
.../config/v1/gcpresourcelabel.go | 14 +-
.../config/v1/gcpresourcetag.go | 23 +-
.../config/v1/githubidentityprovider.go | 36 +-
.../config/v1/gitlabidentityprovider.go | 27 +-
.../config/v1/googleidentityprovider.go | 16 +-
.../config/v1/htpasswdidentityprovider.go | 11 +-
.../config/v1/hubsource.go | 12 +-
.../config/v1/hubsourcestatus.go | 17 +-
.../config/v1/ibmcloudplatformspec.go | 38 +
.../config/v1/ibmcloudplatformstatus.go | 35 +-
.../config/v1/ibmcloudserviceendpoint.go | 27 +-
.../config/v1/identityprovider.go | 42 +-
.../config/v1/identityproviderconfig.go | 38 +-
.../applyconfigurations/config/v1/image.go | 146 +-
.../config/v1/imagecontentpolicy.go | 133 +-
.../config/v1/imagecontentpolicyspec.go | 24 +-
.../config/v1/imagedigestmirrors.go | 49 +-
.../config/v1/imagedigestmirrorset.go | 144 +-
.../config/v1/imagedigestmirrorsetspec.go | 31 +-
.../config/v1/imagelabel.go | 8 +-
.../config/v1/imagepolicy.go | 279 +
...imagepolicyfulciocawithrekorrootoftrust.go | 52 +
.../config/v1/imagepolicypkirootoftrust.go | 51 +
.../v1/imagepolicypublickeyrootoftrust.go | 42 +
.../config/v1/imagepolicyspec.go | 53 +
.../config/v1/imagepolicystatus.go | 34 +
.../v1/imagesigstoreverificationpolicy.go | 38 +
.../config/v1/imagespec.go | 54 +-
.../config/v1/imagestatus.go | 37 +-
.../config/v1/imagetagmirrors.go | 51 +-
.../config/v1/imagetagmirrorset.go | 144 +-
.../config/v1/imagetagmirrorsetspec.go | 31 +-
.../config/v1/infrastructure.go | 141 +-
.../config/v1/infrastructurespec.go | 24 +-
.../config/v1/infrastructurestatus.go | 74 +-
.../applyconfigurations/config/v1/ingress.go | 142 +-
.../config/v1/ingressplatformspec.go | 22 +-
.../config/v1/ingressspec.go | 59 +-
.../config/v1/ingressstatus.go | 22 +-
.../config/v1/insightsdatagather.go | 261 +
.../config/v1/insightsdatagatherspec.go | 26 +
.../config/v1/keystoneidentityprovider.go | 18 +-
.../config/v1/kmspluginconfig.go | 46 +
.../config/v1/kubevirtplatformstatus.go | 14 +-
.../config/v1/ldapattributemapping.go | 23 +-
.../config/v1/ldapidentityprovider.go | 40 +-
.../config/v1/loadbalancer.go | 8 +-
.../config/v1/maxagepolicy.go | 14 +-
.../config/v1/mtumigration.go | 8 +-
.../config/v1/mtumigrationvalues.go | 10 +-
.../applyconfigurations/config/v1/network.go | 145 +-
.../config/v1/networkdiagnostics.go | 58 +
.../v1/networkdiagnosticssourceplacement.go | 56 +
.../v1/networkdiagnosticstargetplacement.go | 56 +
.../config/v1/networkmigration.go | 14 +-
.../config/v1/networkobservabilityspec.go | 33 +
.../config/v1/networkspec.go | 66 +-
.../config/v1/networkstatus.go | 42 +-
.../applyconfigurations/config/v1/node.go | 145 +-
.../applyconfigurations/config/v1/nodespec.go | 39 +-
.../config/v1/nodestatus.go | 33 +
.../config/v1/nutanixfailuredomain.go | 60 +
.../config/v1/nutanixplatformloadbalancer.go | 21 +-
.../config/v1/nutanixplatformspec.go | 35 +-
.../config/v1/nutanixplatformstatus.go | 61 +-
.../config/v1/nutanixprismelementendpoint.go | 14 +-
.../config/v1/nutanixprismendpoint.go | 10 +-
.../config/v1/nutanixresourceidentifier.go | 50 +
.../applyconfigurations/config/v1/oauth.go | 145 +-
.../config/v1/oauthremoteconnectioninfo.go | 34 +-
.../config/v1/oauthspec.go | 14 +-
.../config/v1/oauthtemplates.go | 30 +-
.../config/v1/objectreference.go | 16 +-
.../config/v1/oidcclientconfig.go | 90 +
.../config/v1/oidcclientreference.go | 53 +
.../config/v1/oidcclientstatus.go | 102 +
.../config/v1/oidcprovider.go | 132 +
.../config/v1/openidclaims.go | 27 +-
.../config/v1/openididentityprovider.go | 37 +-
.../v1/openstackplatformloadbalancer.go | 21 +-
.../config/v1/openstackplatformspec.go | 74 +
.../config/v1/openstackplatformstatus.go | 85 +-
.../config/v1/operandversion.go | 10 +-
.../config/v1/operatorhub.go | 141 +-
.../config/v1/operatorhubspec.go | 21 +-
.../config/v1/operatorhubstatus.go | 9 +-
.../config/v1/ovirtplatformloadbalancer.go | 21 +-
.../config/v1/ovirtplatformstatus.go | 64 +-
.../v1/persistentvolumeclaimreference.go | 28 +
.../config/v1/persistentvolumeconfig.go | 40 +
.../config/v1/pkicertificatesubject.go | 39 +
.../config/v1/platformspec.go | 94 +-
.../config/v1/platformstatus.go | 63 +-
.../config/v1/policyfulciosubject.go | 41 +
.../config/v1/policyidentity.go | 57 +
.../config/v1/policymatchexactrepository.go | 30 +
.../config/v1/policymatchremapidentity.go | 47 +
.../config/v1/policyrootoftrust.go | 69 +
.../config/v1/powervsplatformspec.go | 9 +-
.../config/v1/powervsplatformstatus.go | 30 +-
.../config/v1/powervsserviceendpoint.go | 17 +-
.../config/v1/prefixedclaimmapping.go | 49 +
.../config/v1/profilecustomizations.go | 37 +
.../applyconfigurations/config/v1/project.go | 143 +-
.../config/v1/projectspec.go | 12 +-
.../config/v1/promqlclustercondition.go | 11 +-
.../applyconfigurations/config/v1/proxy.go | 141 +-
.../config/v1/proxyspec.go | 44 +-
.../config/v1/proxystatus.go | 13 +-
.../config/v1/registrylocation.go | 14 +-
.../config/v1/registrysources.go | 40 +-
.../applyconfigurations/config/v1/release.go | 42 +-
.../config/v1/repositorydigestmirrors.go | 28 +-
.../v1/requestheaderidentityprovider.go | 50 +-
.../config/v1/requiredhstspolicy.go | 49 +-
.../config/v1/scheduler.go | 144 +-
.../config/v1/schedulerspec.go | 62 +-
.../config/v1/secretnamereference.go | 8 +-
.../config/v1/signaturestore.go | 44 +
.../config/v1/sourcedclaimmapping.go | 51 +
.../config/v1/sourceurl.go | 67 +
.../applyconfigurations/config/v1/storage.go | 46 +
.../config/v1/templatereference.go | 8 +-
.../config/v1/tlsprofilespec.go | 56 +-
.../config/v1/tlssecurityprofile.go | 122 +-
.../config/v1/tokenclaimmapping.go | 47 +
.../config/v1/tokenclaimmappings.go | 74 +
.../v1/tokenclaimorexpressionmapping.go | 50 +
.../config/v1/tokenclaimvalidationcelrule.go | 37 +
.../config/v1/tokenclaimvalidationrule.go | 61 +
.../config/v1/tokenconfig.go | 31 +-
.../config/v1/tokenissuer.go | 77 +
.../config/v1/tokenrequiredclaim.go | 40 +
.../config/v1/tokenuservalidationrule.go | 43 +
.../applyconfigurations/config/v1/update.go | 84 +-
.../config/v1/updatehistory.go | 47 +-
.../config/v1/usernameclaimmapping.go | 88 +
.../config/v1/usernameprefix.go | 29 +
.../config/v1/vaultapproleauthentication.go | 28 +
.../config/v1/vaultauthentication.go | 43 +
.../config/v1/vaultconfigmapreference.go | 28 +
.../config/v1/vaultkmspluginconfig.go | 123 +
.../config/v1/vaultsecretreference.go | 28 +
.../config/v1/vaulttlsconfig.go | 58 +
.../v1/vspherefailuredomainhostgroup.go | 54 +
.../v1/vspherefailuredomainregionaffinity.go | 34 +
.../v1/vspherefailuredomainzoneaffinity.go | 49 +
.../v1/vsphereplatformfailuredomainspec.go | 50 +-
.../config/v1/vsphereplatformloadbalancer.go | 21 +-
.../v1/vsphereplatformnodenetworking.go | 8 +-
.../v1/vsphereplatformnodenetworkingspec.go | 26 +-
.../config/v1/vsphereplatformspec.go | 85 +-
.../config/v1/vsphereplatformstatus.go | 81 +-
.../config/v1/vsphereplatformtopology.go | 62 +-
.../config/v1/vsphereplatformvcenterspec.go | 23 +-
.../config/v1/webhooktokenauthenticator.go | 17 +-
.../v1alpha1/additionalalertmanagerconfig.go | 119 +
.../config/v1alpha1/alertmanagerconfig.go | 48 +
.../v1alpha1/alertmanagercustomconfig.go | 200 +
.../config/v1alpha1/audit.go | 38 +
.../config/v1alpha1/authorizationconfig.go | 44 +
.../config/v1alpha1/backup.go | 121 +-
.../config/v1alpha1/backupspec.go | 5 +-
.../config/v1alpha1/basicauth.go | 38 +
.../config/v1alpha1/certificateconfig.go | 29 +
.../config/v1alpha1/clustermonitoring.go | 277 +
.../config/v1alpha1/clustermonitoringspec.go | 188 +
.../config/v1alpha1/containerresource.go | 64 +
.../v1alpha1/criocredentialproviderconfig.go | 285 +
.../criocredentialproviderconfigspec.go | 72 +
.../criocredentialproviderconfigstatus.go | 41 +
.../config/v1alpha1/custompkipolicy.go | 51 +
.../v1alpha1/defaultcertificateconfig.go | 30 +
.../config/v1alpha1/dropequalactionconfig.go | 29 +
.../config/v1alpha1/ecdsakeyconfig.go | 40 +
.../config/v1alpha1/etcdbackupspec.go | 26 +-
.../config/v1alpha1/gatherconfig.go | 41 +-
.../config/v1alpha1/hashmodactionconfig.go | 40 +
.../config/v1alpha1/insightsdatagather.go | 121 +-
.../config/v1alpha1/insightsdatagatherspec.go | 5 +-
.../config/v1alpha1/keepequalactionconfig.go | 29 +
.../config/v1alpha1/keyconfig.go | 59 +
.../config/v1alpha1/kubestatemetricsconfig.go | 145 +
.../kubestatemetricsresourcelabels.go | 53 +
.../config/v1alpha1/label.go | 39 +
.../config/v1alpha1/labelmapactionconfig.go | 30 +
.../config/v1alpha1/lowercaseactionconfig.go | 29 +
.../config/v1alpha1/metadataconfig.go | 42 +
.../config/v1alpha1/metadataconfigcustom.go | 29 +
.../config/v1alpha1/metricsserverconfig.go | 147 +
.../config/v1alpha1/monitoringpluginconfig.go | 112 +
.../nodeexportercollectorbuddyinfoconfig.go | 37 +
.../v1alpha1/nodeexportercollectorconfig.go | 184 +
.../nodeexportercollectorcpufreqconfig.go | 36 +
.../nodeexportercollectorethtoolconfig.go | 36 +
.../nodeexportercollectorksmdconfig.go | 37 +
.../nodeexportercollectormountstatsconfig.go | 38 +
...eexportercollectornetclasscollectconfig.go | 36 +
.../nodeexportercollectornetclassconfig.go | 53 +
.../nodeexportercollectornetdevconfig.go | 37 +
.../nodeexportercollectorprocessesconfig.go | 37 +
.../nodeexportercollectorsoftirqsconfig.go | 37 +
...deexportercollectorsystemdcollectconfig.go | 40 +
.../nodeexportercollectorsystemdconfig.go | 55 +
.../nodeexportercollectortcpstatconfig.go | 36 +
.../config/v1alpha1/nodeexporterconfig.go | 115 +
.../config/v1alpha1/oauth2.go | 82 +
.../config/v1alpha1/oauth2endpointparam.go | 39 +
.../v1alpha1/openshiftstatemetricsconfig.go | 117 +
.../persistentvolumeclaimreference.go | 27 +
.../config/v1alpha1/persistentvolumeconfig.go | 40 +
.../config/v1alpha1/pki.go | 262 +
.../v1alpha1/pkicertificatemanagement.go | 65 +
.../config/v1alpha1/pkiprofile.go | 68 +
.../config/v1alpha1/pkispec.go | 28 +
.../config/v1alpha1/prometheusconfig.go | 282 +
...rometheusoperatoradmissionwebhookconfig.go | 78 +
.../v1alpha1/prometheusoperatorconfig.go | 136 +
.../v1alpha1/prometheusremotewriteheader.go | 40 +
.../config/v1alpha1/queueconfig.go | 129 +
.../config/v1alpha1/relabelactionconfig.go | 135 +
.../config/v1alpha1/relabelconfig.go | 89 +
.../v1alpha1/remotewriteauthorization.go | 100 +
.../config/v1alpha1/remotewritespec.go | 175 +
.../config/v1alpha1/replaceactionconfig.go | 41 +
.../config/v1alpha1/retention.go | 54 +
.../config/v1alpha1/retentionnumberconfig.go | 9 +-
.../config/v1alpha1/retentionpolicy.go | 21 +-
.../config/v1alpha1/retentionsizeconfig.go | 9 +-
.../config/v1alpha1/rsakeyconfig.go | 27 +
.../config/v1alpha1/secretkeyselector.go | 40 +
.../config/v1alpha1/sigv4.go | 78 +
.../config/v1alpha1/storage.go | 46 +
.../config/v1alpha1/telemeterclientconfig.go | 118 +
.../config/v1alpha1/thanosquerierconfig.go | 167 +
.../thanosquerierrequestloggingconfig.go | 34 +
.../config/v1alpha1/tlsconfig.go | 81 +
.../config/v1alpha1/uppercaseactionconfig.go | 29 +
.../config/v1alpha1/userdefinedmonitoring.go | 34 +
.../config/v1alpha2/custom.go | 36 +
.../config/v1alpha2/gatherconfig.go | 58 +
.../config/v1alpha2/gathererconfig.go | 49 +
.../config/v1alpha2/gatherers.go | 44 +
.../config/v1alpha2/insightsdatagather.go | 277 +
.../config/v1alpha2/insightsdatagatherspec.go | 24 +
.../persistentvolumeclaimreference.go | 27 +
.../config/v1alpha2/persistentvolumeconfig.go | 40 +
.../config/v1alpha2/storage.go | 46 +
.../applyconfigurations/internal/internal.go | 6851 +++++--
.../config/clientset/versioned/clientset.go | 17 +-
.../clientset/versioned/scheme/register.go | 2 +
.../versioned/typed/config/v1/apiserver.go | 215 +-
.../typed/config/v1/authentication.go | 215 +-
.../versioned/typed/config/v1/build.go | 165 +-
.../typed/config/v1/clusterimagepolicy.go | 58 +
.../typed/config/v1/clusteroperator.go | 215 +-
.../typed/config/v1/clusterversion.go | 215 +-
.../typed/config/v1/config_client.go | 37 +-
.../versioned/typed/config/v1/console.go | 215 +-
.../versioned/typed/config/v1/dns.go | 215 +-
.../versioned/typed/config/v1/featuregate.go | 215 +-
.../typed/config/v1/generated_expansion.go | 6 +
.../versioned/typed/config/v1/image.go | 215 +-
.../typed/config/v1/imagecontentpolicy.go | 165 +-
.../typed/config/v1/imagedigestmirrorset.go | 215 +-
.../versioned/typed/config/v1/imagepolicy.go | 58 +
.../typed/config/v1/imagetagmirrorset.go | 215 +-
.../typed/config/v1/infrastructure.go | 215 +-
.../versioned/typed/config/v1/ingress.go | 215 +-
.../typed/config/v1/insightsdatagather.go | 54 +
.../versioned/typed/config/v1/network.go | 215 +-
.../versioned/typed/config/v1/node.go | 215 +-
.../versioned/typed/config/v1/oauth.go | 215 +-
.../versioned/typed/config/v1/operatorhub.go | 215 +-
.../versioned/typed/config/v1/project.go | 215 +-
.../versioned/typed/config/v1/proxy.go | 215 +-
.../versioned/typed/config/v1/scheduler.go | 215 +-
.../versioned/typed/config/v1alpha1/backup.go | 215 +-
.../config/v1alpha1/clustermonitoring.go | 58 +
.../typed/config/v1alpha1/config_client.go | 37 +-
.../v1alpha1/criocredentialproviderconfig.go | 62 +
.../config/v1alpha1/generated_expansion.go | 6 +
.../config/v1alpha1/insightsdatagather.go | 215 +-
.../versioned/typed/config/v1alpha1/pki.go | 54 +
.../typed/config/v1alpha2/config_client.go | 85 +
.../versioned/typed/config/v1alpha2/doc.go | 4 +
.../config/v1alpha2/generated_expansion.go | 5 +
.../config/v1alpha2/insightsdatagather.go | 58 +
.../applyconfigurations/internal/internal.go | 4729 +++++
.../operator/v1/accesslogging.go | 104 +
.../v1/additionalnetworkdefinition.go | 76 +
.../v1/additionalroutingcapabilities.go | 36 +
.../operator/v1/addpage.go | 29 +
.../operator/v1/authentication.go | 275 +
.../operator/v1/authenticationspec.go | 60 +
.../operator/v1/authenticationstatus.go | 83 +
.../v1/awsclassicloadbalancerparameters.go | 57 +
.../operator/v1/awscsidriverconfigspec.go | 44 +
.../operator/v1/awsefsvolumemetrics.go | 45 +
.../awsefsvolumemetricsrecursivewalkconfig.go | 42 +
.../operator/v1/awsloadbalancerparameters.go | 66 +
.../v1/awsnetworkloadbalancerparameters.go | 65 +
.../operator/v1/awssubnets.go | 54 +
.../operator/v1/azurecsidriverconfigspec.go | 27 +
.../operator/v1/azurediskencryptionset.go | 60 +
.../operator/v1/bgpmanagedconfig.go | 46 +
.../v1/bootimageskewenforcementconfig.go | 52 +
.../v1/bootimageskewenforcementstatus.go | 67 +
.../operator/v1/capability.go | 41 +
.../operator/v1/capabilityvisibility.go | 32 +
.../operator/v1/clienttls.go | 69 +
.../operator/v1/cloudcredential.go | 275 +
.../operator/v1/cloudcredentialspec.go | 80 +
.../operator/v1/cloudcredentialstatus.go | 75 +
.../operator/v1/clusterbootimageautomatic.go | 45 +
.../operator/v1/clusterbootimagemanual.go | 63 +
.../operator/v1/clustercsidriver.go | 279 +
.../operator/v1/clustercsidriverspec.go | 92 +
.../operator/v1/clustercsidriverstatus.go | 75 +
.../operator/v1/clusternetworkentry.go | 37 +
.../applyconfigurations/operator/v1/config.go | 278 +
.../operator/v1/configmapfilereference.go | 43 +
.../operator/v1/configspec.go | 60 +
.../operator/v1/configstatus.go | 73 +
.../operator/v1/console.go | 275 +
.../operator/v1/consoleconfigroute.go | 47 +
.../operator/v1/consolecustomization.go | 172 +
.../operator/v1/consoleproviders.go | 27 +
.../operator/v1/consolespec.go | 126 +
.../operator/v1/consolestatus.go | 75 +
.../containerloggingdestinationparameters.go | 31 +
.../operator/v1/csidriverconfigspec.go | 84 +
.../operator/v1/csisnapshotcontroller.go | 277 +
.../operator/v1/csisnapshotcontrollerspec.go | 62 +
.../v1/csisnapshotcontrollerstatus.go | 75 +
.../operator/v1/defaultnetworkdefinition.go | 53 +
.../v1/developerconsolecatalogcategory.go | 59 +
.../v1/developerconsolecatalogcategorymeta.go | 50 +
.../developerconsolecatalogcustomization.go | 42 +
.../v1/developerconsolecatalogtypes.go | 59 +
.../applyconfigurations/operator/v1/dns.go | 283 +
.../operator/v1/dnscache.go | 56 +
.../operator/v1/dnsnodeplacement.go | 65 +
.../operator/v1/dnsovertlsconfig.go | 49 +
.../operator/v1/dnsspec.go | 138 +
.../operator/v1/dnsstatus.go | 72 +
.../operator/v1/dnstransportconfig.go | 55 +
.../operator/v1/egressipconfig.go | 32 +
.../operator/v1/endpointpublishingstrategy.go | 121 +
.../applyconfigurations/operator/v1/etcd.go | 275 +
.../operator/v1/etcdspec.go | 111 +
.../operator/v1/etcdstatus.go | 107 +
.../operator/v1/exportnetworkflows.go | 44 +
.../operator/v1/featuresmigration.go | 47 +
.../operator/v1/filereferencesource.go | 44 +
.../operator/v1/forwardplugin.go | 92 +
.../operator/v1/gatewayconfig.go | 69 +
.../operator/v1/gathererstatus.go | 57 +
.../operator/v1/gatherstatus.go | 57 +
.../operator/v1/gcpcsidriverconfigspec.go | 27 +
.../operator/v1/gcpkmskeyreference.go | 66 +
.../operator/v1/gcploadbalancerparameters.go | 45 +
.../operator/v1/generationstatus.go | 76 +
.../operator/v1/healthcheck.go | 64 +
.../operator/v1/hostnetworkstrategy.go | 103 +
.../operator/v1/httpcompressionpolicy.go | 45 +
.../operator/v1/hybridoverlayconfig.go | 40 +
.../v1/ibmcloudcsidriverconfigspec.go | 27 +
.../operator/v1/ibmloadbalancerparameters.go | 49 +
.../operator/v1/ingress.go | 49 +
.../operator/v1/ingresscontroller.go | 291 +
.../v1/ingresscontrollercapturehttpcookie.go | 61 +
...ingresscontrollercapturehttpcookieunion.go | 59 +
.../v1/ingresscontrollercapturehttpheader.go | 41 +
.../v1/ingresscontrollercapturehttpheaders.go | 51 +
.../v1/ingresscontrollerhttpheader.go | 42 +
.../v1/ingresscontrollerhttpheaderactions.go | 64 +
.../ingresscontrollerhttpheaderactionunion.go | 44 +
.../v1/ingresscontrollerhttpheaders.go | 124 +
...gresscontrollerhttpuniqueidheaderpolicy.go | 46 +
.../operator/v1/ingresscontrollerlogging.go | 28 +
.../v1/ingresscontrollersethttpheader.go | 33 +
.../operator/v1/ingresscontrollerspec.go | 446 +
.../operator/v1/ingresscontrollerstatus.go | 150 +
.../v1/ingresscontrollertuningoptions.go | 365 +
.../operator/v1/insightsoperator.go | 277 +
.../operator/v1/insightsoperatorspec.go | 60 +
.../operator/v1/insightsoperatorstatus.go | 95 +
.../operator/v1/insightsreport.go | 49 +
.../operator/v1/ipamconfig.go | 41 +
.../operator/v1/ipfixconfig.go | 30 +
.../operator/v1/ipsecconfig.go | 47 +
.../operator/v1/ipsecfullmodeconfig.go | 37 +
.../operator/v1/ipv4gatewayconfig.go | 34 +
.../operator/v1/ipv4ovnkubernetesconfig.go | 49 +
.../operator/v1/ipv6gatewayconfig.go | 34 +
.../operator/v1/ipv6ovnkubernetesconfig.go | 51 +
.../v1/irreconcilablevalidationoverrides.go | 40 +
.../operator/v1/kmsencryptionstatus.go | 31 +
.../operator/v1/kmspluginhealthreport.go | 91 +
.../operator/v1/kubeapiserver.go | 277 +
.../operator/v1/kubeapiserverspec.go | 101 +
.../operator/v1/kubeapiserverstatus.go | 123 +
.../operator/v1/kubecontrollermanager.go | 277 +
.../operator/v1/kubecontrollermanagerspec.go | 98 +
.../v1/kubecontrollermanagerstatus.go | 94 +
.../operator/v1/kubescheduler.go | 277 +
.../operator/v1/kubeschedulerspec.go | 84 +
.../operator/v1/kubeschedulerstatus.go | 94 +
.../operator/v1/kubestorageversionmigrator.go | 275 +
.../v1/kubestorageversionmigratorspec.go | 60 +
.../v1/kubestorageversionmigratorstatus.go | 73 +
.../operator/v1/loadbalancerstrategy.go | 81 +
.../operator/v1/loggingdestination.go | 70 +
.../applyconfigurations/operator/v1/logo.go | 52 +
.../operator/v1/machineconfiguration.go | 277 +
.../operator/v1/machineconfigurationspec.go | 144 +
.../operator/v1/machineconfigurationstatus.go | 80 +
.../operator/v1/machinemanager.go | 56 +
.../operator/v1/machinemanagerselector.go | 44 +
.../operator/v1/managedbootimages.go | 30 +
.../operator/v1/mtumigration.go | 40 +
.../operator/v1/mtumigrationvalues.go | 36 +
.../operator/v1/netflowconfig.go | 31 +
.../operator/v1/network.go | 276 +
.../operator/v1/networkmigration.go | 72 +
.../operator/v1/networkspec.go | 229 +
.../operator/v1/networkstatus.go | 76 +
.../v1/nodedisruptionpolicyclusterstatus.go | 57 +
.../operator/v1/nodedisruptionpolicyconfig.go | 59 +
.../v1/nodedisruptionpolicyspecaction.go | 51 +
.../v1/nodedisruptionpolicyspecfile.go | 48 +
.../v1/nodedisruptionpolicyspecsshkey.go | 37 +
.../v1/nodedisruptionpolicyspecunit.go | 55 +
.../operator/v1/nodedisruptionpolicystatus.go | 24 +
.../v1/nodedisruptionpolicystatusaction.go | 51 +
.../v1/nodedisruptionpolicystatusfile.go | 48 +
.../v1/nodedisruptionpolicystatussshkey.go | 37 +
.../v1/nodedisruptionpolicystatusunit.go | 55 +
.../operator/v1/nodeplacement.go | 72 +
.../operator/v1/nodeportstrategy.go | 53 +
.../operator/v1/nodestatus.go | 114 +
.../operator/v1/nooverlayconfig.go | 50 +
.../operator/v1/oauthapiserverstatus.go | 35 +
.../applyconfigurations/operator/v1/olm.go | 277 +
.../operator/v1/olmspec.go | 60 +
.../operator/v1/olmstatus.go | 73 +
.../operator/v1/openshiftapiserver.go | 277 +
.../operator/v1/openshiftapiserverspec.go | 60 +
.../operator/v1/openshiftapiserverstatus.go | 83 +
.../operator/v1/openshiftcontrollermanager.go | 275 +
.../v1/openshiftcontrollermanagerspec.go | 60 +
.../v1/openshiftcontrollermanagerstatus.go | 73 +
.../operator/v1/openshiftsdnconfig.go | 74 +
.../v1/openstackloadbalancerparameters.go | 34 +
.../operator/v1/operatorcondition.go | 74 +
.../operator/v1/operatorspec.go | 85 +
.../operator/v1/operatorstatus.go | 84 +
.../operator/v1/ovnkubernetesconfig.go | 212 +
.../operator/v1/partialselector.go | 30 +
.../operator/v1/perspective.go | 64 +
.../operator/v1/perspectivevisibility.go | 40 +
.../operator/v1/pinnedresourcereference.go | 54 +
.../operator/v1/policyauditconfig.go | 75 +
.../operator/v1/privatestrategy.go | 54 +
.../operator/v1/projectaccess.go | 29 +
.../v1/providerloadbalancerparameters.go | 89 +
.../operator/v1/proxyconfig.go | 61 +
.../operator/v1/quickstarts.go | 28 +
.../operator/v1/reloadservice.go | 33 +
.../v1/resourceattributesaccessreview.go | 46 +
.../operator/v1/restartservice.go | 33 +
.../operator/v1/routeadmissionpolicy.go | 64 +
.../applyconfigurations/operator/v1/server.go | 52 +
.../operator/v1/serviceaccountissuerstatus.go | 40 +
.../operator/v1/serviceca.go | 277 +
.../operator/v1/servicecaspec.go | 60 +
.../operator/v1/servicecastatus.go | 73 +
.../operator/v1/servicecatalogapiserver.go | 276 +
.../v1/servicecatalogapiserverspec.go | 60 +
.../v1/servicecatalogapiserverstatus.go | 73 +
.../v1/servicecatalogcontrollermanager.go | 276 +
.../v1/servicecatalogcontrollermanagerspec.go | 60 +
.../servicecatalogcontrollermanagerstatus.go | 73 +
.../operator/v1/sflowconfig.go | 30 +
.../operator/v1/simplemacvlanconfig.go | 62 +
.../operator/v1/staticipamaddresses.go | 36 +
.../operator/v1/staticipamconfig.go | 56 +
.../operator/v1/staticipamdns.go | 50 +
.../operator/v1/staticipamroutes.go | 37 +
.../operator/v1/staticpodoperatorspec.go | 96 +
.../operator/v1/staticpodoperatorstatus.go | 101 +
.../operator/v1/statuspageprovider.go | 26 +
.../operator/v1/storage.go | 277 +
.../operator/v1/storagespec.go | 77 +
.../operator/v1/storagestatus.go | 75 +
.../v1/syslogloggingdestinationparameters.go | 65 +
.../applyconfigurations/operator/v1/theme.go | 50 +
.../operator/v1/upstream.go | 62 +
.../operator/v1/upstreamresolvers.go | 99 +
.../operator/v1/vspherecsidriverconfigspec.go | 89 +
.../api/v1alpha1/provisioning_types.go | 63 +
.../api/v1alpha1/provisioning_validation.go | 71 +-
.../api/v1alpha1/provisioning_webhook.go | 33 +-
.../api/v1alpha1/zz_generated.deepcopy.go | 53 +-
.../provisioning/baremetal_config.go | 75 +-
.../provisioning/baremetal_crypto.go | 66 +-
.../provisioning/baremetal_pod.go | 438 +-
.../provisioning/baremetal_secrets.go | 163 +-
.../provisioning/baremetal_webhook.go | 6 +-
.../provisioning/bmo_pod.go | 90 +-
.../provisioning/container_images.go | 4 +-
.../provisioning/image_cache.go | 97 +-
.../provisioning/image_customization.go | 173 +-
.../provisioning/ironic_proxy.go | 147 +-
.../provisioning/machine_os_images.go | 15 +-
.../provisioning/provisioning_info.go | 21 +-
.../provisioning/state_service.go | 280 +-
.../provisioning/tls_profile.go | 209 +
.../provisioning/utils.go | 46 +-
.../provisioning/webhook.go | 4 +-
.../pkg/apiserver/apiserver.go | 13 +-
.../pkg/cmd/server/start.go | 1 +
.../admissionreview/generated/openapi.go | 16 +
.../apis/hive/v1/clusterdeprovision_types.go | 9 +-
.../hive/apis/hive/v1/clusterpool_types.go | 2 +-
.../hive/apis/hive/v1/vsphere/machinepools.go | 23 +-
.../hive/apis/hive/v1/vsphere/platform.go | 34 +-
.../hive/v1/vsphere/zz_generated.deepcopy.go | 27 +-
.../apis/hive/v1/zz_generated.deepcopy.go | 9 +-
vendor/github.com/openshift/installer/LICENSE | 202 +
vendor/github.com/openshift/installer/NOTICE | 5 +
.../installer/pkg/types/vsphere/OWNERS | 7 +
.../installer/pkg/types/vsphere/doc.go | 7 +
.../pkg/types/vsphere/machinepool.go | 122 +
.../installer/pkg/types/vsphere/metadata.go | 25 +
.../installer/pkg/types/vsphere/platform.go | 370 +
.../types/vsphere/zz_generated.deepcopy.go | 283 +
.../pkg/apiserver/jsonpatch/jsonpatch.go | 87 +
.../clusteroperator/v1helpers/status.go | 13 +-
.../library-go/pkg/crypto/cert_config.go | 225 +
.../openshift/library-go/pkg/crypto/crypto.go | 326 +-
.../openshift/library-go/pkg/crypto/keygen.go | 118 +
.../library-go/pkg/crypto/options.go | 49 +
.../library-go/pkg/crypto/tls_adherence.go | 23 +
.../pkg/operator/events/recorder.go | 38 +-
.../pkg/operator/events/recorder_in_memory.go | 22 +-
.../pkg/operator/events/recorder_logging.go | 13 +-
.../pkg/operator/events/recorder_upstream.go | 9 +-
.../resourceapply/admissionregistration.go | 323 +-
.../resource/resourceapply/apiextensions.go | 15 +-
.../resource/resourceapply/apiregistration.go | 13 +-
.../operator/resource/resourceapply/apps.go | 49 +-
.../operator/resource/resourceapply/core.go | 131 +-
.../resource/resourceapply/event_helpers.go | 56 -
.../resource/resourceapply/generic.go | 82 +
.../resourceapply/json_patch_helpers.go | 2 +-
.../resource/resourceapply/migration.go | 15 +-
.../resource/resourceapply/monitoring.go | 228 +-
.../resource/resourceapply/networking.go | 69 +
.../operator/resource/resourceapply/policy.go | 15 +-
.../operator/resource/resourceapply/rbac.go | 80 +-
.../resource/resourceapply/storage.go | 86 +-
.../resource/resourceapply/unstructured.go | 11 +-
.../resourceapply/volumesnapshotclass.go | 5 +-
.../resource/resourcehelper/event_helpers.go | 43 +
.../resourcehelper/resource_helpers.go | 3 +
.../resource/resourcemerge/apiextensions.go | 4 +-
.../resource/resourcemerge/object_merger.go | 82 +-
.../resource/resourceread/admission.go | 38 +
.../resource/resourceread/apiregistration.go | 26 +
.../operator/resource/resourceread/config.go | 58 +
.../resource/resourceread/networking.go | 26 +
.../pkg/operator/v1helpers/canonicalize.go | 109 +
.../pkg/operator/v1helpers/helpers.go | 111 +-
.../pkg/operator/v1helpers/informers.go | 31 +-
.../pkg/operator/v1helpers/interfaces.go | 24 +
.../pkg/operator/v1helpers/test_helpers.go | 196 +-
.../opentracing/opentracing-go/.gitignore | 1 +
.../opentracing/opentracing-go/.travis.yml | 20 +
.../opentracing/opentracing-go/CHANGELOG.md | 63 +
.../opentracing/opentracing-go}/LICENSE | 2 +-
.../opentracing/opentracing-go/Makefile | 20 +
.../opentracing/opentracing-go/README.md | 171 +
.../opentracing/opentracing-go/ext.go | 24 +
.../opentracing/opentracing-go/ext/field.go | 17 +
.../opentracing/opentracing-go/ext/tags.go | 215 +
.../opentracing-go/globaltracer.go | 42 +
.../opentracing/opentracing-go/gocontext.go | 65 +
.../opentracing/opentracing-go/log/field.go | 282 +
.../opentracing/opentracing-go/log/util.go | 61 +
.../opentracing/opentracing-go/noop.go | 64 +
.../opentracing/opentracing-go/propagation.go | 176 +
.../opentracing/opentracing-go/span.go | 189 +
.../opentracing/opentracing-go/tracer.go | 304 +
.../pkg/apis/monitoring/register.go | 8 +-
.../pkg/apis/monitoring/resource.go | 60 +
.../apis/monitoring/v1/alertmanager_types.go | 464 +
.../apis/monitoring/v1/podmonitor_types.go | 312 +
.../pkg/apis/monitoring/v1/probe_types.go | 222 +
.../apis/monitoring/v1/prometheus_types.go | 1877 ++
.../monitoring/v1/prometheusrule_types.go | 121 +
.../monitoring/v1/servicemonitor_types.go | 168 +
.../pkg/apis/monitoring/v1/thanos_types.go | 103 +-
.../pkg/apis/monitoring/v1/types.go | 2004 +-
.../monitoring/v1/zz_generated.deepcopy.go | 1368 +-
.../prometheus/client_golang/NOTICE | 5 -
.../internal/github.com/golang/gddo}/LICENSE | 2 +-
.../golang/gddo/httputil/header/header.go | 145 +
.../golang/gddo/httputil/negotiate.go | 36 +
.../client_golang/prometheus/collectorfunc.go | 30 +
.../collectors/go_collector_latest.go | 4 +-
.../client_golang/prometheus/desc.go | 18 +-
.../client_golang/prometheus/go_collector.go | 55 +-
.../prometheus/go_collector_latest.go | 19 +-
.../client_golang/prometheus/histogram.go | 517 +-
.../prometheus/internal/difflib.go | 23 +-
.../internal/go_collector_options.go | 2 +
.../prometheus/internal/go_runtime_metrics.go | 3 +-
.../client_golang/prometheus/labels.go | 3 +-
.../client_golang/prometheus/metric.go | 51 +-
.../prometheus/process_collector.go | 56 +-
.../prometheus/process_collector_darwin.go | 130 +
.../process_collector_mem_cgo_darwin.c | 84 +
.../process_collector_mem_cgo_darwin.go | 51 +
.../process_collector_mem_nocgo_darwin.go | 39 +
.../process_collector_not_supported.go | 33 +
....go => process_collector_procfsenabled.go} | 34 +-
.../prometheus/process_collector_windows.go | 21 +-
.../prometheus/promhttp/delegator.go | 6 +
.../client_golang/prometheus/promhttp/http.go | 138 +-
.../prometheus/promhttp/instrument_server.go | 2 +-
.../internal/compression.go} | 19 +-
.../client_golang/prometheus/registry.go | 17 +-
.../client_golang/prometheus/summary.go | 49 +-
.../prometheus/testutil/promlint/promlint.go | 2 +-
.../testutil/promlint/validation.go | 1 +
.../validations/duplicate_validations.go | 37 +
.../validations/generic_name_validations.go | 20 +-
.../prometheus/testutil/testutil.go | 118 +-
.../client_golang/prometheus/vec.go | 12 +-
.../client_golang/prometheus/wrap.go | 36 +-
.../prometheus/client_model/go/metrics.pb.go | 195 +-
.../prometheus/common/expfmt/decode.go | 68 +-
.../prometheus/common/expfmt/encode.go | 89 +-
.../prometheus/common/expfmt/expfmt.go | 192 +-
.../prometheus/common/expfmt/fuzz.go | 9 +-
.../common/expfmt/openmetrics_create.go | 339 +-
.../prometheus/common/expfmt/text_create.go | 180 +-
.../prometheus/common/expfmt/text_parse.go | 316 +-
.../bitbucket.org/ww/goautoneg/README.txt | 67 -
.../bitbucket.org/ww/goautoneg/autoneg.go | 160 -
.../prometheus/common/model/alert.go | 40 +-
.../prometheus/common/model/labels.go | 39 +-
.../prometheus/common/model/labelset.go | 21 +-
.../common/model/labelset_string.go | 43 +
.../prometheus/common/model/metadata.go | 28 +
.../prometheus/common/model/metric.go | 515 +-
.../prometheus/common/model/signature.go | 6 +-
.../prometheus/common/model/silence.go | 19 +-
.../prometheus/common/model/time.go | 37 +-
.../prometheus/common/model/value.go | 31 +-
.../prometheus/common/model/value_float.go | 17 +-
.../common/model/value_histogram.go | 17 +-
.../prometheus/common/model/value_type.go | 4 +-
.../prometheus/procfs/.golangci.yml | 62 +-
.../prometheus/procfs/MAINTAINERS.md | 3 +-
vendor/github.com/prometheus/procfs/Makefile | 2 +-
.../prometheus/procfs/Makefile.common | 45 +-
vendor/github.com/prometheus/procfs/README.md | 6 +-
vendor/github.com/prometheus/procfs/arp.go | 19 +-
.../github.com/prometheus/procfs/buddyinfo.go | 16 +-
.../github.com/prometheus/procfs/cmdline.go | 2 +-
.../github.com/prometheus/procfs/cpuinfo.go | 6 +-
.../prometheus/procfs/cpuinfo_armx.go | 2 +-
.../prometheus/procfs/cpuinfo_loong64.go | 2 +-
.../prometheus/procfs/cpuinfo_mipsx.go | 2 +-
.../prometheus/procfs/cpuinfo_others.go | 2 +-
.../prometheus/procfs/cpuinfo_ppcx.go | 2 +-
.../prometheus/procfs/cpuinfo_riscvx.go | 2 +-
.../prometheus/procfs/cpuinfo_s390x.go | 2 +-
.../prometheus/procfs/cpuinfo_x86.go | 2 +-
vendor/github.com/prometheus/procfs/crypto.go | 8 +-
vendor/github.com/prometheus/procfs/doc.go | 2 +-
vendor/github.com/prometheus/procfs/fs.go | 12 +-
.../prometheus/procfs/fs_statfs_notype.go | 6 +-
.../prometheus/procfs/fs_statfs_type.go | 2 +-
.../github.com/prometheus/procfs/fscache.go | 19 +-
.../prometheus/procfs/internal/fs/fs.go | 5 +-
.../prometheus/procfs/internal/util/parse.go | 16 +-
.../procfs/internal/util/readfile.go | 2 +-
.../procfs/internal/util/sysreadfile.go | 22 +-
.../internal/util/sysreadfile_compat.go | 2 +-
.../procfs/internal/util/valueparser.go | 2 +-
vendor/github.com/prometheus/procfs/ipvs.go | 8 +-
.../prometheus/procfs/kernel_hung.go | 45 +
.../prometheus/procfs/kernel_random.go | 2 +-
.../github.com/prometheus/procfs/loadavg.go | 4 +-
vendor/github.com/prometheus/procfs/mdstat.go | 181 +-
.../github.com/prometheus/procfs/meminfo.go | 255 +-
.../github.com/prometheus/procfs/mountinfo.go | 25 +-
.../prometheus/procfs/mountstats.go | 42 +-
.../prometheus/procfs/net_conntrackstat.go | 6 +-
.../github.com/prometheus/procfs/net_dev.go | 2 +-
.../prometheus/procfs/net_dev_snmp6.go | 99 +
.../prometheus/procfs/net_ip_socket.go | 54 +-
.../prometheus/procfs/net_protocols.go | 25 +-
.../github.com/prometheus/procfs/net_route.go | 2 +-
.../prometheus/procfs/net_sockstat.go | 9 +-
.../prometheus/procfs/net_softnet.go | 4 +-
.../github.com/prometheus/procfs/net_tcp.go | 6 +-
.../prometheus/procfs/net_tls_stat.go | 119 +
.../github.com/prometheus/procfs/net_udp.go | 2 +-
.../github.com/prometheus/procfs/net_unix.go | 24 +-
.../prometheus/procfs/net_wireless.go | 24 +-
.../github.com/prometheus/procfs/net_xfrm.go | 2 +-
.../github.com/prometheus/procfs/netstat.go | 2 +-
.../prometheus/procfs/nfnetlink_queue.go | 85 +
vendor/github.com/prometheus/procfs/proc.go | 20 +-
.../prometheus/procfs/proc_cgroup.go | 4 +-
.../prometheus/procfs/proc_cgroups.go | 8 +-
.../prometheus/procfs/proc_environ.go | 2 +-
.../prometheus/procfs/proc_fdinfo.go | 13 +-
.../prometheus/procfs/proc_interrupts.go | 2 +-
.../github.com/prometheus/procfs/proc_io.go | 4 +-
.../prometheus/procfs/proc_limits.go | 9 +-
.../github.com/prometheus/procfs/proc_maps.go | 2 +-
.../prometheus/procfs/proc_netstat.go | 226 +-
.../github.com/prometheus/procfs/proc_ns.go | 6 +-
.../github.com/prometheus/procfs/proc_psi.go | 4 +-
.../prometheus/procfs/proc_smaps.go | 8 +-
.../github.com/prometheus/procfs/proc_snmp.go | 122 +-
.../prometheus/procfs/proc_snmp6.go | 152 +-
.../github.com/prometheus/procfs/proc_stat.go | 21 +-
.../prometheus/procfs/proc_statm.go | 116 +
.../prometheus/procfs/proc_status.go | 56 +-
.../github.com/prometheus/procfs/proc_sys.go | 6 +-
.../github.com/prometheus/procfs/schedstat.go | 2 +-
vendor/github.com/prometheus/procfs/slab.go | 2 +-
.../github.com/prometheus/procfs/softirqs.go | 46 +-
vendor/github.com/prometheus/procfs/stat.go | 27 +-
vendor/github.com/prometheus/procfs/swaps.go | 8 +-
vendor/github.com/prometheus/procfs/thread.go | 4 +-
vendor/github.com/prometheus/procfs/vm.go | 2 +-
.../github.com/prometheus/procfs/zoneinfo.go | 12 +-
.../sirupsen/logrus/terminal_check_bsd.go | 2 +-
.../sirupsen/logrus/terminal_check_unix.go | 2 +
.../sirupsen/logrus/terminal_check_wasi.go | 8 +
.../sirupsen/logrus/terminal_check_wasip1.go | 8 +
vendor/github.com/spf13/cobra/.golangci.yml | 43 +-
vendor/github.com/spf13/cobra/README.md | 25 +-
vendor/github.com/spf13/cobra/SECURITY.md | 105 +
vendor/github.com/spf13/cobra/active_help.go | 15 +-
vendor/github.com/spf13/cobra/args.go | 4 +-
.../spf13/cobra/bash_completions.go | 25 +-
.../spf13/cobra/bash_completionsV2.go | 152 +-
vendor/github.com/spf13/cobra/cobra.go | 18 +-
vendor/github.com/spf13/cobra/command.go | 365 +-
vendor/github.com/spf13/cobra/completions.go | 203 +-
vendor/github.com/spf13/cobra/flag_groups.go | 34 +-
.../spf13/cobra/powershell_completions.go | 39 +-
vendor/github.com/x448/float16/.travis.yml | 13 +
vendor/github.com/x448/float16/LICENSE | 22 +
vendor/github.com/x448/float16/README.md | 133 +
vendor/github.com/x448/float16/float16.go | 302 +
.../go.etcd.io/etcd/api/v3/authpb/auth.pb.go | 47 +-
.../go.etcd.io/etcd/api/v3/authpb/auth.proto | 2 +
.../etcd/api/v3/etcdserverpb/etcdserver.pb.go | 52 +-
.../etcd/api/v3/etcdserverpb/etcdserver.proto | 2 +
.../api/v3/etcdserverpb/raft_internal.pb.go | 192 +-
.../api/v3/etcdserverpb/raft_internal.proto | 22 +-
.../v3/etcdserverpb/raft_internal_stringer.go | 12 +-
.../etcd/api/v3/etcdserverpb/rpc.pb.go | 1291 +-
.../etcd/api/v3/etcdserverpb/rpc.proto | 343 +-
.../etcd/api/v3/membershippb/membership.pb.go | 53 +-
.../etcd/api/v3/membershippb/membership.proto | 15 +
vendor/go.etcd.io/etcd/api/v3/mvccpb/kv.pb.go | 42 +-
vendor/go.etcd.io/etcd/api/v3/mvccpb/kv.proto | 2 +
.../etcd/api/v3/v3rpc/rpctypes/error.go | 168 +-
.../api/v3/v3rpc/rpctypes/metadatafields.go | 3 +
.../go.etcd.io/etcd/api/v3/version/version.go | 31 +-
.../etcd/api/v3/versionpb/version.pb.go | 91 +
.../etcd/api/v3/versionpb/version.proto | 30 +
.../etcd/client/pkg/v3/fileutil/dir_unix.go | 3 +-
.../client/pkg/v3/fileutil/dir_windows.go | 3 +-
.../etcd/client/pkg/v3/fileutil/fileutil.go | 27 +-
.../etcd/client/pkg/v3/fileutil/lock.go | 4 +-
.../etcd/client/pkg/v3/fileutil/lock_flock.go | 4 +-
.../etcd/client/pkg/v3/fileutil/lock_linux.go | 8 +-
.../client/pkg/v3/fileutil/lock_solaris.go | 1 -
.../etcd/client/pkg/v3/fileutil/lock_unix.go | 1 -
.../client/pkg/v3/fileutil/lock_windows.go | 47 +-
.../client/pkg/v3/fileutil/preallocate.go | 6 +-
.../pkg/v3/fileutil/preallocate_darwin.go | 4 +-
.../pkg/v3/fileutil/preallocate_unix.go | 10 +-
.../v3/fileutil/preallocate_unsupported.go | 1 -
.../etcd/client/pkg/v3/fileutil/purge.go | 71 +-
.../etcd/client/pkg/v3/fileutil/sync.go | 1 -
.../client/pkg/v3/fileutil/sync_darwin.go | 1 -
.../etcd/client/pkg/v3/fileutil/sync_linux.go | 1 -
.../etcd/client/pkg/v3/logutil/log_format.go | 42 +
.../etcd/client/pkg/v3/logutil/zap.go | 51 +-
.../etcd/client/pkg/v3/logutil/zap_journal.go | 5 +-
.../etcd/client/pkg/v3/tlsutil/tlsutil.go | 8 +-
.../pkg/v3/transport/keepalive_listener.go | 17 +-
.../transport/keepalive_listener_openbsd.go} | 22 +-
.../v3/transport/keepalive_listener_unix.go} | 14 +-
.../client/pkg/v3/transport/limit_listen.go | 4 +-
.../etcd/client/pkg/v3/transport/listener.go | 240 +-
.../client/pkg/v3/transport/listener_opts.go | 14 +
.../client/pkg/v3/transport/listener_tls.go | 11 +-
.../etcd/client/pkg/v3/transport/sockopt.go | 14 +
.../pkg/v3/transport/sockopt_solaris.go | 5 +-
.../client/pkg/v3/transport/sockopt_unix.go | 3 +-
.../client/pkg/v3/transport/sockopt_wasm.go} | 27 +-
.../pkg/v3/transport/sockopt_windows.go | 21 +-
.../etcd/client/pkg/v3/transport/tls.go | 3 +-
.../etcd/client/pkg/v3/transport/transport.go | 13 +-
.../go.etcd.io/etcd/client/pkg/v3/types/id.go | 19 +-
.../etcd/client/pkg/v3/types/set.go | 2 +-
.../etcd/client/pkg/v3/types/urls.go | 21 +-
.../etcd/client/pkg/v3/verify/verify.go | 80 +
vendor/go.etcd.io/etcd/client/v3/OWNERS | 4 +
vendor/go.etcd.io/etcd/client/v3/README.md | 29 +-
vendor/go.etcd.io/etcd/client/v3/auth.go | 39 +-
vendor/go.etcd.io/etcd/client/v3/client.go | 155 +-
vendor/go.etcd.io/etcd/client/v3/cluster.go | 22 +-
vendor/go.etcd.io/etcd/client/v3/compare.go | 12 +-
vendor/go.etcd.io/etcd/client/v3/config.go | 138 +-
.../etcd/client/v3/credentials/credentials.go | 86 +-
vendor/go.etcd.io/etcd/client/v3/ctx.go | 3 +-
vendor/go.etcd.io/etcd/client/v3/doc.go | 5 +-
.../client/v3/internal/endpoint/endpoint.go | 26 +-
.../client/v3/internal/resolver/resolver.go | 11 +-
.../etcd/client/v3/kubernetes/client.go | 136 +
.../etcd/client/v3/kubernetes/interface.go | 142 +
vendor/go.etcd.io/etcd/client/v3/kv.go | 30 +-
vendor/go.etcd.io/etcd/client/v3/lease.go | 55 +-
vendor/go.etcd.io/etcd/client/v3/logger.go | 5 +-
.../go.etcd.io/etcd/client/v3/maintenance.go | 185 +-
vendor/go.etcd.io/etcd/client/v3/op.go | 35 +-
vendor/go.etcd.io/etcd/client/v3/options.go | 2 +-
vendor/go.etcd.io/etcd/client/v3/retry.go | 45 +-
.../etcd/client/v3/retry_interceptor.go | 116 +-
vendor/go.etcd.io/etcd/client/v3/sort.go | 6 +-
vendor/go.etcd.io/etcd/client/v3/txn.go | 6 +-
vendor/go.etcd.io/etcd/client/v3/watch.go | 81 +-
.../bson/bsoncodec/default_value_decoders.go | 16 +-
.../mongo-driver/bson/bsoncodec/uint_codec.go | 8 +-
.../bson/bsonrw/extjson_parser.go | 2 +-
.../bson/bsonrw/extjson_wrappers.go | 4 +-
.../bson/bsonrw/extjson_writer.go | 20 +-
.../mongo-driver/bson/bsonrw/json_scanner.go | 37 +-
.../mongo-driver/bson/bsonrw/value_reader.go | 12 +-
.../mongo-driver/bson/bsonrw/value_writer.go | 2 +-
.../go.mongodb.org/mongo-driver/bson/doc.go | 11 +-
.../mongo-driver/bson/primitive/decimal.go | 6 +-
.../mongo-driver/bson/raw_value.go | 8 +-
.../mongo-driver/bson/registry.go | 18 +-
.../mongo-driver/bson/unmarshal.go | 3 +
.../mongo-driver/x/bsonx/bsoncore/bsoncore.go | 40 +-
.../mongo-driver/x/bsonx/bsoncore/doc.go | 23 +-
.../mongo-driver/x/bsonx/bsoncore/element.go | 8 +-
.../mongo-driver/x/bsonx/bsoncore/value.go | 13 +-
.../google.golang.org/grpc/otelgrpc/config.go | 179 +-
.../google.golang.org/grpc/otelgrpc/doc.go | 13 +-
.../grpc/otelgrpc/interceptor.go | 348 +-
.../grpc/otelgrpc/interceptorinfo.go | 13 +-
.../grpc/otelgrpc/internal/parse.go | 16 +-
.../grpc/otelgrpc/metadata_supplier.go | 17 +-
.../grpc/otelgrpc/semconv.go | 52 -
.../grpc/otelgrpc/stats_handler.go | 342 +-
.../grpc/otelgrpc/version.go | 22 +-
.../net/http/otelhttp/client.go | 21 +-
.../net/http/otelhttp/common.go | 27 +-
.../net/http/otelhttp/config.go | 34 +-
.../instrumentation/net/http/otelhttp/doc.go | 13 +-
.../net/http/otelhttp/handler.go | 185 +-
.../otelhttp/internal/request/body_wrapper.go | 80 +
.../net/http/otelhttp/internal/request/gen.go | 10 +
.../internal/request/resp_writer_wrapper.go | 122 +
.../net/http/otelhttp/internal/semconv/env.go | 343 +
.../net/http/otelhttp/internal/semconv/gen.go | 16 +
.../otelhttp/internal/semconv/httpconv.go | 517 +
.../http/otelhttp/internal/semconv/util.go | 127 +
.../http/otelhttp/internal/semconv/v1.20.0.go | 273 +
.../http/otelhttp/internal/semconvutil/gen.go | 13 +-
.../otelhttp/internal/semconvutil/httpconv.go | 66 +-
.../otelhttp/internal/semconvutil/netconv.go | 31 +-
.../net/http/otelhttp/labeler.go | 25 +-
.../net/http/otelhttp/start_time_context.go | 29 +
.../net/http/otelhttp/transport.go | 163 +-
.../net/http/otelhttp/version.go | 22 +-
.../instrumentation/net/http/otelhttp/wrap.go | 100 -
.../otel/exporters/otlp/otlptrace/README.md | 3 +
.../otel/exporters/otlp/otlptrace/clients.go | 13 +-
.../otel/exporters/otlp/otlptrace/doc.go | 13 +-
.../otel/exporters/otlp/otlptrace/exporter.go | 15 +-
.../internal/tracetransform/attribute.go | 13 +-
.../tracetransform/instrumentation.go | 18 +-
.../internal/tracetransform/resource.go | 13 +-
.../otlptrace/internal/tracetransform/span.go | 54 +-
.../otlp/otlptrace/otlptracegrpc/README.md | 3 +
.../otlp/otlptrace/otlptracegrpc/client.go | 26 +-
.../otlp/otlptrace/otlptracegrpc/doc.go | 26 +-
.../otlp/otlptrace/otlptracegrpc/exporter.go | 13 +-
.../internal/envconfig/envconfig.go | 45 +-
.../otlptrace/otlptracegrpc/internal/gen.go | 13 +-
.../internal/otlpconfig/envconfig.go | 13 +-
.../internal/otlpconfig/options.go | 54 +-
.../internal/otlpconfig/optiontypes.go | 13 +-
.../otlptracegrpc/internal/otlpconfig/tls.go | 13 +-
.../otlptracegrpc/internal/partialsuccess.go | 13 +-
.../otlptracegrpc/internal/retry/retry.go | 15 +-
.../otlp/otlptrace/otlptracegrpc/options.go | 55 +-
.../otel/exporters/otlp/otlptrace/version.go | 15 +-
.../otel/semconv/internal/v2/http.go | 398 +
.../otel/semconv/internal/v2/net.go | 313 +
.../otel/semconv/v1.17.0/httpconv/README.md | 3 +
.../otel/semconv/v1.17.0/httpconv/http.go | 141 +
.../otel/semconv/v1.34.0/MIGRATION.md | 4 +
.../otel/semconv/v1.34.0/README.md | 3 +
.../otel/semconv/v1.34.0/attribute_group.go | 14061 ++++++++++++++
.../otel/semconv/v1.34.0/doc.go | 9 +
.../otel/semconv/v1.34.0/error_type.go | 31 +
.../otel/semconv/v1.34.0/exception.go | 9 +
.../otel/semconv/v1.34.0/httpconv/metric.go | 1421 ++
.../otel/semconv/v1.34.0/rpcconv/metric.go | 716 +
.../otel/semconv/v1.34.0/schema.go | 9 +
.../proto/otlp/trace/v1/trace.pb.go | 399 +-
vendor/go.starlark.net/LICENSE | 29 -
.../internal/compile/compile.go | 1924 --
.../internal/compile/serial.go | 395 -
.../go.starlark.net/internal/spell/spell.go | 115 -
vendor/go.starlark.net/resolve/binding.go | 74 -
vendor/go.starlark.net/resolve/resolve.go | 969 -
vendor/go.starlark.net/starlark/debug.go | 42 -
vendor/go.starlark.net/starlark/empty.s | 3 -
vendor/go.starlark.net/starlark/eval.go | 1648 --
vendor/go.starlark.net/starlark/hashtable.go | 390 -
vendor/go.starlark.net/starlark/int.go | 452 -
.../go.starlark.net/starlark/int_generic.go | 34 -
.../go.starlark.net/starlark/int_posix64.go | 91 -
vendor/go.starlark.net/starlark/interp.go | 705 -
vendor/go.starlark.net/starlark/library.go | 2289 ---
vendor/go.starlark.net/starlark/profile.go | 449 -
vendor/go.starlark.net/starlark/unpack.go | 355 -
vendor/go.starlark.net/starlark/value.go | 1500 --
.../go.starlark.net/starlarkstruct/module.go | 43 -
.../go.starlark.net/starlarkstruct/struct.go | 282 -
vendor/go.starlark.net/syntax/grammar.txt | 129 -
vendor/go.starlark.net/syntax/parse.go | 1028 --
vendor/go.starlark.net/syntax/quote.go | 309 -
vendor/go.starlark.net/syntax/scan.go | 1123 --
vendor/go.starlark.net/syntax/syntax.go | 525 -
vendor/go.starlark.net/syntax/walk.go | 161 -
vendor/go.uber.org/zap/.golangci.yml | 2 +-
vendor/go.uber.org/zap/.readme.tmpl | 10 +-
vendor/go.uber.org/zap/CHANGELOG.md | 54 +-
.../go.uber.org/zap/{LICENSE.txt => LICENSE} | 0
vendor/go.uber.org/zap/README.md | 66 +-
vendor/go.uber.org/zap/buffer/buffer.go | 2 +-
vendor/go.uber.org/zap/field.go | 2 +
vendor/go.uber.org/zap/logger.go | 39 +-
vendor/go.uber.org/zap/options.go | 15 +
vendor/go.uber.org/zap/sugar.go | 39 +
.../zap/zapcore/console_encoder.go | 2 +-
vendor/go.uber.org/zap/zapcore/encoder.go | 15 +
vendor/go.uber.org/zap/zapcore/field.go | 2 +-
.../go.uber.org/zap/zapcore/json_encoder.go | 2 +-
vendor/go.uber.org/zap/zapgrpc/zapgrpc.go | 18 +-
.../yaml => go.yaml.in/yaml/v3}/LICENSE | 0
.../yaml => go.yaml.in/yaml/v3}/NOTICE | 0
vendor/go.yaml.in/yaml/v3/README.md | 171 +
.../yaml => go.yaml.in/yaml/v3}/apic.go | 8 +-
.../yaml => go.yaml.in/yaml/v3}/decode.go | 24 +-
.../yaml => go.yaml.in/yaml/v3}/emitterc.go | 76 +-
.../yaml => go.yaml.in/yaml/v3}/encode.go | 0
.../yaml => go.yaml.in/yaml/v3}/parserc.go | 140 +-
.../yaml => go.yaml.in/yaml/v3}/readerc.go | 8 +-
.../yaml => go.yaml.in/yaml/v3}/resolve.go | 0
.../yaml => go.yaml.in/yaml/v3}/scannerc.go | 42 +-
.../yaml => go.yaml.in/yaml/v3}/sorter.go | 0
.../yaml => go.yaml.in/yaml/v3}/writerc.go | 8 +-
.../yaml => go.yaml.in/yaml/v3}/yaml.go | 75 +-
.../yaml => go.yaml.in/yaml/v3}/yamlh.go | 10 +-
.../yaml/v3}/yamlprivateh.go | 20 +-
.../x/exp/constraints/constraints.go | 50 -
vendor/golang.org/x/exp/maps/maps.go | 68 +-
vendor/golang.org/x/exp/slices/cmp.go | 44 -
vendor/golang.org/x/exp/slices/slices.go | 447 +-
vendor/golang.org/x/exp/slices/sort.go | 162 +-
.../golang.org/x/exp/slices/zsortanyfunc.go | 479 -
.../golang.org/x/exp/slices/zsortordered.go | 481 -
vendor/golang.org/x/net/html/entity.go | 5 +-
vendor/golang.org/x/net/html/escape.go | 140 +-
vendor/golang.org/x/net/html/token.go | 26 +-
vendor/golang.org/x/net/http2/server_wrap.go | 16 +
.../golang.org/x/net/http2/transport_wrap.go | 15 +-
.../golang.org/x/net/internal/socks/client.go | 168 -
.../golang.org/x/net/internal/socks/socks.go | 317 -
vendor/golang.org/x/net/proxy/dial.go | 54 -
vendor/golang.org/x/net/proxy/direct.go | 31 -
vendor/golang.org/x/net/proxy/per_host.go | 153 -
vendor/golang.org/x/net/proxy/proxy.go | 149 -
vendor/golang.org/x/net/proxy/socks5.go | 42 -
vendor/golang.org/x/time/rate/rate.go | 2 +-
.../gomodules.xyz/jsonpatch/v2/jsonpatch.go | 17 +-
.../grpc/attributes/attributes.go | 77 +-
.../grpc/balancer/balancer.go | 32 +-
.../grpc/balancer/base/balancer.go | 6 +-
.../endpointsharding/endpointsharding.go | 11 +-
.../grpc/balancer/pickfirst/pickfirst.go | 12 +-
.../grpc_binarylog_v1/binarylog.pb.go | 2 +-
.../google.golang.org/grpc/credentials/tls.go | 18 +-
vendor/google.golang.org/grpc/dialoptions.go | 9 +-
.../grpc/health/grpc_health_v1/health.pb.go | 2 +-
.../health/grpc_health_v1/health_grpc.pb.go | 2 +-
.../grpc/internal/envconfig/envconfig.go | 38 +-
.../grpc/internal/mem/buffer_pool.go | 338 +
.../grpc/internal/transport/defaults.go | 1 +
.../grpc/internal/transport/http2_client.go | 6 +-
.../grpc/internal/transport/http2_server.go | 6 +-
.../google.golang.org/grpc/mem/buffer_pool.go | 167 +-
.../google.golang.org/grpc/picker_wrapper.go | 4 +-
vendor/google.golang.org/grpc/resolver/map.go | 34 +
vendor/google.golang.org/grpc/rpc_util.go | 22 +-
vendor/google.golang.org/grpc/server.go | 1 +
vendor/google.golang.org/grpc/version.go | 2 +-
.../encoding/protodelim/protodelim.go | 167 +
.../protobuf/encoding/protojson/decode.go | 12 +
.../encoding/protojson/well_known_types.go | 5 +-
.../protobuf/encoding/prototext/decode.go | 18 +
.../protobuf/internal/descfmt/stringer.go | 269 +-
.../protobuf/internal/encoding/tag/tag.go | 11 +-
.../protobuf/internal/encoding/text/decode.go | 115 +-
.../protobuf/internal/filedesc/desc.go | 1 +
.../protobuf/internal/filedesc/desc_lazy.go | 22 -
.../protobuf/internal/genid/descriptor_gen.go | 1 +
.../protobuf/internal/impl/codec_map.go | 6 +
.../protobuf/internal/impl/decode.go | 3 +-
.../protobuf/internal/impl/validate.go | 26 +
.../protobuf/internal/version/version.go | 4 +-
.../protobuf/proto/decode.go | 10 +-
.../protobuf/reflect/protodesc/desc.go | 11 +-
.../protobuf/reflect/protodesc/desc_init.go | 1 +
.../protobuf/reflect/protodesc/editions.go | 4 +-
.../types/descriptorpb/descriptor.pb.go | 13 +-
.../types/known/timestamppb/timestamp.pb.go | 13 +-
vendor/gopkg.in/djherbis/times.v1/.travis.sh | 28 -
vendor/gopkg.in/djherbis/times.v1/.travis.yml | 28 -
.../evanphx/json-patch.v4}/.gitignore | 0
.../evanphx/json-patch.v4}/LICENSE | 0
.../evanphx/json-patch.v4}/README.md | 4 +-
.../evanphx/json-patch.v4}/errors.go | 0
.../evanphx/json-patch.v4}/merge.go | 0
.../evanphx/json-patch.v4}/patch.go | 101 +-
vendor/k8s.io/api/admission/v1/doc.go | 4 +-
.../k8s.io/api/admission/v1/generated.pb.go | 178 +-
.../k8s.io/api/admission/v1/generated.proto | 65 +-
.../admission/v1/generated.protomessage.pb.go | 28 +
vendor/k8s.io/api/admission/v1/types.go | 48 +-
.../v1/types_swagger_doc_generated.go | 46 +-
.../admission/v1/zz_generated.model_name.go | 37 +
.../v1/zz_generated.prerelease-lifecycle.go | 28 +
vendor/k8s.io/api/admission/v1beta1/doc.go | 3 +-
.../api/admission/v1beta1/generated.pb.go | 178 +-
.../api/admission/v1beta1/generated.proto | 65 +-
.../v1beta1/generated.protomessage.pb.go | 28 +
vendor/k8s.io/api/admission/v1beta1/types.go | 47 +-
.../v1beta1/types_swagger_doc_generated.go | 46 +-
.../v1beta1/zz_generated.model_name.go | 37 +
.../api/admissionregistration/v1/doc.go | 5 +-
.../admissionregistration/v1/generated.pb.go | 6166 +++++--
.../admissionregistration/v1/generated.proto | 583 +-
.../v1/generated.protomessage.pb.go | 76 +
.../api/admissionregistration/v1/register.go | 4 +
.../api/admissionregistration/v1/types.go | 619 +-
.../v1/types_swagger_doc_generated.go | 178 +-
.../v1/zz_generated.deepcopy.go | 432 +
.../v1/zz_generated.model_name.go | 157 +
.../v1/zz_generated.prerelease-lifecycle.go | 70 +
.../api/admissionregistration/v1alpha1/doc.go | 5 +-
.../v1alpha1/generated.pb.go | 4531 +++--
.../v1alpha1/generated.proto | 332 +-
.../v1alpha1/generated.protomessage.pb.go | 74 +
.../v1alpha1/register.go | 4 +
.../admissionregistration/v1alpha1/types.go | 367 +-
.../v1alpha1/types_swagger_doc_generated.go | 103 +-
.../v1alpha1/zz_generated.deepcopy.go | 252 +
.../v1alpha1/zz_generated.model_name.go | 152 +
.../zz_generated.prerelease-lifecycle.go | 166 +
.../api/admissionregistration/v1beta1/doc.go | 4 +-
.../v1beta1/generated.pb.go | 3618 ++--
.../v1beta1/generated.proto | 355 +-
.../v1beta1/generated.protomessage.pb.go | 90 +
.../admissionregistration/v1beta1/register.go | 4 +
.../admissionregistration/v1beta1/types.go | 358 +-
.../v1beta1/types_swagger_doc_generated.go | 99 +-
.../v1beta1/zz_generated.deepcopy.go | 254 +-
.../v1beta1/zz_generated.model_name.go | 192 +
.../zz_generated.prerelease-lifecycle.go | 72 +
.../v1alpha1 => apidiscovery/v2}/doc.go | 8 +-
.../api/apidiscovery/v2/generated.pb.go | 1537 ++
.../api/apidiscovery/v2/generated.proto | 156 +
.../v2/generated.protomessage.pb.go | 32 +
.../apidiscovery/v2}/register.go | 37 +-
vendor/k8s.io/api/apidiscovery/v2/types.go | 157 +
.../apidiscovery/v2/zz_generated.deepcopy.go | 190 +
.../v2/zz_generated.model_name.go | 47 +
.../v2/zz_generated.prerelease-lifecycle.go | 34 +
vendor/k8s.io/api/apidiscovery/v2beta1/doc.go | 3 +-
.../api/apidiscovery/v2beta1/generated.pb.go | 219 +-
.../api/apidiscovery/v2beta1/generated.proto | 10 +-
.../v2beta1/generated.protomessage.pb.go | 32 +
.../v2beta1/zz_generated.model_name.go | 47 +
.../api/apiserverinternal/v1alpha1/doc.go | 3 +-
.../v1alpha1/generated.pb.go | 251 +-
.../v1alpha1/generated.proto | 7 +-
.../v1alpha1/generated.protomessage.pb.go | 34 +
.../api/apiserverinternal/v1alpha1/types.go | 1 -
.../v1alpha1/zz_generated.model_name.go | 52 +
vendor/k8s.io/api/apps/v1/doc.go | 4 +-
vendor/k8s.io/api/apps/v1/generated.pb.go | 1091 +-
vendor/k8s.io/api/apps/v1/generated.proto | 126 +-
.../api/apps/v1/generated.protomessage.pb.go | 82 +
vendor/k8s.io/api/apps/v1/types.go | 80 +-
.../apps/v1/types_swagger_doc_generated.go | 32 +-
.../api/apps/v1/zz_generated.deepcopy.go | 10 +
.../api/apps/v1/zz_generated.model_name.go | 172 +
.../v1/zz_generated.prerelease-lifecycle.go | 82 +
vendor/k8s.io/api/apps/v1beta1/doc.go | 3 +-
.../k8s.io/api/apps/v1beta1/generated.pb.go | 860 +-
.../k8s.io/api/apps/v1beta1/generated.proto | 87 +-
.../apps/v1beta1/generated.protomessage.pb.go | 68 +
vendor/k8s.io/api/apps/v1beta1/types.go | 54 +-
.../v1beta1/types_swagger_doc_generated.go | 21 +-
.../api/apps/v1beta1/zz_generated.deepcopy.go | 5 +
.../apps/v1beta1/zz_generated.model_name.go | 137 +
vendor/k8s.io/api/apps/v1beta2/doc.go | 3 +-
.../k8s.io/api/apps/v1beta2/generated.pb.go | 1193 +-
.../k8s.io/api/apps/v1beta2/generated.proto | 136 +-
.../apps/v1beta2/generated.protomessage.pb.go | 88 +
vendor/k8s.io/api/apps/v1beta2/types.go | 81 +-
.../v1beta2/types_swagger_doc_generated.go | 32 +-
.../api/apps/v1beta2/zz_generated.deepcopy.go | 10 +
.../apps/v1beta2/zz_generated.model_name.go | 187 +
vendor/k8s.io/api/authentication/v1/doc.go | 4 +-
.../api/authentication/v1/generated.pb.go | 413 +-
.../api/authentication/v1/generated.proto | 12 +-
.../v1/generated.protomessage.pb.go | 44 +
vendor/k8s.io/api/authentication/v1/types.go | 7 +
.../v1/zz_generated.model_name.go | 72 +
.../v1/zz_generated.prerelease-lifecycle.go | 40 +
.../k8s.io/api/authentication/v1alpha1/doc.go | 3 +-
.../authentication/v1alpha1/generated.pb.go | 109 +-
.../authentication/v1alpha1/generated.proto | 4 +-
.../v1alpha1/generated.protomessage.pb.go | 26 +
.../v1alpha1/zz_generated.model_name.go | 32 +
.../k8s.io/api/authentication/v1beta1/doc.go | 3 +-
.../authentication/v1beta1/generated.pb.go | 283 +-
.../authentication/v1beta1/generated.proto | 9 +-
.../v1beta1/generated.protomessage.pb.go | 36 +
.../api/authentication/v1beta1/types.go | 3 +
.../v1beta1/zz_generated.model_name.go | 52 +
vendor/k8s.io/api/authorization/v1/doc.go | 4 +-
.../api/authorization/v1/generated.pb.go | 994 +-
.../api/authorization/v1/generated.proto | 79 +-
.../v1/generated.protomessage.pb.go | 54 +
vendor/k8s.io/api/authorization/v1/types.go | 73 +
.../v1/types_swagger_doc_generated.go | 38 +-
.../authorization/v1/zz_generated.deepcopy.go | 61 +-
.../v1/zz_generated.model_name.go | 97 +
.../v1/zz_generated.prerelease-lifecycle.go | 46 +
.../k8s.io/api/authorization/v1beta1/doc.go | 3 +-
.../api/authorization/v1beta1/generated.pb.go | 618 +-
.../api/authorization/v1beta1/generated.proto | 26 +-
.../v1beta1/generated.protomessage.pb.go | 50 +
.../k8s.io/api/authorization/v1beta1/types.go | 16 +
.../v1beta1/types_swagger_doc_generated.go | 18 +-
.../v1beta1/zz_generated.deepcopy.go | 15 +-
.../v1beta1/zz_generated.model_name.go | 87 +
vendor/k8s.io/api/autoscaling/v1/doc.go | 4 +-
.../k8s.io/api/autoscaling/v1/generated.pb.go | 737 +-
.../k8s.io/api/autoscaling/v1/generated.proto | 58 +-
.../v1/generated.protomessage.pb.go | 64 +
vendor/k8s.io/api/autoscaling/v1/types.go | 12 +-
.../v1/types_swagger_doc_generated.go | 6 +-
.../autoscaling/v1/zz_generated.model_name.go | 127 +
.../v1/zz_generated.prerelease-lifecycle.go | 40 +
vendor/k8s.io/api/autoscaling/v2/doc.go | 4 +-
.../k8s.io/api/autoscaling/v2/generated.pb.go | 885 +-
.../k8s.io/api/autoscaling/v2/generated.proto | 53 +-
.../v2/generated.protomessage.pb.go | 70 +
vendor/k8s.io/api/autoscaling/v2/types.go | 37 +-
.../v2/types_swagger_doc_generated.go | 11 +-
.../autoscaling/v2/zz_generated.deepcopy.go | 5 +
.../autoscaling/v2/zz_generated.model_name.go | 142 +
.../v2/zz_generated.prerelease-lifecycle.go | 34 +
vendor/k8s.io/api/autoscaling/v2beta1/doc.go | 3 +-
.../api/autoscaling/v2beta1/generated.pb.go | 647 +-
.../api/autoscaling/v2beta1/generated.proto | 56 +-
.../v2beta1/generated.protomessage.pb.go | 58 +
.../k8s.io/api/autoscaling/v2beta1/types.go | 8 +-
.../v2beta1/types_swagger_doc_generated.go | 6 +-
.../v2beta1/zz_generated.model_name.go | 112 +
vendor/k8s.io/api/autoscaling/v2beta2/doc.go | 3 +-
.../api/autoscaling/v2beta2/generated.pb.go | 832 +-
.../api/autoscaling/v2beta2/generated.proto | 27 +-
.../v2beta2/generated.protomessage.pb.go | 70 +
.../k8s.io/api/autoscaling/v2beta2/types.go | 9 +-
.../v2beta2/types_swagger_doc_generated.go | 6 +-
.../v2beta2/zz_generated.model_name.go | 142 +
vendor/k8s.io/api/batch/v1/doc.go | 4 +-
vendor/k8s.io/api/batch/v1/generated.pb.go | 986 +-
vendor/k8s.io/api/batch/v1/generated.proto | 140 +-
.../api/batch/v1/generated.protomessage.pb.go | 56 +
vendor/k8s.io/api/batch/v1/types.go | 130 +-
.../batch/v1/types_swagger_doc_generated.go | 51 +-
.../api/batch/v1/zz_generated.deepcopy.go | 59 +
.../api/batch/v1/zz_generated.model_name.go | 107 +
.../v1/zz_generated.prerelease-lifecycle.go | 46 +
vendor/k8s.io/api/batch/v1beta1/doc.go | 3 +-
.../k8s.io/api/batch/v1beta1/generated.pb.go | 221 +-
.../k8s.io/api/batch/v1beta1/generated.proto | 14 +-
.../v1beta1/generated.protomessage.pb.go | 32 +
.../batch/v1beta1/zz_generated.model_name.go | 47 +
vendor/k8s.io/api/certificates/v1/doc.go | 4 +-
.../api/certificates/v1/generated.pb.go | 265 +-
.../api/certificates/v1/generated.proto | 18 +-
.../v1/generated.protomessage.pb.go | 34 +
vendor/k8s.io/api/certificates/v1/types.go | 12 +-
.../v1/zz_generated.model_name.go | 47 +
.../v1/zz_generated.prerelease-lifecycle.go | 34 +
.../k8s.io/api/certificates/v1alpha1/doc.go | 3 +-
.../api/certificates/v1alpha1/generated.pb.go | 142 +-
.../api/certificates/v1alpha1/generated.proto | 4 +-
.../v1alpha1/generated.protomessage.pb.go | 28 +
.../k8s.io/api/certificates/v1alpha1/types.go | 2 +
.../v1alpha1/zz_generated.model_name.go | 37 +
.../zz_generated.prerelease-lifecycle.go | 8 +-
vendor/k8s.io/api/certificates/v1beta1/doc.go | 3 +-
.../api/certificates/v1beta1/generated.pb.go | 2896 ++-
.../api/certificates/v1beta1/generated.proto | 308 +-
.../v1beta1/generated.protomessage.pb.go | 48 +
.../api/certificates/v1beta1/register.go | 4 +
.../k8s.io/api/certificates/v1beta1/types.go | 343 +-
.../v1beta1/types_swagger_doc_generated.go | 83 +
.../v1beta1/zz_generated.deepcopy.go | 211 +
.../v1beta1/zz_generated.model_name.go | 82 +
.../zz_generated.prerelease-lifecycle.go | 72 +
vendor/k8s.io/api/coordination/v1/doc.go | 4 +-
.../api/coordination/v1/generated.pb.go | 237 +-
.../api/coordination/v1/generated.proto | 26 +-
.../v1/generated.protomessage.pb.go | 28 +
vendor/k8s.io/api/coordination/v1/types.go | 30 +-
.../v1/types_swagger_doc_generated.go | 6 +-
.../coordination/v1/zz_generated.deepcopy.go | 10 +
.../v1/zz_generated.model_name.go | 37 +
.../v1/zz_generated.prerelease-lifecycle.go | 34 +
.../k8s.io/api/coordination/v1alpha2/doc.go | 25 +
.../api/coordination/v1alpha2/generated.pb.go | 886 +
.../api/coordination/v1alpha2/generated.proto | 98 +
.../v1alpha2/generated.protomessage.pb.go | 28 +
.../api/coordination/v1alpha2/register.go | 53 +
.../k8s.io/api/coordination/v1alpha2/types.go | 93 +
.../v1alpha2/types_swagger_doc_generated.go | 64 +
.../v1alpha2/zz_generated.deepcopy.go | 110 +
.../v1alpha2/zz_generated.model_name.go | 37 +
.../zz_generated.prerelease-lifecycle.go | 58 +
vendor/k8s.io/api/coordination/v1beta1/doc.go | 3 +-
.../api/coordination/v1beta1/generated.pb.go | 1003 +-
.../api/coordination/v1beta1/generated.proto | 92 +-
.../v1beta1/generated.protomessage.pb.go | 34 +
.../api/coordination/v1beta1/register.go | 2 +
.../k8s.io/api/coordination/v1beta1/types.go | 86 +
.../v1beta1/types_swagger_doc_generated.go | 38 +-
.../v1beta1/zz_generated.deepcopy.go | 95 +
.../v1beta1/zz_generated.model_name.go | 52 +
.../zz_generated.prerelease-lifecycle.go | 36 +
.../api/core/v1/annotation_key_constants.go | 25 +-
vendor/k8s.io/api/core/v1/doc.go | 6 +-
vendor/k8s.io/api/core/v1/generated.pb.go | 14870 +++++++--------
vendor/k8s.io/api/core/v1/generated.proto | 1404 +-
.../api/core/v1/generated.protomessage.pb.go | 498 +
vendor/k8s.io/api/core/v1/lifecycle.go | 24 +
vendor/k8s.io/api/core/v1/objectreference.go | 2 +-
vendor/k8s.io/api/core/v1/toleration.go | 57 +-
vendor/k8s.io/api/core/v1/types.go | 1518 +-
.../core/v1/types_swagger_doc_generated.go | 578 +-
.../api/core/v1/zz_generated.deepcopy.go | 553 +-
.../api/core/v1/zz_generated.model_name.go | 1212 ++
.../v1/zz_generated.prerelease-lifecycle.go | 274 +
vendor/k8s.io/api/discovery/v1/doc.go | 5 +-
.../k8s.io/api/discovery/v1/generated.pb.go | 483 +-
.../k8s.io/api/discovery/v1/generated.proto | 82 +-
.../discovery/v1/generated.protomessage.pb.go | 38 +
vendor/k8s.io/api/discovery/v1/types.go | 80 +-
.../v1/types_swagger_doc_generated.go | 28 +-
.../api/discovery/v1/zz_generated.deepcopy.go | 21 +
.../discovery/v1/zz_generated.model_name.go | 62 +
.../v1/zz_generated.prerelease-lifecycle.go | 34 +
vendor/k8s.io/api/discovery/v1beta1/doc.go | 4 +-
.../api/discovery/v1beta1/generated.pb.go | 482 +-
.../api/discovery/v1beta1/generated.proto | 17 +-
.../v1beta1/generated.protomessage.pb.go | 38 +
vendor/k8s.io/api/discovery/v1beta1/types.go | 11 +
.../v1beta1/types_swagger_doc_generated.go | 10 +
.../v1beta1/zz_generated.deepcopy.go | 21 +
.../v1beta1/zz_generated.model_name.go | 62 +
vendor/k8s.io/api/events/v1/doc.go | 4 +-
vendor/k8s.io/api/events/v1/generated.pb.go | 162 +-
vendor/k8s.io/api/events/v1/generated.proto | 18 +-
.../events/v1/generated.protomessage.pb.go | 28 +
vendor/k8s.io/api/events/v1/types.go | 2 +
.../api/events/v1/zz_generated.model_name.go | 37 +
.../v1/zz_generated.prerelease-lifecycle.go | 34 +
vendor/k8s.io/api/events/v1beta1/doc.go | 3 +-
.../k8s.io/api/events/v1beta1/generated.pb.go | 162 +-
.../k8s.io/api/events/v1beta1/generated.proto | 18 +-
.../v1beta1/generated.protomessage.pb.go | 28 +
.../events/v1beta1/zz_generated.model_name.go | 37 +
vendor/k8s.io/api/extensions/v1beta1/doc.go | 5 +-
.../api/extensions/v1beta1/generated.pb.go | 1580 +-
.../api/extensions/v1beta1/generated.proto | 126 +-
.../v1beta1/generated.protomessage.pb.go | 112 +
vendor/k8s.io/api/extensions/v1beta1/types.go | 67 +-
.../v1beta1/types_swagger_doc_generated.go | 26 +-
.../v1beta1/zz_generated.deepcopy.go | 10 +
.../v1beta1/zz_generated.model_name.go | 247 +
.../v1beta1/zz_generated.validations.go | 90 +
vendor/k8s.io/api/flowcontrol/v1/doc.go | 4 +-
.../k8s.io/api/flowcontrol/v1/generated.pb.go | 794 +-
.../k8s.io/api/flowcontrol/v1/generated.proto | 12 +-
.../v1/generated.protomessage.pb.go | 68 +
vendor/k8s.io/api/flowcontrol/v1/types.go | 4 +
.../flowcontrol/v1/zz_generated.model_name.go | 137 +
.../v1/zz_generated.prerelease-lifecycle.go | 46 +
vendor/k8s.io/api/flowcontrol/v1beta1/doc.go | 3 +-
.../api/flowcontrol/v1beta1/generated.pb.go | 795 +-
.../api/flowcontrol/v1beta1/generated.proto | 12 +-
.../v1beta1/generated.protomessage.pb.go | 68 +
.../v1beta1/zz_generated.model_name.go | 137 +
vendor/k8s.io/api/flowcontrol/v1beta2/doc.go | 3 +-
.../api/flowcontrol/v1beta2/generated.pb.go | 796 +-
.../api/flowcontrol/v1beta2/generated.proto | 12 +-
.../v1beta2/generated.protomessage.pb.go | 68 +
.../v1beta2/zz_generated.model_name.go | 137 +
vendor/k8s.io/api/flowcontrol/v1beta3/doc.go | 3 +-
.../api/flowcontrol/v1beta3/generated.pb.go | 795 +-
.../api/flowcontrol/v1beta3/generated.proto | 12 +-
.../v1beta3/generated.protomessage.pb.go | 68 +
.../v1beta3/zz_generated.model_name.go | 137 +
vendor/k8s.io/api/imagepolicy/v1alpha1/doc.go | 3 +-
.../api/imagepolicy/v1alpha1/generated.pb.go | 194 +-
.../api/imagepolicy/v1alpha1/generated.proto | 3 +-
.../v1alpha1/generated.protomessage.pb.go | 30 +
.../k8s.io/api/imagepolicy/v1alpha1/types.go | 1 +
.../v1alpha1/zz_generated.model_name.go | 42 +
vendor/k8s.io/api/networking/v1/doc.go | 5 +-
.../k8s.io/api/networking/v1/generated.pb.go | 4029 ++--
.../k8s.io/api/networking/v1/generated.proto | 148 +-
.../v1/generated.protomessage.pb.go | 92 +
vendor/k8s.io/api/networking/v1/register.go | 4 +
vendor/k8s.io/api/networking/v1/types.go | 155 +-
.../v1/types_swagger_doc_generated.go | 82 +-
.../{v1alpha1 => v1}/well_known_labels.go | 2 +-
.../networking/v1/zz_generated.deepcopy.go | 202 +
.../networking/v1/zz_generated.model_name.go | 197 +
.../v1/zz_generated.prerelease-lifecycle.go | 82 +
.../api/networking/v1alpha1/generated.proto | 138 -
.../k8s.io/api/networking/v1alpha1/types.go | 150 -
.../v1alpha1/types_swagger_doc_generated.go | 110 -
.../zz_generated.prerelease-lifecycle.go | 94 -
vendor/k8s.io/api/networking/v1beta1/doc.go | 4 +-
.../api/networking/v1beta1/generated.pb.go | 3583 ++--
.../api/networking/v1beta1/generated.proto | 126 +-
.../v1beta1/generated.protomessage.pb.go | 72 +
.../k8s.io/api/networking/v1beta1/register.go | 4 +
vendor/k8s.io/api/networking/v1beta1/types.go | 137 +-
.../v1beta1/types_swagger_doc_generated.go | 80 +
.../networking/v1beta1/well_known_labels.go | 33 +
.../v1beta1/zz_generated.deepcopy.go | 203 +
.../v1beta1/zz_generated.model_name.go | 147 +
.../zz_generated.prerelease-lifecycle.go | 72 +
vendor/k8s.io/api/node/v1/doc.go | 4 +-
vendor/k8s.io/api/node/v1/generated.pb.go | 196 +-
vendor/k8s.io/api/node/v1/generated.proto | 8 +-
.../api/node/v1/generated.protomessage.pb.go | 30 +
vendor/k8s.io/api/node/v1/types.go | 2 +
.../api/node/v1/zz_generated.model_name.go | 42 +
.../v1/zz_generated.prerelease-lifecycle.go | 34 +
vendor/k8s.io/api/node/v1alpha1/doc.go | 3 +-
.../k8s.io/api/node/v1alpha1/generated.pb.go | 227 +-
.../k8s.io/api/node/v1alpha1/generated.proto | 8 +-
.../v1alpha1/generated.protomessage.pb.go | 32 +
.../node/v1alpha1/zz_generated.model_name.go | 47 +
vendor/k8s.io/api/node/v1beta1/doc.go | 3 +-
.../k8s.io/api/node/v1beta1/generated.pb.go | 196 +-
.../k8s.io/api/node/v1beta1/generated.proto | 8 +-
.../node/v1beta1/generated.protomessage.pb.go | 30 +
.../node/v1beta1/zz_generated.model_name.go | 42 +
vendor/k8s.io/api/policy/v1/doc.go | 4 +-
vendor/k8s.io/api/policy/v1/generated.pb.go | 232 +-
vendor/k8s.io/api/policy/v1/generated.proto | 21 +-
.../policy/v1/generated.protomessage.pb.go | 32 +
vendor/k8s.io/api/policy/v1/types.go | 6 +-
.../policy/v1/types_swagger_doc_generated.go | 2 +-
.../api/policy/v1/zz_generated.model_name.go | 47 +
.../v1/zz_generated.prerelease-lifecycle.go | 40 +
vendor/k8s.io/api/policy/v1beta1/doc.go | 3 +-
.../k8s.io/api/policy/v1beta1/generated.pb.go | 232 +-
.../k8s.io/api/policy/v1beta1/generated.proto | 21 +-
.../v1beta1/generated.protomessage.pb.go | 32 +
vendor/k8s.io/api/policy/v1beta1/types.go | 3 -
.../v1beta1/types_swagger_doc_generated.go | 2 +-
.../policy/v1beta1/zz_generated.model_name.go | 47 +
vendor/k8s.io/api/rbac/v1/doc.go | 4 +-
vendor/k8s.io/api/rbac/v1/generated.pb.go | 425 +-
vendor/k8s.io/api/rbac/v1/generated.proto | 32 +-
.../api/rbac/v1/generated.protomessage.pb.go | 46 +
vendor/k8s.io/api/rbac/v1/types.go | 24 +-
.../api/rbac/v1/zz_generated.model_name.go | 82 +
.../v1/zz_generated.prerelease-lifecycle.go | 70 +
vendor/k8s.io/api/rbac/v1alpha1/doc.go | 3 +-
.../k8s.io/api/rbac/v1alpha1/generated.pb.go | 427 +-
.../k8s.io/api/rbac/v1alpha1/generated.proto | 32 +-
.../v1alpha1/generated.protomessage.pb.go | 46 +
vendor/k8s.io/api/rbac/v1alpha1/types.go | 16 +-
.../rbac/v1alpha1/zz_generated.model_name.go | 82 +
vendor/k8s.io/api/rbac/v1beta1/doc.go | 3 +-
.../k8s.io/api/rbac/v1beta1/generated.pb.go | 425 +-
.../k8s.io/api/rbac/v1beta1/generated.proto | 32 +-
.../rbac/v1beta1/generated.protomessage.pb.go | 46 +
vendor/k8s.io/api/rbac/v1beta1/types.go | 16 +-
.../rbac/v1beta1/zz_generated.model_name.go | 82 +
vendor/k8s.io/api/resource/v1/devicetaint.go | 35 +
vendor/k8s.io/api/resource/v1/doc.go | 25 +
vendor/k8s.io/api/resource/v1/generated.pb.go | 11396 ++++++++++++
vendor/k8s.io/api/resource/v1/generated.proto | 1707 ++
.../resource/v1/generated.protomessage.pb.go | 108 +
vendor/k8s.io/api/resource/v1/register.go | 60 +
vendor/k8s.io/api/resource/v1/types.go | 2018 ++
.../v1/types_swagger_doc_generated.go | 510 +
.../api/resource/v1/zz_generated.deepcopy.go | 1257 ++
.../resource/v1/zz_generated.model_name.go | 237 +
.../v1/zz_generated.prerelease-lifecycle.go | 70 +
.../api/resource/v1alpha2/generated.pb.go | 4817 -----
.../api/resource/v1alpha2/generated.proto | 400 -
vendor/k8s.io/api/resource/v1alpha2/types.go | 462 -
.../v1alpha2/types_swagger_doc_generated.go | 232 -
.../v1alpha2/zz_generated.deepcopy.go | 498 -
.../api/resource/v1alpha3/devicetaint.go | 35 +
vendor/k8s.io/api/resource/v1alpha3/doc.go | 26 +
.../v1alpha3}/generated.pb.go | 1141 +-
.../api/resource/v1alpha3/generated.proto | 239 +
.../v1alpha3/generated.protomessage.pb.go | 38 +
.../v1 => api/resource/v1alpha3}/register.go | 41 +-
vendor/k8s.io/api/resource/v1alpha3/types.go | 334 +
.../v1alpha3/types_swagger_doc_generated.go | 111 +
.../v1alpha3}/zz_generated.deepcopy.go | 158 +-
.../v1alpha3/zz_generated.model_name.go | 62 +
.../zz_generated.prerelease-lifecycle.go | 58 +
.../api/resource/v1beta1/devicetaint.go | 35 +
.../api/resource/{v1alpha2 => v1beta1}/doc.go | 6 +-
.../api/resource/v1beta1/generated.pb.go | 11386 ++++++++++++
.../api/resource/v1beta1/generated.proto | 1721 ++
.../v1beta1/generated.protomessage.pb.go | 108 +
.../{v1alpha2 => v1beta1}/register.go | 15 +-
vendor/k8s.io/api/resource/v1beta1/types.go | 2032 ++
.../v1beta1/types_swagger_doc_generated.go | 510 +
.../resource/v1beta1/zz_generated.deepcopy.go | 1247 ++
.../v1beta1/zz_generated.model_name.go | 237 +
.../zz_generated.prerelease-lifecycle.go | 166 +
.../api/resource/v1beta2/devicetaint.go | 35 +
vendor/k8s.io/api/resource/v1beta2/doc.go | 26 +
.../api/resource/v1beta2/generated.pb.go | 11396 ++++++++++++
.../api/resource/v1beta2/generated.proto | 1707 ++
.../v1beta2/generated.protomessage.pb.go | 108 +
.../k8s.io/api/resource/v1beta2/register.go | 60 +
vendor/k8s.io/api/resource/v1beta2/types.go | 2018 ++
.../v1beta2/types_swagger_doc_generated.go | 510 +
.../resource/v1beta2/zz_generated.deepcopy.go | 1257 ++
.../v1beta2/zz_generated.model_name.go | 237 +
.../zz_generated.prerelease-lifecycle.go | 166 +
vendor/k8s.io/api/scheduling/v1/doc.go | 4 +-
.../k8s.io/api/scheduling/v1/generated.pb.go | 116 +-
.../k8s.io/api/scheduling/v1/generated.proto | 4 +-
.../v1/generated.protomessage.pb.go | 26 +
vendor/k8s.io/api/scheduling/v1/types.go | 2 +
.../scheduling/v1/zz_generated.model_name.go | 32 +
.../v1/zz_generated.prerelease-lifecycle.go | 34 +
vendor/k8s.io/api/scheduling/v1alpha1/doc.go | 3 +-
.../api/scheduling/v1alpha1/generated.pb.go | 1599 +-
.../api/scheduling/v1alpha1/generated.proto | 119 +-
.../v1alpha1/generated.protomessage.pb.go | 42 +
.../api/scheduling/v1alpha1/register.go | 2 +
.../k8s.io/api/scheduling/v1alpha1/types.go | 127 +
.../v1alpha1/types_swagger_doc_generated.go | 78 +
.../v1alpha1/zz_generated.deepcopy.go | 179 +
.../v1alpha1/zz_generated.model_name.go | 72 +
vendor/k8s.io/api/scheduling/v1beta1/doc.go | 3 +-
.../api/scheduling/v1beta1/generated.pb.go | 117 +-
.../api/scheduling/v1beta1/generated.proto | 4 +-
.../v1beta1/generated.protomessage.pb.go | 26 +
.../v1beta1/zz_generated.model_name.go | 32 +
vendor/k8s.io/api/storage/v1/doc.go | 4 +-
vendor/k8s.io/api/storage/v1/generated.pb.go | 1373 +-
vendor/k8s.io/api/storage/v1/generated.proto | 137 +-
.../storage/v1/generated.protomessage.pb.go | 64 +
vendor/k8s.io/api/storage/v1/register.go | 3 +
vendor/k8s.io/api/storage/v1/types.go | 129 +-
.../storage/v1/types_swagger_doc_generated.go | 50 +-
.../api/storage/v1/zz_generated.deepcopy.go | 81 +
.../api/storage/v1/zz_generated.model_name.go | 127 +
.../v1/zz_generated.prerelease-lifecycle.go | 94 +
vendor/k8s.io/api/storage/v1alpha1/doc.go | 3 +-
.../api/storage/v1alpha1/generated.pb.go | 421 +-
.../api/storage/v1alpha1/generated.proto | 36 +-
.../v1alpha1/generated.protomessage.pb.go | 42 +
vendor/k8s.io/api/storage/v1alpha1/types.go | 18 +-
.../v1alpha1/types_swagger_doc_generated.go | 9 +-
.../storage/v1alpha1/zz_generated.deepcopy.go | 5 +
.../v1alpha1/zz_generated.model_name.go | 72 +
.../zz_generated.prerelease-lifecycle.go | 12 +
vendor/k8s.io/api/storage/v1beta1/doc.go | 3 +-
.../api/storage/v1beta1/generated.pb.go | 1373 +-
.../api/storage/v1beta1/generated.proto | 134 +-
.../v1beta1/generated.protomessage.pb.go | 64 +
vendor/k8s.io/api/storage/v1beta1/register.go | 3 +
vendor/k8s.io/api/storage/v1beta1/types.go | 118 +-
.../v1beta1/types_swagger_doc_generated.go | 50 +-
.../storage/v1beta1/zz_generated.deepcopy.go | 81 +
.../v1beta1/zz_generated.model_name.go | 127 +
.../zz_generated.prerelease-lifecycle.go | 48 +
.../api/storagemigration/v1beta1/doc.go | 25 +
.../storagemigration/v1beta1/generated.pb.go | 904 +
.../storagemigration/v1beta1/generated.proto | 82 +
.../v1beta1/generated.protomessage.pb.go | 30 +
.../v1beta1}/register.go | 34 +-
.../api/storagemigration/v1beta1/types.go | 91 +
.../v1beta1/types_swagger_doc_generated.go | 70 +
.../v1beta1/zz_generated.deepcopy.go | 128 +
.../v1beta1/zz_generated.model_name.go | 42 +
.../zz_generated.prerelease-lifecycle.go | 58 +
.../pkg/apis/apiextensions/doc.go | 2 +-
.../pkg/apis/apiextensions/types.go | 36 +
.../apis/apiextensions/types_jsonschema.go | 1 -
.../pkg/apis/apiextensions/v1/conversion.go | 28 +-
.../pkg/apis/apiextensions/v1/defaults.go | 4 +-
.../pkg/apis/apiextensions/v1/doc.go | 5 +-
.../pkg/apis/apiextensions/v1/generated.pb.go | 1237 +-
.../pkg/apis/apiextensions/v1/generated.proto | 63 +-
.../v1/generated.protomessage.pb.go | 76 +
.../pkg/apis/apiextensions/v1/marshal.go | 161 +-
.../pkg/apis/apiextensions/v1/types.go | 44 +
.../apis/apiextensions/v1/types_jsonschema.go | 53 +-
.../v1/zz_generated.conversion.go | 37 +
.../apiextensions/v1/zz_generated.deepcopy.go | 21 +
.../v1/zz_generated.model_name.go | 157 +
.../v1/zz_generated.prerelease-lifecycle.go | 40 +
.../apis/apiextensions/v1beta1/conversion.go | 2 +-
.../apis/apiextensions/v1beta1/defaults.go | 6 +-
.../pkg/apis/apiextensions/v1beta1/doc.go | 4 +-
.../apiextensions/v1beta1/generated.pb.go | 1270 +-
.../apiextensions/v1beta1/generated.proto | 71 +-
.../v1beta1/generated.protomessage.pb.go | 74 +
.../pkg/apis/apiextensions/v1beta1/marshal.go | 159 +-
.../pkg/apis/apiextensions/v1beta1/types.go | 48 +
.../apiextensions/v1beta1/types_jsonschema.go | 53 +-
.../v1beta1/zz_generated.conversion.go | 38 +
.../v1beta1/zz_generated.deepcopy.go | 26 +
.../v1beta1/zz_generated.model_name.go | 152 +
.../apiextensions/zz_generated.deepcopy.go | 26 +
.../v1/customresourcecolumndefinition.go | 28 +-
.../v1/customresourceconversion.go | 19 +-
.../v1/customresourcedefinition.go | 93 +-
.../v1/customresourcedefinitioncondition.go | 40 +-
.../v1/customresourcedefinitionnames.go | 28 +-
.../v1/customresourcedefinitionspec.go | 38 +-
.../v1/customresourcedefinitionstatus.go | 31 +-
.../v1/customresourcedefinitionversion.go | 54 +-
.../v1/customresourcesubresources.go | 19 +-
.../v1/customresourcesubresourcescale.go | 28 +-
.../v1/customresourcevalidation.go | 7 +-
.../apiextensions/v1/externaldocumentation.go | 6 +-
.../apiextensions/v1/jsonschemaprops.go | 209 +-
.../apiextensions/v1/selectablefield.go | 49 +
.../apiextensions/v1/servicereference.go | 20 +-
.../apiextensions/v1/validationrule.go | 128 +-
.../apiextensions/v1/webhookclientconfig.go | 43 +-
.../apiextensions/v1/webhookconversion.go | 17 +-
.../v1beta1/customresourcecolumndefinition.go | 28 +-
.../v1beta1/customresourceconversion.go | 29 +-
.../v1beta1/customresourcedefinition.go | 80 +-
.../customresourcedefinitioncondition.go | 40 +-
.../v1beta1/customresourcedefinitionnames.go | 28 +-
.../v1beta1/customresourcedefinitionspec.go | 83 +-
.../v1beta1/customresourcedefinitionstatus.go | 31 +-
.../customresourcedefinitionversion.go | 59 +-
.../v1beta1/customresourcesubresources.go | 19 +-
.../v1beta1/customresourcesubresourcescale.go | 28 +-
.../v1beta1/customresourcevalidation.go | 7 +-
.../v1beta1/externaldocumentation.go | 6 +-
.../apiextensions/v1beta1/jsonschemaprops.go | 209 +-
.../apiextensions/v1beta1/selectablefield.go | 49 +
.../apiextensions/v1beta1/servicereference.go | 20 +-
.../apiextensions/v1beta1/validationrule.go | 128 +-
.../v1beta1/webhookclientconfig.go | 43 +-
.../client/clientset/clientset/clientset.go | 4 +-
.../apiextensions/v1/apiextensions_client.go | 22 +-
.../v1/customresourcedefinition.go | 218 +-
.../v1beta1/apiextensions_client.go | 22 +-
.../v1beta1/customresourcedefinition.go | 220 +-
.../k8s.io/apimachinery/pkg/api/errors/doc.go | 2 +-
.../apimachinery/pkg/api/errors/errors.go | 12 +-
.../k8s.io/apimachinery/pkg/api/meta/OWNERS | 3 +-
.../k8s.io/apimachinery/pkg/api/meta/doc.go | 2 +-
.../k8s.io/apimachinery/pkg/api/meta/help.go | 3 +
.../meta/testrestmapper/test_restmapper.go | 165 +
.../pkg/api/operation/operation.go | 102 +
.../pkg/api/resource/generated.pb.go | 96 +-
.../pkg/api/resource/generated.proto | 2 +
.../api/resource/generated.protomessage.pb.go | 26 +
.../apimachinery/pkg/api/resource/quantity.go | 70 +-
.../pkg/api/resource/quantity_proto.go | 4 -
.../api/resource/zz_generated.model_name.go | 32 +
.../k8s.io/apimachinery/pkg/api/safe/safe.go | 59 +
.../apimachinery/pkg/api/validate/README.md | 64 +
.../apimachinery/pkg/api/validate/common.go | 28 +
.../api/validate/constraints/constraints.go | 32 +
.../pkg/api/validate/content/decimal_int.go | 62 +
.../pkg/api/validate/content/dns.go | 101 +
.../pkg/api/validate/content/errors.go | 66 +
.../pkg/api/validate/content/identifier.go | 35 +
.../pkg/api/validate/content/kube.go | 101 +
.../apimachinery/pkg/api/validate/doc.go | 50 +
.../apimachinery/pkg/api/validate/each.go | 186 +
.../apimachinery/pkg/api/validate/enum.go | 74 +
.../apimachinery/pkg/api/validate/equality.go | 38 +
.../pkg/api/validate/immutable.go | 40 +
.../apimachinery/pkg/api/validate/item.go | 77 +
.../apimachinery/pkg/api/validate/limits.go | 57 +
.../apimachinery/pkg/api/validate/options.go | 35 +
.../apimachinery/pkg/api/validate/required.go | 133 +
.../apimachinery/pkg/api/validate/strfmt.go | 290 +
.../apimachinery/pkg/api/validate/subfield.go | 53 +
.../pkg/api/validate/testing.go} | 31 +-
.../apimachinery/pkg/api/validate/union.go | 238 +
.../apimachinery/pkg/api/validate/update.go | 160 +
.../pkg/api/validate/zeroorone.go | 59 +
.../pkg/api/validation}/OWNERS | 2 -
.../apimachinery/pkg/api/validation/doc.go | 2 +-
.../pkg/api/validation/generic.go | 8 +-
.../pkg/api/validation/objectmeta.go | 94 +-
.../k8s.io/apimachinery/pkg/apis/asn1/oid.go | 43 +
.../pkg/apis/meta/internalversion/doc.go | 2 +-
.../apis/meta/internalversion/scheme/doc.go | 2 +-
.../meta/internalversion/scheme/register.go | 8 +-
.../pkg/apis/meta/internalversion/types.go | 2 -
.../apimachinery/pkg/apis/meta/v1/OWNERS | 3 +-
.../pkg/apis/meta/v1/controller_ref.go | 13 +-
.../apimachinery/pkg/apis/meta/v1/doc.go | 3 +-
.../pkg/apis/meta/v1/generated.pb.go | 1750 +-
.../pkg/apis/meta/v1/generated.proto | 60 +-
.../apis/meta/v1/generated.protomessage.pb.go | 112 +
.../apimachinery/pkg/apis/meta/v1/helpers.go | 83 +-
.../pkg/apis/meta/v1/micro_time.go | 28 +
.../pkg/apis/meta/v1/micro_time_fuzz.go | 13 +-
.../apimachinery/pkg/apis/meta/v1/time.go | 29 +
.../pkg/apis/meta/v1/time_fuzz.go | 13 +-
.../apimachinery/pkg/apis/meta/v1/types.go | 94 +-
.../meta/v1/types_swagger_doc_generated.go | 12 +
.../pkg/apis/meta/v1/unstructured/helpers.go | 55 +-
.../apis/meta/v1/unstructured/unstructured.go | 10 +-
.../unstructured/unstructuredscheme/scheme.go | 8 +-
.../pkg/apis/meta/v1/validation/validation.go | 99 +-
.../apis/meta/v1/zz_generated.conversion.go | 7 +
.../pkg/apis/meta/v1/zz_generated.deepcopy.go | 26 +
.../apis/meta/v1/zz_generated.model_name.go | 267 +
.../apimachinery/pkg/apis/meta/v1beta1/doc.go | 3 +-
.../pkg/apis/meta/v1beta1/generated.pb.go | 75 +-
.../pkg/apis/meta/v1beta1/generated.proto | 4 +-
.../meta/v1beta1/generated.protomessage.pb.go | 24 +
.../pkg/apis/meta/v1beta1/types.go | 1 +
.../meta/v1beta1/zz_generated.model_name.go | 27 +
.../k8s.io/apimachinery/pkg/conversion/doc.go | 2 +-
.../pkg/conversion/queryparams/doc.go | 2 +-
vendor/k8s.io/apimachinery/pkg/fields/doc.go | 2 +-
vendor/k8s.io/apimachinery/pkg/labels/doc.go | 2 +-
.../k8s.io/apimachinery/pkg/labels/labels.go | 9 +
.../apimachinery/pkg/labels/selector.go | 60 +-
.../apimachinery/pkg/runtime/converter.go | 29 +-
vendor/k8s.io/apimachinery/pkg/runtime/doc.go | 4 +-
.../apimachinery/pkg/runtime/extension.go | 100 +-
.../apimachinery/pkg/runtime/generated.pb.go | 138 +-
.../pkg/runtime/generated.protomessage.pb.go | 28 +
.../k8s.io/apimachinery/pkg/runtime/helper.go | 30 +-
.../apimachinery/pkg/runtime/interfaces.go | 20 +
.../pkg/runtime/schema/generated.pb.go | 41 +-
.../schema/generated.protomessage.pb.go | 22 +
.../k8s.io/apimachinery/pkg/runtime/scheme.go | 113 +
.../pkg/runtime/serializer/cbor/cbor.go | 383 +
.../runtime/serializer/cbor/direct/direct.go | 43 +
.../pkg/runtime/serializer/cbor/framer.go | 90 +
.../serializer/cbor/internal/modes/buffers.go | 65 +
.../serializer/cbor/internal/modes/decode.go | 178 +
.../cbor/internal/modes/diagnostic.go | 36 +
.../serializer/cbor/internal/modes/encode.go | 177 +
.../cbor/internal/modes/transcoding.go | 108 +
.../pkg/runtime/serializer/cbor/raw.go | 236 +
.../pkg/runtime/serializer/codec_factory.go | 170 +-
.../runtime/serializer/json/collections.go | 230 +
.../pkg/runtime/serializer/json/json.go | 16 +-
.../serializer/protobuf/collections.go | 176 +
.../pkg/runtime/serializer/protobuf/doc.go | 2 +-
.../runtime/serializer/protobuf/protobuf.go | 126 +-
.../k8s.io/apimachinery/pkg/runtime/types.go | 8 +-
.../apimachinery/pkg/runtime/types_proto.go | 137 +-
.../pkg/runtime/zz_generated.model_name.go | 92 +
vendor/k8s.io/apimachinery/pkg/types/doc.go | 2 +-
vendor/k8s.io/apimachinery/pkg/types/patch.go | 4 +-
.../k8s.io/apimachinery/pkg/util/diff/cmp.go | 31 +
.../k8s.io/apimachinery/pkg/util/diff/diff.go | 142 +-
.../apimachinery/pkg/util/diff/legacy_diff.go | 67 +
.../apimachinery/pkg/util/errors/doc.go | 2 +-
.../apimachinery/pkg/util/errors/errors.go | 2 +
.../apimachinery/pkg/util/framer/framer.go | 24 +-
.../apimachinery/pkg/util/httpstream/doc.go | 2 +-
.../pkg/util/httpstream/httpstream.go | 39 +-
.../pkg/util/httpstream/spdy/connection.go | 204 -
.../pkg/util/httpstream/spdy/roundtripper.go | 399 -
.../pkg/util/httpstream/spdy/upgrade.go | 120 -
.../pkg/util/httpstream/wsstream/conn.go | 24 +
.../pkg/util/httpstream/wsstream/doc.go | 2 +-
.../pkg/util/intstr/generated.pb.go | 75 +-
.../pkg/util/intstr/generated.proto | 1 +
.../util/intstr/generated.protomessage.pb.go | 24 +
.../pkg/util/intstr/instr_fuzz.go | 14 +-
.../apimachinery/pkg/util/intstr/intstr.go | 27 +
.../util/intstr/zz_generated.model_name.go | 27 +
.../pkg/util/managedfields/extract.go | 4 +-
.../pkg/util/managedfields/fieldmanager.go | 7 +-
.../pkg/util/managedfields/gvkparser.go | 4 +-
.../managedfields/internal/capmanagers.go | 2 +-
.../util/managedfields/internal/conflict.go | 4 +-
.../managedfields/internal/fieldmanager.go | 2 +-
.../pkg/util/managedfields/internal/fields.go | 2 +-
.../internal/lastappliedmanager.go | 4 +-
.../managedfields/internal/managedfields.go | 2 +-
.../internal/managedfieldsupdater.go | 2 +-
.../util/managedfields/internal/manager.go | 2 +-
.../managedfields/internal/pathelement.go | 4 +-
.../internal/runtimetypeconverter.go | 62 +
.../managedfields/internal/skipnonapplied.go | 3 +
.../util/managedfields/internal/stripmeta.go | 2 +-
.../managedfields/internal/structuredmerge.go | 19 +-
.../managedfields/internal/typeconverter.go | 6 +-
.../internal/versionconverter.go | 6 +-
.../pkg/util/managedfields/node.yaml | 2 +-
.../pkg/util/managedfields/scalehandler.go | 2 +-
.../pkg/util/managedfields/typeconverter.go | 9 +
.../pkg/util/portforward/constants.go | 24 +
.../apimachinery/pkg/util/proxy/dial.go | 122 -
.../apimachinery/pkg/util/proxy/transport.go | 272 -
.../pkg/util/proxy/upgradeaware.go | 556 -
.../apimachinery/pkg/util/runtime/runtime.go | 170 +-
.../apimachinery/pkg/util/sets/ordered.go | 53 -
.../k8s.io/apimachinery/pkg/util/sets/set.go | 32 +-
.../k8s.io/apimachinery/pkg/util/sort/sort.go | 191 +
.../pkg/util/strategicpatch/meta.go | 2 +-
.../pkg/util/strategicpatch/patch.go | 4 +
.../apimachinery/pkg/util/validation/OWNERS | 11 +
.../util/validation/field/error_matcher.go | 321 +
.../pkg/util/validation/field/errors.go | 214 +-
.../apimachinery/pkg/util/validation/ip.go | 278 +
.../pkg/util/validation/validation.go | 192 +-
.../apimachinery/pkg/util/version/doc.go | 2 +-
.../apimachinery/pkg/util/version/version.go | 112 +
.../apimachinery/pkg/util/wait/backoff.go | 50 +-
.../k8s.io/apimachinery/pkg/util/wait/doc.go | 2 +-
.../k8s.io/apimachinery/pkg/util/wait/loop.go | 4 +-
.../k8s.io/apimachinery/pkg/util/wait/wait.go | 9 +-
.../apimachinery/pkg/util/waitgroup/doc.go | 2 +-
.../apimachinery/pkg/util/yaml/decoder.go | 170 +-
.../pkg/util/yaml/stream_reader.go | 130 +
vendor/k8s.io/apimachinery/pkg/version/doc.go | 6 +-
.../k8s.io/apimachinery/pkg/version/types.go | 28 +-
.../pkg/version/zz_generated.model_name.go | 27 +
vendor/k8s.io/apimachinery/pkg/watch/doc.go | 2 +-
.../apimachinery/pkg/watch/streamwatcher.go | 15 +-
vendor/k8s.io/apimachinery/pkg/watch/watch.go | 75 +-
.../third_party/forked/golang/netutil/addr.go | 28 -
.../k8s.io/apiserver/pkg/admission/audit.go | 6 +-
.../k8s.io/apiserver/pkg/admission/config.go | 2 +-
.../pkg/admission/initializer/initializer.go | 14 +
.../pkg/admission/initializer/interfaces.go | 15 +
.../pkg/admission/metrics/metrics.go | 9 +-
.../caching_authorizer.go | 46 +-
.../pkg/admission/plugin/cel/activation.go | 190 +
.../pkg/admission/plugin/cel/compile.go | 117 +-
.../pkg/admission/plugin/cel/composition.go | 64 +-
.../pkg/admission/plugin/cel/condition.go | 216 +
.../pkg/admission/plugin/cel/filter.go | 357 -
.../pkg/admission/plugin/cel/interface.go | 43 +-
.../pkg/admission/plugin/cel/mutation.go | 73 +
.../plugin/policy/generic/accessor.go | 43 +
.../plugin/policy/generic/interfaces.go | 67 +
.../admission/plugin/policy/generic/plugin.go | 221 +
.../policy/generic/policy_dispatcher.go | 417 +
.../plugin/policy/generic/policy_matcher.go | 124 +
.../plugin/policy/generic/policy_source.go | 501 +
.../policy/generic/policy_test_context.go | 644 +
.../internal/generic/controller.go | 24 +-
.../internal/generic/doc.go | 0
.../internal/generic/informer.go | 4 +
.../internal/generic/interface.go | 0
.../internal/generic/lister.go | 0
.../matching/matching.go | 12 +-
.../plugin/policy/mutating/accessor.go | 144 +
.../plugin/policy/mutating/compilation.go | 81 +
.../plugin/policy/mutating/dispatcher.go | 307 +
.../plugin/policy/mutating/errors.go | 38 +
.../plugin/policy/mutating/metrics/errors.go | 38 +
.../plugin/policy/mutating/metrics/metrics.go | 110 +
.../plugin/policy/mutating/patch/interface.go | 45 +
.../policy/mutating/patch/json_patch.go | 192 +
.../plugin/policy/mutating/patch/smd.go | 217 +
.../policy/mutating/patch/typeconverter.go | 187 +
.../plugin/policy/mutating/plugin.go | 151 +
.../policy/mutating/reinvocationcontext.go | 76 +
.../plugin/policy/validating/accessor.go | 86 +
.../validating/dispatcher.go} | 389 +-
.../plugin/policy/validating/errors.go | 38 +
.../validating}/initializer.go | 2 +-
.../validating}/interface.go | 20 +-
.../validating}/message.go | 2 +-
.../policy/validating/metrics/errors.go | 38 +
.../policy/validating/metrics}/metrics.go | 81 +-
.../plugin/policy/validating/plugin.go | 190 +
.../validating}/policy_decision.go | 2 +-
.../validating}/typechecking.go | 143 +-
.../validating}/validator.go | 22 +-
.../plugin/validatingadmissionpolicy/OWNERS | 10 -
.../validatingadmissionpolicy/admission.go | 197 -
.../controller_reconcile.go | 551 -
.../validatingadmissionpolicy/matcher.go | 83 -
.../pkg/admission/plugin/webhook/accessors.go | 10 +-
.../admission/plugin/webhook/errors/doc.go | 2 +-
.../plugin/webhook/generic/webhook.go | 8 +-
.../plugin/webhook/matchconditions/matcher.go | 4 +-
.../plugin/webhook/mutating/dispatcher.go | 12 +-
.../admission/plugin/webhook/mutating/doc.go | 2 +-
.../webhook/predicates/namespace/doc.go | 2 +-
.../webhook/predicates/namespace/matcher.go | 13 +-
.../plugin/webhook/predicates/object/doc.go | 2 +-
.../webhook/predicates/object/matcher.go | 2 +-
.../plugin/webhook/predicates/rules/rules.go | 2 +-
.../admission/plugin/webhook/request/doc.go | 2 +-
.../plugin/webhook/validating/dispatcher.go | 4 +-
.../plugin/webhook/validating/doc.go | 2 +-
.../pkg/apis/apidiscovery/v2/conversion.go | 226 +
.../pkg/apis/apidiscovery/v2}/doc.go | 6 +-
.../pkg/apis/apidiscovery/v2/register.go | 39 +
.../apiserver/pkg/apis/apiserver/doc.go | 2 +-
.../apiserver/pkg/apis/apiserver/register.go | 1 +
.../apiserver/pkg/apis/apiserver/types.go | 92 +-
.../types_encryption.go} | 2 +-
.../apis/{config => apiserver}/v1/defaults.go | 16 +
.../apiserver/pkg/apis/apiserver/v1/doc.go | 2 +-
.../pkg/apis/apiserver/v1/register.go | 7 +
.../apiserver/pkg/apis/apiserver/v1/types.go | 515 +
.../v1/types_encryption.go} | 0
.../apiserver/v1/zz_generated.conversion.go | 927 +
.../apiserver/v1/zz_generated.deepcopy.go | 590 +
.../apiserver/v1/zz_generated.defaults.go | 23 +
.../pkg/apis/apiserver/v1alpha1/defaults.go | 7 +
.../pkg/apis/apiserver/v1alpha1/doc.go | 2 +-
.../pkg/apis/apiserver/v1alpha1/types.go | 144 +-
.../v1alpha1/zz_generated.conversion.go | 155 +-
.../v1alpha1/zz_generated.deepcopy.go | 57 +
.../pkg/apis/apiserver/v1beta1/defaults.go | 43 +
.../pkg/apis/apiserver/v1beta1/doc.go | 2 +-
.../pkg/apis/apiserver/v1beta1/register.go | 4 +-
.../pkg/apis/apiserver/v1beta1/types.go | 504 +
.../v1beta1/zz_generated.conversion.go | 639 +
.../v1beta1/zz_generated.deepcopy.go | 362 +
.../v1beta1/zz_generated.defaults.go | 10 +
.../apis/apiserver/validation/validation.go | 399 +-
.../validation/validation_encryption.go} | 27 +-
.../apis/apiserver/zz_generated.deepcopy.go | 244 +
vendor/k8s.io/apiserver/pkg/apis/audit/doc.go | 2 +-
.../k8s.io/apiserver/pkg/apis/audit/types.go | 11 +
.../k8s.io/apiserver/pkg/apis/audit/v1/doc.go | 3 +-
.../pkg/apis/audit/v1/generated.pb.go | 485 +-
.../pkg/apis/audit/v1/generated.proto | 43 +-
.../audit/v1/generated.protomessage.pb.go | 38 +
.../apiserver/pkg/apis/audit/v1/types.go | 22 +
.../apis/audit/v1/zz_generated.conversion.go | 32 +
.../apis/audit/v1/zz_generated.deepcopy.go | 21 +
.../apis/audit/v1/zz_generated.model_name.go | 62 +
.../pkg/apis/audit/zz_generated.deepcopy.go | 21 +
.../apis/config/v1/zz_generated.conversion.go | 299 -
.../apis/config/v1/zz_generated.deepcopy.go | 228 -
.../apis/config/v1/zz_generated.defaults.go | 46 -
.../pkg/apis/config/zz_generated.deepcopy.go | 228 -
.../pkg/apis/flowcontrol/bootstrap/default.go | 48 -
vendor/k8s.io/apiserver/pkg/audit/context.go | 291 +-
.../apiserver/pkg/audit/policy/reader.go | 4 +-
vendor/k8s.io/apiserver/pkg/audit/request.go | 207 +-
.../authenticatorfactory/delegating.go | 14 +-
.../authenticatorfactory/requestheader.go | 2 +
.../pkg/authentication/cel/compile.go | 7 +
.../pkg/authentication/cel/interface.go | 10 +-
.../pkg/authentication/cel/mapper.go | 33 +-
.../request/anonymous/anonymous.go | 45 +-
.../request/headerrequest/requestheader.go | 71 +-
.../headerrequest/requestheader_controller.go | 29 +-
.../pkg/authentication/request/x509/doc.go | 2 +-
.../pkg/authentication/request/x509/x509.go | 47 +
.../pkg/authentication/serviceaccount/util.go | 52 +-
.../token/cache/cached_token_authenticator.go | 6 +-
.../apiserver/pkg/authentication/user/doc.go | 2 +-
.../apiserver/pkg/authentication/user/user.go | 6 +-
.../authorization/authorizer/interfaces.go | 43 +-
.../authorizerfactory/builtin.go | 4 +-
.../authorizerfactory/delegating.go | 16 +-
.../authorizerfactory/metrics.go | 39 +-
.../pkg/authorization/cel/compile.go | 130 +-
.../pkg/authorization/cel/matcher.go | 27 +-
.../pkg/authorization/cel/metrics.go | 120 +
.../apiserver/pkg/authorization/path/doc.go | 2 +-
.../pkg/authorization/union/union.go | 4 +-
vendor/k8s.io/apiserver/pkg/cel/cidr.go | 87 +
.../apiserver/pkg/cel/common/schemas.go | 28 +-
.../apiserver/pkg/cel/common/typeprovider.go | 117 +
.../apiserver/pkg/cel/common/valuesreflect.go | 678 +
.../{values.go => valuesunstructured.go} | 18 +-
.../apiserver/pkg/cel/environment/base.go | 149 +-
.../pkg/cel/environment/environment.go | 34 +-
vendor/k8s.io/apiserver/pkg/cel/errors.go | 79 +-
vendor/k8s.io/apiserver/pkg/cel/format.go | 73 +
vendor/k8s.io/apiserver/pkg/cel/ip.go | 86 +
.../k8s.io/apiserver/pkg/cel/library/authz.go | 176 +-
.../k8s.io/apiserver/pkg/cel/library/cidr.go | 292 +
.../k8s.io/apiserver/pkg/cel/library/cost.go | 334 +-
.../apiserver/pkg/cel/library/format.go | 285 +
vendor/k8s.io/apiserver/pkg/cel/library/ip.go | 335 +
.../apiserver/pkg/cel/library/jsonpatch.go | 89 +
.../apiserver/pkg/cel/library/libraries.go | 61 +
.../k8s.io/apiserver/pkg/cel/library/lists.go | 10 +-
.../apiserver/pkg/cel/library/quantity.go | 14 +-
.../k8s.io/apiserver/pkg/cel/library/regex.go | 10 +-
.../apiserver/pkg/cel/library/semverlib.go | 343 +
.../k8s.io/apiserver/pkg/cel/library/test.go | 2 +-
.../k8s.io/apiserver/pkg/cel/library/urls.go | 10 +-
vendor/k8s.io/apiserver/pkg/cel/limits.go | 4 +
.../pkg/cel/mutation/dynamic/objects.go | 249 +
.../apiserver/pkg/cel/mutation/jsonpatch.go | 185 +
.../pkg/cel/mutation/typeresolver.go | 47 +
.../apiserver/pkg/cel/openapi/adaptor.go | 3 +
.../pkg/cel/openapi/resolver/definitions.go | 4 +-
vendor/k8s.io/apiserver/pkg/cel/quantity.go | 2 +-
vendor/k8s.io/apiserver/pkg/cel/semver.go | 73 +
vendor/k8s.io/apiserver/pkg/cel/types.go | 89 +-
.../endpoints/discovery/aggregated/etag.go | 4 +-
.../endpoints/discovery/aggregated/fake.go | 26 +-
.../endpoints/discovery/aggregated/handler.go | 147 +-
.../endpoints/discovery/aggregated/metrics.go | 39 +-
.../discovery/aggregated/negotiation.go | 10 +-
.../aggregated/peer_aggregated_handler.go | 495 +
.../endpoints/discovery/aggregated/wrapper.go | 45 +-
.../apiserver/pkg/endpoints/discovery/root.go | 34 +-
vendor/k8s.io/apiserver/pkg/endpoints/doc.go | 2 +-
.../endpoints/filterlatency/filterlatency.go | 20 +-
.../apiserver/pkg/endpoints/filters/audit.go | 106 +-
.../pkg/endpoints/filters/authentication.go | 5 +-
.../pkg/endpoints/filters/authn_audit.go | 13 +-
.../pkg/endpoints/filters/authorization.go | 34 +-
.../apiserver/pkg/endpoints/filters/doc.go | 2 +-
.../endpoints/filters/impersonation/OWNERS | 8 +
.../endpoints/filters/impersonation/cache.go | 320 +
.../constrained_impersonation.go | 251 +
.../{ => impersonation}/impersonation.go | 14 +-
.../endpoints/filters/impersonation/mode.go | 637 +
.../pkg/endpoints/filters/request_deadline.go | 26 +-
.../apiserver/pkg/endpoints/filters/traces.go | 54 +-
.../pkg/endpoints/filters/webhook_duration.go | 11 +-
.../apiserver/pkg/endpoints/groupversion.go | 8 +-
.../pkg/endpoints/handlers/create.go | 3 +-
.../pkg/endpoints/handlers/delete.go | 156 +-
.../apiserver/pkg/endpoints/handlers/doc.go | 2 +-
.../handlers/fieldmanager/equality.go | 51 +-
.../endpoints/handlers/fieldmanager/node.yaml | 2 +-
.../apiserver/pkg/endpoints/handlers/get.go | 48 +-
.../pkg/endpoints/handlers/metrics/metrics.go | 7 +-
.../pkg/endpoints/handlers/negotiation/doc.go | 2 +-
.../handlers/negotiation/negotiate.go | 13 +
.../apiserver/pkg/endpoints/handlers/patch.go | 83 +-
.../pkg/endpoints/handlers/response.go | 51 +-
.../endpoints/handlers/responsewriters/doc.go | 2 +-
.../handlers/responsewriters/errors.go | 25 +-
.../handlers/responsewriters/writers.go | 114 +-
.../apiserver/pkg/endpoints/handlers/rest.go | 9 +-
.../pkg/endpoints/handlers/update.go | 12 +-
.../apiserver/pkg/endpoints/handlers/watch.go | 223 +-
.../apiserver/pkg/endpoints/installer.go | 192 +-
.../pkg/endpoints/metrics/metrics.go | 113 +-
.../pkg/endpoints/openapi/openapi.go | 38 +-
.../apiserver/pkg/endpoints/request/doc.go | 2 +-
.../pkg/endpoints/request/methods.go | 37 +
.../pkg/endpoints/request/requestinfo.go | 41 +-
.../pkg/endpoints/request/webhook_duration.go | 60 +-
.../apiserver/pkg/features/kube_features.go | 614 +-
.../apiserver/pkg/registry/generic/OWNERS | 3 +-
.../apiserver/pkg/registry/generic/doc.go | 2 +-
.../apiserver/pkg/registry/generic/options.go | 8 +-
.../generic/registry/corrupt_obj_deleter.go | 128 +
.../pkg/registry/generic/registry/doc.go | 2 +-
.../pkg/registry/generic/registry/dryrun.go | 8 +-
.../generic/registry/storage_factory.go | 27 +-
.../pkg/registry/generic/registry/store.go | 115 +-
.../k8s.io/apiserver/pkg/registry/rest/OWNERS | 3 +-
.../apiserver/pkg/registry/rest/delete.go | 23 +-
.../k8s.io/apiserver/pkg/registry/rest/doc.go | 2 +-
.../apiserver/pkg/registry/rest/meta.go | 5 +-
.../apiserver/pkg/registry/rest/rest.go | 26 +-
.../apiserver/pkg/registry/rest/update.go | 1 +
.../apiserver/pkg/registry/rest/validate.go | 389 +
vendor/k8s.io/apiserver/pkg/server/config.go | 146 +-
.../apiserver/pkg/server/deleted_kinds.go | 229 +-
vendor/k8s.io/apiserver/pkg/server/doc.go | 2 +-
.../configmap_cafile_content.go | 9 +-
.../dynamic_cafile_content.go | 10 +-
.../dynamic_serving_content.go | 7 +-
.../server/dynamiccertificates/tlsconfig.go | 7 +-
.../pkg/server/egressselector/config.go | 25 +-
.../server/egressselector/egress_selector.go | 10 +-
.../apiserver/pkg/server/filters/doc.go | 2 +-
.../pkg/server/filters/maxinflight.go | 2 +-
.../server/filters/priority-and-fairness.go | 40 +-
.../apiserver/pkg/server/filters/timeout.go | 4 +-
.../apiserver/pkg/server/filters/wrap.go | 3 +-
.../k8s.io/apiserver/pkg/server/flagz/OWNERS | 7 +
.../v1 => server/flagz/api/v1alpha1}/doc.go | 11 +-
.../pkg/server/flagz/api/v1alpha1/register.go | 47 +
.../pkg/server/flagz/api/v1alpha1/types.go | 37 +
.../api/v1alpha1/zz_generated.deepcopy.go | 59 +
.../api/v1alpha1/zz_generated.model_name.go | 27 +
.../apiserver/pkg/server/flagz/flagreader.go | 52 +
.../apiserver/pkg/server/flagz/flagz.go | 198 +
.../pkg/server/flagz/negotiate/negotiation.go | 53 +
.../apiserver/pkg/server/flagz/registry.go | 39 +
.../pkg/server/flagz/textserializer.go | 77 +
.../apiserver/pkg/server/genericapiserver.go | 190 +-
vendor/k8s.io/apiserver/pkg/server/handler.go | 1 -
vendor/k8s.io/apiserver/pkg/server/healthz.go | 117 +-
.../apiserver/pkg/server/healthz/doc.go | 2 +-
.../apiserver/pkg/server/healthz/healthz.go | 72 +-
vendor/k8s.io/apiserver/pkg/server/hooks.go | 11 +-
.../apiserver/pkg/server/httplog/doc.go | 2 +-
.../apiserver/pkg/server/httplog/httplog.go | 19 +-
vendor/k8s.io/apiserver/pkg/server/mux/doc.go | 2 +-
.../apiserver/pkg/server/mux/pathrecorder.go | 4 +-
.../apiserver/pkg/server/options/admission.go | 35 +-
.../pkg/server/options/api_enablement.go | 29 +
.../pkg/server/options/authentication.go | 38 +-
.../authentication_dynamic_request_header.go | 1 +
.../options/deprecated_insecure_serving.go | 126 -
.../apiserver/pkg/server/options/doc.go | 2 +-
.../server/options/encryptionconfig/config.go | 159 +-
.../encryptionconfig/controller/controller.go | 13 +-
.../encryptionconfig/metrics/metrics.go | 51 +-
.../apiserver/pkg/server/options/etcd.go | 112 +-
.../apiserver/pkg/server/options/feature.go | 3 +
.../pkg/server/options/recommended.go | 20 +-
.../pkg/server/options/server_run_options.go | 95 +-
.../apiserver/pkg/server/options/serving.go | 6 +
.../server/options/serving_with_loopback.go | 12 +-
.../apiserver/pkg/server/options/tracing.go | 16 +-
vendor/k8s.io/apiserver/pkg/server/plugins.go | 4 +-
.../pkg/server/resourceconfig/doc.go | 2 +-
.../pkg/server/resourceconfig/helpers.go | 91 +-
.../pkg/server/routes/debugsocket.go | 12 +-
.../k8s.io/apiserver/pkg/server/routes/doc.go | 2 +-
.../apiserver/pkg/server/routes/flags.go | 33 +-
.../apiserver/pkg/server/routes/version.go | 4 +-
.../apiserver/pkg/server/routine/routine.go | 91 +
.../apiserver/pkg/server/secure_serving.go | 55 +-
.../apiserver/pkg/server/statusz/OWNERS | 7 +
.../pkg/server/statusz/api/v1alpha1/doc.go | 22 +
.../server/statusz/api/v1alpha1/register.go | 47 +
.../pkg/server/statusz/api/v1alpha1/types.go | 50 +
.../api/v1alpha1/zz_generated.deepcopy.go | 58 +
.../api/v1alpha1/zz_generated.model_name.go | 27 +
.../server/statusz/negotiate/negotiation.go | 53 +
.../apiserver/pkg/server/statusz/registry.go | 97 +
.../apiserver/pkg/server/statusz/statusz.go | 257 +
.../pkg/server/statusz/textserializer.go | 88 +
.../apiserver/pkg/server/storage/doc.go | 2 +-
.../pkg/server/storage/resource_config.go | 63 +-
.../storage/resource_encoding_config.go | 129 +-
.../pkg/server/storage/storage_factory.go | 19 +-
.../pkg/server/storage_readiness_hook.go | 91 +
vendor/k8s.io/apiserver/pkg/storage/OWNERS | 3 +-
.../pkg/storage/cacher/cache_watcher.go | 15 +-
.../apiserver/pkg/storage/cacher/cacher.go | 581 +-
.../apiserver/pkg/storage/cacher/compactor.go | 83 +
.../apiserver/pkg/storage/cacher/delegator.go | 459 +
.../pkg/storage/cacher/delegator/interface.go | 113 +
.../pkg/storage/cacher/lister_watcher.go | 66 +-
.../pkg/storage/cacher/metrics/metrics.go | 86 +-
.../cacher/{ => progress}/watch_progress.go | 39 +-
.../apiserver/pkg/storage/cacher/ready.go | 84 +-
.../apiserver/pkg/storage/cacher/store.go | 135 +
.../pkg/storage/cacher/store_btree.go | 505 +
.../apiserver/pkg/storage/cacher/util.go | 20 +-
.../pkg/storage/cacher/watch_cache.go | 431 +-
.../storage/cacher/watch_cache_interval.go | 56 +-
.../k8s.io/apiserver/pkg/storage/continue.go | 27 +
vendor/k8s.io/apiserver/pkg/storage/doc.go | 2 +-
vendor/k8s.io/apiserver/pkg/storage/errors.go | 84 +-
.../apiserver/pkg/storage/errors/doc.go | 2 +-
.../apiserver/pkg/storage/errors/storage.go | 16 +-
.../k8s.io/apiserver/pkg/storage/etcd3/OWNERS | 3 +
.../apiserver/pkg/storage/etcd3/compact.go | 201 +-
.../pkg/storage/etcd3/corrupt_obj_deleter.go | 270 +
.../apiserver/pkg/storage/etcd3/decoder.go | 94 +
.../apiserver/pkg/storage/etcd3/errors.go | 17 +
.../pkg/storage/etcd3/metrics/OWNERS | 7 +-
.../pkg/storage/etcd3/metrics/metrics.go | 114 +-
.../apiserver/pkg/storage/etcd3/stats.go | 195 +
.../apiserver/pkg/storage/etcd3/store.go | 679 +-
.../apiserver/pkg/storage/etcd3/watcher.go | 313 +-
.../feature/feature_support_checker.go | 172 +
.../apiserver/pkg/storage/interfaces.go | 133 +-
.../pkg/storage/selection_predicate.go | 22 +-
.../pkg/storage/storagebackend/config.go | 7 +-
.../storage/storagebackend/factory/etcd3.go | 78 +-
vendor/k8s.io/apiserver/pkg/storage/util.go | 70 +-
.../value/encrypt/envelope/kmsv2/envelope.go | 59 +-
.../encrypt/envelope/kmsv2/grpc_service.go | 6 +-
.../value/encrypt/envelope/kmsv2/v2/api.pb.go | 294 +-
.../apiserver/pkg/storage/value/metrics.go | 8 +-
.../pkg/storage/value/transformer.go | 16 +-
.../apiserver/pkg/util/apihelpers/helpers.go | 18 +
.../pkg/util/compatibility/registry.go | 53 +
.../pkg/util/compatibility/version.go | 65 +
.../pkg/util/configmetrics/info_collector.go | 92 +
.../pkg/util/feature/feature_gate.go | 4 +-
.../pkg/util/flowcontrol/apf_controller.go | 103 +-
.../fairqueuing/queueset/queueset.go | 27 +-
.../pkg/util/flowcontrol/metrics/metrics.go | 2 +-
.../pkg/util/flowcontrol/request/config.go | 24 +-
.../request/list_work_estimator.go | 143 +-
.../request/mutating_work_estimator.go | 4 +-
.../request/object_count_tracker.go | 42 +-
.../pkg/util/flowcontrol/request/width.go | 21 +-
.../apiserver/pkg/util/flushwriter/doc.go | 2 +-
.../pkg/util/peerproxy/metrics/metrics.go | 5 +
.../apiserver/pkg/util/webhook/client.go | 51 +-
.../apiserver/pkg/util/webhook/validation.go | 14 +-
.../apiserver/pkg/util/webhook/webhook.go | 1 +
.../apiserver/pkg/validation/metrics.go | 134 +
.../plugin/pkg/audit/buffered/doc.go | 2 +-
.../plugin/pkg/audit/truncate/doc.go | 2 +-
.../plugin/pkg/authorizer/webhook/metrics.go | 35 -
.../pkg/authorizer/webhook/metrics/metrics.go | 166 +
.../plugin/pkg/authorizer/webhook/webhook.go | 187 +-
.../pkg/genericclioptions/builder_flags.go | 9 +-
.../genericclioptions/builder_flags_fake.go | 19 +-
.../pkg/genericclioptions/command_headers.go | 19 +-
.../pkg/genericclioptions/config_flags.go | 139 +-
.../cli-runtime/pkg/genericclioptions/doc.go | 2 +-
.../pkg/genericclioptions/json_yaml_flags.go | 17 +-
.../pkg/genericclioptions/record_flags.go | 2 +-
vendor/k8s.io/cli-runtime/pkg/printers/doc.go | 2 +-
.../k8s.io/cli-runtime/pkg/printers/json.go | 5 +-
.../cli-runtime/pkg/printers/jsonpath.go | 3 +-
.../k8s.io/cli-runtime/pkg/printers/kyaml.go | 66 +
.../k8s.io/cli-runtime/pkg/printers/name.go | 3 +-
.../cli-runtime/pkg/printers/template.go | 3 +-
.../k8s.io/cli-runtime/pkg/printers/yaml.go | 5 +-
.../cli-runtime/pkg/resource/builder.go | 14 +-
vendor/k8s.io/cli-runtime/pkg/resource/doc.go | 2 +-
.../k8s.io/cli-runtime/pkg/resource/mapper.go | 2 +-
.../pkg/resource/query_param_verifier.go | 2 +-
.../k8s.io/cli-runtime/pkg/resource/result.go | 6 +-
.../client-go/applyconfigurations/OWNERS | 6 +
.../v1/auditannotation.go | 80 +
.../v1/expressionwarning.go | 56 +
.../v1/matchcondition.go | 30 +-
.../v1/matchresources.go | 166 +
.../v1/mutatingwebhook.go | 157 +-
.../v1/mutatingwebhookconfiguration.go | 129 +-
.../v1/namedrulewithoperations.go | 98 +
.../admissionregistration/v1/paramkind.go | 55 +
.../admissionregistration/v1/paramref.go | 114 +
.../admissionregistration/v1/rule.go | 48 +-
.../v1/rulewithoperations.go | 29 +-
.../v1/servicereference.go | 21 +-
.../admissionregistration/v1/typechecking.go | 48 +
.../v1/validatingadmissionpolicy.go | 293 +
.../v1/validatingadmissionpolicybinding.go | 284 +
.../validatingadmissionpolicybindingspec.go | 125 +
.../v1/validatingadmissionpolicyspec.go | 169 +
.../v1/validatingadmissionpolicystatus.go | 72 +
.../v1/validatingwebhook.go | 140 +-
.../v1/validatingwebhookconfiguration.go | 129 +-
.../admissionregistration/v1/validation.go | 136 +
.../admissionregistration/v1/variable.go | 55 +
.../v1/webhookclientconfig.go | 44 +-
.../v1alpha1/applyconfiguration.go | 81 +
.../v1alpha1/auditannotation.go | 38 +-
.../v1alpha1/expressionwarning.go | 14 +-
.../v1alpha1/jsonpatch.go | 105 +
.../v1alpha1/matchcondition.go | 28 +-
.../v1alpha1/matchresources.go | 91 +-
.../v1alpha1/mutatingadmissionpolicy.go | 274 +
.../mutatingadmissionpolicybinding.go | 284 +
.../mutatingadmissionpolicybindingspec.go | 75 +
.../v1alpha1/mutatingadmissionpolicyspec.go | 173 +
.../v1alpha1/mutation.go | 72 +
.../v1alpha1/namedrulewithoperations.go | 20 +-
.../v1alpha1/paramkind.go | 13 +-
.../v1alpha1/paramref.go | 54 +-
.../v1alpha1/typechecking.go | 8 +-
.../v1alpha1/validatingadmissionpolicy.go | 121 +-
.../validatingadmissionpolicybinding.go | 123 +-
.../validatingadmissionpolicybindingspec.go | 63 +-
.../v1alpha1/validatingadmissionpolicyspec.go | 70 +-
.../validatingadmissionpolicystatus.go | 16 +-
.../v1alpha1/validation.go | 78 +-
.../v1alpha1/variable.go | 13 +-
.../v1beta1/applyconfiguration.go | 81 +
.../v1beta1/auditannotation.go | 38 +-
.../v1beta1/expressionwarning.go | 14 +-
.../v1beta1/jsonpatch.go | 105 +
.../v1beta1/matchcondition.go | 30 +-
.../v1beta1/matchresources.go | 90 +-
.../v1beta1/mutatingadmissionpolicy.go | 274 +
.../v1beta1/mutatingadmissionpolicybinding.go | 284 +
.../mutatingadmissionpolicybindingspec.go | 75 +
.../v1beta1/mutatingadmissionpolicyspec.go | 173 +
.../v1beta1/mutatingwebhook.go | 161 +-
.../v1beta1/mutatingwebhookconfiguration.go | 114 +-
.../admissionregistration/v1beta1/mutation.go | 72 +
.../v1beta1/namedrulewithoperations.go | 20 +-
.../v1beta1/paramkind.go | 13 +-
.../admissionregistration/v1beta1/paramref.go | 59 +-
.../v1beta1/servicereference.go | 21 +-
.../v1beta1/typechecking.go | 8 +-
.../v1beta1/validatingadmissionpolicy.go | 121 +-
.../validatingadmissionpolicybinding.go | 123 +-
.../validatingadmissionpolicybindingspec.go | 63 +-
.../v1beta1/validatingadmissionpolicyspec.go | 70 +-
.../validatingadmissionpolicystatus.go | 16 +-
.../v1beta1/validatingwebhook.go | 141 +-
.../v1beta1/validatingwebhookconfiguration.go | 114 +-
.../v1beta1/validation.go | 78 +-
.../admissionregistration/v1beta1/variable.go | 13 +-
.../v1beta1/webhookclientconfig.go | 44 +-
.../v1alpha1/serverstorageversion.go | 20 +-
.../v1alpha1/storageversion.go | 127 +-
.../v1alpha1/storageversioncondition.go | 30 +-
.../v1alpha1/storageversionstatus.go | 19 +-
.../apps/v1/controllerrevision.go | 139 +-
.../applyconfigurations/apps/v1/daemonset.go | 144 +-
.../apps/v1/daemonsetcondition.go | 26 +-
.../apps/v1/daemonsetspec.go | 38 +-
.../apps/v1/daemonsetstatus.go | 49 +-
.../apps/v1/daemonsetupdatestrategy.go | 18 +-
.../applyconfigurations/apps/v1/deployment.go | 145 +-
.../apps/v1/deploymentcondition.go | 28 +-
.../apps/v1/deploymentspec.go | 46 +-
.../apps/v1/deploymentstatus.go | 47 +-
.../apps/v1/deploymentstrategy.go | 18 +-
.../applyconfigurations/apps/v1/replicaset.go | 152 +-
.../apps/v1/replicasetcondition.go | 25 +-
.../apps/v1/replicasetspec.go | 32 +-
.../apps/v1/replicasetstatus.go | 38 +-
.../apps/v1/rollingupdatedaemonset.go | 40 +-
.../apps/v1/rollingupdatedeployment.go | 29 +-
.../v1/rollingupdatestatefulsetstrategy.go | 19 +-
.../apps/v1/statefulset.go | 152 +-
.../apps/v1/statefulsetcondition.go | 25 +-
.../apps/v1/statefulsetordinals.go | 15 +-
...setpersistentvolumeclaimretentionpolicy.go | 26 +-
.../apps/v1/statefulsetspec.go | 84 +-
.../apps/v1/statefulsetstatus.go | 43 +-
.../apps/v1/statefulsetupdatestrategy.go | 17 +-
.../apps/v1beta1/controllerrevision.go | 129 +-
.../apps/v1beta1/deployment.go | 122 +-
.../apps/v1beta1/deploymentcondition.go | 28 +-
.../apps/v1beta1/deploymentspec.go | 45 +-
.../apps/v1beta1/deploymentstatus.go | 47 +-
.../apps/v1beta1/deploymentstrategy.go | 18 +-
.../apps/v1beta1/rollbackconfig.go | 7 +-
.../apps/v1beta1/rollingupdatedeployment.go | 29 +-
.../rollingupdatestatefulsetstrategy.go | 19 +-
.../apps/v1beta1/statefulset.go | 126 +-
.../apps/v1beta1/statefulsetcondition.go | 25 +-
.../apps/v1beta1/statefulsetordinals.go | 15 +-
...setpersistentvolumeclaimretentionpolicy.go | 26 +-
.../apps/v1beta1/statefulsetspec.go | 83 +-
.../apps/v1beta1/statefulsetstatus.go | 43 +-
.../apps/v1beta1/statefulsetupdatestrategy.go | 16 +-
.../apps/v1beta2/controllerrevision.go | 129 +-
.../apps/v1beta2/daemonset.go | 128 +-
.../apps/v1beta2/daemonsetcondition.go | 26 +-
.../apps/v1beta2/daemonsetspec.go | 34 +-
.../apps/v1beta2/daemonsetstatus.go | 49 +-
.../apps/v1beta2/daemonsetupdatestrategy.go | 18 +-
.../apps/v1beta2/deployment.go | 122 +-
.../apps/v1beta2/deploymentcondition.go | 28 +-
.../apps/v1beta2/deploymentspec.go | 42 +-
.../apps/v1beta2/deploymentstatus.go | 47 +-
.../apps/v1beta2/deploymentstrategy.go | 18 +-
.../apps/v1beta2/replicaset.go | 129 +-
.../apps/v1beta2/replicasetcondition.go | 25 +-
.../apps/v1beta2/replicasetspec.go | 28 +-
.../apps/v1beta2/replicasetstatus.go | 38 +-
.../apps/v1beta2/rollingupdatedaemonset.go | 40 +-
.../apps/v1beta2/rollingupdatedeployment.go | 29 +-
.../rollingupdatestatefulsetstrategy.go | 19 +-
.../applyconfigurations/apps/v1beta2/scale.go | 83 +-
.../apps/v1beta2/statefulset.go | 132 +-
.../apps/v1beta2/statefulsetcondition.go | 25 +-
.../apps/v1beta2/statefulsetordinals.go | 15 +-
...setpersistentvolumeclaimretentionpolicy.go | 26 +-
.../apps/v1beta2/statefulsetspec.go | 84 +-
.../apps/v1beta2/statefulsetstatus.go | 43 +-
.../apps/v1beta2/statefulsetupdatestrategy.go | 17 +-
.../v1/crossversionobjectreference.go | 13 +-
.../autoscaling/v1/horizontalpodautoscaler.go | 138 +-
.../v1/horizontalpodautoscalerspec.go | 24 +-
.../v1/horizontalpodautoscalerstatus.go | 27 +-
.../autoscaling/v1/scale.go | 91 +-
.../autoscaling/v1/scalespec.go | 7 +-
.../autoscaling/v1/scalestatus.go | 13 +-
.../v2/containerresourcemetricsource.go | 21 +-
.../v2/containerresourcemetricstatus.go | 19 +-
.../v2/crossversionobjectreference.go | 13 +-
.../autoscaling/v2/externalmetricsource.go | 12 +-
.../autoscaling/v2/externalmetricstatus.go | 11 +-
.../autoscaling/v2/horizontalpodautoscaler.go | 124 +-
.../v2/horizontalpodautoscalerbehavior.go | 18 +-
.../v2/horizontalpodautoscalercondition.go | 28 +-
.../v2/horizontalpodautoscalerspec.go | 36 +-
.../v2/horizontalpodautoscalerstatus.go | 28 +-
.../autoscaling/v2/hpascalingpolicy.go | 21 +-
.../autoscaling/v2/hpascalingrules.go | 60 +-
.../autoscaling/v2/metricidentifier.go | 12 +-
.../autoscaling/v2/metricspec.go | 43 +-
.../autoscaling/v2/metricstatus.go | 42 +-
.../autoscaling/v2/metrictarget.go | 26 +-
.../autoscaling/v2/metricvaluestatus.go | 18 +-
.../autoscaling/v2/objectmetricsource.go | 14 +-
.../autoscaling/v2/objectmetricstatus.go | 14 +-
.../autoscaling/v2/podsmetricsource.go | 13 +-
.../autoscaling/v2/podsmetricstatus.go | 11 +-
.../autoscaling/v2/resourcemetricsource.go | 16 +-
.../autoscaling/v2/resourcemetricstatus.go | 14 +-
.../v2beta1/containerresourcemetricsource.go | 28 +-
.../v2beta1/containerresourcemetricstatus.go | 29 +-
.../v2beta1/crossversionobjectreference.go | 13 +-
.../v2beta1/externalmetricsource.go | 24 +-
.../v2beta1/externalmetricstatus.go | 21 +-
.../v2beta1/horizontalpodautoscaler.go | 124 +-
.../horizontalpodautoscalercondition.go | 28 +-
.../v2beta1/horizontalpodautoscalerspec.go | 28 +-
.../v2beta1/horizontalpodautoscalerstatus.go | 28 +-
.../autoscaling/v2beta1/metricspec.go | 43 +-
.../autoscaling/v2beta1/metricstatus.go | 42 +-
.../autoscaling/v2beta1/objectmetricsource.go | 25 +-
.../autoscaling/v2beta1/objectmetricstatus.go | 25 +-
.../autoscaling/v2beta1/podsmetricsource.go | 21 +-
.../autoscaling/v2beta1/podsmetricstatus.go | 19 +-
.../v2beta1/resourcemetricsource.go | 25 +-
.../v2beta1/resourcemetricstatus.go | 26 +-
.../v2beta2/containerresourcemetricsource.go | 21 +-
.../v2beta2/containerresourcemetricstatus.go | 19 +-
.../v2beta2/crossversionobjectreference.go | 13 +-
.../v2beta2/externalmetricsource.go | 12 +-
.../v2beta2/externalmetricstatus.go | 11 +-
.../v2beta2/horizontalpodautoscaler.go | 124 +-
.../horizontalpodautoscalerbehavior.go | 18 +-
.../horizontalpodautoscalercondition.go | 28 +-
.../v2beta2/horizontalpodautoscalerspec.go | 36 +-
.../v2beta2/horizontalpodautoscalerstatus.go | 28 +-
.../autoscaling/v2beta2/hpascalingpolicy.go | 21 +-
.../autoscaling/v2beta2/hpascalingrules.go | 31 +-
.../autoscaling/v2beta2/metricidentifier.go | 12 +-
.../autoscaling/v2beta2/metricspec.go | 43 +-
.../autoscaling/v2beta2/metricstatus.go | 42 +-
.../autoscaling/v2beta2/metrictarget.go | 26 +-
.../autoscaling/v2beta2/metricvaluestatus.go | 18 +-
.../autoscaling/v2beta2/objectmetricsource.go | 13 +-
.../autoscaling/v2beta2/objectmetricstatus.go | 11 +-
.../autoscaling/v2beta2/podsmetricsource.go | 13 +-
.../autoscaling/v2beta2/podsmetricstatus.go | 11 +-
.../v2beta2/resourcemetricsource.go | 16 +-
.../v2beta2/resourcemetricstatus.go | 14 +-
.../applyconfigurations/batch/v1/cronjob.go | 141 +-
.../batch/v1/cronjobspec.go | 51 +-
.../batch/v1/cronjobstatus.go | 19 +-
.../applyconfigurations/batch/v1/job.go | 141 +-
.../batch/v1/jobcondition.go | 28 +-
.../applyconfigurations/batch/v1/jobspec.go | 171 +-
.../applyconfigurations/batch/v1/jobstatus.go | 98 +-
.../batch/v1/jobtemplatespec.go | 72 +-
.../batch/v1/podfailurepolicy.go | 11 +-
.../podfailurepolicyonexitcodesrequirement.go | 42 +-
.../podfailurepolicyonpodconditionspattern.go | 22 +-
.../batch/v1/podfailurepolicyrule.go | 32 +-
.../batch/v1/successpolicy.go | 52 +
.../batch/v1/successpolicyrule.go | 72 +
.../batch/v1/uncountedterminatedpods.go | 11 +-
.../batch/v1beta1/cronjob.go | 123 +-
.../batch/v1beta1/cronjobspec.go | 53 +-
.../batch/v1beta1/cronjobstatus.go | 15 +-
.../batch/v1beta1/jobtemplatespec.go | 58 +-
.../v1/certificatesigningrequest.go | 153 +-
.../v1/certificatesigningrequestcondition.go | 45 +-
.../v1/certificatesigningrequestspec.go | 93 +-
.../v1/certificatesigningrequeststatus.go | 38 +-
.../v1alpha1/clustertrustbundle.go | 127 +-
.../v1alpha1/clustertrustbundlespec.go | 37 +-
.../v1beta1/certificatesigningrequest.go | 117 +-
.../certificatesigningrequestcondition.go | 31 +-
.../v1beta1/certificatesigningrequestspec.go | 97 +-
.../certificatesigningrequeststatus.go | 10 +-
.../v1beta1/clustertrustbundle.go | 288 +
.../v1beta1/clustertrustbundlespec.go | 79 +
.../v1beta1/podcertificaterequest.go | 295 +
.../v1beta1/podcertificaterequestspec.go | 214 +
.../v1beta1/podcertificaterequeststatus.go | 133 +
.../coordination/v1/lease.go | 130 +-
.../coordination/v1/leasespec.go | 58 +-
.../coordination/v1alpha2/leasecandidate.go | 278 +
.../v1alpha2/leasecandidatespec.go | 113 +
.../coordination/v1beta1/lease.go | 114 +-
.../coordination/v1beta1/leasecandidate.go | 278 +
.../v1beta1/leasecandidatespec.go | 115 +
.../coordination/v1beta1/leasespec.go | 50 +-
.../applyconfigurations/core/v1/affinity.go | 13 +-
.../core/v1/apparmorprofile.go | 63 +
.../core/v1/attachedvolume.go | 16 +-
.../v1/awselasticblockstorevolumesource.go | 32 +-
.../core/v1/azurediskvolumesource.go | 33 +-
.../v1/azurefilepersistentvolumesource.go | 18 +-
.../core/v1/azurefilevolumesource.go | 14 +-
.../core/v1/capabilities.go | 18 +-
.../core/v1/cephfspersistentvolumesource.go | 31 +-
.../core/v1/cephfsvolumesource.go | 31 +-
.../core/v1/cinderpersistentvolumesource.go | 26 +-
.../core/v1/cindervolumesource.go | 26 +-
.../core/v1/claimsource.go | 48 -
.../core/v1/clientipconfig.go | 9 +-
.../core/v1/clustertrustbundleprojection.go | 37 +-
.../core/v1/componentcondition.go | 28 +-
.../core/v1/componentstatus.go | 131 +-
.../applyconfigurations/core/v1/configmap.go | 147 +-
.../core/v1/configmapenvsource.go | 16 +-
.../core/v1/configmapkeyselector.go | 15 +-
.../core/v1/configmapnodeconfigsource.go | 27 +-
.../core/v1/configmapprojection.go | 26 +-
.../core/v1/configmapvolumesource.go | 34 +-
.../applyconfigurations/core/v1/container.go | 195 +-
.../v1/containerextendedresourcerequest.go | 63 +
.../core/v1/containerimage.go | 13 +-
.../core/v1/containerport.go | 32 +-
.../core/v1/containerresizepolicy.go | 20 +-
.../core/v1/containerrestartrule.go | 58 +
.../v1/containerrestartruleonexitcodes.go | 65 +
.../core/v1/containerstate.go | 15 +-
.../core/v1/containerstaterunning.go | 13 +-
.../core/v1/containerstateterminated.go | 33 +-
.../core/v1/containerstatewaiting.go | 10 +-
.../core/v1/containerstatus.go | 124 +-
.../core/v1/containeruser.go | 43 +
.../core/v1/csipersistentvolumesource.go | 59 +-
.../core/v1/csivolumesource.go | 28 +-
.../core/v1/daemonendpoint.go | 7 +-
.../core/v1/downwardapiprojection.go | 9 +-
.../core/v1/downwardapivolumefile.go | 22 +-
.../core/v1/downwardapivolumesource.go | 20 +-
.../core/v1/emptydirvolumesource.go | 23 +-
.../core/v1/endpointaddress.go | 19 +-
.../core/v1/endpointport.go | 42 +-
.../applyconfigurations/core/v1/endpoints.go | 153 +-
.../core/v1/endpointsubset.go | 30 +-
.../core/v1/envfromsource.go | 14 +-
.../applyconfigurations/core/v1/envvar.go | 22 +-
.../core/v1/envvarsource.go | 29 +-
.../core/v1/ephemeralcontainer.go | 86 +-
.../core/v1/ephemeralcontainercommon.go | 153 +-
.../core/v1/ephemeralvolumesource.go | 27 +-
.../applyconfigurations/core/v1/event.go | 187 +-
.../core/v1/eventseries.go | 17 +-
.../core/v1/eventsource.go | 10 +-
.../applyconfigurations/core/v1/execaction.go | 11 +-
.../core/v1/fcvolumesource.go | 26 +-
.../core/v1/filekeyselector.go | 81 +
.../core/v1/flexpersistentvolumesource.go | 27 +-
.../core/v1/flexvolumesource.go | 27 +-
.../core/v1/flockervolumesource.go | 11 +-
.../core/v1/gcepersistentdiskvolumesource.go | 34 +-
.../core/v1/gitrepovolumesource.go | 22 +-
.../v1/glusterfspersistentvolumesource.go | 23 +-
.../core/v1/glusterfsvolumesource.go | 17 +-
.../applyconfigurations/core/v1/grpcaction.go | 13 +-
.../applyconfigurations/core/v1/hostalias.go | 11 +-
.../applyconfigurations/core/v1/hostip.go | 7 +-
.../core/v1/hostpathvolumesource.go | 21 +-
.../core/v1/httpgetaction.go | 27 +-
.../applyconfigurations/core/v1/httpheader.go | 11 +-
.../core/v1/imagevolumesource.go | 65 +
.../core/v1/iscsipersistentvolumesource.go | 51 +-
.../core/v1/iscsivolumesource.go | 51 +-
.../applyconfigurations/core/v1/keytopath.go | 21 +-
.../applyconfigurations/core/v1/lifecycle.go | 39 +-
.../core/v1/lifecyclehandler.go | 19 +-
.../applyconfigurations/core/v1/limitrange.go | 131 +-
.../core/v1/limitrangeitem.go | 38 +-
.../core/v1/limitrangespec.go | 7 +-
.../core/v1/linuxcontaineruser.go | 64 +
.../core/v1/loadbalanceringress.go | 31 +-
.../core/v1/loadbalancerstatus.go | 8 +-
.../core/v1/localobjectreference.go | 24 +-
.../core/v1/localvolumesource.go | 14 +-
.../core/v1/modifyvolumestatus.go | 25 +-
.../applyconfigurations/core/v1/namespace.go | 142 +-
.../core/v1/namespacecondition.go | 27 +-
.../core/v1/namespacespec.go | 14 +-
.../core/v1/namespacestatus.go | 15 +-
.../core/v1/nfsvolumesource.go | 20 +-
.../applyconfigurations/core/v1/node.go | 144 +-
.../core/v1/nodeaddress.go | 16 +-
.../core/v1/nodeaffinity.go | 22 +-
.../core/v1/nodecondition.go | 30 +-
.../core/v1/nodeconfigsource.go | 8 +-
.../core/v1/nodeconfigstatus.go | 47 +-
.../core/v1/nodedaemonendpoints.go | 7 +-
.../core/v1/nodefeatures.go | 44 +
.../core/v1/noderuntimehandler.go | 53 +
.../core/v1/noderuntimehandlerfeatures.go | 52 +
.../core/v1/nodeselector.go | 9 +-
.../core/v1/nodeselectorrequirement.go | 25 +-
.../core/v1/nodeselectorterm.go | 12 +-
.../applyconfigurations/core/v1/nodespec.go | 31 +-
.../applyconfigurations/core/v1/nodestatus.go | 99 +-
.../core/v1/nodeswapstatus.go | 42 +
.../core/v1/nodesysteminfo.go | 48 +-
.../core/v1/objectfieldselector.go | 10 +-
.../core/v1/objectreference.go | 54 +-
.../core/v1/persistentvolume.go | 146 +-
.../core/v1/persistentvolumeclaim.go | 142 +-
.../core/v1/persistentvolumeclaimcondition.go | 35 +-
.../core/v1/persistentvolumeclaimspec.go | 85 +-
.../core/v1/persistentvolumeclaimstatus.go | 99 +-
.../core/v1/persistentvolumeclaimtemplate.go | 80 +-
.../v1/persistentvolumeclaimvolumesource.go | 15 +-
.../core/v1/persistentvolumesource.go | 109 +-
.../core/v1/persistentvolumespec.go | 112 +-
.../core/v1/persistentvolumestatus.go | 25 +-
.../v1/photonpersistentdiskvolumesource.go | 12 +-
.../applyconfigurations/core/v1/pod.go | 155 +-
.../core/v1/podaffinity.go | 24 +-
.../core/v1/podaffinityterm.go | 61 +-
.../core/v1/podantiaffinity.go | 24 +-
.../core/v1/podcertificateprojection.go | 160 +
.../core/v1/podcondition.go | 44 +-
.../core/v1/poddnsconfig.go | 23 +-
.../core/v1/poddnsconfigoption.go | 11 +-
.../core/v1/podextendedresourceclaimstatus.go | 61 +
.../applyconfigurations/core/v1/podip.go | 7 +-
.../applyconfigurations/core/v1/podos.go | 16 +-
.../core/v1/podreadinessgate.go | 13 +-
.../core/v1/podresourceclaim.go | 54 +-
.../core/v1/podresourceclaimstatus.go | 17 +-
.../core/v1/podschedulinggate.go | 8 +-
.../core/v1/podsecuritycontext.go | 145 +-
.../applyconfigurations/core/v1/podspec.go | 327 +-
.../applyconfigurations/core/v1/podstatus.go | 177 +-
.../core/v1/podtemplate.go | 131 +-
.../core/v1/podtemplatespec.go | 72 +-
.../applyconfigurations/core/v1/portstatus.go | 27 +-
.../core/v1/portworxvolumesource.go | 16 +-
.../core/v1/preferredschedulingterm.go | 11 +-
.../applyconfigurations/core/v1/probe.go | 49 +-
.../core/v1/probehandler.go | 17 +-
.../core/v1/projectedvolumesource.go | 18 +-
.../core/v1/quobytevolumesource.go | 29 +-
.../core/v1/rbdpersistentvolumesource.go | 48 +-
.../core/v1/rbdvolumesource.go | 48 +-
.../core/v1/replicationcontroller.go | 151 +-
.../core/v1/replicationcontrollercondition.go | 27 +-
.../core/v1/replicationcontrollerspec.go | 30 +-
.../core/v1/replicationcontrollerstatus.go | 26 +-
.../core/v1/resourceclaim.go | 21 +-
.../core/v1/resourcefieldselector.go | 15 +-
.../core/v1/resourcehealth.go | 66 +
.../core/v1/resourcequota.go | 141 +-
.../core/v1/resourcequotaspec.go | 23 +-
.../core/v1/resourcequotastatus.go | 19 +-
.../core/v1/resourcerequirements.go | 31 +-
.../core/v1/resourcestatus.go | 66 +
.../core/v1/scaleiopersistentvolumesource.go | 43 +-
.../core/v1/scaleiovolumesource.go | 43 +-
.../v1/scopedresourceselectorrequirement.go | 26 +-
.../core/v1/scopeselector.go | 8 +-
.../core/v1/seccompprofile.go | 25 +-
.../applyconfigurations/core/v1/secret.go | 148 +-
.../core/v1/secretenvsource.go | 16 +-
.../core/v1/secretkeyselector.go | 15 +-
.../core/v1/secretprojection.go | 25 +-
.../core/v1/secretreference.go | 11 +-
.../core/v1/secretvolumesource.go | 35 +-
.../core/v1/securitycontext.go | 93 +-
.../core/v1/selinuxoptions.go | 16 +-
.../applyconfigurations/core/v1/service.go | 145 +-
.../core/v1/serviceaccount.go | 155 +-
.../core/v1/serviceaccounttokenprojection.go | 27 +-
.../core/v1/serviceport.go | 62 +-
.../core/v1/servicespec.go | 229 +-
.../core/v1/servicestatus.go | 11 +-
.../core/v1/sessionaffinityconfig.go | 7 +-
.../core/v1/sleepaction.go | 7 +-
.../v1/storageospersistentvolumesource.go | 31 +-
.../core/v1/storageosvolumesource.go | 31 +-
.../applyconfigurations/core/v1/sysctl.go | 10 +-
.../applyconfigurations/core/v1/taint.go | 25 +-
.../core/v1/tcpsocketaction.go | 12 +-
.../applyconfigurations/core/v1/toleration.go | 38 +-
.../v1/topologyselectorlabelrequirement.go | 12 +-
.../core/v1/topologyselectorterm.go | 11 +-
.../core/v1/topologyspreadconstraint.go | 120 +-
.../core/v1/typedlocalobjectreference.go | 30 +-
.../core/v1/typedobjectreference.go | 20 +-
.../applyconfigurations/core/v1/volume.go | 80 +-
.../core/v1/volumedevice.go | 10 +-
.../core/v1/volumemount.go | 64 +-
.../core/v1/volumemountstatus.go | 78 +
.../core/v1/volumenodeaffinity.go | 7 +-
.../core/v1/volumeprojection.go | 75 +-
.../core/v1/volumeresourcerequirements.go | 22 +-
.../core/v1/volumesource.go | 189 +-
.../core/v1/vspherevirtualdiskvolumesource.go | 18 +-
.../core/v1/weightedpodaffinityterm.go | 11 +-
.../core/v1/windowssecuritycontextoptions.go | 24 +-
.../core/v1/workloadreference.go | 74 +
.../discovery/v1/endpoint.go | 47 +-
.../discovery/v1/endpointconditions.go | 23 +-
.../discovery/v1/endpointhints.go | 24 +-
.../discovery/v1/endpointport.go | 47 +-
.../discovery/v1/endpointslice.go | 153 +-
.../discovery/v1/fornode.go | 42 +
.../discovery/v1/forzone.go | 7 +-
.../discovery/v1beta1/endpoint.go | 49 +-
.../discovery/v1beta1/endpointconditions.go | 22 +-
.../discovery/v1beta1/endpointhints.go | 24 +-
.../discovery/v1beta1/endpointport.go | 33 +-
.../discovery/v1beta1/endpointslice.go | 136 +-
.../discovery/v1beta1/fornode.go | 42 +
.../discovery/v1beta1/forzone.go | 7 +-
.../client-go/applyconfigurations/doc.go | 150 +
.../applyconfigurations/events/v1/event.go | 195 +-
.../events/v1/eventseries.go | 19 +-
.../events/v1beta1/event.go | 172 +-
.../events/v1beta1/eventseries.go | 11 +-
.../extensions/v1beta1/daemonset.go | 128 +-
.../extensions/v1beta1/daemonsetcondition.go | 26 +-
.../extensions/v1beta1/daemonsetspec.go | 38 +-
.../extensions/v1beta1/daemonsetstatus.go | 49 +-
.../v1beta1/daemonsetupdatestrategy.go | 21 +-
.../extensions/v1beta1/deployment.go | 128 +-
.../extensions/v1beta1/deploymentcondition.go | 28 +-
.../extensions/v1beta1/deploymentspec.go | 47 +-
.../extensions/v1beta1/deploymentstatus.go | 47 +-
.../extensions/v1beta1/deploymentstrategy.go | 18 +-
.../extensions/v1beta1/httpingresspath.go | 38 +-
.../v1beta1/httpingressrulevalue.go | 11 +-
.../extensions/v1beta1/ingress.go | 127 +-
.../extensions/v1beta1/ingressbackend.go | 17 +-
.../v1beta1/ingressloadbalanceringress.go | 15 +-
.../v1beta1/ingressloadbalancerstatus.go | 7 +-
.../extensions/v1beta1/ingressportstatus.go | 21 +-
.../extensions/v1beta1/ingressrule.go | 41 +-
.../extensions/v1beta1/ingressrulevalue.go | 15 +-
.../extensions/v1beta1/ingressspec.go | 35 +-
.../extensions/v1beta1/ingressstatus.go | 7 +-
.../extensions/v1beta1/ingresstls.go | 19 +-
.../extensions/v1beta1/ipblock.go | 16 +-
.../extensions/v1beta1/networkpolicy.go | 115 +-
.../v1beta1/networkpolicyegressrule.go | 21 +-
.../v1beta1/networkpolicyingressrule.go | 19 +-
.../extensions/v1beta1/networkpolicypeer.go | 24 +-
.../extensions/v1beta1/networkpolicyport.go | 22 +-
.../extensions/v1beta1/networkpolicyspec.go | 43 +-
.../extensions/v1beta1/replicaset.go | 135 +-
.../extensions/v1beta1/replicasetcondition.go | 25 +-
.../extensions/v1beta1/replicasetspec.go | 28 +-
.../extensions/v1beta1/replicasetstatus.go | 38 +-
.../extensions/v1beta1/rollbackconfig.go | 7 +-
.../v1beta1/rollingupdatedaemonset.go | 41 +-
.../v1beta1/rollingupdatedeployment.go | 29 +-
.../extensions/v1beta1/scale.go | 83 +-
.../v1/exemptprioritylevelconfiguration.go | 32 +-
.../flowcontrol/v1/flowdistinguishermethod.go | 15 +-
.../flowcontrol/v1/flowschema.go | 142 +-
.../flowcontrol/v1/flowschemacondition.go | 30 +-
.../flowcontrol/v1/flowschemaspec.go | 24 +-
.../flowcontrol/v1/flowschemastatus.go | 7 +-
.../flowcontrol/v1/groupsubject.go | 10 +-
.../v1/limitedprioritylevelconfiguration.go | 59 +-
.../flowcontrol/v1/limitresponse.go | 21 +-
.../flowcontrol/v1/nonresourcepolicyrule.go | 22 +-
.../flowcontrol/v1/policyruleswithsubjects.go | 22 +-
.../v1/prioritylevelconfiguration.go | 141 +-
.../v1/prioritylevelconfigurationcondition.go | 30 +-
.../v1/prioritylevelconfigurationreference.go | 8 +-
.../v1/prioritylevelconfigurationspec.go | 30 +-
.../v1/prioritylevelconfigurationstatus.go | 7 +-
.../flowcontrol/v1/queuingconfiguration.go | 31 +-
.../flowcontrol/v1/resourcepolicyrule.go | 48 +-
.../flowcontrol/v1/serviceaccountsubject.go | 12 +-
.../flowcontrol/v1/subject.go | 22 +-
.../flowcontrol/v1/usersubject.go | 8 +-
.../exemptprioritylevelconfiguration.go | 32 +-
.../v1beta1/flowdistinguishermethod.go | 15 +-
.../flowcontrol/v1beta1/flowschema.go | 122 +-
.../v1beta1/flowschemacondition.go | 30 +-
.../flowcontrol/v1beta1/flowschemaspec.go | 24 +-
.../flowcontrol/v1beta1/flowschemastatus.go | 7 +-
.../flowcontrol/v1beta1/groupsubject.go | 10 +-
.../limitedprioritylevelconfiguration.go | 55 +-
.../flowcontrol/v1beta1/limitresponse.go | 21 +-
.../v1beta1/nonresourcepolicyrule.go | 22 +-
.../v1beta1/policyruleswithsubjects.go | 22 +-
.../v1beta1/prioritylevelconfiguration.go | 121 +-
.../prioritylevelconfigurationcondition.go | 30 +-
.../prioritylevelconfigurationreference.go | 8 +-
.../v1beta1/prioritylevelconfigurationspec.go | 30 +-
.../prioritylevelconfigurationstatus.go | 7 +-
.../v1beta1/queuingconfiguration.go | 31 +-
.../flowcontrol/v1beta1/resourcepolicyrule.go | 48 +-
.../v1beta1/serviceaccountsubject.go | 12 +-
.../flowcontrol/v1beta1/subject.go | 22 +-
.../flowcontrol/v1beta1/usersubject.go | 8 +-
.../exemptprioritylevelconfiguration.go | 32 +-
.../v1beta2/flowdistinguishermethod.go | 15 +-
.../flowcontrol/v1beta2/flowschema.go | 122 +-
.../v1beta2/flowschemacondition.go | 30 +-
.../flowcontrol/v1beta2/flowschemaspec.go | 24 +-
.../flowcontrol/v1beta2/flowschemastatus.go | 7 +-
.../flowcontrol/v1beta2/groupsubject.go | 10 +-
.../limitedprioritylevelconfiguration.go | 55 +-
.../flowcontrol/v1beta2/limitresponse.go | 21 +-
.../v1beta2/nonresourcepolicyrule.go | 22 +-
.../v1beta2/policyruleswithsubjects.go | 22 +-
.../v1beta2/prioritylevelconfiguration.go | 121 +-
.../prioritylevelconfigurationcondition.go | 30 +-
.../prioritylevelconfigurationreference.go | 8 +-
.../v1beta2/prioritylevelconfigurationspec.go | 30 +-
.../prioritylevelconfigurationstatus.go | 7 +-
.../v1beta2/queuingconfiguration.go | 31 +-
.../flowcontrol/v1beta2/resourcepolicyrule.go | 48 +-
.../v1beta2/serviceaccountsubject.go | 12 +-
.../flowcontrol/v1beta2/subject.go | 22 +-
.../flowcontrol/v1beta2/usersubject.go | 8 +-
.../exemptprioritylevelconfiguration.go | 32 +-
.../v1beta3/flowdistinguishermethod.go | 15 +-
.../flowcontrol/v1beta3/flowschema.go | 122 +-
.../v1beta3/flowschemacondition.go | 30 +-
.../flowcontrol/v1beta3/flowschemaspec.go | 24 +-
.../flowcontrol/v1beta3/flowschemastatus.go | 7 +-
.../flowcontrol/v1beta3/groupsubject.go | 10 +-
.../limitedprioritylevelconfiguration.go | 55 +-
.../flowcontrol/v1beta3/limitresponse.go | 21 +-
.../v1beta3/nonresourcepolicyrule.go | 22 +-
.../v1beta3/policyruleswithsubjects.go | 22 +-
.../v1beta3/prioritylevelconfiguration.go | 121 +-
.../prioritylevelconfigurationcondition.go | 30 +-
.../prioritylevelconfigurationreference.go | 8 +-
.../v1beta3/prioritylevelconfigurationspec.go | 30 +-
.../prioritylevelconfigurationstatus.go | 7 +-
.../v1beta3/queuingconfiguration.go | 31 +-
.../flowcontrol/v1beta3/resourcepolicyrule.go | 48 +-
.../v1beta3/serviceaccountsubject.go | 12 +-
.../flowcontrol/v1beta3/subject.go | 22 +-
.../flowcontrol/v1beta3/usersubject.go | 8 +-
.../imagepolicy/v1alpha1/imagereview.go | 291 +
.../v1alpha1/imagereviewcontainerspec.go | 42 +
.../imagepolicy/v1alpha1/imagereviewspec.go | 75 +
.../imagepolicy/v1alpha1/imagereviewstatus.go | 73 +
.../applyconfigurations/internal/internal.go | 15336 ++++++++++------
.../applyconfigurations/meta/v1/condition.go | 56 +-
.../meta/v1/deleteoptions.go | 76 +-
.../meta/v1/groupresource.go | 51 +
.../meta/v1/labelselector.go | 19 +-
.../meta/v1/labelselectorrequirement.go | 24 +-
.../meta/v1/managedfieldsentry.go | 51 +-
.../applyconfigurations/meta/v1/objectmeta.go | 153 +-
.../meta/v1/ownerreference.go | 36 +-
.../meta/v1/preconditions.go | 12 +-
.../applyconfigurations/meta/v1/typemeta.go | 29 +-
.../meta/v1/unstructured.go | 2 +-
.../networking/v1/httpingresspath.go | 37 +-
.../networking/v1/httpingressrulevalue.go | 11 +-
.../networking/v1/ingress.go | 144 +-
.../networking/v1/ingressbackend.go | 14 +-
.../networking/v1/ingressclass.go | 135 +-
.../v1/ingressclassparametersreference.go | 25 +-
.../networking/v1/ingressclassspec.go | 17 +-
.../v1/ingressloadbalanceringress.go | 15 +-
.../v1/ingressloadbalancerstatus.go | 7 +-
.../networking/v1/ingressportstatus.go | 27 +-
.../networking/v1/ingressrule.go | 41 +-
.../networking/v1/ingressrulevalue.go | 9 +-
.../networking/v1/ingressservicebackend.go | 12 +-
.../networking/v1/ingressspec.go | 35 +-
.../networking/v1/ingressstatus.go | 7 +-
.../networking/v1/ingresstls.go | 19 +-
.../networking/v1/ipaddress.go | 282 +
.../{v1alpha1 => v1}/ipaddressspec.go | 10 +-
.../networking/v1/ipblock.go | 15 +-
.../networking/v1/networkpolicy.go | 130 +-
.../networking/v1/networkpolicyegressrule.go | 20 +-
.../networking/v1/networkpolicyingressrule.go | 19 +-
.../networking/v1/networkpolicypeer.go | 33 +-
.../networking/v1/networkpolicyport.go | 26 +-
.../networking/v1/networkpolicyspec.go | 52 +-
.../{v1alpha1 => v1}/parentreference.go | 18 +-
.../networking/v1/servicebackendport.go | 14 +-
.../networking/v1/servicecidr.go | 294 +
.../{v1alpha1 => v1}/servicecidrspec.go | 11 +-
.../networking/v1/servicecidrstatus.go | 52 +
.../networking/v1beta1/httpingresspath.go | 38 +-
.../v1beta1/httpingressrulevalue.go | 11 +-
.../networking/v1beta1/ingress.go | 126 +-
.../networking/v1beta1/ingressbackend.go | 17 +-
.../networking/v1beta1/ingressclass.go | 119 +-
.../ingressclassparametersreference.go | 25 +-
.../networking/v1beta1/ingressclassspec.go | 17 +-
.../v1beta1/ingressloadbalanceringress.go | 15 +-
.../v1beta1/ingressloadbalancerstatus.go | 7 +-
.../networking/v1beta1/ingressportstatus.go | 21 +-
.../networking/v1beta1/ingressrule.go | 41 +-
.../networking/v1beta1/ingressrulevalue.go | 9 +-
.../networking/v1beta1/ingressspec.go | 35 +-
.../networking/v1beta1/ingressstatus.go | 7 +-
.../networking/v1beta1/ingresstls.go | 19 +-
.../{v1alpha1 => v1beta1}/ipaddress.go | 131 +-
.../networking/v1beta1/ipaddressspec.go | 43 +
.../v1beta1/parentreference.go} | 56 +-
.../{v1alpha1 => v1beta1}/servicecidr.go | 132 +-
.../networking/v1beta1/servicecidrspec.go | 46 +
.../servicecidrstatus.go | 10 +-
.../applyconfigurations/node/v1/overhead.go | 13 +-
.../node/v1/runtimeclass.go | 155 +-
.../applyconfigurations/node/v1/scheduling.go | 23 +-
.../node/v1alpha1/overhead.go | 7 +-
.../node/v1alpha1/runtimeclass.go | 120 +-
.../node/v1alpha1/runtimeclassspec.go | 32 +-
.../node/v1alpha1/scheduling.go | 19 +-
.../node/v1beta1/overhead.go | 7 +-
.../node/v1beta1/runtimeclass.go | 139 +-
.../node/v1beta1/scheduling.go | 19 +-
.../applyconfigurations/policy/v1/eviction.go | 131 +-
.../policy/v1/poddisruptionbudget.go | 139 +-
.../policy/v1/poddisruptionbudgetspec.go | 50 +-
.../policy/v1/poddisruptionbudgetstatus.go | 60 +-
.../policy/v1beta1/eviction.go | 117 +-
.../policy/v1beta1/poddisruptionbudget.go | 121 +-
.../policy/v1beta1/poddisruptionbudgetspec.go | 53 +-
.../v1beta1/poddisruptionbudgetstatus.go | 50 +-
.../rbac/v1/aggregationrule.go | 14 +-
.../rbac/v1/clusterrole.go | 134 +-
.../rbac/v1/clusterrolebinding.go | 135 +-
.../applyconfigurations/rbac/v1/policyrule.go | 27 +-
.../applyconfigurations/rbac/v1/role.go | 129 +-
.../rbac/v1/rolebinding.go | 136 +-
.../applyconfigurations/rbac/v1/roleref.go | 13 +-
.../applyconfigurations/rbac/v1/subject.go | 21 +-
.../rbac/v1alpha1/aggregationrule.go | 8 +-
.../rbac/v1alpha1/clusterrole.go | 119 +-
.../rbac/v1alpha1/clusterrolebinding.go | 119 +-
.../rbac/v1alpha1/policyrule.go | 27 +-
.../applyconfigurations/rbac/v1alpha1/role.go | 114 +-
.../rbac/v1alpha1/rolebinding.go | 120 +-
.../rbac/v1alpha1/roleref.go | 13 +-
.../rbac/v1alpha1/subject.go | 21 +-
.../rbac/v1beta1/aggregationrule.go | 8 +-
.../rbac/v1beta1/clusterrole.go | 119 +-
.../rbac/v1beta1/clusterrolebinding.go | 119 +-
.../rbac/v1beta1/policyrule.go | 28 +-
.../applyconfigurations/rbac/v1beta1/role.go | 114 +-
.../rbac/v1beta1/rolebinding.go | 120 +-
.../rbac/v1beta1/roleref.go | 13 +-
.../rbac/v1beta1/subject.go | 21 +-
.../resource/v1/allocateddevicestatus.go | 132 +
.../resource/v1/allocationresult.go | 72 +
.../resource/v1/capacityrequestpolicy.go | 92 +
.../resource/v1/capacityrequestpolicyrange.go | 83 +
.../resource/v1/capacityrequirements.go | 74 +
.../resource/v1/celdeviceselector.go | 93 +
.../resource/v1/counter.go | 46 +
.../resource/v1/counterset.go | 69 +
.../applyconfigurations/resource/v1/device.go | 244 +
.../v1/deviceallocationconfiguration.go | 74 +
.../resource/v1/deviceallocationresult.go | 68 +
.../resource/v1/deviceattribute.go | 73 +
.../resource/v1/devicecapacity.go | 68 +
.../resource/v1/deviceclaim.go | 81 +
.../resource/v1/deviceclaimconfiguration.go | 58 +
.../resource/v1/deviceclass.go | 287 +
.../resource/v1/deviceclassconfiguration.go | 41 +
.../resource/v1/deviceclassspec.go | 86 +
.../resource/v1/deviceconfiguration.go | 44 +
.../resource/v1/deviceconstraint.go | 96 +
.../resource/v1/devicecounterconsumption.go | 62 +
.../resource/v1/devicerequest.go | 94 +
.../v1/devicerequestallocationresult.go | 199 +
.../resource/v1/deviceselector.go | 42 +
.../resource/v1/devicesubrequest.go | 184 +
.../resource/v1/devicetaint.go | 87 +
.../resource/v1/devicetoleration.go | 100 +
.../resource/v1/exactdevicerequest.go | 182 +
.../resource/v1/networkdevicedata.go | 76 +
.../resource/v1/opaquedeviceconfiguration.go | 69 +
.../resource/v1/resourceclaim.go | 300 +
.../resourceclaimconsumerreference.go | 24 +-
.../resource/v1/resourceclaimspec.go | 42 +
.../resource/v1/resourceclaimstatus.go | 93 +
.../resource/v1/resourceclaimtemplate.go | 283 +
.../resource/v1/resourceclaimtemplatespec.go | 208 +
.../resource/v1/resourcepool.go | 81 +
.../resource/v1/resourceslice.go | 299 +
.../resource/v1/resourceslicespec.go | 165 +
.../resource/v1alpha2/allocationresult.go | 66 -
.../v1alpha2/podschedulingcontextspec.go | 50 -
.../v1alpha2/podschedulingcontextstatus.go | 44 -
.../v1alpha2/resourceclaimschedulingstatus.go | 50 -
.../resource/v1alpha2/resourceclaimspec.go | 61 -
.../resource/v1alpha2/resourceclaimstatus.go | 71 -
.../resource/v1alpha2/resourceclass.go | 266 -
.../resource/v1alpha2/resourcehandle.go | 48 -
.../resource/v1alpha3/devicetaint.go | 87 +
.../resource/v1alpha3/devicetaintrule.go | 294 +
.../resource/v1alpha3/devicetaintrulespec.go | 55 +
.../v1alpha3/devicetaintrulestatus.go | 70 +
.../resource/v1alpha3/devicetaintselector.go | 76 +
.../resource/v1beta1/allocateddevicestatus.go | 132 +
.../resource/v1beta1/allocationresult.go | 72 +
.../resource/v1beta1/basicdevice.go | 232 +
.../resource/v1beta1/capacityrequestpolicy.go | 92 +
.../v1beta1/capacityrequestpolicyrange.go | 83 +
.../resource/v1beta1/capacityrequirements.go | 74 +
.../resource/v1beta1/celdeviceselector.go | 93 +
.../resource/v1beta1/counter.go | 46 +
.../resource/v1beta1/counterset.go | 69 +
.../resource/v1beta1/device.go | 54 +
.../v1beta1/deviceallocationconfiguration.go | 74 +
.../v1beta1/deviceallocationresult.go | 68 +
.../resource/v1beta1/deviceattribute.go | 73 +
.../resource/v1beta1/devicecapacity.go | 68 +
.../resource/v1beta1/deviceclaim.go | 81 +
.../v1beta1/deviceclaimconfiguration.go | 58 +
.../resource/v1beta1/deviceclass.go | 287 +
.../v1beta1/deviceclassconfiguration.go | 41 +
.../resource/v1beta1/deviceclassspec.go | 86 +
.../resource/v1beta1/deviceconfiguration.go | 44 +
.../resource/v1beta1/deviceconstraint.go | 96 +
.../v1beta1/devicecounterconsumption.go | 62 +
.../resource/v1beta1/devicerequest.go | 245 +
.../v1beta1/devicerequestallocationresult.go | 199 +
.../resource/v1beta1/deviceselector.go | 42 +
.../resource/v1beta1/devicesubrequest.go | 185 +
.../resource/v1beta1/devicetaint.go | 87 +
.../resource/v1beta1/devicetoleration.go | 100 +
.../resource/v1beta1/networkdevicedata.go | 78 +
.../v1beta1/opaquedeviceconfiguration.go | 69 +
.../{v1alpha2 => v1beta1}/resourceclaim.go | 138 +-
.../v1beta1/resourceclaimconsumerreference.go | 80 +
.../resource/v1beta1/resourceclaimspec.go | 42 +
.../resource/v1beta1/resourceclaimstatus.go | 93 +
.../resourceclaimtemplate.go | 130 +-
.../resourceclaimtemplatespec.go | 62 +-
.../resource/v1beta1/resourcepool.go | 81 +
.../resource/v1beta1/resourceslice.go | 299 +
.../resource/v1beta1/resourceslicespec.go | 165 +
.../resource/v1beta2/allocateddevicestatus.go | 132 +
.../resource/v1beta2/allocationresult.go | 72 +
.../resource/v1beta2/capacityrequestpolicy.go | 92 +
.../v1beta2/capacityrequestpolicyrange.go | 83 +
.../resource/v1beta2/capacityrequirements.go | 74 +
.../resource/v1beta2/celdeviceselector.go | 93 +
.../resource/v1beta2/counter.go | 46 +
.../resource/v1beta2/counterset.go | 69 +
.../resource/v1beta2/device.go | 244 +
.../v1beta2/deviceallocationconfiguration.go | 74 +
.../v1beta2/deviceallocationresult.go | 68 +
.../resource/v1beta2/deviceattribute.go | 73 +
.../resource/v1beta2/devicecapacity.go | 68 +
.../resource/v1beta2/deviceclaim.go | 81 +
.../v1beta2/deviceclaimconfiguration.go | 58 +
.../resource/v1beta2/deviceclass.go | 287 +
.../v1beta2/deviceclassconfiguration.go | 41 +
.../resource/v1beta2/deviceclassspec.go | 86 +
.../resource/v1beta2/deviceconfiguration.go | 44 +
.../resource/v1beta2/deviceconstraint.go | 96 +
.../v1beta2/devicecounterconsumption.go | 62 +
.../resource/v1beta2/devicerequest.go | 94 +
.../v1beta2/devicerequestallocationresult.go | 199 +
.../resource/v1beta2/deviceselector.go | 42 +
.../resource/v1beta2/devicesubrequest.go | 184 +
.../resource/v1beta2/devicetaint.go | 87 +
.../resource/v1beta2/devicetoleration.go | 100 +
.../resource/v1beta2/exactdevicerequest.go | 182 +
.../resource/v1beta2/networkdevicedata.go | 76 +
.../v1beta2/opaquedeviceconfiguration.go | 69 +
.../resource/v1beta2/resourceclaim.go | 300 +
.../v1beta2/resourceclaimconsumerreference.go | 80 +
.../resource/v1beta2/resourceclaimspec.go | 42 +
.../resource/v1beta2/resourceclaimstatus.go | 93 +
.../resource/v1beta2/resourceclaimtemplate.go | 283 +
.../v1beta2/resourceclaimtemplatespec.go | 208 +
.../resource/v1beta2/resourcepool.go | 81 +
.../resource/v1beta2/resourceslice.go | 299 +
.../resource/v1beta2/resourceslicespec.go | 165 +
.../scheduling/v1/priorityclass.go | 146 +-
.../v1alpha1/gangschedulingpolicy.go | 44 +
.../scheduling/v1alpha1/podgroup.go | 53 +
.../scheduling/v1alpha1/podgrouppolicy.go | 58 +
.../scheduling/v1alpha1/priorityclass.go | 135 +-
.../v1alpha1/typedlocalobjectreference.go} | 32 +-
.../v1alpha1/workload.go} | 183 +-
.../scheduling/v1alpha1/workloadspec.go | 61 +
.../scheduling/v1beta1/priorityclass.go | 135 +-
.../storage/v1/csidriver.go | 140 +-
.../storage/v1/csidriverspec.go | 187 +-
.../applyconfigurations/storage/v1/csinode.go | 138 +-
.../storage/v1/csinodedriver.go | 38 +-
.../storage/v1/csinodespec.go | 8 +-
.../storage/v1/csistoragecapacity.go | 194 +-
.../storage/v1/storageclass.go | 159 +-
.../storage/v1/tokenrequest.go | 14 +-
.../storage/v1/volumeattachment.go | 145 +-
.../storage/v1/volumeattachmentsource.go | 24 +-
.../storage/v1/volumeattachmentspec.go | 16 +-
.../storage/v1/volumeattachmentstatus.go | 28 +-
.../storage/v1/volumeattributesclass.go | 306 +
.../storage/v1/volumeerror.go | 30 +-
.../storage/v1/volumenoderesources.go | 10 +-
.../storage/v1alpha1/csistoragecapacity.go | 180 +-
.../storage/v1alpha1/volumeattachment.go | 125 +-
.../v1alpha1/volumeattachmentsource.go | 20 +-
.../storage/v1alpha1/volumeattachmentspec.go | 16 +-
.../v1alpha1/volumeattachmentstatus.go | 28 +-
.../storage/v1alpha1/volumeattributesclass.go | 134 +-
.../storage/v1alpha1/volumeerror.go | 26 +-
.../storage/v1beta1/csidriver.go | 127 +-
.../storage/v1beta1/csidriverspec.go | 187 +-
.../storage/v1beta1/csinode.go | 123 +-
.../storage/v1beta1/csinodedriver.go | 37 +-
.../storage/v1beta1/csinodespec.go | 8 +-
.../storage/v1beta1/csistoragecapacity.go | 180 +-
.../storage/v1beta1/storageclass.go | 149 +-
.../storage/v1beta1/tokenrequest.go | 14 +-
.../storage/v1beta1/volumeattachment.go | 125 +-
.../storage/v1beta1/volumeattachmentsource.go | 20 +-
.../storage/v1beta1/volumeattachmentspec.go | 16 +-
.../storage/v1beta1/volumeattachmentstatus.go | 28 +-
.../storage/v1beta1/volumeattributesclass.go | 306 +
.../storage/v1beta1/volumeerror.go | 26 +-
.../storage/v1beta1/volumenoderesources.go | 10 +-
.../v1beta1/storageversionmigration.go | 292 +
.../v1beta1/storageversionmigrationspec.go | 48 +
.../v1beta1/storageversionmigrationstatus.go | 63 +
.../client-go/applyconfigurations/utils.go | 2004 ++
.../discovery/aggregated_discovery.go | 124 +-
.../client-go/discovery/discovery_client.go | 60 +-
vendor/k8s.io/client-go/discovery/doc.go | 2 +-
.../client-go/discovery/fake/discovery.go | 180 +
.../dynamic/dynamicinformer/informer.go | 20 +-
.../k8s.io/client-go/dynamic/fake/simple.go | 548 +
vendor/k8s.io/client-go/dynamic/scheme.go | 66 +-
vendor/k8s.io/client-go/dynamic/simple.go | 193 +-
vendor/k8s.io/client-go/features/envvar.go | 188 +
vendor/k8s.io/client-go/features/features.go | 182 +
.../client-go/features/known_features.go | 105 +
vendor/k8s.io/client-go/gentype/fake.go | 305 +
vendor/k8s.io/client-go/gentype/type.go | 348 +
.../admissionregistration/v1/interface.go | 14 +
.../v1/mutatingwebhookconfiguration.go | 36 +-
.../v1/validatingadmissionpolicy.go | 101 +
.../v1/validatingadmissionpolicybinding.go | 101 +
.../v1/validatingwebhookconfiguration.go | 36 +-
.../v1alpha1/interface.go | 14 +
.../v1alpha1/mutatingadmissionpolicy.go | 101 +
.../mutatingadmissionpolicybinding.go | 101 +
.../v1alpha1/validatingadmissionpolicy.go | 36 +-
.../validatingadmissionpolicybinding.go | 36 +-
.../v1beta1/interface.go | 14 +
.../v1beta1/mutatingadmissionpolicy.go | 101 +
.../v1beta1/mutatingadmissionpolicybinding.go | 101 +
.../v1beta1/mutatingwebhookconfiguration.go | 36 +-
.../v1beta1/validatingadmissionpolicy.go | 36 +-
.../validatingadmissionpolicybinding.go | 36 +-
.../v1beta1/validatingwebhookconfiguration.go | 36 +-
.../v1alpha1/storageversion.go | 36 +-
.../informers/apps/v1/controllerrevision.go | 36 +-
.../client-go/informers/apps/v1/daemonset.go | 36 +-
.../client-go/informers/apps/v1/deployment.go | 36 +-
.../client-go/informers/apps/v1/replicaset.go | 36 +-
.../informers/apps/v1/statefulset.go | 36 +-
.../apps/v1beta1/controllerrevision.go | 36 +-
.../informers/apps/v1beta1/deployment.go | 36 +-
.../informers/apps/v1beta1/statefulset.go | 36 +-
.../apps/v1beta2/controllerrevision.go | 36 +-
.../informers/apps/v1beta2/daemonset.go | 36 +-
.../informers/apps/v1beta2/deployment.go | 36 +-
.../informers/apps/v1beta2/replicaset.go | 36 +-
.../informers/apps/v1beta2/statefulset.go | 36 +-
.../autoscaling/v1/horizontalpodautoscaler.go | 36 +-
.../autoscaling/v2/horizontalpodautoscaler.go | 36 +-
.../v2beta1/horizontalpodautoscaler.go | 36 +-
.../v2beta2/horizontalpodautoscaler.go | 36 +-
.../client-go/informers/batch/v1/cronjob.go | 36 +-
.../client-go/informers/batch/v1/job.go | 36 +-
.../informers/batch/v1beta1/cronjob.go | 36 +-
.../v1/certificatesigningrequest.go | 36 +-
.../v1alpha1/clustertrustbundle.go | 36 +-
.../v1beta1/certificatesigningrequest.go | 36 +-
.../v1beta1/clustertrustbundle.go | 101 +
.../certificates/v1beta1/interface.go | 14 +
.../v1beta1/podcertificaterequest.go | 102 +
.../informers/coordination/interface.go | 8 +
.../informers/coordination/v1/lease.go | 36 +-
.../v1alpha2}/interface.go | 19 +-
.../coordination/v1alpha2/leasecandidate.go | 102 +
.../coordination/v1beta1/interface.go | 7 +
.../informers/coordination/v1beta1/lease.go | 36 +-
.../coordination/v1beta1/leasecandidate.go | 102 +
.../informers/core/v1/componentstatus.go | 36 +-
.../client-go/informers/core/v1/configmap.go | 36 +-
.../client-go/informers/core/v1/endpoints.go | 36 +-
.../client-go/informers/core/v1/event.go | 36 +-
.../client-go/informers/core/v1/limitrange.go | 36 +-
.../client-go/informers/core/v1/namespace.go | 36 +-
.../client-go/informers/core/v1/node.go | 36 +-
.../informers/core/v1/persistentvolume.go | 36 +-
.../core/v1/persistentvolumeclaim.go | 36 +-
.../k8s.io/client-go/informers/core/v1/pod.go | 36 +-
.../informers/core/v1/podtemplate.go | 36 +-
.../core/v1/replicationcontroller.go | 36 +-
.../informers/core/v1/resourcequota.go | 36 +-
.../client-go/informers/core/v1/secret.go | 36 +-
.../client-go/informers/core/v1/service.go | 36 +-
.../informers/core/v1/serviceaccount.go | 36 +-
.../informers/discovery/v1/endpointslice.go | 36 +-
.../discovery/v1beta1/endpointslice.go | 36 +-
.../client-go/informers/events/v1/event.go | 36 +-
.../informers/events/v1beta1/event.go | 36 +-
.../informers/extensions/v1beta1/daemonset.go | 36 +-
.../extensions/v1beta1/deployment.go | 36 +-
.../informers/extensions/v1beta1/ingress.go | 36 +-
.../extensions/v1beta1/networkpolicy.go | 36 +-
.../extensions/v1beta1/replicaset.go | 36 +-
vendor/k8s.io/client-go/informers/factory.go | 10 +-
.../informers/flowcontrol/v1/flowschema.go | 36 +-
.../v1/prioritylevelconfiguration.go | 36 +-
.../flowcontrol/v1beta1/flowschema.go | 36 +-
.../v1beta1/prioritylevelconfiguration.go | 36 +-
.../flowcontrol/v1beta2/flowschema.go | 36 +-
.../v1beta2/prioritylevelconfiguration.go | 36 +-
.../flowcontrol/v1beta3/flowschema.go | 36 +-
.../v1beta3/prioritylevelconfiguration.go | 36 +-
vendor/k8s.io/client-go/informers/generic.go | 98 +-
.../informers/networking/interface.go | 8 -
.../informers/networking/v1/ingress.go | 36 +-
.../informers/networking/v1/ingressclass.go | 36 +-
.../informers/networking/v1/interface.go | 14 +
.../informers/networking/v1/ipaddress.go | 101 +
.../informers/networking/v1/networkpolicy.go | 36 +-
.../informers/networking/v1/servicecidr.go | 101 +
.../informers/networking/v1beta1/ingress.go | 36 +-
.../networking/v1beta1/ingressclass.go | 36 +-
.../informers/networking/v1beta1/interface.go | 14 +
.../{v1alpha1 => v1beta1}/ipaddress.go | 38 +-
.../{v1alpha1 => v1beta1}/servicecidr.go | 38 +-
.../informers/node/v1/runtimeclass.go | 36 +-
.../informers/node/v1alpha1/runtimeclass.go | 36 +-
.../informers/node/v1beta1/runtimeclass.go | 36 +-
.../policy/v1/poddisruptionbudget.go | 36 +-
.../policy/v1beta1/poddisruptionbudget.go | 36 +-
.../informers/rbac/v1/clusterrole.go | 36 +-
.../informers/rbac/v1/clusterrolebinding.go | 36 +-
.../client-go/informers/rbac/v1/role.go | 36 +-
.../informers/rbac/v1/rolebinding.go | 36 +-
.../informers/rbac/v1alpha1/clusterrole.go | 36 +-
.../rbac/v1alpha1/clusterrolebinding.go | 36 +-
.../client-go/informers/rbac/v1alpha1/role.go | 36 +-
.../informers/rbac/v1alpha1/rolebinding.go | 36 +-
.../informers/rbac/v1beta1/clusterrole.go | 36 +-
.../rbac/v1beta1/clusterrolebinding.go | 36 +-
.../client-go/informers/rbac/v1beta1/role.go | 36 +-
.../informers/rbac/v1beta1/rolebinding.go | 36 +-
.../client-go/informers/resource/interface.go | 36 +-
.../informers/resource/v1/deviceclass.go | 101 +
.../resource/{v1alpha2 => v1}/interface.go | 22 +-
.../informers/resource/v1/resourceclaim.go | 102 +
.../resource/v1/resourceclaimtemplate.go | 102 +
.../informers/resource/v1/resourceslice.go | 101 +
.../resource/v1alpha2/podschedulingcontext.go | 90 -
.../resource/v1alpha3/devicetaintrule.go | 101 +
.../informers/resource/v1alpha3/interface.go | 45 +
.../informers/resource/v1beta1/deviceclass.go | 101 +
.../informers/resource/v1beta1/interface.go | 66 +
.../resource/v1beta1/resourceclaim.go | 102 +
.../resourceclaimtemplate.go | 38 +-
.../resourceslice.go} | 62 +-
.../informers/resource/v1beta2/deviceclass.go | 101 +
.../informers/resource/v1beta2/interface.go | 66 +
.../{v1alpha2 => v1beta2}/resourceclaim.go | 38 +-
.../resource/v1beta2/resourceclaimtemplate.go | 102 +
.../resource/v1beta2/resourceslice.go | 101 +
.../informers/scheduling/v1/priorityclass.go | 36 +-
.../scheduling/v1alpha1/interface.go | 7 +
.../scheduling/v1alpha1/priorityclass.go | 36 +-
.../informers/scheduling/v1alpha1/workload.go | 102 +
.../scheduling/v1beta1/priorityclass.go | 36 +-
.../informers/storage/v1/csidriver.go | 36 +-
.../client-go/informers/storage/v1/csinode.go | 36 +-
.../storage/v1/csistoragecapacity.go | 36 +-
.../informers/storage/v1/interface.go | 7 +
.../informers/storage/v1/storageclass.go | 36 +-
.../informers/storage/v1/volumeattachment.go | 36 +-
.../storage/v1/volumeattributesclass.go | 101 +
.../storage/v1alpha1/csistoragecapacity.go | 36 +-
.../storage/v1alpha1/volumeattachment.go | 36 +-
.../storage/v1alpha1/volumeattributesclass.go | 36 +-
.../informers/storage/v1beta1/csidriver.go | 36 +-
.../informers/storage/v1beta1/csinode.go | 36 +-
.../storage/v1beta1/csistoragecapacity.go | 36 +-
.../informers/storage/v1beta1/interface.go | 7 +
.../informers/storage/v1beta1/storageclass.go | 36 +-
.../storage/v1beta1/volumeattachment.go | 36 +-
.../storage/v1beta1/volumeattributesclass.go | 101 +
.../informers/storagemigration/interface.go | 46 +
.../storagemigration/v1beta1/interface.go | 45 +
.../v1beta1/storageversionmigration.go | 101 +
.../k8s.io/client-go/kubernetes/clientset.go | 98 +-
.../kubernetes/fake/clientset_generated.go | 520 +
.../k8s.io/client-go/kubernetes/fake/doc.go | 20 +
.../client-go/kubernetes/fake/register.go | 164 +
vendor/k8s.io/client-go/kubernetes/import.go | 2 +-
.../client-go/kubernetes/scheme/register.go | 16 +-
.../v1/admissionregistration_client.go | 32 +-
.../admissionregistration/v1/fake/doc.go | 20 +
.../fake/fake_admissionregistration_client.go | 52 +
.../fake/fake_mutatingwebhookconfiguration.go | 53 +
.../v1/fake/fake_validatingadmissionpolicy.go | 53 +
.../fake_validatingadmissionpolicybinding.go | 53 +
.../fake_validatingwebhookconfiguration.go | 53 +
.../v1/generated_expansion.go | 4 +
.../v1/mutatingwebhookconfiguration.go | 170 +-
.../v1/validatingadmissionpolicy.go | 79 +
.../v1/validatingadmissionpolicybinding.go | 75 +
.../v1/validatingwebhookconfiguration.go | 170 +-
.../v1alpha1/admissionregistration_client.go | 32 +-
.../v1alpha1/fake/doc.go | 20 +
.../fake/fake_admissionregistration_client.go | 52 +
.../fake/fake_mutatingadmissionpolicy.go | 53 +
.../fake_mutatingadmissionpolicybinding.go | 55 +
.../fake/fake_validatingadmissionpolicy.go | 53 +
.../fake_validatingadmissionpolicybinding.go | 55 +
.../v1alpha1/generated_expansion.go | 4 +
.../v1alpha1/mutatingadmissionpolicy.go | 75 +
.../mutatingadmissionpolicybinding.go | 75 +
.../v1alpha1/validatingadmissionpolicy.go | 220 +-
.../validatingadmissionpolicybinding.go | 170 +-
.../v1beta1/admissionregistration_client.go | 32 +-
.../admissionregistration/v1beta1/fake/doc.go | 20 +
.../fake/fake_admissionregistration_client.go | 60 +
.../fake/fake_mutatingadmissionpolicy.go | 53 +
.../fake_mutatingadmissionpolicybinding.go | 55 +
.../fake/fake_mutatingwebhookconfiguration.go | 53 +
.../fake/fake_validatingadmissionpolicy.go | 53 +
.../fake_validatingadmissionpolicybinding.go | 55 +
.../fake_validatingwebhookconfiguration.go | 55 +
.../v1beta1/generated_expansion.go | 4 +
.../v1beta1/mutatingadmissionpolicy.go | 75 +
.../v1beta1/mutatingadmissionpolicybinding.go | 75 +
.../v1beta1/mutatingwebhookconfiguration.go | 170 +-
.../v1beta1/validatingadmissionpolicy.go | 220 +-
.../validatingadmissionpolicybinding.go | 170 +-
.../v1beta1/validatingwebhookconfiguration.go | 170 +-
.../v1alpha1/apiserverinternal_client.go | 22 +-
.../apiserverinternal/v1alpha1/fake/doc.go | 20 +
.../fake/fake_apiserverinternal_client.go | 40 +
.../v1alpha1/fake/fake_storageversion.go | 53 +
.../v1alpha1/storageversion.go | 218 +-
.../kubernetes/typed/apps/v1/apps_client.go | 22 +-
.../typed/apps/v1/controllerrevision.go | 177 +-
.../kubernetes/typed/apps/v1/daemonset.go | 229 +-
.../kubernetes/typed/apps/v1/deployment.go | 249 +-
.../kubernetes/typed/apps/v1/fake/doc.go | 20 +
.../typed/apps/v1/fake/fake_apps_client.go | 56 +
.../apps/v1/fake/fake_controllerrevision.go | 53 +
.../typed/apps/v1/fake/fake_daemonset.go | 49 +
.../typed/apps/v1/fake/fake_deployment.go | 102 +
.../typed/apps/v1/fake/fake_replicaset.go | 102 +
.../typed/apps/v1/fake/fake_statefulset.go | 102 +
.../kubernetes/typed/apps/v1/replicaset.go | 249 +-
.../kubernetes/typed/apps/v1/statefulset.go | 249 +-
.../typed/apps/v1beta1/apps_client.go | 22 +-
.../typed/apps/v1beta1/controllerrevision.go | 177 +-
.../typed/apps/v1beta1/deployment.go | 229 +-
.../kubernetes/typed/apps/v1beta1/fake/doc.go | 20 +
.../apps/v1beta1/fake/fake_apps_client.go | 48 +
.../v1beta1/fake/fake_controllerrevision.go | 53 +
.../apps/v1beta1/fake/fake_deployment.go | 51 +
.../apps/v1beta1/fake/fake_statefulset.go | 51 +
.../typed/apps/v1beta1/statefulset.go | 229 +-
.../typed/apps/v1beta2/apps_client.go | 22 +-
.../typed/apps/v1beta2/controllerrevision.go | 177 +-
.../typed/apps/v1beta2/daemonset.go | 229 +-
.../typed/apps/v1beta2/deployment.go | 229 +-
.../kubernetes/typed/apps/v1beta2/fake/doc.go | 20 +
.../apps/v1beta2/fake/fake_apps_client.go | 56 +
.../v1beta2/fake/fake_controllerrevision.go | 53 +
.../typed/apps/v1beta2/fake/fake_daemonset.go | 51 +
.../apps/v1beta2/fake/fake_deployment.go | 51 +
.../apps/v1beta2/fake/fake_replicaset.go | 51 +
.../apps/v1beta2/fake/fake_statefulset.go | 102 +
.../typed/apps/v1beta2/replicaset.go | 229 +-
.../typed/apps/v1beta2/statefulset.go | 269 +-
.../v1/authentication_client.go | 22 +-
.../typed/authentication/v1/fake/doc.go | 20 +
.../v1/fake/fake_authentication_client.go | 44 +
.../v1/fake/fake_selfsubjectreview.go | 44 +
.../v1/fake/fake_tokenreview.go | 44 +
.../authentication/v1/selfsubjectreview.go | 31 +-
.../typed/authentication/v1/tokenreview.go | 31 +-
.../v1alpha1/authentication_client.go | 22 +-
.../typed/authentication/v1alpha1/fake/doc.go | 20 +
.../fake/fake_authentication_client.go | 40 +
.../v1alpha1/fake/fake_selfsubjectreview.go | 44 +
.../v1alpha1/selfsubjectreview.go | 31 +-
.../v1beta1/authentication_client.go | 22 +-
.../typed/authentication/v1beta1/fake/doc.go | 20 +
.../fake/fake_authentication_client.go | 44 +
.../v1beta1/fake/fake_selfsubjectreview.go | 44 +
.../v1beta1/fake/fake_tokenreview.go | 44 +
.../v1beta1/selfsubjectreview.go | 31 +-
.../authentication/v1beta1/tokenreview.go | 31 +-
.../authorization/v1/authorization_client.go | 22 +-
.../typed/authorization/v1/fake/doc.go | 20 +
.../v1/fake/fake_authorization_client.go | 52 +
.../v1/fake/fake_localsubjectaccessreview.go | 44 +
.../v1/fake/fake_selfsubjectaccessreview.go | 44 +
.../v1/fake/fake_selfsubjectrulesreview.go | 44 +
.../v1/fake/fake_subjectaccessreview.go | 44 +
.../v1/localsubjectaccessreview.go | 34 +-
.../v1/selfsubjectaccessreview.go | 31 +-
.../v1/selfsubjectrulesreview.go | 31 +-
.../authorization/v1/subjectaccessreview.go | 31 +-
.../v1beta1/authorization_client.go | 22 +-
.../typed/authorization/v1beta1/fake/doc.go | 20 +
.../v1beta1/fake/fake_authorization_client.go | 52 +
.../fake/fake_localsubjectaccessreview.go | 44 +
.../fake/fake_selfsubjectaccessreview.go | 44 +
.../fake/fake_selfsubjectrulesreview.go | 44 +
.../v1beta1/fake/fake_subjectaccessreview.go | 44 +
.../v1beta1/localsubjectaccessreview.go | 36 +-
.../v1beta1/selfsubjectaccessreview.go | 33 +-
.../v1beta1/selfsubjectrulesreview.go | 33 +-
.../v1beta1/subjectaccessreview.go | 31 +-
.../autoscaling/v1/autoscaling_client.go | 22 +-
.../typed/autoscaling/v1/fake/doc.go | 20 +
.../v1/fake/fake_autoscaling_client.go | 40 +
.../v1/fake/fake_horizontalpodautoscaler.go | 53 +
.../autoscaling/v1/horizontalpodautoscaler.go | 229 +-
.../autoscaling/v2/autoscaling_client.go | 22 +-
.../typed/autoscaling/v2/fake/doc.go | 20 +
.../v2/fake/fake_autoscaling_client.go | 40 +
.../v2/fake/fake_horizontalpodautoscaler.go | 53 +
.../autoscaling/v2/horizontalpodautoscaler.go | 229 +-
.../autoscaling/v2beta1/autoscaling_client.go | 22 +-
.../typed/autoscaling/v2beta1/fake/doc.go | 20 +
.../v2beta1/fake/fake_autoscaling_client.go | 40 +
.../fake/fake_horizontalpodautoscaler.go | 53 +
.../v2beta1/horizontalpodautoscaler.go | 233 +-
.../autoscaling/v2beta2/autoscaling_client.go | 22 +-
.../typed/autoscaling/v2beta2/fake/doc.go | 20 +
.../v2beta2/fake/fake_autoscaling_client.go | 40 +
.../fake/fake_horizontalpodautoscaler.go | 53 +
.../v2beta2/horizontalpodautoscaler.go | 233 +-
.../kubernetes/typed/batch/v1/batch_client.go | 22 +-
.../kubernetes/typed/batch/v1/cronjob.go | 229 +-
.../kubernetes/typed/batch/v1/fake/doc.go | 20 +
.../typed/batch/v1/fake/fake_batch_client.go | 44 +
.../typed/batch/v1/fake/fake_cronjob.go | 49 +
.../typed/batch/v1/fake/fake_job.go | 49 +
.../kubernetes/typed/batch/v1/job.go | 229 +-
.../typed/batch/v1beta1/batch_client.go | 22 +-
.../kubernetes/typed/batch/v1beta1/cronjob.go | 229 +-
.../typed/batch/v1beta1/fake/doc.go | 20 +
.../batch/v1beta1/fake/fake_batch_client.go | 40 +
.../typed/batch/v1beta1/fake/fake_cronjob.go | 51 +
.../certificates/v1/certificates_client.go | 22 +-
.../v1/certificatesigningrequest.go | 227 +-
.../typed/certificates/v1/fake/doc.go | 20 +
.../v1/fake/fake_certificates_client.go | 40 +
.../v1/fake/fake_certificatesigningrequest.go | 68 +
.../v1alpha1/certificates_client.go | 22 +-
.../v1alpha1/clustertrustbundle.go | 168 +-
.../typed/certificates/v1alpha1/fake/doc.go | 20 +
.../v1alpha1/fake/fake_certificates_client.go | 40 +
.../v1alpha1/fake/fake_clustertrustbundle.go | 53 +
.../v1beta1/certificates_client.go | 32 +-
.../v1beta1/certificatesigningrequest.go | 220 +-
.../certificatesigningrequest_expansion.go | 2 +-
.../v1beta1/clustertrustbundle.go | 73 +
.../typed/certificates/v1beta1/fake/doc.go | 20 +
.../v1beta1/fake/fake_certificates_client.go | 48 +
.../fake/fake_certificatesigningrequest.go | 53 +
...ake_certificatesigningrequest_expansion.go | 34 +
.../v1beta1/fake/fake_clustertrustbundle.go | 53 +
.../fake/fake_podcertificaterequest.go | 53 +
.../v1beta1/generated_expansion.go | 4 +
.../v1beta1/podcertificaterequest.go | 77 +
.../coordination/v1/coordination_client.go | 22 +-
.../typed/coordination/v1/fake/doc.go | 20 +
.../v1/fake/fake_coordination_client.go | 40 +
.../typed/coordination/v1/fake/fake_lease.go | 49 +
.../kubernetes/typed/coordination/v1/lease.go | 177 +-
.../v1alpha2/coordination_client.go | 101 +
.../v1alpha2/doc.go | 0
.../typed/coordination/v1alpha2/fake/doc.go | 20 +
.../v1alpha2/fake/fake_coordination_client.go | 40 +
.../v1alpha2/fake/fake_leasecandidate.go | 53 +
.../v1alpha2}/generated_expansion.go | 6 +-
.../coordination/v1alpha2/leasecandidate.go | 71 +
.../v1beta1/coordination_client.go | 27 +-
.../typed/coordination/v1beta1/fake/doc.go | 20 +
.../v1beta1/fake/fake_coordination_client.go | 44 +
.../coordination/v1beta1/fake/fake_lease.go | 49 +
.../v1beta1/fake/fake_leasecandidate.go | 53 +
.../v1beta1/generated_expansion.go | 2 +
.../typed/coordination/v1beta1/lease.go | 177 +-
.../coordination/v1beta1/leasecandidate.go | 71 +
.../typed/core/v1/componentstatus.go | 166 +-
.../kubernetes/typed/core/v1/configmap.go | 177 +-
.../kubernetes/typed/core/v1/core_client.go | 22 +-
.../kubernetes/typed/core/v1/endpoints.go | 177 +-
.../kubernetes/typed/core/v1/event.go | 177 +-
.../typed/core/v1/event_expansion.go | 87 +-
.../kubernetes/typed/core/v1/fake/doc.go | 20 +
.../core/v1/fake/fake_componentstatus.go | 51 +
.../typed/core/v1/fake/fake_configmap.go | 49 +
.../typed/core/v1/fake/fake_core_client.go | 100 +
.../typed/core/v1/fake/fake_endpoints.go | 49 +
.../typed/core/v1/fake/fake_event.go | 49 +
.../core/v1/fake/fake_event_expansion.go | 130 +
.../typed/core/v1/fake/fake_limitrange.go | 49 +
.../typed/core/v1/fake/fake_namespace.go | 49 +
.../core/v1/fake/fake_namespace_expansion.go | 40 +
.../typed/core/v1/fake/fake_node.go | 49 +
.../typed/core/v1/fake/fake_node_expansion.go | 38 +
.../core/v1/fake/fake_persistentvolume.go | 51 +
.../v1/fake/fake_persistentvolumeclaim.go | 53 +
.../kubernetes/typed/core/v1/fake/fake_pod.go | 77 +
.../typed/core/v1/fake/fake_pod_expansion.go | 112 +
.../typed/core/v1/fake/fake_podtemplate.go | 49 +
.../v1/fake/fake_replicationcontroller.go | 82 +
.../typed/core/v1/fake/fake_resourcequota.go | 51 +
.../typed/core/v1/fake/fake_secret.go | 49 +
.../typed/core/v1/fake/fake_service.go | 49 +
.../core/v1/fake/fake_service_expansion.go} | 12 +-
.../typed/core/v1/fake/fake_serviceaccount.go | 68 +
.../kubernetes/typed/core/v1/limitrange.go | 177 +-
.../kubernetes/typed/core/v1/namespace.go | 201 +-
.../typed/core/v1/namespace_expansion.go | 2 +-
.../kubernetes/typed/core/v1/node.go | 216 +-
.../typed/core/v1/node_expansion.go | 2 +-
.../typed/core/v1/persistentvolume.go | 216 +-
.../typed/core/v1/persistentvolumeclaim.go | 229 +-
.../client-go/kubernetes/typed/core/v1/pod.go | 245 +-
.../kubernetes/typed/core/v1/pod_expansion.go | 14 +-
.../kubernetes/typed/core/v1/podtemplate.go | 177 +-
.../typed/core/v1/replicationcontroller.go | 239 +-
.../kubernetes/typed/core/v1/resourcequota.go | 229 +-
.../kubernetes/typed/core/v1/secret.go | 177 +-
.../kubernetes/typed/core/v1/service.go | 213 +-
.../typed/core/v1/service_expansion.go | 4 +-
.../typed/core/v1/serviceaccount.go | 182 +-
.../typed/discovery/v1/discovery_client.go | 22 +-
.../typed/discovery/v1/endpointslice.go | 177 +-
.../kubernetes/typed/discovery/v1/fake/doc.go | 20 +
.../v1/fake/fake_discovery_client.go | 40 +
.../discovery/v1/fake/fake_endpointslice.go | 51 +
.../discovery/v1beta1/discovery_client.go | 22 +-
.../typed/discovery/v1beta1/endpointslice.go | 177 +-
.../typed/discovery/v1beta1/fake/doc.go | 20 +
.../v1beta1/fake/fake_discovery_client.go | 40 +
.../v1beta1/fake/fake_endpointslice.go | 53 +
.../kubernetes/typed/events/v1/event.go | 177 +-
.../typed/events/v1/events_client.go | 22 +-
.../kubernetes/typed/events/v1/fake/doc.go | 20 +
.../typed/events/v1/fake/fake_event.go | 49 +
.../events/v1/fake/fake_events_client.go | 40 +
.../kubernetes/typed/events/v1beta1/event.go | 177 +-
.../typed/events/v1beta1/event_expansion.go | 24 +-
.../typed/events/v1beta1/events_client.go | 22 +-
.../typed/events/v1beta1/fake/doc.go | 20 +
.../typed/events/v1beta1/fake/fake_event.go | 49 +
.../v1beta1/fake/fake_event_expansion.go | 66 +
.../events/v1beta1/fake/fake_events_client.go | 40 +
.../typed/extensions/v1beta1/daemonset.go | 229 +-
.../typed/extensions/v1beta1/deployment.go | 269 +-
.../v1beta1/deployment_expansion.go | 2 +-
.../extensions/v1beta1/extensions_client.go | 22 +-
.../typed/extensions/v1beta1/fake/doc.go | 20 +
.../extensions/v1beta1/fake/fake_daemonset.go | 51 +
.../v1beta1/fake/fake_deployment.go | 102 +
.../v1beta1/fake/fake_deployment_expansion.go | 36 +
.../v1beta1/fake/fake_extensions_client.go | 56 +
.../extensions/v1beta1/fake/fake_ingress.go | 51 +
.../v1beta1/fake/fake_networkpolicy.go | 53 +
.../v1beta1/fake/fake_replicaset.go | 102 +
.../typed/extensions/v1beta1/ingress.go | 229 +-
.../typed/extensions/v1beta1/networkpolicy.go | 177 +-
.../typed/extensions/v1beta1/replicaset.go | 269 +-
.../typed/flowcontrol/v1/fake/doc.go | 20 +
.../v1/fake/fake_flowcontrol_client.go | 44 +
.../flowcontrol/v1/fake/fake_flowschema.go | 49 +
.../fake/fake_prioritylevelconfiguration.go | 53 +
.../flowcontrol/v1/flowcontrol_client.go | 22 +-
.../typed/flowcontrol/v1/flowschema.go | 216 +-
.../v1/prioritylevelconfiguration.go | 218 +-
.../typed/flowcontrol/v1beta1/fake/doc.go | 20 +
.../v1beta1/fake/fake_flowcontrol_client.go | 44 +
.../v1beta1/fake/fake_flowschema.go | 51 +
.../fake/fake_prioritylevelconfiguration.go | 53 +
.../flowcontrol/v1beta1/flowcontrol_client.go | 22 +-
.../typed/flowcontrol/v1beta1/flowschema.go | 216 +-
.../v1beta1/prioritylevelconfiguration.go | 220 +-
.../typed/flowcontrol/v1beta2/fake/doc.go | 20 +
.../v1beta2/fake/fake_flowcontrol_client.go | 44 +
.../v1beta2/fake/fake_flowschema.go | 51 +
.../fake/fake_prioritylevelconfiguration.go | 53 +
.../flowcontrol/v1beta2/flowcontrol_client.go | 22 +-
.../typed/flowcontrol/v1beta2/flowschema.go | 216 +-
.../v1beta2/prioritylevelconfiguration.go | 220 +-
.../typed/flowcontrol/v1beta3/fake/doc.go | 20 +
.../v1beta3/fake/fake_flowcontrol_client.go | 44 +
.../v1beta3/fake/fake_flowschema.go | 51 +
.../fake/fake_prioritylevelconfiguration.go | 53 +
.../flowcontrol/v1beta3/flowcontrol_client.go | 22 +-
.../typed/flowcontrol/v1beta3/flowschema.go | 216 +-
.../v1beta3/prioritylevelconfiguration.go | 220 +-
.../typed/networking/v1/fake/doc.go | 20 +
.../typed/networking/v1/fake/fake_ingress.go | 49 +
.../networking/v1/fake/fake_ingressclass.go | 51 +
.../networking/v1/fake/fake_ipaddress.go | 49 +
.../v1/fake/fake_networking_client.go | 56 +
.../networking/v1/fake/fake_networkpolicy.go | 51 +
.../networking/v1/fake/fake_servicecidr.go | 49 +
.../networking/v1/generated_expansion.go | 4 +
.../kubernetes/typed/networking/v1/ingress.go | 229 +-
.../typed/networking/v1/ingressclass.go | 166 +-
.../typed/networking/v1/ipaddress.go | 71 +
.../typed/networking/v1/networking_client.go | 32 +-
.../typed/networking/v1/networkpolicy.go | 177 +-
.../typed/networking/v1/servicecidr.go | 75 +
.../typed/networking/v1alpha1/ipaddress.go | 197 -
.../typed/networking/v1alpha1/servicecidr.go | 243 -
.../typed/networking/v1beta1/fake/doc.go | 20 +
.../networking/v1beta1/fake/fake_ingress.go | 51 +
.../v1beta1/fake/fake_ingressclass.go | 53 +
.../networking/v1beta1/fake/fake_ipaddress.go | 51 +
.../v1beta1/fake/fake_networking_client.go | 52 +
.../v1beta1/fake/fake_servicecidr.go | 51 +
.../networking/v1beta1/generated_expansion.go | 4 +
.../typed/networking/v1beta1/ingress.go | 229 +-
.../typed/networking/v1beta1/ingressclass.go | 166 +-
.../typed/networking/v1beta1/ipaddress.go | 71 +
.../networking/v1beta1/networking_client.go | 32 +-
.../typed/networking/v1beta1/servicecidr.go | 75 +
.../kubernetes/typed/node/v1/fake/doc.go | 20 +
.../typed/node/v1/fake/fake_node_client.go | 40 +
.../typed/node/v1/fake/fake_runtimeclass.go | 51 +
.../kubernetes/typed/node/v1/node_client.go | 22 +-
.../kubernetes/typed/node/v1/runtimeclass.go | 166 +-
.../typed/node/v1alpha1/fake/doc.go | 20 +
.../node/v1alpha1/fake/fake_node_client.go | 40 +
.../node/v1alpha1/fake/fake_runtimeclass.go | 53 +
.../typed/node/v1alpha1/node_client.go | 22 +-
.../typed/node/v1alpha1/runtimeclass.go | 166 +-
.../kubernetes/typed/node/v1beta1/fake/doc.go | 20 +
.../node/v1beta1/fake/fake_node_client.go | 40 +
.../node/v1beta1/fake/fake_runtimeclass.go | 53 +
.../typed/node/v1beta1/node_client.go | 22 +-
.../typed/node/v1beta1/runtimeclass.go | 166 +-
.../kubernetes/typed/policy/v1/eviction.go | 17 +-
.../typed/policy/v1/eviction_expansion.go | 2 +-
.../kubernetes/typed/policy/v1/fake/doc.go | 20 +
.../typed/policy/v1/fake/fake_eviction.go | 44 +
.../v1/fake/fake_eviction_expansion.go} | 35 +-
.../v1/fake/fake_poddisruptionbudget.go | 53 +
.../policy/v1/fake/fake_policy_client.go | 44 +
.../typed/policy/v1/poddisruptionbudget.go | 229 +-
.../typed/policy/v1/policy_client.go | 22 +-
.../typed/policy/v1beta1/eviction.go | 17 +-
.../policy/v1beta1/eviction_expansion.go | 2 +-
.../typed/policy/v1beta1/fake/doc.go | 20 +
.../policy/v1beta1/fake/fake_eviction.go | 44 +
.../v1beta1/fake/fake_eviction_expansion.go | 37 +
.../v1beta1/fake/fake_poddisruptionbudget.go | 53 +
.../policy/v1beta1/fake/fake_policy_client.go | 44 +
.../policy/v1beta1/poddisruptionbudget.go | 229 +-
.../typed/policy/v1beta1/policy_client.go | 22 +-
.../kubernetes/typed/rbac/v1/clusterrole.go | 166 +-
.../typed/rbac/v1/clusterrolebinding.go | 166 +-
.../kubernetes/typed/rbac/v1/fake/doc.go | 20 +
.../typed/rbac/v1/fake/fake_clusterrole.go | 49 +
.../rbac/v1/fake/fake_clusterrolebinding.go | 53 +
.../typed/rbac/v1/fake/fake_rbac_client.go | 52 +
.../typed/rbac/v1/fake/fake_role.go | 49 +
.../typed/rbac/v1/fake/fake_rolebinding.go | 49 +
.../kubernetes/typed/rbac/v1/rbac_client.go | 22 +-
.../kubernetes/typed/rbac/v1/role.go | 177 +-
.../kubernetes/typed/rbac/v1/rolebinding.go | 177 +-
.../typed/rbac/v1alpha1/clusterrole.go | 166 +-
.../typed/rbac/v1alpha1/clusterrolebinding.go | 166 +-
.../typed/rbac/v1alpha1/fake/doc.go | 20 +
.../rbac/v1alpha1/fake/fake_clusterrole.go | 53 +
.../v1alpha1/fake/fake_clusterrolebinding.go | 53 +
.../rbac/v1alpha1/fake/fake_rbac_client.go | 52 +
.../typed/rbac/v1alpha1/fake/fake_role.go | 49 +
.../rbac/v1alpha1/fake/fake_rolebinding.go | 53 +
.../typed/rbac/v1alpha1/rbac_client.go | 22 +-
.../kubernetes/typed/rbac/v1alpha1/role.go | 177 +-
.../typed/rbac/v1alpha1/rolebinding.go | 177 +-
.../typed/rbac/v1beta1/clusterrole.go | 166 +-
.../typed/rbac/v1beta1/clusterrolebinding.go | 166 +-
.../kubernetes/typed/rbac/v1beta1/fake/doc.go | 20 +
.../rbac/v1beta1/fake/fake_clusterrole.go | 51 +
.../v1beta1/fake/fake_clusterrolebinding.go | 53 +
.../rbac/v1beta1/fake/fake_rbac_client.go | 52 +
.../typed/rbac/v1beta1/fake/fake_role.go | 49 +
.../rbac/v1beta1/fake/fake_rolebinding.go | 51 +
.../typed/rbac/v1beta1/rbac_client.go | 22 +-
.../kubernetes/typed/rbac/v1beta1/role.go | 177 +-
.../typed/rbac/v1beta1/rolebinding.go | 177 +-
.../typed/resource/v1/deviceclass.go | 71 +
.../v1alpha1 => resource/v1}/doc.go | 2 +-
.../kubernetes/typed/resource/v1/fake/doc.go | 20 +
.../resource/v1/fake/fake_deviceclass.go | 49 +
.../resource/v1/fake/fake_resource_client.go | 52 +
.../resource/v1/fake/fake_resourceclaim.go | 51 +
.../v1/fake/fake_resourceclaimtemplate.go | 53 +
.../resource/v1/fake/fake_resourceslice.go | 51 +
.../{v1alpha2 => v1}/generated_expansion.go | 6 +-
.../{v1alpha2 => v1}/resource_client.go | 68 +-
.../typed/resource/v1/resourceclaim.go | 75 +
.../resource/v1/resourceclaimtemplate.go | 71 +
.../typed/resource/v1/resourceslice.go | 71 +
.../resource/v1alpha2/podschedulingcontext.go | 256 -
.../typed/resource/v1alpha2/resourceclaim.go | 256 -
.../v1alpha2/resourceclaimtemplate.go | 208 -
.../typed/resource/v1alpha2/resourceclass.go | 197 -
.../resource/v1alpha3/devicetaintrule.go | 75 +
.../kubernetes/typed/resource/v1alpha3/doc.go | 20 +
.../typed/resource/v1alpha3/fake/doc.go | 20 +
.../v1alpha3/fake/fake_devicetaintrule.go | 53 +
.../v1alpha3/fake/fake_resource_client.go | 40 +
.../resource/v1alpha3/generated_expansion.go | 21 +
.../resource/v1alpha3/resource_client.go | 101 +
.../typed/resource/v1beta1/deviceclass.go | 71 +
.../kubernetes/typed/resource/v1beta1/doc.go | 20 +
.../typed/resource/v1beta1/fake/doc.go | 20 +
.../resource/v1beta1/fake/fake_deviceclass.go | 51 +
.../v1beta1/fake/fake_resource_client.go | 52 +
.../v1beta1/fake/fake_resourceclaim.go | 53 +
.../fake/fake_resourceclaimtemplate.go | 53 +
.../v1beta1/fake/fake_resourceslice.go | 53 +
.../resource/v1beta1/generated_expansion.go | 27 +
.../typed/resource/v1beta1/resource_client.go | 116 +
.../typed/resource/v1beta1/resourceclaim.go | 75 +
.../resource/v1beta1/resourceclaimtemplate.go | 71 +
.../typed/resource/v1beta1/resourceslice.go | 71 +
.../typed/resource/v1beta2/deviceclass.go | 71 +
.../kubernetes/typed/resource/v1beta2/doc.go | 20 +
.../typed/resource/v1beta2/fake/doc.go | 20 +
.../resource/v1beta2/fake/fake_deviceclass.go | 51 +
.../v1beta2/fake/fake_resource_client.go | 52 +
.../v1beta2/fake/fake_resourceclaim.go | 53 +
.../fake/fake_resourceclaimtemplate.go | 53 +
.../v1beta2/fake/fake_resourceslice.go | 53 +
.../resource/v1beta2/generated_expansion.go | 27 +
.../typed/resource/v1beta2/resource_client.go | 116 +
.../typed/resource/v1beta2/resourceclaim.go | 75 +
.../resource/v1beta2/resourceclaimtemplate.go | 71 +
.../typed/resource/v1beta2/resourceslice.go | 71 +
.../typed/scheduling/v1/fake/doc.go | 20 +
.../scheduling/v1/fake/fake_priorityclass.go | 51 +
.../v1/fake/fake_scheduling_client.go | 40 +
.../typed/scheduling/v1/priorityclass.go | 166 +-
.../typed/scheduling/v1/scheduling_client.go | 22 +-
.../typed/scheduling/v1alpha1/fake/doc.go | 20 +
.../v1alpha1/fake/fake_priorityclass.go | 53 +
.../v1alpha1/fake/fake_scheduling_client.go | 44 +
.../scheduling/v1alpha1/fake/fake_workload.go | 51 +
.../v1alpha1/generated_expansion.go | 2 +
.../scheduling/v1alpha1/priorityclass.go | 166 +-
.../scheduling/v1alpha1/scheduling_client.go | 27 +-
.../typed/scheduling/v1alpha1/workload.go | 71 +
.../typed/scheduling/v1beta1/fake/doc.go | 20 +
.../v1beta1/fake/fake_priorityclass.go | 53 +
.../v1beta1/fake/fake_scheduling_client.go | 40 +
.../typed/scheduling/v1beta1/priorityclass.go | 166 +-
.../scheduling/v1beta1/scheduling_client.go | 22 +-
.../kubernetes/typed/storage/v1/csidriver.go | 166 +-
.../kubernetes/typed/storage/v1/csinode.go | 166 +-
.../typed/storage/v1/csistoragecapacity.go | 177 +-
.../kubernetes/typed/storage/v1/fake/doc.go | 20 +
.../typed/storage/v1/fake/fake_csidriver.go | 49 +
.../typed/storage/v1/fake/fake_csinode.go | 49 +
.../v1/fake/fake_csistoragecapacity.go | 53 +
.../storage/v1/fake/fake_storage_client.go | 60 +
.../storage/v1/fake/fake_storageclass.go | 51 +
.../storage/v1/fake/fake_volumeattachment.go | 51 +
.../v1/fake/fake_volumeattributesclass.go | 53 +
.../typed/storage/v1/generated_expansion.go | 2 +
.../typed/storage/v1/storage_client.go | 27 +-
.../typed/storage/v1/storageclass.go | 166 +-
.../typed/storage/v1/volumeattachment.go | 216 +-
.../typed/storage/v1/volumeattributesclass.go | 71 +
.../storage/v1alpha1/csistoragecapacity.go | 177 +-
.../typed/storage/v1alpha1/fake/doc.go | 20 +
.../v1alpha1/fake/fake_csistoragecapacity.go | 53 +
.../v1alpha1/fake/fake_storage_client.go | 48 +
.../v1alpha1/fake/fake_volumeattachment.go | 53 +
.../fake/fake_volumeattributesclass.go | 53 +
.../typed/storage/v1alpha1/storage_client.go | 22 +-
.../storage/v1alpha1/volumeattachment.go | 216 +-
.../storage/v1alpha1/volumeattributesclass.go | 166 +-
.../typed/storage/v1beta1/csidriver.go | 166 +-
.../typed/storage/v1beta1/csinode.go | 166 +-
.../storage/v1beta1/csistoragecapacity.go | 177 +-
.../typed/storage/v1beta1/fake/doc.go | 20 +
.../storage/v1beta1/fake/fake_csidriver.go | 51 +
.../storage/v1beta1/fake/fake_csinode.go | 51 +
.../v1beta1/fake/fake_csistoragecapacity.go | 53 +
.../v1beta1/fake/fake_storage_client.go | 60 +
.../storage/v1beta1/fake/fake_storageclass.go | 53 +
.../v1beta1/fake/fake_volumeattachment.go | 53 +
.../fake/fake_volumeattributesclass.go | 53 +
.../storage/v1beta1/generated_expansion.go | 2 +
.../typed/storage/v1beta1/storage_client.go | 27 +-
.../typed/storage/v1beta1/storageclass.go | 166 +-
.../typed/storage/v1beta1/volumeattachment.go | 216 +-
.../storage/v1beta1/volumeattributesclass.go | 71 +
.../typed/storagemigration/v1beta1/doc.go | 20 +
.../storagemigration/v1beta1/fake/doc.go | 20 +
.../fake/fake_storagemigration_client.go | 40 +
.../fake/fake_storageversionmigration.go | 53 +
.../v1beta1/generated_expansion.go | 21 +
.../v1beta1/storagemigration_client.go} | 63 +-
.../v1beta1/storageversionmigration.go | 79 +
.../v1/expansion_generated.go | 8 +
.../v1/mutatingwebhookconfiguration.go | 36 +-
.../v1/validatingadmissionpolicy.go | 48 +
.../v1/validatingadmissionpolicybinding.go | 48 +
.../v1/validatingwebhookconfiguration.go | 36 +-
.../v1alpha1/expansion_generated.go | 8 +
.../v1alpha1/mutatingadmissionpolicy.go | 48 +
.../mutatingadmissionpolicybinding.go | 48 +
.../v1alpha1/validatingadmissionpolicy.go | 36 +-
.../validatingadmissionpolicybinding.go | 36 +-
.../v1beta1/expansion_generated.go | 8 +
.../v1beta1/mutatingadmissionpolicy.go | 48 +
.../v1beta1/mutatingadmissionpolicybinding.go | 48 +
.../v1beta1/mutatingwebhookconfiguration.go | 36 +-
.../v1beta1/validatingadmissionpolicy.go | 36 +-
.../validatingadmissionpolicybinding.go | 36 +-
.../v1beta1/validatingwebhookconfiguration.go | 36 +-
.../v1alpha1/storageversion.go | 36 +-
.../listers/apps/v1/controllerrevision.go | 51 +-
.../client-go/listers/apps/v1/daemonset.go | 51 +-
.../client-go/listers/apps/v1/deployment.go | 51 +-
.../client-go/listers/apps/v1/replicaset.go | 51 +-
.../client-go/listers/apps/v1/statefulset.go | 51 +-
.../apps/v1beta1/controllerrevision.go | 51 +-
.../listers/apps/v1beta1/deployment.go | 51 +-
.../listers/apps/v1beta1/statefulset.go | 51 +-
.../apps/v1beta2/controllerrevision.go | 51 +-
.../listers/apps/v1beta2/daemonset.go | 51 +-
.../listers/apps/v1beta2/deployment.go | 51 +-
.../listers/apps/v1beta2/replicaset.go | 51 +-
.../listers/apps/v1beta2/statefulset.go | 51 +-
.../autoscaling/v1/horizontalpodautoscaler.go | 51 +-
.../autoscaling/v2/horizontalpodautoscaler.go | 51 +-
.../v2beta1/horizontalpodautoscaler.go | 51 +-
.../v2beta2/horizontalpodautoscaler.go | 51 +-
.../client-go/listers/batch/v1/cronjob.go | 51 +-
.../k8s.io/client-go/listers/batch/v1/job.go | 51 +-
.../listers/batch/v1beta1/cronjob.go | 51 +-
.../v1/certificatesigningrequest.go | 36 +-
.../v1alpha1/clustertrustbundle.go | 36 +-
.../v1beta1/certificatesigningrequest.go | 36 +-
.../v1beta1/clustertrustbundle.go | 48 +
.../v1beta1/expansion_generated.go | 12 +
.../v1beta1/podcertificaterequest.go | 70 +
.../listers/coordination/v1/lease.go | 51 +-
.../v1alpha2/expansion_generated.go | 27 +
.../coordination/v1alpha2/leasecandidate.go | 70 +
.../v1beta1/expansion_generated.go | 8 +
.../listers/coordination/v1beta1/lease.go | 51 +-
.../coordination/v1beta1/leasecandidate.go | 70 +
.../listers/core/v1/componentstatus.go | 36 +-
.../client-go/listers/core/v1/configmap.go | 51 +-
.../client-go/listers/core/v1/endpoints.go | 51 +-
.../k8s.io/client-go/listers/core/v1/event.go | 51 +-
.../client-go/listers/core/v1/limitrange.go | 51 +-
.../client-go/listers/core/v1/namespace.go | 36 +-
.../k8s.io/client-go/listers/core/v1/node.go | 36 +-
.../listers/core/v1/persistentvolume.go | 36 +-
.../listers/core/v1/persistentvolumeclaim.go | 51 +-
.../k8s.io/client-go/listers/core/v1/pod.go | 51 +-
.../client-go/listers/core/v1/podtemplate.go | 51 +-
.../listers/core/v1/replicationcontroller.go | 51 +-
.../listers/core/v1/resourcequota.go | 51 +-
.../client-go/listers/core/v1/secret.go | 51 +-
.../client-go/listers/core/v1/service.go | 51 +-
.../listers/core/v1/serviceaccount.go | 51 +-
.../listers/discovery/v1/endpointslice.go | 51 +-
.../discovery/v1beta1/endpointslice.go | 51 +-
.../apis/config => client-go/listers}/doc.go | 7 +-
.../client-go/listers/events/v1/event.go | 51 +-
.../client-go/listers/events/v1beta1/event.go | 51 +-
.../listers/extensions/v1beta1/daemonset.go | 51 +-
.../listers/extensions/v1beta1/deployment.go | 51 +-
.../listers/extensions/v1beta1/ingress.go | 51 +-
.../extensions/v1beta1/networkpolicy.go | 51 +-
.../listers/extensions/v1beta1/replicaset.go | 51 +-
.../listers/flowcontrol/v1/flowschema.go | 36 +-
.../v1/prioritylevelconfiguration.go | 36 +-
.../listers/flowcontrol/v1beta1/flowschema.go | 36 +-
.../v1beta1/prioritylevelconfiguration.go | 36 +-
.../listers/flowcontrol/v1beta2/flowschema.go | 36 +-
.../v1beta2/prioritylevelconfiguration.go | 36 +-
.../listers/flowcontrol/v1beta3/flowschema.go | 36 +-
.../v1beta3/prioritylevelconfiguration.go | 36 +-
.../client-go/listers/generic_helpers.go | 72 +
.../networking/v1/expansion_generated.go | 8 +
.../listers/networking/v1/ingress.go | 51 +-
.../listers/networking/v1/ingressclass.go | 36 +-
.../networking/{v1alpha1 => v1}/ipaddress.go | 38 +-
.../listers/networking/v1/networkpolicy.go | 51 +-
.../{v1alpha1 => v1}/servicecidr.go | 38 +-
.../networking/v1beta1/expansion_generated.go | 8 +
.../listers/networking/v1beta1/ingress.go | 51 +-
.../networking/v1beta1/ingressclass.go | 36 +-
.../listers/networking/v1beta1/ipaddress.go | 48 +
.../listers/networking/v1beta1/servicecidr.go | 48 +
.../client-go/listers/node/v1/runtimeclass.go | 36 +-
.../listers/node/v1alpha1/runtimeclass.go | 36 +-
.../listers/node/v1beta1/runtimeclass.go | 36 +-
.../client-go/listers/policy/v1/eviction.go | 51 +-
.../listers/policy/v1/poddisruptionbudget.go | 51 +-
.../listers/policy/v1beta1/eviction.go | 51 +-
.../policy/v1beta1/poddisruptionbudget.go | 51 +-
.../client-go/listers/rbac/v1/clusterrole.go | 36 +-
.../listers/rbac/v1/clusterrolebinding.go | 36 +-
.../k8s.io/client-go/listers/rbac/v1/role.go | 51 +-
.../client-go/listers/rbac/v1/rolebinding.go | 51 +-
.../listers/rbac/v1alpha1/clusterrole.go | 36 +-
.../rbac/v1alpha1/clusterrolebinding.go | 36 +-
.../client-go/listers/rbac/v1alpha1/role.go | 51 +-
.../listers/rbac/v1alpha1/rolebinding.go | 51 +-
.../listers/rbac/v1beta1/clusterrole.go | 36 +-
.../rbac/v1beta1/clusterrolebinding.go | 36 +-
.../client-go/listers/rbac/v1beta1/role.go | 51 +-
.../listers/rbac/v1beta1/rolebinding.go | 51 +-
.../listers/resource/v1/deviceclass.go | 48 +
.../{v1alpha2 => v1}/expansion_generated.go | 18 +-
.../{v1alpha2 => v1}/resourceclaim.go | 53 +-
.../resource/v1/resourceclaimtemplate.go | 70 +
.../listers/resource/v1/resourceslice.go | 48 +
.../resource/v1alpha2/podschedulingcontext.go | 99 -
.../resource/v1alpha2/resourceclass.go | 68 -
.../resource/v1alpha3/devicetaintrule.go | 48 +
.../v1alpha3}/expansion_generated.go | 12 +-
.../listers/resource/v1beta1/deviceclass.go | 48 +
.../resource/v1beta1/expansion_generated.go | 43 +
.../listers/resource/v1beta1/resourceclaim.go | 70 +
.../resourceclaimtemplate.go | 53 +-
.../listers/resource/v1beta1/resourceslice.go | 48 +
.../listers/resource/v1beta2/deviceclass.go | 48 +
.../resource/v1beta2/expansion_generated.go | 43 +
.../listers/resource/v1beta2/resourceclaim.go | 70 +
.../resource/v1beta2/resourceclaimtemplate.go | 70 +
.../listers/resource/v1beta2/resourceslice.go | 48 +
.../listers/scheduling/v1/priorityclass.go | 36 +-
.../v1alpha1/expansion_generated.go | 8 +
.../scheduling/v1alpha1/priorityclass.go | 36 +-
.../listers/scheduling/v1alpha1/workload.go | 70 +
.../scheduling/v1beta1/priorityclass.go | 36 +-
.../client-go/listers/storage/v1/csidriver.go | 36 +-
.../client-go/listers/storage/v1/csinode.go | 36 +-
.../listers/storage/v1/csistoragecapacity.go | 51 +-
.../listers/storage/v1/expansion_generated.go | 4 +
.../listers/storage/v1/storageclass.go | 36 +-
.../listers/storage/v1/volumeattachment.go | 36 +-
.../storage/v1/volumeattributesclass.go | 48 +
.../storage/v1alpha1/csistoragecapacity.go | 51 +-
.../storage/v1alpha1/volumeattachment.go | 36 +-
.../storage/v1alpha1/volumeattributesclass.go | 36 +-
.../listers/storage/v1beta1/csidriver.go | 36 +-
.../listers/storage/v1beta1/csinode.go | 36 +-
.../storage/v1beta1/csistoragecapacity.go | 51 +-
.../storage/v1beta1/expansion_generated.go | 4 +
.../listers/storage/v1beta1/storageclass.go | 36 +-
.../storage/v1beta1/volumeattachment.go | 36 +-
.../storage/v1beta1/volumeattributesclass.go | 48 +
.../v1beta1/expansion_generated.go | 23 +
.../v1beta1/storageversionmigration.go | 48 +
vendor/k8s.io/client-go/metadata/metadata.go | 4 +-
.../client-go/openapi/cached/groupversion.go | 4 +
vendor/k8s.io/client-go/openapi/client.go | 4 +
.../k8s.io/client-go/openapi/groupversion.go | 12 +
.../pkg/apis/clientauthentication/doc.go | 2 +-
.../pkg/apis/clientauthentication/v1/doc.go | 3 +-
.../v1/zz_generated.model_name.go | 42 +
.../apis/clientauthentication/v1beta1/doc.go | 3 +-
.../v1beta1/zz_generated.model_name.go | 42 +
vendor/k8s.io/client-go/pkg/version/base.go | 8 +-
vendor/k8s.io/client-go/pkg/version/doc.go | 2 +-
.../plugin/pkg/client/auth/exec/exec.go | 157 +-
.../plugin/pkg/client/auth/exec/metrics.go | 16 +
.../pkg/client/auth/plugins_providers.go | 3 -
vendor/k8s.io/client-go/rest/.mockery.yaml | 11 +
vendor/k8s.io/client-go/rest/client.go | 165 +-
vendor/k8s.io/client-go/rest/config.go | 107 +-
vendor/k8s.io/client-go/rest/fake/fake.go | 118 +
vendor/k8s.io/client-go/rest/plugin.go | 7 +-
vendor/k8s.io/client-go/rest/request.go | 263 +-
vendor/k8s.io/client-go/rest/url_utils.go | 2 +-
vendor/k8s.io/client-go/rest/urlbackoff.go | 101 +-
vendor/k8s.io/client-go/rest/warnings.go | 56 +-
vendor/k8s.io/client-go/rest/watch/decoder.go | 4 +-
vendor/k8s.io/client-go/rest/watch/encoder.go | 2 +-
vendor/k8s.io/client-go/rest/with_retry.go | 12 +-
.../k8s.io/client-go/restmapper/shortcut.go | 2 +-
vendor/k8s.io/client-go/scale/doc.go | 2 +-
.../client-go/scale/scheme/appsv1beta1/doc.go | 4 +-
.../client-go/scale/scheme/appsv1beta2/doc.go | 4 +-
.../scale/scheme/autoscalingv1/doc.go | 4 +-
.../scale/scheme/extensionsv1beta1/doc.go | 4 +-
vendor/k8s.io/client-go/testing/actions.go | 239 +-
vendor/k8s.io/client-go/testing/fixture.go | 625 +-
vendor/k8s.io/client-go/tools/cache/OWNERS | 3 +-
.../client-go/tools/cache/controller.go | 354 +-
.../client-go/tools/cache/delta_fifo.go | 188 +-
vendor/k8s.io/client-go/tools/cache/doc.go | 2 +-
.../tools/cache/expiration_cache_fakes.go | 2 +-
vendor/k8s.io/client-go/tools/cache/fifo.go | 114 +-
vendor/k8s.io/client-go/tools/cache/index.go | 7 +-
.../k8s.io/client-go/tools/cache/listers.go | 21 +-
.../k8s.io/client-go/tools/cache/listwatch.go | 212 +-
.../client-go/tools/cache/mutation_cache.go | 8 +-
.../tools/cache/mutation_detector.go | 1 +
.../k8s.io/client-go/tools/cache/reflector.go | 550 +-
.../reflector_data_consistency_detector.go | 94 +-
.../client-go/tools/cache/shared_informer.go | 203 +-
vendor/k8s.io/client-go/tools/cache/store.go | 108 +-
.../client-go/tools/cache/the_real_fifo.go | 526 +
.../tools/cache/thread_safe_store.go | 161 +-
.../client-go/tools/clientcmd/api/helpers.go | 5 +-
.../tools/clientcmd/api/latest/latest.go | 2 +-
.../client-go/tools/clientcmd/api/types.go | 66 +-
.../client-go/tools/clientcmd/api/v1/types.go | 7 +-
.../api/v1/zz_generated.conversion.go | 1 +
.../clientcmd/api/zz_generated.deepcopy.go | 38 +
.../tools/clientcmd/client_config.go | 138 +-
.../client-go/tools/clientcmd/config.go | 3 +-
.../k8s.io/client-go/tools/clientcmd/doc.go | 2 +-
.../client-go/tools/clientcmd/loader.go | 22 +-
.../k8s.io/client-go/tools/clientcmd/merge.go | 121 +
.../client-go/tools/clientcmd/validation.go | 5 +
vendor/k8s.io/client-go/tools/events/doc.go | 2 +-
.../tools/events/event_broadcaster.go | 12 +-
.../client-go/tools/events/event_recorder.go | 2 +-
.../client-go/tools/leaderelection/OWNERS | 2 +
.../tools/leaderelection/leaderelection.go | 181 +-
.../tools/leaderelection/leasecandidate.go | 207 +
.../client-go/tools/leaderelection/metrics.go | 30 +-
.../leaderelection/resourcelock/interface.go | 107 +-
.../leaderelection/resourcelock/leaselock.go | 33 +-
.../k8s.io/client-go/tools/metrics/metrics.go | 17 +
vendor/k8s.io/client-go/tools/record/doc.go | 2 +-
vendor/k8s.io/client-go/tools/record/event.go | 27 +-
.../client-go/tools/record/events_cache.go | 12 +-
.../client-go/tools/record/util/util.go | 17 +
.../k8s.io/client-go/tools/reference/ref.go | 5 +-
.../client-go/tools/remotecommand/doc.go | 20 -
.../tools/remotecommand/errorstream.go | 54 -
.../client-go/tools/remotecommand/fallback.go | 57 -
.../client-go/tools/remotecommand/reader.go | 41 -
.../tools/remotecommand/remotecommand.go | 58 -
.../client-go/tools/remotecommand/resize.go | 33 -
.../client-go/tools/remotecommand/spdy.go | 171 -
.../client-go/tools/remotecommand/v1.go | 159 -
.../client-go/tools/remotecommand/v2.go | 199 -
.../client-go/tools/remotecommand/v3.go | 111 -
.../client-go/tools/remotecommand/v4.go | 119 -
.../tools/remotecommand/websocket.go | 519 -
vendor/k8s.io/client-go/transport/cache.go | 8 +-
.../k8s.io/client-go/transport/cache_go118.go | 24 +-
.../client-go/transport/cert_rotation.go | 24 +-
.../client-go/transport/round_trippers.go | 205 +-
.../k8s.io/client-go/transport/spdy/spdy.go | 107 -
.../client-go/transport/token_source.go | 5 +-
.../k8s.io/client-go/transport/transport.go | 2 +-
.../transport/websocket/roundtripper.go | 163 -
vendor/k8s.io/client-go/util/apply/apply.go | 49 +
vendor/k8s.io/client-go/util/cert/cert.go | 52 +-
.../data_consistency_detector.go | 181 +
vendor/k8s.io/client-go/util/exec/exec.go | 52 -
.../client-go/util/flowcontrol/backoff.go | 36 +-
vendor/k8s.io/client-go/util/jsonpath/doc.go | 2 +-
vendor/k8s.io/client-go/util/retry/util.go | 2 +-
.../client-go/util/watchlist/watch_list.go | 99 +
.../util/workqueue/default_rate_limiters.go | 139 +-
.../util/workqueue/delaying_queue.go | 120 +-
vendor/k8s.io/client-go/util/workqueue/doc.go | 3 +-
.../client-go/util/workqueue/metrics.go | 67 +-
.../client-go/util/workqueue/parallelizer.go | 2 +-
.../k8s.io/client-go/util/workqueue/queue.go | 261 +-
.../util/workqueue/rate_limiting_queue.go | 64 +-
.../colon_separated_multimap_string_string.go | 24 +-
.../k8s.io/component-base/cli/flag/flags.go | 4 +-
.../component-base/cli/flag/tracker_flag.go | 82 +
vendor/k8s.io/component-base/cli/run.go | 8 +-
.../k8s.io/component-base/cli/withoutrace.go | 24 +
.../cli/withrace.go} | 19 +-
.../component-base/compatibility/OWNERS | 14 +
.../component-base/compatibility/registry.go | 491 +
.../component-base/compatibility/version.go | 239 +
vendor/k8s.io/component-base/config/types.go | 80 -
.../config/v1alpha1/conversion.go | 53 -
.../config/v1alpha1/defaults.go | 98 -
.../component-base/config/v1alpha1/doc.go | 20 -
.../config/v1alpha1/register.go | 31 -
.../component-base/config/v1alpha1/types.go | 82 -
.../v1alpha1/zz_generated.conversion.go | 133 -
.../config/v1alpha1/zz_generated.deepcopy.go | 88 -
.../config/zz_generated.deepcopy.go | 73 -
.../featuregate/feature_gate.go | 828 +-
.../k8s.io/component-base/logs/api/v1/doc.go | 3 +-
.../logs/api/v1/kube_features.go | 36 +-
.../component-base/logs/api/v1/options.go | 48 +-
.../logs/api/v1/options_no_slog.go} | 12 +-
.../logs/api/v1/options_slog.go} | 32 +-
.../component-base/logs/api/v1/registry.go | 2 +-
.../k8s.io/component-base/logs/api/v1/text.go | 142 +
.../component-base/logs/api/v1/types.go | 13 +
.../logs/api/v1/zz_generated.deepcopy.go | 37 +-
.../logs/api/v1/zz_generated.model_name.go | 67 +
.../k8s.io/component-base/metrics/counter.go | 69 +-
vendor/k8s.io/component-base/metrics/desc.go | 20 +-
.../metrics/features/kube_features.go | 17 +-
vendor/k8s.io/component-base/metrics/gauge.go | 62 +-
.../component-base/metrics/histogram.go | 100 +-
.../metrics/legacyregistry/registry.go | 5 +
.../k8s.io/component-base/metrics/metric.go | 39 +-
.../k8s.io/component-base/metrics/options.go | 2 +-
vendor/k8s.io/component-base/metrics/opts.go | 116 +-
.../metrics/processstarttime.go | 2 +-
.../metrics/processstarttime_others.go | 2 +-
.../metrics/processstarttime_windows.go | 2 +-
.../prometheus/compatversion/metrics.go | 50 +
.../metrics/prometheus/slis/metrics.go | 2 -
.../metrics/prometheus/slis/routes.go | 4 +-
.../k8s.io/component-base/metrics/registry.go | 59 +-
.../k8s.io/component-base/metrics/summary.go | 41 +-
.../metrics/testutil/metrics.go | 76 +-
.../metrics/testutil/promlint.go | 7 +-
.../metrics/testutil/testutil.go | 21 +-
.../metrics/timing_histogram.go | 38 +-
.../component-base/tracing/api/v1/doc.go | 4 +-
.../tracing/api/v1/zz_generated.model_name.go | 27 +
vendor/k8s.io/component-base/tracing/utils.go | 7 +-
vendor/k8s.io/component-base/version/base.go | 15 +-
.../k8s.io/component-base/version/version.go | 2 +
.../component-base/zpages/features/doc.go | 22 +
.../zpages/features/kube_features.go | 52 +
vendor/k8s.io/klog/v2/README.md | 2 -
.../klog/v2/internal/serialize/keyvalues.go | 232 +-
.../internal/serialize/keyvalues_no_slog.go | 10 +-
.../v2/internal/serialize/keyvalues_slog.go | 12 +-
.../klog/v2/internal/verbosity/verbosity.go | 303 +
vendor/k8s.io/klog/v2/klog.go | 87 +-
vendor/k8s.io/klog/v2/klogr.go | 4 +-
vendor/k8s.io/klog/v2/klogr_slog.go | 11 +-
vendor/k8s.io/klog/v2/textlogger/options.go | 172 +
.../k8s.io/klog/v2/textlogger/textlogger.go | 200 +
.../klog/v2/textlogger/textlogger_slog.go | 52 +
vendor/k8s.io/kms/apis/v1beta1/api.pb.go | 749 +-
vendor/k8s.io/kms/apis/v1beta1/api_grpc.pb.go | 240 +
vendor/k8s.io/kms/apis/v2/api.pb.go | 753 +-
vendor/k8s.io/kms/apis/v2/api_grpc.pb.go | 240 +
vendor/k8s.io/kms/pkg/service/grpc_service.go | 1 +
.../pkg/apis/apiregistration/doc.go | 2 +-
.../pkg/apis/apiregistration/v1/defaults.go | 4 +-
.../pkg/apis/apiregistration/v1/doc.go | 7 +-
.../apis/apiregistration/v1/generated.pb.go | 254 +-
.../apis/apiregistration/v1/generated.proto | 6 +-
.../v1/generated.protomessage.pb.go | 34 +
.../pkg/apis/apiregistration/v1/types.go | 2 +
.../v1/zz_generated.model_name.go | 52 +
.../v1/zz_generated.prerelease-lifecycle.go | 34 +
.../apis/apiregistration/v1beta1/defaults.go | 4 +-
.../pkg/apis/apiregistration/v1beta1/doc.go | 6 +-
.../apiregistration/v1beta1/generated.pb.go | 254 +-
.../apiregistration/v1beta1/generated.proto | 6 +-
.../v1beta1/generated.protomessage.pb.go | 34 +
.../v1beta1/zz_generated.model_name.go | 52 +
.../v1/apiregistration_client.go | 22 +-
.../typed/apiregistration/v1/apiservice.go | 153 +-
.../kube-openapi/pkg/builder/openapi.go | 5 +-
.../kube-openapi/pkg/builder3/openapi.go | 10 +-
.../k8s.io/kube-openapi/pkg/common/common.go | 4 +-
.../kube-openapi/pkg/handler/handler.go | 2 +-
.../kube-openapi/pkg/handler3/handler.go | 2 +-
.../pkg/internal/serialization.go | 2 +-
.../go-json-experiment/json/README.md | 246 +-
.../go-json-experiment/json/alias.go | 967 +
.../go-json-experiment/json/arshal.go | 523 +-
.../go-json-experiment/json/arshal_any.go | 283 +-
.../go-json-experiment/json/arshal_default.go | 1469 +-
.../go-json-experiment/json/arshal_funcs.go | 209 +-
.../go-json-experiment/json/arshal_inlined.go | 123 +-
.../go-json-experiment/json/arshal_methods.go | 328 +-
.../go-json-experiment/json/arshal_time.go | 846 +-
.../go-json-experiment/json/decode.go | 1655 --
.../go-json-experiment/json/doc.go | 228 +-
.../go-json-experiment/json/encode.go | 1170 --
.../go-json-experiment/json/errors.go | 409 +-
.../go-json-experiment/json/fields.go | 503 +-
.../go-json-experiment/json/fold.go | 2 +
.../go-json-experiment/json/intern.go | 8 +-
.../json/internal/internal.go | 42 +
.../json/internal/jsonflags/flags.go | 215 +
.../json/internal/jsonopts/options.go | 202 +
.../json/internal/jsonwire/decode.go | 629 +
.../json/internal/jsonwire/encode.go | 290 +
.../json/internal/jsonwire/wire.go | 217 +
.../go-json-experiment/json/jsontext/alias.go | 536 +
.../json/jsontext/decode.go | 1179 ++
.../go-json-experiment/json/jsontext/doc.go | 111 +
.../json/jsontext/encode.go | 977 +
.../json/jsontext/errors.go | 182 +
.../json/jsontext/export.go | 77 +
.../json/jsontext/options.go | 304 +
.../json/{ => jsontext}/pools.go | 92 +-
.../go-json-experiment/json/jsontext/quote.go | 41 +
.../json/{ => jsontext}/state.go | 447 +-
.../json/{ => jsontext}/token.go | 87 +-
.../go-json-experiment/json/jsontext/value.go | 395 +
.../go-json-experiment/json/migrate.sh | 48 +
.../go-json-experiment/json/options.go | 289 +
.../go-json-experiment/json/value.go | 381 -
.../internal/third_party/govalidator}/LICENSE | 10 +-
.../third_party/govalidator/patterns.go | 26 +
.../third_party/govalidator/validator.go | 181 +
.../kube-openapi/pkg/schemaconv/openapi.go | 8 +-
.../pkg/schemaconv/proto_models.go | 12 +-
.../k8s.io/kube-openapi/pkg/schemaconv/smd.go | 2 +-
.../k8s.io/kube-openapi/pkg/spec3/encoding.go | 13 +-
.../k8s.io/kube-openapi/pkg/spec3/example.go | 13 +-
.../pkg/spec3/external_documentation.go | 13 +-
vendor/k8s.io/kube-openapi/pkg/spec3/fuzz.go | 146 +-
.../k8s.io/kube-openapi/pkg/spec3/header.go | 13 +-
.../kube-openapi/pkg/spec3/media_type.go | 13 +-
.../kube-openapi/pkg/spec3/operation.go | 13 +-
.../kube-openapi/pkg/spec3/parameter.go | 13 +-
vendor/k8s.io/kube-openapi/pkg/spec3/path.go | 25 +-
.../kube-openapi/pkg/spec3/request_body.go | 13 +-
.../k8s.io/kube-openapi/pkg/spec3/response.go | 47 +-
.../kube-openapi/pkg/spec3/security_scheme.go | 7 +-
.../k8s.io/kube-openapi/pkg/spec3/server.go | 25 +-
vendor/k8s.io/kube-openapi/pkg/spec3/spec.go | 5 +-
.../kube-openapi/pkg/util/proto/document.go | 2 +-
.../pkg/util/proto/document_v3.go | 2 +-
vendor/k8s.io/kube-openapi/pkg/util/util.go | 13 +-
.../pkg/validation/spec/header.go | 13 +-
.../kube-openapi/pkg/validation/spec/info.go | 13 +-
.../kube-openapi/pkg/validation/spec/items.go | 13 +-
.../pkg/validation/spec/operation.go | 13 +-
.../pkg/validation/spec/parameter.go | 13 +-
.../pkg/validation/spec/path_item.go | 15 +-
.../kube-openapi/pkg/validation/spec/paths.go | 11 +-
.../kube-openapi/pkg/validation/spec/ref.go | 50 -
.../pkg/validation/spec/response.go | 15 +-
.../pkg/validation/spec/responses.go | 17 +-
.../pkg/validation/spec/schema.go | 13 +-
.../pkg/validation/spec/security_scheme.go | 13 +-
.../pkg/validation/spec/swagger.go | 59 +-
.../kube-openapi/pkg/validation/spec/tag.go | 13 +-
.../pkg/validation/strfmt/default.go | 294 +-
.../pkg/validation/strfmt/duration.go | 17 -
.../pkg/validation/strfmt/format.go | 24 +
.../strfmt/kubernetes-extensions.go | 143 +
.../pkg/validation/strfmt/time.go | 20 -
.../kubectl/pkg/cmd/util/caching_verifier.go | 59 +
.../pkg/cmd/util/factory_client_access.go | 2 +-
vendor/k8s.io/kubectl/pkg/cmd/util/helpers.go | 53 +-
vendor/k8s.io/kubectl/pkg/drain/cordon.go | 17 +-
vendor/k8s.io/kubectl/pkg/drain/drain.go | 68 +-
vendor/k8s.io/kubectl/pkg/drain/filters.go | 10 +-
vendor/k8s.io/kubectl/pkg/scheme/install.go | 3 +-
vendor/k8s.io/kubectl/pkg/util/i18n/i18n.go | 1 -
.../pkg/util/i18n/translations/README.md | 2 +-
.../kubectl/de_DE/LC_MESSAGES/k8s.po | 4 +-
.../kubectl/default/LC_MESSAGES/k8s.po | 4 +-
.../kubectl/en_US/LC_MESSAGES/k8s.po | 4 +-
.../kubectl/it_IT/LC_MESSAGES/k8s.po | 4 +-
.../kubectl/ja_JP/LC_MESSAGES/k8s.po | 6 +-
.../kubectl/pt_BR/LC_MESSAGES/k8s.po | 4 +-
.../kubectl/zh_CN/LC_MESSAGES/k8s.po | 4 +-
vendor/k8s.io/kubectl/pkg/util/openapi/doc.go | 2 +-
.../pkg/util/templates/help_flags_printer.go | 2 +-
vendor/k8s.io/kubectl/pkg/util/term/resize.go | 40 +-
.../kubectl/pkg/util/term/resizeevents.go | 3 +-
.../pkg/util/term/resizeevents_windows.go | 3 +-
.../kubectl/pkg/util/term/term_writer.go | 4 +-
vendor/k8s.io/utils/buffer/ring_fixed.go | 120 +
.../k8s.io/utils/clock/testing/fake_clock.go | 374 -
vendor/k8s.io/utils/exec/exec.go | 16 +
vendor/k8s.io/utils/integer/integer.go | 79 -
vendor/k8s.io/utils/strings/slices/slices.go | 82 -
vendor/modules.txt | 655 +-
.../proto/client/client.pb.go | 148 +-
.../proto/client/client.proto | 7 +
.../proto/client/client_grpc.pb.go | 2 +-
.../sigs.k8s.io/controller-runtime/.gitignore | 5 +-
.../controller-runtime/.golangci.yml | 307 +-
.../controller-runtime/.gomodcheck.yaml | 21 +
vendor/sigs.k8s.io/controller-runtime/FAQ.md | 4 +-
.../sigs.k8s.io/controller-runtime/Makefile | 128 +-
vendor/sigs.k8s.io/controller-runtime/OWNERS | 3 +-
.../controller-runtime/OWNERS_ALIASES | 12 +-
.../sigs.k8s.io/controller-runtime/README.md | 32 +-
.../sigs.k8s.io/controller-runtime/RELEASE.md | 14 +-
.../controller-runtime/VERSIONING.md | 10 +
.../sigs.k8s.io/controller-runtime/alias.go | 35 +-
vendor/sigs.k8s.io/controller-runtime/doc.go | 2 +-
.../pkg/builder/controller.go | 181 +-
.../controller-runtime/pkg/builder/options.go | 10 +-
.../controller-runtime/pkg/builder/webhook.go | 270 +-
.../controller-runtime/pkg/cache/cache.go | 252 +-
.../pkg/cache/delegating_by_gvk_cache.go | 21 +-
.../pkg/cache/informer_cache.go | 38 +-
.../pkg/cache/internal/cache_reader.go | 74 +-
.../pkg/cache/internal/informers.go | 165 +-
.../pkg/cache/multi_namespace_cache.go | 94 +-
.../pkg/certwatcher/certwatcher.go | 119 +-
.../pkg/certwatcher/metrics/metrics.go | 1 +
.../pkg/client/apiutil/apimachinery.go | 48 +-
.../pkg/client/apiutil/errors.go | 4 +-
.../pkg/client/apiutil/restmapper.go | 196 +-
.../pkg/client/applyconfigurations.go | 75 +
.../controller-runtime/pkg/client/client.go | 131 +-
.../pkg/client/client_rest_resources.go | 105 +-
.../pkg/client/config/config.go | 18 +-
.../controller-runtime/pkg/client/dryrun.go | 8 +
.../pkg/client/fake/client.go | 1052 +-
.../controller-runtime/pkg/client/fake/doc.go | 2 +-
.../pkg/client/fake/typeconverter.go | 60 +
.../pkg/client/fake/versioned_tracker.go | 368 +
.../pkg/client/fieldowner.go | 114 +
.../pkg/client/fieldvalidation.go | 117 +
.../pkg/client/interceptor/intercept.go | 17 +
.../pkg/client/interfaces.go | 20 +-
.../pkg/client/namespaced_client.go | 103 +-
.../controller-runtime/pkg/client/options.go | 248 +-
.../controller-runtime/pkg/client/patch.go | 8 +-
.../pkg/client/typed_client.go | 90 +-
.../pkg/client/unstructured_client.go | 89 +-
.../controller-runtime/pkg/cluster/cluster.go | 46 +-
.../pkg/cluster/internal.go | 5 +
.../controller-runtime/pkg/config/config.go | 112 -
.../pkg/config/controller.go | 49 +-
.../controller-runtime/pkg/config/doc.go | 19 -
.../pkg/config/v1alpha1/doc.go | 22 -
.../pkg/config/v1alpha1/register.go | 43 -
.../pkg/config/v1alpha1/types.go | 179 -
.../config/v1alpha1/zz_generated.deepcopy.go | 157 -
.../pkg/controller/controller.go | 211 +-
.../controllerutil/controllerutil.go | 206 +-
.../ratelimiter.go => controller/name.go} | 39 +-
.../pkg/controller/priorityqueue/metrics.go | 172 +
.../controller/priorityqueue/priorityqueue.go | 569 +
.../pkg/envtest/binaries.go | 387 +
.../controller-runtime/pkg/envtest/crd.go | 33 +-
.../controller-runtime/pkg/envtest/server.go | 104 +-
.../controller-runtime/pkg/envtest/webhook.go | 22 +-
.../controller-runtime/pkg/event/event.go | 54 +-
.../controller-runtime/pkg/handler/enqueue.go | 62 +-
.../pkg/handler/enqueue_mapped.go | 109 +-
.../pkg/handler/enqueue_owner.go | 60 +-
.../pkg/handler/eventhandler.go | 179 +-
.../controller-runtime/pkg/healthz/healthz.go | 4 +-
.../pkg/internal/controller/controller.go | 394 +-
.../internal/controller/metrics/metrics.go | 27 +-
.../pkg/internal/field/selector/utils.go | 16 +-
.../pkg/internal/flock/flock_other.go | 2 +-
.../pkg/internal/flock/flock_unix.go | 1 -
.../pkg/internal/metrics/workqueue.go | 210 +
.../pkg/internal/recorder/recorder.go | 106 +-
.../pkg/internal/source/event_handler.go | 50 +-
.../pkg/internal/source/kind.go | 79 +-
.../pkg/internal/syncs/syncs.go | 38 +
.../pkg/internal/testing/addr/manager.go | 8 +-
.../testing/controlplane/apiserver.go | 18 +-
.../pkg/internal/testing/controlplane/auth.go | 2 +-
.../pkg/internal/testing/controlplane/etcd.go | 4 +
.../internal/testing/controlplane/kubectl.go | 1 +
.../pkg/internal/testing/process/arguments.go | 8 +-
.../testing/process/procattr_other.go | 27 +
.../internal/testing/process/procattr_unix.go | 32 +
.../pkg/internal/testing/process/process.go | 6 +-
.../pkg/leaderelection/leader_election.go | 36 +-
.../controller-runtime/pkg/log/deleg.go | 10 +-
.../controller-runtime/pkg/log/log.go | 2 +-
.../controller-runtime/pkg/log/null.go | 6 +-
.../pkg/log/warning_handler.go | 27 +-
.../controller-runtime/pkg/log/zap/flags.go | 3 +-
.../pkg/log/zap/kube_helpers.go | 1 +
.../controller-runtime/pkg/log/zap/zap.go | 4 +-
.../pkg/manager/internal.go | 147 +-
.../controller-runtime/pkg/manager/manager.go | 200 +-
.../pkg/manager/runnable_group.go | 80 +-
.../controller-runtime/pkg/manager/server.go | 74 +-
.../pkg/manager/signals/signal_posix.go | 1 -
.../pkg/metrics/leaderelection.go | 23 +-
.../pkg/metrics/server/server.go | 34 +-
.../pkg/metrics/workqueue.go | 101 -
.../pkg/predicate/predicate.go | 215 +-
.../controller-runtime/pkg/ratelimiter/doc.go | 22 -
.../pkg/reconcile/reconcile.go | 73 +-
.../pkg/recorder/recorder.go | 7 +-
.../controller-runtime/pkg/source/source.go | 190 +-
.../pkg/webhook/admission/decode.go | 27 +-
.../pkg/webhook/admission/defaulter.go | 82 -
.../pkg/webhook/admission/defaulter_custom.go | 136 +-
.../pkg/webhook/admission/http.go | 52 +-
.../pkg/webhook/admission/metrics/metrics.go | 39 +
.../pkg/webhook/admission/multi.go | 6 +
.../pkg/webhook/admission/validator.go | 125 -
.../pkg/webhook/admission/validator_custom.go | 66 +-
.../pkg/webhook/admission/webhook.go | 33 +-
.../controller-runtime/pkg/webhook/alias.go | 14 +-
.../pkg/webhook/conversion/conversion.go | 38 +-
.../webhook/conversion/conversion_hubspoke.go | 173 +
.../webhook/conversion/conversion_registry.go | 57 +
.../pkg/webhook/conversion/metrics/metrics.go | 39 +
.../pkg/webhook/internal/metrics/metrics.go | 9 +-
.../controller-runtime/pkg/webhook/server.go | 4 +-
.../kustomize/api/filters/imagetag/updater.go | 2 +-
.../kustomize/api/filters/nameref/nameref.go | 9 +-
.../filters/patchjson6902/patchjson6902.go | 2 +-
.../api/filters/replacement/replacement.go | 30 +-
.../accumulator/loadconfigfromcrds.go | 2 +-
.../internal/accumulator/resaccumulator.go | 2 +-
.../builtins/HelmChartInflationGenerator.go | 84 +-
.../internal/builtins/NamespaceTransformer.go | 2 +
.../builtins/PatchJson6902Transformer.go | 2 +-
.../api/internal/builtins/PatchTransformer.go | 147 +-
.../builtins/ReplacementTransformer.go | 10 +-
.../internal/builtins/SortOrderTransformer.go | 56 +-
.../kustomize/api/internal/git/cloner.go | 6 +
.../api/{ => internal}/image/image.go | 0
.../builtinpluginconsts/commonannotations.go | 0
.../builtinpluginconsts/commonlabels.go | 0
.../builtinpluginconsts/defaultconfig.go | 0
.../konfig/builtinpluginconsts/doc.go | 0
.../konfig/builtinpluginconsts/images.go | 4 +
.../builtinpluginconsts/metadatalabels.go | 0
.../konfig/builtinpluginconsts/nameprefix.go | 0
.../builtinpluginconsts/namereference.go | 7 +
.../konfig/builtinpluginconsts/namespace.go | 0
.../konfig/builtinpluginconsts/namesuffix.go | 0
.../konfig/builtinpluginconsts/replicas.go | 0
.../builtinpluginconsts/templatelabels.go | 0
.../builtinpluginconsts/varreference.go | 0
.../api/{ => internal}/loader/errors.go | 0
.../api/{ => internal}/loader/fileloader.go | 103 +-
.../api/{ => internal}/loader/loader.go | 2 +-
.../{ => internal}/loader/loadrestrictions.go | 0
.../builtinconfig/loaddefaultconfig.go | 2 +-
.../builtinconfig/namebackreferences.go | 13 +
.../builtinconfig/transformerconfig.go | 64 +-
.../internal/plugins/execplugin/execplugin.go | 35 +-
.../api/internal/plugins/execplugin/shlex.go | 62 +
.../api/internal/plugins/fnplugin/fnplugin.go | 1 -
.../internal/plugins/loader/load_go_plugin.go | 62 +
.../plugins/loader/load_go_plugin_disabled.go | 25 +
.../api/internal/plugins/loader/loader.go | 68 +-
.../api/internal/target/kusttarget.go | 28 +-
.../target/kusttarget_configplugin.go | 29 +-
.../api/internal/utils/errtimeout.go | 6 +-
.../kustomize/api/internal/utils/timedcall.go | 2 +-
.../kustomize/api/krusty/kustomizer.go | 2 +-
.../kustomize/api/provenance/provenance.go | 67 +-
.../kustomize/api/resmap/reswrangler.go | 7 +-
.../kustomize/api/resource/factory.go | 31 +-
.../kustomize/api/resource/resource.go | 25 +-
.../kustomize/api/types/fieldspec.go | 9 +
.../kustomize/api/types/generatorargs.go | 2 +-
.../kustomize/api/types/helmchartargs.go | 19 +
.../kustomize/api/types/kustomization.go | 6 +
.../sigs.k8s.io/kustomize/api/types/labels.go | 4 +-
.../kustomize/api/types/pluginconfig.go | 8 +-
.../kustomize/api/types/pluginrestrictions.go | 2 -
.../kustomize/api/types/replacement.go | 3 +
.../kustomize/kyaml/filesys/filesystem.go | 1 +
.../kyaml/fn/runtime/container/container.go | 2 +-
.../kustomize/kyaml/fn/runtime/exec/exec.go | 4 +
.../fn/runtime/runtimeutil/functiontypes.go | 20 +-
.../kyaml/fn/runtime/starlark/context.go | 79 -
.../kyaml/fn/runtime/starlark/doc.go | 36 -
.../kyaml/fn/runtime/starlark/starlark.go | 180 -
.../forked/github.com/go-yaml/yaml/README.md | 150 -
.../github.com/qri-io/starlib/util/doc.go | 25 -
.../github.com/qri-io/starlib/util/util.go | 275 -
.../kustomize/kyaml/kio/filters/filters.go | 210 -
.../kustomize/kyaml/kio/filters/fmtr.go | 314 -
.../kustomize/kyaml/kio/filters/grep.go | 117 -
.../kustomize/kyaml/kio/filters/local.go | 38 -
.../kustomize/kyaml/kio/filters/merge.go | 86 -
.../kustomize/kyaml/kio/filters/merge3.go | 317 -
.../kustomize/kyaml/kio/filters/modify.go | 4 -
.../kyaml/kio/filters/stripcomments.go | 32 -
.../kustomize/kyaml/kio/ignorefilesmatcher.go | 2 +-
.../kyaml/openapi/kustomizationapi/swagger.go | 2 +-
.../kustomize/kyaml/openapi/openapi.go | 67 +-
.../kustomize/kyaml/runfn/runfn.go | 69 +-
.../sigs.k8s.io/kustomize/kyaml/yaml/alias.go | 4 +-
.../kustomize/kyaml/yaml/compatibility.go | 6 +-
.../sigs.k8s.io/kustomize/kyaml/yaml/fns.go | 17 +-
.../sigs.k8s.io/kustomize/kyaml/yaml/kfns.go | 2 +-
.../sigs.k8s.io/kustomize/kyaml/yaml/match.go | 2 +-
.../kustomize/kyaml/yaml/merge2/merge2.go | 5 +-
.../kustomize/kyaml/yaml/merge3/merge3.go | 45 -
.../kustomize/kyaml/yaml/merge3/visitor.go | 172 -
.../sigs.k8s.io/kustomize/kyaml/yaml/rnode.go | 19 +-
.../sigs.k8s.io/kustomize/kyaml/yaml/types.go | 2 +-
.../kustomize/kyaml/yaml/walk/map.go | 21 +-
vendor/sigs.k8s.io/randfill/CONTRIBUTING.md | 43 +
vendor/sigs.k8s.io/randfill/LICENSE | 202 +
vendor/sigs.k8s.io/randfill/NOTICE | 24 +
vendor/sigs.k8s.io/randfill/OWNERS | 8 +
vendor/sigs.k8s.io/randfill/OWNERS_ALIASES | 14 +
.../gofuzz => sigs.k8s.io/randfill}/README.md | 45 +-
vendor/sigs.k8s.io/randfill/SECURITY_CONTACTS | 16 +
.../randfill}/bytesource/bytesource.go | 0
.../sigs.k8s.io/randfill/code-of-conduct.md | 3 +
vendor/sigs.k8s.io/randfill/randfill.go | 682 +
.../structured-merge-diff/v6}/LICENSE | 0
.../{v4 => v6}/fieldpath/doc.go | 0
.../{v4 => v6}/fieldpath/element.go | 73 +-
.../{v4 => v6}/fieldpath/fromvalue.go | 2 +-
.../{v4 => v6}/fieldpath/managers.go | 0
.../{v4 => v6}/fieldpath/path.go | 2 +-
.../{v4 => v6}/fieldpath/pathelementmap.go | 2 +-
.../{v4 => v6}/fieldpath/serialize-pe.go | 28 +-
.../{v4 => v6}/fieldpath/serialize.go | 0
.../{v4 => v6}/fieldpath/set.go | 43 +-
.../{v4 => v6}/merge/conflict.go | 2 +-
.../{v4 => v6}/merge/update.go | 7 +-
.../{v4 => v6}/schema/doc.go | 0
.../{v4 => v6}/schema/elements.go | 47 +-
.../{v4 => v6}/schema/equals.go | 0
.../{v4 => v6}/schema/schemaschema.go | 0
.../{v4 => v6}/typed/compare.go | 6 +-
.../{v4 => v6}/typed/doc.go | 0
.../{v4 => v6}/typed/helpers.go | 15 +-
.../{v4 => v6}/typed/merge.go | 6 +-
.../{v4 => v6}/typed/parser.go | 6 +-
.../{v4 => v6}/typed/reconcile_schema.go | 4 +-
.../{v4 => v6}/typed/remove.go | 71 +-
.../{v4 => v6}/typed/tofieldset.go | 6 +-
.../{v4 => v6}/typed/typed.go | 6 +-
.../{v4 => v6}/typed/validate.go | 6 +-
.../{v4 => v6}/value/allocator.go | 0
.../{v4 => v6}/value/doc.go | 0
.../{v4 => v6}/value/fields.go | 8 +
.../{v4 => v6}/value/jsontagutil.go | 0
.../{v4 => v6}/value/list.go | 0
.../{v4 => v6}/value/listreflect.go | 0
.../{v4 => v6}/value/listunstructured.go | 0
.../{v4 => v6}/value/map.go | 0
.../{v4 => v6}/value/mapreflect.go | 0
.../{v4 => v6}/value/mapunstructured.go | 0
.../{v4 => v6}/value/reflectcache.go | 4 +
.../{v4 => v6}/value/scalar.go | 0
.../{v4 => v6}/value/structreflect.go | 0
.../{v4 => v6}/value/value.go | 19 +-
.../{v4 => v6}/value/valuereflect.go | 0
.../{v4 => v6}/value/valueunstructured.go | 0
vendor/sigs.k8s.io/yaml/goyaml.v2/README.md | 71 -
.../yaml/goyaml.v2/yaml_aliases.go | 85 -
vendor/sigs.k8s.io/yaml/kyaml/kyaml.go | 828 +
5909 files changed, 476432 insertions(+), 232826 deletions(-)
delete mode 100644 api/vendor/github.com/go-openapi/analysis/appveyor.yml
create mode 100644 api/vendor/github.com/go-openapi/jsonpointer/errors.go
delete mode 100644 api/vendor/github.com/go-openapi/spec/appveyor.yml
delete mode 100644 api/vendor/github.com/go-openapi/spec/bindata.go
create mode 100644 api/vendor/github.com/go-openapi/spec/embed.go
create mode 100644 api/vendor/github.com/go-openapi/spec/schemas/jsonschema-draft-04.json
create mode 100644 api/vendor/github.com/go-openapi/spec/schemas/v2/schema.json
delete mode 100644 api/vendor/github.com/go-openapi/spec/url_go18.go
create mode 100644 api/vendor/github.com/go-openapi/swag/errors.go
create mode 100644 api/vendor/github.com/go-openapi/validate/BENCHMARK.md
create mode 100644 api/vendor/github.com/go-openapi/validate/pools.go
create mode 100644 api/vendor/github.com/go-openapi/validate/pools_debug.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/AUTHORS
delete mode 100644 api/vendor/github.com/gogo/protobuf/CONTRIBUTORS
delete mode 100644 api/vendor/github.com/gogo/protobuf/LICENSE
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/Makefile
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/clone.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/custom_gogo.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/decode.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/deprecated.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/discard.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/duration.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/duration_gogo.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/encode.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/encode_gogo.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/equal.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/extensions.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/extensions_gogo.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/lib.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/lib_gogo.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/message_set.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/pointer_reflect.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/pointer_reflect_gogo.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/pointer_unsafe.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/pointer_unsafe_gogo.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/properties.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/properties_gogo.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/skip_gogo.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/table_marshal.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/table_marshal_gogo.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/table_merge.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/table_unmarshal.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/table_unmarshal_gogo.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/text.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/text_gogo.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/text_parser.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/timestamp.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/timestamp_gogo.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/wrappers.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/proto/wrappers_gogo.go
delete mode 100644 api/vendor/github.com/gogo/protobuf/sortkeys/sortkeys.go
create mode 100644 api/vendor/github.com/google/uuid/CHANGELOG.md
create mode 100644 api/vendor/github.com/google/uuid/CONTRIBUTING.md
create mode 100644 api/vendor/github.com/google/uuid/CONTRIBUTORS
rename {vendor/github.com/imdario/mergo => api/vendor/github.com/google/uuid}/LICENSE (92%)
create mode 100644 api/vendor/github.com/google/uuid/README.md
create mode 100644 api/vendor/github.com/google/uuid/dce.go
create mode 100644 api/vendor/github.com/google/uuid/doc.go
create mode 100644 api/vendor/github.com/google/uuid/hash.go
create mode 100644 api/vendor/github.com/google/uuid/marshal.go
create mode 100644 api/vendor/github.com/google/uuid/node.go
create mode 100644 api/vendor/github.com/google/uuid/node_js.go
create mode 100644 api/vendor/github.com/google/uuid/node_net.go
create mode 100644 api/vendor/github.com/google/uuid/null.go
create mode 100644 api/vendor/github.com/google/uuid/sql.go
create mode 100644 api/vendor/github.com/google/uuid/time.go
create mode 100644 api/vendor/github.com/google/uuid/util.go
create mode 100644 api/vendor/github.com/google/uuid/uuid.go
create mode 100644 api/vendor/github.com/google/uuid/version1.go
create mode 100644 api/vendor/github.com/google/uuid/version4.go
create mode 100644 api/vendor/github.com/google/uuid/version6.go
create mode 100644 api/vendor/github.com/google/uuid/version7.go
create mode 100644 api/vendor/github.com/openshift/installer/LICENSE
create mode 100644 api/vendor/github.com/openshift/installer/NOTICE
create mode 100644 api/vendor/github.com/openshift/installer/pkg/types/vsphere/OWNERS
create mode 100644 api/vendor/github.com/openshift/installer/pkg/types/vsphere/doc.go
create mode 100644 api/vendor/github.com/openshift/installer/pkg/types/vsphere/machinepool.go
create mode 100644 api/vendor/github.com/openshift/installer/pkg/types/vsphere/metadata.go
create mode 100644 api/vendor/github.com/openshift/installer/pkg/types/vsphere/platform.go
create mode 100644 api/vendor/github.com/openshift/installer/pkg/types/vsphere/zz_generated.deepcopy.go
create mode 100644 api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/codec_cache.go
create mode 100644 api/vendor/k8s.io/api/authorization/v1/generated.protomessage.pb.go
create mode 100644 api/vendor/k8s.io/api/authorization/v1/zz_generated.model_name.go
create mode 100644 api/vendor/k8s.io/api/core/v1/generated.protomessage.pb.go
create mode 100644 api/vendor/k8s.io/api/core/v1/zz_generated.model_name.go
create mode 100644 api/vendor/k8s.io/api/rbac/v1/generated.protomessage.pb.go
create mode 100644 api/vendor/k8s.io/api/rbac/v1/zz_generated.model_name.go
create mode 100644 api/vendor/k8s.io/apimachinery/pkg/api/resource/generated.protomessage.pb.go
create mode 100644 api/vendor/k8s.io/apimachinery/pkg/api/resource/zz_generated.model_name.go
create mode 100644 api/vendor/k8s.io/apimachinery/pkg/api/validate/constraints/constraints.go
create mode 100644 api/vendor/k8s.io/apimachinery/pkg/api/validate/content/decimal_int.go
create mode 100644 api/vendor/k8s.io/apimachinery/pkg/api/validate/content/dns.go
create mode 100644 api/vendor/k8s.io/apimachinery/pkg/api/validate/content/errors.go
create mode 100644 api/vendor/k8s.io/apimachinery/pkg/api/validate/content/identifier.go
create mode 100644 api/vendor/k8s.io/apimachinery/pkg/api/validate/content/kube.go
create mode 100644 api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.protomessage.pb.go
create mode 100644 api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.model_name.go
create mode 100644 api/vendor/k8s.io/apimachinery/pkg/runtime/generated.protomessage.pb.go
create mode 100644 api/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.protomessage.pb.go
create mode 100644 api/vendor/k8s.io/apimachinery/pkg/runtime/zz_generated.model_name.go
create mode 100644 api/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.protomessage.pb.go
create mode 100644 api/vendor/k8s.io/apimachinery/pkg/util/intstr/zz_generated.model_name.go
rename {vendor/github.com/google/gofuzz => api/vendor/k8s.io/kube-openapi}/LICENSE (100%)
create mode 100644 api/vendor/k8s.io/kube-openapi/pkg/util/trie.go
create mode 100644 api/vendor/k8s.io/kube-openapi/pkg/util/util.go
create mode 100644 vendor/cel.dev/expr/.bazelversion
create mode 100644 vendor/cel.dev/expr/.gitattributes
create mode 100644 vendor/cel.dev/expr/.gitignore
create mode 100644 vendor/cel.dev/expr/BUILD.bazel
create mode 100644 vendor/cel.dev/expr/CODE_OF_CONDUCT.md
create mode 100644 vendor/cel.dev/expr/CONTRIBUTING.md
create mode 100644 vendor/cel.dev/expr/GOVERNANCE.md
rename vendor/{github.com/moby/spdystream => cel.dev/expr}/LICENSE (100%)
create mode 100644 vendor/cel.dev/expr/MAINTAINERS.md
create mode 100644 vendor/cel.dev/expr/MODULE.bazel
create mode 100644 vendor/cel.dev/expr/README.md
create mode 100644 vendor/cel.dev/expr/WORKSPACE
create mode 100644 vendor/cel.dev/expr/WORKSPACE.bzlmod
create mode 100644 vendor/cel.dev/expr/checked.pb.go
create mode 100644 vendor/cel.dev/expr/cloudbuild.yaml
create mode 100644 vendor/cel.dev/expr/eval.pb.go
create mode 100644 vendor/cel.dev/expr/explain.pb.go
create mode 100644 vendor/cel.dev/expr/regen_go_proto.sh
create mode 100644 vendor/cel.dev/expr/regen_go_proto_canonical_protos.sh
create mode 100644 vendor/cel.dev/expr/syntax.pb.go
create mode 100644 vendor/cel.dev/expr/value.pb.go
create mode 100644 vendor/github.com/alecthomas/units/renovate.json5
delete mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/LICENSE
delete mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/antlrdoc.go
delete mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_config.go
delete mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/atn_config_set.go
delete mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/input_stream.go
delete mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/jcollect.go
delete mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/prediction_context.go
delete mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/prediction_mode.go
delete mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/rule_context.go
delete mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/v4/utils_set.go
create mode 100644 vendor/github.com/antlr4-go/antlr/v4/.gitignore
create mode 100644 vendor/github.com/antlr4-go/antlr/v4/LICENSE
create mode 100644 vendor/github.com/antlr4-go/antlr/v4/README.md
create mode 100644 vendor/github.com/antlr4-go/antlr/v4/antlrdoc.go
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/atn.go (94%)
create mode 100644 vendor/github.com/antlr4-go/antlr/v4/atn_config.go
create mode 100644 vendor/github.com/antlr4-go/antlr/v4/atn_config_set.go
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/atn_deserialization_options.go (86%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/atn_deserializer.go (97%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/atn_simulator.go (66%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/atn_state.go (65%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/atn_type.go (100%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/char_stream.go (89%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/common_token_factory.go (100%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/common_token_stream.go (88%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/comparators.go (82%)
create mode 100644 vendor/github.com/antlr4-go/antlr/v4/configuration.go
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/dfa.go (76%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/dfa_serializer.go (97%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/dfa_state.go (81%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/diagnostic_error_listener.go (92%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/error_listener.go (62%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/error_strategy.go (58%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/errors.go (73%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/file_stream.go (52%)
create mode 100644 vendor/github.com/antlr4-go/antlr/v4/input_stream.go
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/int_stream.go (100%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/interval_set.go (82%)
create mode 100644 vendor/github.com/antlr4-go/antlr/v4/jcollect.go
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/lexer.go (78%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/lexer_action.go (78%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/lexer_action_executor.go (70%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/lexer_atn_simulator.go (80%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/ll1_analyzer.go (73%)
create mode 100644 vendor/github.com/antlr4-go/antlr/v4/nostatistics.go
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/parser.go (80%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/parser_atn_simulator.go (64%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/parser_rule_context.go (77%)
create mode 100644 vendor/github.com/antlr4-go/antlr/v4/prediction_context.go
create mode 100644 vendor/github.com/antlr4-go/antlr/v4/prediction_context_cache.go
create mode 100644 vendor/github.com/antlr4-go/antlr/v4/prediction_mode.go
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/recognizer.go (70%)
create mode 100644 vendor/github.com/antlr4-go/antlr/v4/rule_context.go
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/semantic_context.go (92%)
create mode 100644 vendor/github.com/antlr4-go/antlr/v4/statistics.go
create mode 100644 vendor/github.com/antlr4-go/antlr/v4/stats_data.go
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/token.go (86%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/token_source.go (100%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/token_stream.go (90%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/tokenstream_rewriter.go (73%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/trace_listener.go (100%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/transition.go (67%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/tree.go (62%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/trees.go (81%)
rename vendor/github.com/{antlr/antlr4/runtime/Go => antlr4-go}/antlr/v4/utils.go (85%)
create mode 100644 vendor/github.com/coreos/go-systemd/v22/unit/doc.go
create mode 100644 vendor/github.com/coreos/ignition/v2/config/shared/parse/unit.go
create mode 100644 vendor/github.com/coreos/ignition/v2/config/v3_0/types/systemd.go
create mode 100644 vendor/github.com/coreos/ignition/v2/config/v3_1/types/systemd.go
create mode 100644 vendor/github.com/coreos/ignition/v2/config/v3_2/types/systemd.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/disk/disk_wasip1.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/blockgroup.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/checksum.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/consts.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/crc/crc16.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/crc/crc32.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/directory.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/directoryentry.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/dirhash.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/ext4.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/ext4.md
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/extent.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/features.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/file.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/fileinfo.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/groupdescriptors.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/inode.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/journaldevice_other.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/journaldevice_shared.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/journaldevice_windows.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/md4/md4.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/miscflags.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/mountoptions.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/superblock.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/ext4/util.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/finalize_wasip1.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/lru.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/util/bitmap.go
create mode 100644 vendor/github.com/diskfs/go-diskfs/util/uniqify.go
rename vendor/{gopkg.in/djherbis/times.v1 => github.com/djherbis/times}/LICENSE (100%)
rename vendor/{gopkg.in/djherbis/times.v1 => github.com/djherbis/times}/README.md (82%)
rename vendor/{gopkg.in/djherbis/times.v1 => github.com/djherbis/times}/ctime_windows.go (100%)
rename vendor/{gopkg.in/djherbis/times.v1 => github.com/djherbis/times}/js.cover.dockerfile (75%)
rename vendor/{gopkg.in/djherbis/times.v1 => github.com/djherbis/times}/js.cover.sh (100%)
create mode 100644 vendor/github.com/djherbis/times/linux.cover.dockerfile
create mode 100644 vendor/github.com/djherbis/times/linux.cover.sh
rename vendor/{gopkg.in/djherbis/times.v1 => github.com/djherbis/times}/times.go (100%)
rename vendor/{gopkg.in/djherbis/times.v1 => github.com/djherbis/times}/times_aix.go (100%)
rename vendor/{gopkg.in/djherbis/times.v1 => github.com/djherbis/times}/times_darwin.go (100%)
rename vendor/{gopkg.in/djherbis/times.v1 => github.com/djherbis/times}/times_dragonfly.go (100%)
rename vendor/{gopkg.in/djherbis/times.v1 => github.com/djherbis/times}/times_freebsd.go (100%)
rename vendor/{gopkg.in/djherbis/times.v1 => github.com/djherbis/times}/times_js.go (100%)
create mode 100644 vendor/github.com/djherbis/times/times_linux.go
rename vendor/{gopkg.in/djherbis/times.v1 => github.com/djherbis/times}/times_nacl.go (100%)
rename vendor/{gopkg.in/djherbis/times.v1 => github.com/djherbis/times}/times_netbsd.go (100%)
rename vendor/{gopkg.in/djherbis/times.v1 => github.com/djherbis/times}/times_openbsd.go (100%)
rename vendor/{gopkg.in/djherbis/times.v1 => github.com/djherbis/times}/times_plan9.go (100%)
rename vendor/{gopkg.in/djherbis/times.v1 => github.com/djherbis/times}/times_solaris.go (100%)
rename vendor/{gopkg.in/djherbis/times.v1/times_linux.go => github.com/djherbis/times/times_wasip1.go} (60%)
rename vendor/{gopkg.in/djherbis/times.v1 => github.com/djherbis/times}/times_windows.go (100%)
rename vendor/{gopkg.in/djherbis/times.v1 => github.com/djherbis/times}/use_generic_stat.go (58%)
delete mode 100644 vendor/github.com/emicklei/go-restful/v3/.travis.yml
delete mode 100644 vendor/github.com/fsnotify/fsnotify/.editorconfig
delete mode 100644 vendor/github.com/fsnotify/fsnotify/.gitattributes
create mode 100644 vendor/github.com/fsnotify/fsnotify/internal/darwin.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/internal/debug_darwin.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/internal/debug_dragonfly.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/internal/debug_freebsd.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/internal/debug_kqueue.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/internal/debug_linux.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/internal/debug_netbsd.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/internal/debug_openbsd.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/internal/debug_solaris.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/internal/debug_windows.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/internal/freebsd.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/internal/internal.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/internal/unix.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/internal/unix2.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/internal/windows.go
delete mode 100644 vendor/github.com/fsnotify/fsnotify/mkdoc.zsh
create mode 100644 vendor/github.com/fsnotify/fsnotify/shared.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/staticcheck.conf
create mode 100644 vendor/github.com/fxamacker/cbor/v2/.gitignore
create mode 100644 vendor/github.com/fxamacker/cbor/v2/.golangci.yml
create mode 100644 vendor/github.com/fxamacker/cbor/v2/CODE_OF_CONDUCT.md
create mode 100644 vendor/github.com/fxamacker/cbor/v2/CONTRIBUTING.md
rename vendor/github.com/{josharian/intern/license.md => fxamacker/cbor/v2/LICENSE} (95%)
create mode 100644 vendor/github.com/fxamacker/cbor/v2/README.md
create mode 100644 vendor/github.com/fxamacker/cbor/v2/SECURITY.md
create mode 100644 vendor/github.com/fxamacker/cbor/v2/bytestring.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/cache.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/common.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/decode.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/diagnose.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/doc.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/encode.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/encode_map.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/omitzero_go124.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/omitzero_pre_go124.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/simplevalue.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/stream.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/structfields.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/tag.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/valid.go
delete mode 100644 vendor/github.com/ghodss/yaml/.gitignore
delete mode 100644 vendor/github.com/ghodss/yaml/.travis.yml
delete mode 100644 vendor/github.com/ghodss/yaml/LICENSE
delete mode 100644 vendor/github.com/ghodss/yaml/README.md
delete mode 100644 vendor/github.com/ghodss/yaml/fields.go
delete mode 100644 vendor/github.com/ghodss/yaml/yaml.go
create mode 100644 vendor/github.com/go-errors/errors/join_unwrap_1_20.go
create mode 100644 vendor/github.com/go-errors/errors/join_unwrap_backward.go
create mode 100644 vendor/github.com/go-openapi/jsonpointer/errors.go
create mode 100644 vendor/github.com/go-openapi/runtime/.gitattributes
create mode 100644 vendor/github.com/go-openapi/runtime/.golangci.yml
delete mode 100644 vendor/github.com/go-openapi/runtime/.travis.yml
create mode 100644 vendor/github.com/go-openapi/runtime/client/opentelemetry.go
create mode 100644 vendor/github.com/go-openapi/runtime/client/opentracing.go
create mode 100644 vendor/github.com/go-openapi/runtime/csv_options.go
delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/go18.go
delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/pre_go18.go
create mode 100644 vendor/github.com/go-openapi/runtime/middleware/swaggerui_oauth2.go
create mode 100644 vendor/github.com/go-openapi/runtime/middleware/ui_options.go
create mode 100644 vendor/github.com/go-openapi/swag/.codecov.yml
create mode 100644 vendor/github.com/go-openapi/swag/.mockery.yml
create mode 100644 vendor/github.com/go-openapi/swag/SECURITY.md
rename vendor/github.com/{google/shlex/COPYING => go-openapi/swag/cmdutils/LICENSE} (100%)
create mode 100644 vendor/github.com/go-openapi/swag/cmdutils/cmd_utils.go
create mode 100644 vendor/github.com/go-openapi/swag/cmdutils/doc.go
create mode 100644 vendor/github.com/go-openapi/swag/cmdutils_iface.go
rename vendor/github.com/{metal3-io/baremetal-operator/pkg/hardwareutils => go-openapi/swag/conv}/LICENSE (99%)
create mode 100644 vendor/github.com/go-openapi/swag/conv/convert.go
create mode 100644 vendor/github.com/go-openapi/swag/conv/convert_types.go
create mode 100644 vendor/github.com/go-openapi/swag/conv/doc.go
create mode 100644 vendor/github.com/go-openapi/swag/conv/format.go
create mode 100644 vendor/github.com/go-openapi/swag/conv/sizeof.go
create mode 100644 vendor/github.com/go-openapi/swag/conv/type_constraints.go
create mode 100644 vendor/github.com/go-openapi/swag/conv_iface.go
delete mode 100644 vendor/github.com/go-openapi/swag/convert.go
delete mode 100644 vendor/github.com/go-openapi/swag/convert_types.go
create mode 100644 vendor/github.com/go-openapi/swag/fileutils/LICENSE
create mode 100644 vendor/github.com/go-openapi/swag/fileutils/doc.go
create mode 100644 vendor/github.com/go-openapi/swag/fileutils/file.go
rename vendor/github.com/go-openapi/swag/{ => fileutils}/path.go (58%)
create mode 100644 vendor/github.com/go-openapi/swag/fileutils_iface.go
delete mode 100644 vendor/github.com/go-openapi/swag/initialism_index.go
delete mode 100644 vendor/github.com/go-openapi/swag/json.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonname/LICENSE
create mode 100644 vendor/github.com/go-openapi/swag/jsonname/doc.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonname/name_provider.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonname_iface.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/LICENSE
create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/README.md
create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/doc.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/doc.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/ifaces.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/registry_iface.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/registry.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/doc.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/concat.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/doc.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/json.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonutils/ordered_map.go
create mode 100644 vendor/github.com/go-openapi/swag/jsonutils_iface.go
create mode 100644 vendor/github.com/go-openapi/swag/loading/LICENSE
create mode 100644 vendor/github.com/go-openapi/swag/loading/doc.go
create mode 100644 vendor/github.com/go-openapi/swag/loading/errors.go
create mode 100644 vendor/github.com/go-openapi/swag/loading/json.go
rename vendor/github.com/go-openapi/swag/{ => loading}/loading.go (59%)
create mode 100644 vendor/github.com/go-openapi/swag/loading/options.go
create mode 100644 vendor/github.com/go-openapi/swag/loading/yaml.go
create mode 100644 vendor/github.com/go-openapi/swag/loading_iface.go
rename vendor/github.com/go-openapi/swag/{ => mangling}/BENCHMARK.md (53%)
create mode 100644 vendor/github.com/go-openapi/swag/mangling/LICENSE
create mode 100644 vendor/github.com/go-openapi/swag/mangling/doc.go
create mode 100644 vendor/github.com/go-openapi/swag/mangling/initialism_index.go
create mode 100644 vendor/github.com/go-openapi/swag/mangling/name_lexem.go
create mode 100644 vendor/github.com/go-openapi/swag/mangling/name_mangler.go
create mode 100644 vendor/github.com/go-openapi/swag/mangling/options.go
create mode 100644 vendor/github.com/go-openapi/swag/mangling/pools.go
create mode 100644 vendor/github.com/go-openapi/swag/mangling/split.go
rename vendor/github.com/go-openapi/swag/{ => mangling}/string_bytes.go (60%)
create mode 100644 vendor/github.com/go-openapi/swag/mangling/util.go
create mode 100644 vendor/github.com/go-openapi/swag/mangling_iface.go
delete mode 100644 vendor/github.com/go-openapi/swag/name_lexem.go
delete mode 100644 vendor/github.com/go-openapi/swag/net.go
create mode 100644 vendor/github.com/go-openapi/swag/netutils/LICENSE
create mode 100644 vendor/github.com/go-openapi/swag/netutils/doc.go
create mode 100644 vendor/github.com/go-openapi/swag/netutils/net.go
create mode 100644 vendor/github.com/go-openapi/swag/netutils_iface.go
delete mode 100644 vendor/github.com/go-openapi/swag/split.go
create mode 100644 vendor/github.com/go-openapi/swag/stringutils/LICENSE
create mode 100644 vendor/github.com/go-openapi/swag/stringutils/collection_formats.go
create mode 100644 vendor/github.com/go-openapi/swag/stringutils/doc.go
create mode 100644 vendor/github.com/go-openapi/swag/stringutils/strings.go
create mode 100644 vendor/github.com/go-openapi/swag/stringutils_iface.go
create mode 100644 vendor/github.com/go-openapi/swag/typeutils/LICENSE
create mode 100644 vendor/github.com/go-openapi/swag/typeutils/doc.go
create mode 100644 vendor/github.com/go-openapi/swag/typeutils/types.go
create mode 100644 vendor/github.com/go-openapi/swag/typeutils_iface.go
delete mode 100644 vendor/github.com/go-openapi/swag/util.go
delete mode 100644 vendor/github.com/go-openapi/swag/yaml.go
create mode 100644 vendor/github.com/go-openapi/swag/yamlutils/LICENSE
create mode 100644 vendor/github.com/go-openapi/swag/yamlutils/doc.go
create mode 100644 vendor/github.com/go-openapi/swag/yamlutils/errors.go
create mode 100644 vendor/github.com/go-openapi/swag/yamlutils/ordered_map.go
create mode 100644 vendor/github.com/go-openapi/swag/yamlutils/yaml.go
create mode 100644 vendor/github.com/go-openapi/swag/yamlutils_iface.go
delete mode 100644 vendor/github.com/gogo/protobuf/sortkeys/sortkeys.go
delete mode 100644 vendor/github.com/golang/groupcache/LICENSE
delete mode 100644 vendor/github.com/golang/groupcache/lru/lru.go
create mode 100644 vendor/github.com/golang/mock/gomock/doc.go
delete mode 100644 vendor/github.com/golang/protobuf/ptypes/any.go
delete mode 100644 vendor/github.com/golang/protobuf/ptypes/any/any.pb.go
delete mode 100644 vendor/github.com/golang/protobuf/ptypes/doc.go
delete mode 100644 vendor/github.com/golang/protobuf/ptypes/duration.go
delete mode 100644 vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go
delete mode 100644 vendor/github.com/golang/protobuf/ptypes/timestamp.go
delete mode 100644 vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
create mode 100644 vendor/github.com/google/cel-go/cel/folding.go
create mode 100644 vendor/github.com/google/cel-go/cel/inlining.go
create mode 100644 vendor/github.com/google/cel-go/cel/optimizer.go
create mode 100644 vendor/github.com/google/cel-go/cel/prompt.go
create mode 100644 vendor/github.com/google/cel-go/cel/templates/authoring.tmpl
delete mode 100644 vendor/github.com/google/cel-go/checker/standard.go
create mode 100644 vendor/github.com/google/cel-go/common/ast/conversion.go
create mode 100644 vendor/github.com/google/cel-go/common/ast/factory.go
create mode 100644 vendor/github.com/google/cel-go/common/ast/navigable.go
create mode 100644 vendor/github.com/google/cel-go/common/env/BUILD.bazel
create mode 100644 vendor/github.com/google/cel-go/common/env/env.go
create mode 100644 vendor/github.com/google/cel-go/common/types/format.go
create mode 100644 vendor/github.com/google/cel-go/ext/comprehensions.go
create mode 100644 vendor/github.com/google/cel-go/ext/extension_option_factory.go
create mode 100644 vendor/github.com/google/cel-go/ext/formatting.go
create mode 100644 vendor/github.com/google/cel-go/ext/formatting_v2.go
create mode 100644 vendor/github.com/google/cel-go/ext/regex.go
delete mode 100644 vendor/github.com/google/cel-go/interpreter/formatting.go
create mode 100644 vendor/github.com/google/gnostic-models/openapiv3/annotations.pb.go
create mode 100644 vendor/github.com/google/gnostic-models/openapiv3/annotations.proto
delete mode 100644 vendor/github.com/google/gofuzz/.travis.yml
delete mode 100644 vendor/github.com/google/gofuzz/CONTRIBUTING.md
delete mode 100644 vendor/github.com/google/gofuzz/fuzz.go
delete mode 100644 vendor/github.com/google/shlex/README
delete mode 100644 vendor/github.com/google/shlex/shlex.go
delete mode 100644 vendor/github.com/gorilla/websocket/.gitignore
delete mode 100644 vendor/github.com/gorilla/websocket/AUTHORS
delete mode 100644 vendor/github.com/gorilla/websocket/LICENSE
delete mode 100644 vendor/github.com/gorilla/websocket/README.md
delete mode 100644 vendor/github.com/gorilla/websocket/client.go
delete mode 100644 vendor/github.com/gorilla/websocket/compression.go
delete mode 100644 vendor/github.com/gorilla/websocket/conn.go
delete mode 100644 vendor/github.com/gorilla/websocket/doc.go
delete mode 100644 vendor/github.com/gorilla/websocket/join.go
delete mode 100644 vendor/github.com/gorilla/websocket/json.go
delete mode 100644 vendor/github.com/gorilla/websocket/mask.go
delete mode 100644 vendor/github.com/gorilla/websocket/mask_safe.go
delete mode 100644 vendor/github.com/gorilla/websocket/prepared.go
delete mode 100644 vendor/github.com/gorilla/websocket/proxy.go
delete mode 100644 vendor/github.com/gorilla/websocket/server.go
delete mode 100644 vendor/github.com/gorilla/websocket/util.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options/BUILD.bazel
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options/annotations.pb.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options/annotations.proto
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options/annotations_protoopaque.pb.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options/buf.gen.yaml
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options/openapiv2.pb.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options/openapiv2.proto
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options/openapiv2_protoopaque.pb.go
delete mode 100644 vendor/github.com/imdario/mergo/.deepsource.toml
delete mode 100644 vendor/github.com/imdario/mergo/.gitignore
delete mode 100644 vendor/github.com/imdario/mergo/.travis.yml
delete mode 100644 vendor/github.com/imdario/mergo/CODE_OF_CONDUCT.md
delete mode 100644 vendor/github.com/imdario/mergo/CONTRIBUTING.md
delete mode 100644 vendor/github.com/imdario/mergo/README.md
delete mode 100644 vendor/github.com/imdario/mergo/SECURITY.md
delete mode 100644 vendor/github.com/imdario/mergo/doc.go
delete mode 100644 vendor/github.com/imdario/mergo/map.go
delete mode 100644 vendor/github.com/imdario/mergo/merge.go
delete mode 100644 vendor/github.com/imdario/mergo/mergo.go
delete mode 100644 vendor/github.com/itchyny/gojq/math.go
delete mode 100644 vendor/github.com/josharian/intern/README.md
delete mode 100644 vendor/github.com/josharian/intern/intern.go
create mode 100644 vendor/github.com/kylelemons/godebug/LICENSE
create mode 100644 vendor/github.com/kylelemons/godebug/diff/diff.go
delete mode 100644 vendor/github.com/mailru/easyjson/LICENSE
delete mode 100644 vendor/github.com/mailru/easyjson/buffer/pool.go
delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/bytestostr.go
delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go
delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/error.go
delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/lexer.go
delete mode 100644 vendor/github.com/mailru/easyjson/jwriter/writer.go
delete mode 100644 vendor/github.com/matttproud/golang_protobuf_extensions/v2/NOTICE
delete mode 100644 vendor/github.com/matttproud/golang_protobuf_extensions/v2/pbutil/.gitignore
delete mode 100644 vendor/github.com/matttproud/golang_protobuf_extensions/v2/pbutil/Makefile
delete mode 100644 vendor/github.com/matttproud/golang_protobuf_extensions/v2/pbutil/decode.go
delete mode 100644 vendor/github.com/matttproud/golang_protobuf_extensions/v2/pbutil/encode.go
delete mode 100644 vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/baremetalhost_validation.go
delete mode 100644 vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/baremetalhost_webhook.go
create mode 100644 vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/baremetalswitch_types.go
delete mode 100644 vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/bmceventsubscription_validation.go
delete mode 100644 vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/bmceventsubscription_webhook.go
create mode 100644 vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/dataimage_types.go
create mode 100644 vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/doc.go
create mode 100644 vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/hostclaim_types.go
create mode 100644 vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/hostdeploypolicy_types.go
create mode 100644 vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/hostfirmwarecomponents_types.go
create mode 100644 vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/hostnetworkattachment_types.go
create mode 100644 vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/hostupdatepolicy_types.go
delete mode 100644 vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/access.go
delete mode 100644 vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/credentials.go
delete mode 100644 vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/errors.go
delete mode 100644 vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/ibmc.go
delete mode 100644 vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/idrac.go
delete mode 100644 vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/idrac_virtualmedia.go
delete mode 100644 vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/ilo4.go
delete mode 100644 vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/ilo5.go
delete mode 100644 vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/ipmi.go
delete mode 100644 vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/irmc.go
delete mode 100644 vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/redfish.go
delete mode 100644 vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/bmc/redfish_virtualmedia.go
delete mode 100644 vendor/github.com/moby/spdystream/CONTRIBUTING.md
delete mode 100644 vendor/github.com/moby/spdystream/MAINTAINERS
delete mode 100644 vendor/github.com/moby/spdystream/NOTICE
delete mode 100644 vendor/github.com/moby/spdystream/README.md
delete mode 100644 vendor/github.com/moby/spdystream/connection.go
delete mode 100644 vendor/github.com/moby/spdystream/handlers.go
delete mode 100644 vendor/github.com/moby/spdystream/priority.go
delete mode 100644 vendor/github.com/moby/spdystream/spdy/PATENTS
delete mode 100644 vendor/github.com/moby/spdystream/spdy/dictionary.go
delete mode 100644 vendor/github.com/moby/spdystream/spdy/options.go
delete mode 100644 vendor/github.com/moby/spdystream/spdy/read.go
delete mode 100644 vendor/github.com/moby/spdystream/spdy/types.go
delete mode 100644 vendor/github.com/moby/spdystream/spdy/write.go
delete mode 100644 vendor/github.com/moby/spdystream/stream.go
delete mode 100644 vendor/github.com/moby/spdystream/utils.go
delete mode 100644 vendor/github.com/mxk/go-flowrate/LICENSE
delete mode 100644 vendor/github.com/mxk/go-flowrate/flowrate/flowrate.go
delete mode 100644 vendor/github.com/mxk/go-flowrate/flowrate/io.go
delete mode 100644 vendor/github.com/mxk/go-flowrate/flowrate/util.go
create mode 100644 vendor/github.com/onsi/gomega/matchers/internal/miter/type_support_iter.go
create mode 100644 vendor/github.com/onsi/gomega/matchers/internal/miter/type_support_noiter.go
create mode 100644 vendor/github.com/openshift/api/.coderabbit.yaml
create mode 100644 vendor/github.com/openshift/api/annotations/annotations.go
create mode 100644 vendor/github.com/openshift/api/apiextensions/install.go
create mode 100644 vendor/github.com/openshift/api/apiextensions/v1alpha1/Makefile
create mode 100644 vendor/github.com/openshift/api/apiextensions/v1alpha1/doc.go
create mode 100644 vendor/github.com/openshift/api/apiextensions/v1alpha1/register.go
create mode 100644 vendor/github.com/openshift/api/apiextensions/v1alpha1/types_compatibilityrequirement.go
create mode 100644 vendor/github.com/openshift/api/apiextensions/v1alpha1/zz_generated.deepcopy.go
create mode 100644 vendor/github.com/openshift/api/apiextensions/v1alpha1/zz_generated.featuregated-crd-manifests.yaml
create mode 100644 vendor/github.com/openshift/api/apiextensions/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/apiextensions/v1alpha1/zz_generated.swagger_doc_generated.go
create mode 100644 vendor/github.com/openshift/api/apiserver/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/apps/v1/generated.protomessage.pb.go
create mode 100644 vendor/github.com/openshift/api/apps/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/authorization/v1/generated.protomessage.pb.go
create mode 100644 vendor/github.com/openshift/api/authorization/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/build/v1/generated.protomessage.pb.go
create mode 100644 vendor/github.com/openshift/api/build/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/cloudnetwork/v1/generated.protomessage.pb.go
create mode 100644 vendor/github.com/openshift/api/cloudnetwork/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/config/v1/types_insights.go
create mode 100644 vendor/github.com/openshift/api/config/v1/zz_generated.model_name.go
delete mode 100644 vendor/github.com/openshift/api/config/v1alpha1/types_cluster_image_policy.go
create mode 100644 vendor/github.com/openshift/api/config/v1alpha1/types_crio_credential_provider_config.go
delete mode 100644 vendor/github.com/openshift/api/config/v1alpha1/types_image_policy.go
create mode 100644 vendor/github.com/openshift/api/config/v1alpha1/types_pki.go
create mode 100644 vendor/github.com/openshift/api/config/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/config/v1alpha2/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/console/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/etcd/README.md
create mode 100644 vendor/github.com/openshift/api/etcd/install.go
create mode 100644 vendor/github.com/openshift/api/etcd/v1/Makefile
create mode 100644 vendor/github.com/openshift/api/etcd/v1/doc.go
create mode 100644 vendor/github.com/openshift/api/etcd/v1/register.go
create mode 100644 vendor/github.com/openshift/api/etcd/v1/types_pacemakercluster.go
create mode 100644 vendor/github.com/openshift/api/etcd/v1/zz_generated.deepcopy.go
create mode 100644 vendor/github.com/openshift/api/etcd/v1/zz_generated.featuregated-crd-manifests.yaml
create mode 100644 vendor/github.com/openshift/api/etcd/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/etcd/v1/zz_generated.swagger_doc_generated.go
create mode 100644 vendor/github.com/openshift/api/etcd/v1alpha1/Makefile
create mode 100644 vendor/github.com/openshift/api/etcd/v1alpha1/doc.go
create mode 100644 vendor/github.com/openshift/api/etcd/v1alpha1/register.go
create mode 100644 vendor/github.com/openshift/api/etcd/v1alpha1/types_pacemakercluster.go
create mode 100644 vendor/github.com/openshift/api/etcd/v1alpha1/zz_generated.deepcopy.go
create mode 100644 vendor/github.com/openshift/api/etcd/v1alpha1/zz_generated.featuregated-crd-manifests.yaml
create mode 100644 vendor/github.com/openshift/api/etcd/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/etcd/v1alpha1/zz_generated.swagger_doc_generated.go
create mode 100644 vendor/github.com/openshift/api/helm/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/image/v1/generated.protomessage.pb.go
create mode 100644 vendor/github.com/openshift/api/image/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/imageregistry/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/kubecontrolplane/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/legacyconfig/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/machine/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/machine/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/machine/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/monitoring/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/network/v1/generated.protomessage.pb.go
create mode 100644 vendor/github.com/openshift/api/network/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/network/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/networkoperator/v1/generated.protomessage.pb.go
create mode 100644 vendor/github.com/openshift/api/networkoperator/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/oauth/v1/generated.protomessage.pb.go
create mode 100644 vendor/github.com/openshift/api/oauth/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/openshiftcontrolplane/v1/zz_generated.model_name.go
rename vendor/github.com/openshift/api/operator/v1/{types_ingress.go => types_ingresscontroller.go} (98%)
create mode 100644 vendor/github.com/openshift/api/operator/v1/types_kmsencryption.go
create mode 100644 vendor/github.com/openshift/api/operator/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/operator/v1alpha1/types_clusterapi.go
create mode 100644 vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/operatorcontrolplane/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/osin/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/project/v1/generated.protomessage.pb.go
create mode 100644 vendor/github.com/openshift/api/project/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/quota/v1/generated.protomessage.pb.go
create mode 100644 vendor/github.com/openshift/api/quota/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/route/v1/generated.protomessage.pb.go
create mode 100644 vendor/github.com/openshift/api/route/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/samples/v1/generated.protomessage.pb.go
create mode 100644 vendor/github.com/openshift/api/samples/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/security/v1/generated.protomessage.pb.go
create mode 100644 vendor/github.com/openshift/api/security/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/servicecertsigner/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/sharedresource/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/template/v1/generated.protomessage.pb.go
create mode 100644 vendor/github.com/openshift/api/template/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/api/user/v1/generated.protomessage.pb.go
create mode 100644 vendor/github.com/openshift/api/user/v1/zz_generated.model_name.go
create mode 100644 vendor/github.com/openshift/assisted-image-service/internal/common/version.go
create mode 100644 vendor/github.com/openshift/assisted-image-service/pkg/isoeditor/ignition_image.go
create mode 100644 vendor/github.com/openshift/assisted-image-service/pkg/isoeditor/initrd_addrsize.go
create mode 100644 vendor/github.com/openshift/assisted-image-service/pkg/isoeditor/isolate_file.go
create mode 100644 vendor/github.com/openshift/assisted-image-service/pkg/isoeditor/mock_executer.go
create mode 100644 vendor/github.com/openshift/assisted-image-service/pkg/isoeditor/mock_nmstate_handler.go
create mode 100644 vendor/github.com/openshift/assisted-image-service/pkg/isoeditor/nmstate_handler.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/acceptrisk.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/baremetalplatformspec.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clientcredentialconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clientsecretsecretreference.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/cloudloadbalancerconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/cloudloadbalancerips.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterimagepolicy.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterimagepolicyspec.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/clusterimagepolicystatus.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/custom.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalclaimssource.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalsourceauthentication.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalsourcecertificateauthorityconfigmapreference.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalsourcepredicate.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/externalsourcetls.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/extramapping.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gatherconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gathererconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/gatherers.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/ibmcloudplatformspec.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagepolicy.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagepolicyfulciocawithrekorrootoftrust.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagepolicypkirootoftrust.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagepolicypublickeyrootoftrust.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagepolicyspec.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagepolicystatus.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/imagesigstoreverificationpolicy.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/insightsdatagather.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/insightsdatagatherspec.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/kmspluginconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkdiagnostics.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkdiagnosticssourceplacement.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkdiagnosticstargetplacement.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/networkobservabilityspec.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nodestatus.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixfailuredomain.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/nutanixresourceidentifier.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcclientconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcclientreference.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcclientstatus.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/oidcprovider.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/openstackplatformspec.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/persistentvolumeclaimreference.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/persistentvolumeconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/pkicertificatesubject.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/policyfulciosubject.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/policyidentity.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/policymatchexactrepository.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/policymatchremapidentity.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/policyrootoftrust.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/prefixedclaimmapping.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/profilecustomizations.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/signaturestore.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/sourcedclaimmapping.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/sourceurl.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/storage.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimmapping.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimmappings.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimorexpressionmapping.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimvalidationcelrule.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenclaimvalidationrule.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenissuer.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenrequiredclaim.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/tokenuservalidationrule.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/usernameclaimmapping.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/usernameprefix.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vaultapproleauthentication.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vaultauthentication.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vaultconfigmapreference.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vaultkmspluginconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vaultsecretreference.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vaulttlsconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vspherefailuredomainhostgroup.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vspherefailuredomainregionaffinity.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/vspherefailuredomainzoneaffinity.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/additionalalertmanagerconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/alertmanagerconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/alertmanagercustomconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/audit.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/authorizationconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/basicauth.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/certificateconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clustermonitoring.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clustermonitoringspec.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/containerresource.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/criocredentialproviderconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/criocredentialproviderconfigspec.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/criocredentialproviderconfigstatus.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/custompkipolicy.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/defaultcertificateconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/dropequalactionconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/ecdsakeyconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/hashmodactionconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/keepequalactionconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/keyconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/kubestatemetricsconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/kubestatemetricsresourcelabels.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/label.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/labelmapactionconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/lowercaseactionconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/metadataconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/metadataconfigcustom.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/metricsserverconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/monitoringpluginconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/nodeexportercollectorbuddyinfoconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/nodeexportercollectorconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/nodeexportercollectorcpufreqconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/nodeexportercollectorethtoolconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/nodeexportercollectorksmdconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/nodeexportercollectormountstatsconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/nodeexportercollectornetclasscollectconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/nodeexportercollectornetclassconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/nodeexportercollectornetdevconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/nodeexportercollectorprocessesconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/nodeexportercollectorsoftirqsconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/nodeexportercollectorsystemdcollectconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/nodeexportercollectorsystemdconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/nodeexportercollectortcpstatconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/nodeexporterconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/oauth2.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/oauth2endpointparam.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/openshiftstatemetricsconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/persistentvolumeclaimreference.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/persistentvolumeconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/pki.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/pkicertificatemanagement.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/pkiprofile.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/pkispec.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/prometheusconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/prometheusoperatoradmissionwebhookconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/prometheusoperatorconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/prometheusremotewriteheader.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/queueconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/relabelactionconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/relabelconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/remotewriteauthorization.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/remotewritespec.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/replaceactionconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/retention.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/rsakeyconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/secretkeyselector.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/sigv4.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/storage.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/telemeterclientconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/thanosquerierconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/thanosquerierrequestloggingconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/tlsconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/uppercaseactionconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/userdefinedmonitoring.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha2/custom.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha2/gatherconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha2/gathererconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha2/gatherers.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha2/insightsdatagather.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha2/insightsdatagatherspec.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha2/persistentvolumeclaimreference.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha2/persistentvolumeconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha2/storage.go
create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusterimagepolicy.go
create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/imagepolicy.go
create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/insightsdatagather.go
create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/clustermonitoring.go
create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/criocredentialproviderconfig.go
create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha1/pki.go
create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha2/config_client.go
create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha2/doc.go
create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha2/generated_expansion.go
create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1alpha2/insightsdatagather.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/internal/internal.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/accesslogging.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/additionalnetworkdefinition.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/additionalroutingcapabilities.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/addpage.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/authentication.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/authenticationspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/authenticationstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsclassicloadbalancerparameters.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awscsidriverconfigspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsefsvolumemetrics.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsefsvolumemetricsrecursivewalkconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsloadbalancerparameters.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awsnetworkloadbalancerparameters.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awssubnets.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/azurecsidriverconfigspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/azurediskencryptionset.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/bgpmanagedconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/bootimageskewenforcementconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/bootimageskewenforcementstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/capability.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/capabilityvisibility.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clienttls.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/cloudcredential.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/cloudcredentialspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/cloudcredentialstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clusterbootimageautomatic.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clusterbootimagemanual.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clustercsidriver.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clustercsidriverspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clustercsidriverstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/clusternetworkentry.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/config.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/configmapfilereference.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/configspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/configstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/console.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consoleconfigroute.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consolecustomization.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consoleproviders.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consolespec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/consolestatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/containerloggingdestinationparameters.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/csidriverconfigspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/csisnapshotcontroller.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/csisnapshotcontrollerspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/csisnapshotcontrollerstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/defaultnetworkdefinition.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/developerconsolecatalogcategory.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/developerconsolecatalogcategorymeta.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/developerconsolecatalogcustomization.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/developerconsolecatalogtypes.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dns.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnscache.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnsnodeplacement.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnsovertlsconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnsspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnsstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/dnstransportconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/egressipconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/endpointpublishingstrategy.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/etcd.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/etcdspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/etcdstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/exportnetworkflows.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/featuresmigration.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/filereferencesource.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/forwardplugin.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gatewayconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gathererstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gatherstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gcpcsidriverconfigspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gcpkmskeyreference.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/gcploadbalancerparameters.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/generationstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/healthcheck.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/hostnetworkstrategy.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/httpcompressionpolicy.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/hybridoverlayconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ibmcloudcsidriverconfigspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ibmloadbalancerparameters.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingress.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontroller.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollercapturehttpcookie.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollercapturehttpcookieunion.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollercapturehttpheader.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollercapturehttpheaders.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpheader.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpheaderactions.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpheaderactionunion.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpheaders.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerhttpuniqueidheaderpolicy.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerlogging.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollersethttpheader.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollerstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollertuningoptions.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/insightsoperator.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/insightsoperatorspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/insightsoperatorstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/insightsreport.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipamconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipfixconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipsecconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipsecfullmodeconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipv4gatewayconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipv4ovnkubernetesconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipv6gatewayconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ipv6ovnkubernetesconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/irreconcilablevalidationoverrides.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kmsencryptionstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kmspluginhealthreport.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeapiserver.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeapiserverspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeapiserverstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubecontrollermanager.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubecontrollermanagerspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubecontrollermanagerstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubescheduler.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeschedulerspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubeschedulerstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubestorageversionmigrator.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubestorageversionmigratorspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/kubestorageversionmigratorstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/loadbalancerstrategy.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/loggingdestination.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/logo.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machineconfiguration.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machineconfigurationspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machineconfigurationstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machinemanager.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/machinemanagerselector.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/managedbootimages.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/mtumigration.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/mtumigrationvalues.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/netflowconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/network.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/networkmigration.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/networkspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/networkstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyclusterstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyspecaction.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyspecfile.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyspecsshkey.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicyspecunit.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatusaction.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatusfile.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatussshkey.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodedisruptionpolicystatusunit.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodeplacement.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodeportstrategy.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nodestatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nooverlayconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/oauthapiserverstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/olm.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/olmspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/olmstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftapiserver.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftapiserverspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftapiserverstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftcontrollermanager.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftcontrollermanagerspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftcontrollermanagerstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openshiftsdnconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/openstackloadbalancerparameters.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/operatorcondition.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/operatorspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/operatorstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ovnkubernetesconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/partialselector.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/perspective.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/perspectivevisibility.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/pinnedresourcereference.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/policyauditconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/privatestrategy.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/projectaccess.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/providerloadbalancerparameters.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/proxyconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/quickstarts.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/reloadservice.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/resourceattributesaccessreview.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/restartservice.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/routeadmissionpolicy.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/server.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/serviceaccountissuerstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/serviceca.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecaspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecastatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogapiserver.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogapiserverspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogapiserverstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogcontrollermanager.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogcontrollermanagerspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/servicecatalogcontrollermanagerstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/sflowconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/simplemacvlanconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticipamaddresses.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticipamconfig.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticipamdns.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticipamroutes.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticpodoperatorspec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/staticpodoperatorstatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/statuspageprovider.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/storage.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/storagespec.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/storagestatus.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/syslogloggingdestinationparameters.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/theme.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/upstream.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/upstreamresolvers.go
create mode 100644 vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/vspherecsidriverconfigspec.go
create mode 100644 vendor/github.com/openshift/cluster-baremetal-operator/provisioning/tls_profile.go
create mode 100644 vendor/github.com/openshift/installer/LICENSE
create mode 100644 vendor/github.com/openshift/installer/NOTICE
create mode 100644 vendor/github.com/openshift/installer/pkg/types/vsphere/OWNERS
create mode 100644 vendor/github.com/openshift/installer/pkg/types/vsphere/doc.go
create mode 100644 vendor/github.com/openshift/installer/pkg/types/vsphere/machinepool.go
create mode 100644 vendor/github.com/openshift/installer/pkg/types/vsphere/metadata.go
create mode 100644 vendor/github.com/openshift/installer/pkg/types/vsphere/platform.go
create mode 100644 vendor/github.com/openshift/installer/pkg/types/vsphere/zz_generated.deepcopy.go
create mode 100644 vendor/github.com/openshift/library-go/pkg/apiserver/jsonpatch/jsonpatch.go
create mode 100644 vendor/github.com/openshift/library-go/pkg/crypto/cert_config.go
create mode 100644 vendor/github.com/openshift/library-go/pkg/crypto/keygen.go
create mode 100644 vendor/github.com/openshift/library-go/pkg/crypto/options.go
create mode 100644 vendor/github.com/openshift/library-go/pkg/crypto/tls_adherence.go
delete mode 100644 vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/event_helpers.go
create mode 100644 vendor/github.com/openshift/library-go/pkg/operator/resource/resourceapply/networking.go
create mode 100644 vendor/github.com/openshift/library-go/pkg/operator/resource/resourcehelper/event_helpers.go
create mode 100644 vendor/github.com/openshift/library-go/pkg/operator/resource/resourceread/apiregistration.go
create mode 100644 vendor/github.com/openshift/library-go/pkg/operator/resource/resourceread/config.go
create mode 100644 vendor/github.com/openshift/library-go/pkg/operator/resource/resourceread/networking.go
create mode 100644 vendor/github.com/openshift/library-go/pkg/operator/v1helpers/canonicalize.go
create mode 100644 vendor/github.com/opentracing/opentracing-go/.gitignore
create mode 100644 vendor/github.com/opentracing/opentracing-go/.travis.yml
create mode 100644 vendor/github.com/opentracing/opentracing-go/CHANGELOG.md
rename vendor/{sigs.k8s.io/structured-merge-diff/v4 => github.com/opentracing/opentracing-go}/LICENSE (99%)
create mode 100644 vendor/github.com/opentracing/opentracing-go/Makefile
create mode 100644 vendor/github.com/opentracing/opentracing-go/README.md
create mode 100644 vendor/github.com/opentracing/opentracing-go/ext.go
create mode 100644 vendor/github.com/opentracing/opentracing-go/ext/field.go
create mode 100644 vendor/github.com/opentracing/opentracing-go/ext/tags.go
create mode 100644 vendor/github.com/opentracing/opentracing-go/globaltracer.go
create mode 100644 vendor/github.com/opentracing/opentracing-go/gocontext.go
create mode 100644 vendor/github.com/opentracing/opentracing-go/log/field.go
create mode 100644 vendor/github.com/opentracing/opentracing-go/log/util.go
create mode 100644 vendor/github.com/opentracing/opentracing-go/noop.go
create mode 100644 vendor/github.com/opentracing/opentracing-go/propagation.go
create mode 100644 vendor/github.com/opentracing/opentracing-go/span.go
create mode 100644 vendor/github.com/opentracing/opentracing-go/tracer.go
create mode 100644 vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/resource.go
create mode 100644 vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/alertmanager_types.go
create mode 100644 vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/podmonitor_types.go
create mode 100644 vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/probe_types.go
create mode 100644 vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/prometheus_types.go
create mode 100644 vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/prometheusrule_types.go
create mode 100644 vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/servicemonitor_types.go
rename vendor/github.com/{moby/spdystream/spdy => prometheus/client_golang/internal/github.com/golang/gddo}/LICENSE (96%)
create mode 100644 vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header/header.go
create mode 100644 vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/negotiate.go
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/collectorfunc.go
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/process_collector_darwin.go
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/process_collector_mem_cgo_darwin.c
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/process_collector_mem_cgo_darwin.go
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/process_collector_mem_nocgo_darwin.go
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/process_collector_not_supported.go
rename vendor/github.com/prometheus/client_golang/prometheus/{process_collector_other.go => process_collector_procfsenabled.go} (64%)
rename vendor/github.com/prometheus/client_golang/prometheus/{process_collector_js.go => promhttp/internal/compression.go} (70%)
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/duplicate_validations.go
delete mode 100644 vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/README.txt
delete mode 100644 vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/autoneg.go
create mode 100644 vendor/github.com/prometheus/common/model/labelset_string.go
create mode 100644 vendor/github.com/prometheus/common/model/metadata.go
create mode 100644 vendor/github.com/prometheus/procfs/kernel_hung.go
create mode 100644 vendor/github.com/prometheus/procfs/net_dev_snmp6.go
create mode 100644 vendor/github.com/prometheus/procfs/net_tls_stat.go
create mode 100644 vendor/github.com/prometheus/procfs/nfnetlink_queue.go
create mode 100644 vendor/github.com/prometheus/procfs/proc_statm.go
create mode 100644 vendor/github.com/sirupsen/logrus/terminal_check_wasi.go
create mode 100644 vendor/github.com/sirupsen/logrus/terminal_check_wasip1.go
create mode 100644 vendor/github.com/spf13/cobra/SECURITY.md
create mode 100644 vendor/github.com/x448/float16/.travis.yml
create mode 100644 vendor/github.com/x448/float16/LICENSE
create mode 100644 vendor/github.com/x448/float16/README.md
create mode 100644 vendor/github.com/x448/float16/float16.go
create mode 100644 vendor/go.etcd.io/etcd/api/v3/versionpb/version.pb.go
create mode 100644 vendor/go.etcd.io/etcd/api/v3/versionpb/version.proto
create mode 100644 vendor/go.etcd.io/etcd/client/pkg/v3/logutil/log_format.go
rename vendor/{github.com/prometheus/client_golang/prometheus/process_collector_wasip1.go => go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener_openbsd.go} (56%)
rename vendor/{github.com/matttproud/golang_protobuf_extensions/v2/pbutil/doc.go => go.etcd.io/etcd/client/pkg/v3/transport/keepalive_listener_unix.go} (69%)
rename vendor/{github.com/go-openapi/swag/file.go => go.etcd.io/etcd/client/pkg/v3/transport/sockopt_wasm.go} (55%)
create mode 100644 vendor/go.etcd.io/etcd/client/pkg/v3/verify/verify.go
create mode 100644 vendor/go.etcd.io/etcd/client/v3/OWNERS
create mode 100644 vendor/go.etcd.io/etcd/client/v3/kubernetes/client.go
create mode 100644 vendor/go.etcd.io/etcd/client/v3/kubernetes/interface.go
delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/body_wrapper.go
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/gen.go
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/resp_writer_wrapper.go
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/gen.go
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/httpconv.go
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/start_time_context.go
delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go
create mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/README.md
create mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/README.md
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/internal/v2/http.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/internal/v2/net.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.17.0/httpconv/README.md
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.17.0/httpconv/http.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.34.0/MIGRATION.md
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.34.0/README.md
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.34.0/attribute_group.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.34.0/doc.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.34.0/error_type.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.34.0/exception.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.34.0/httpconv/metric.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.34.0/rpcconv/metric.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.34.0/schema.go
delete mode 100644 vendor/go.starlark.net/LICENSE
delete mode 100644 vendor/go.starlark.net/internal/compile/compile.go
delete mode 100644 vendor/go.starlark.net/internal/compile/serial.go
delete mode 100644 vendor/go.starlark.net/internal/spell/spell.go
delete mode 100644 vendor/go.starlark.net/resolve/binding.go
delete mode 100644 vendor/go.starlark.net/resolve/resolve.go
delete mode 100644 vendor/go.starlark.net/starlark/debug.go
delete mode 100644 vendor/go.starlark.net/starlark/empty.s
delete mode 100644 vendor/go.starlark.net/starlark/eval.go
delete mode 100644 vendor/go.starlark.net/starlark/hashtable.go
delete mode 100644 vendor/go.starlark.net/starlark/int.go
delete mode 100644 vendor/go.starlark.net/starlark/int_generic.go
delete mode 100644 vendor/go.starlark.net/starlark/int_posix64.go
delete mode 100644 vendor/go.starlark.net/starlark/interp.go
delete mode 100644 vendor/go.starlark.net/starlark/library.go
delete mode 100644 vendor/go.starlark.net/starlark/profile.go
delete mode 100644 vendor/go.starlark.net/starlark/unpack.go
delete mode 100644 vendor/go.starlark.net/starlark/value.go
delete mode 100644 vendor/go.starlark.net/starlarkstruct/module.go
delete mode 100644 vendor/go.starlark.net/starlarkstruct/struct.go
delete mode 100644 vendor/go.starlark.net/syntax/grammar.txt
delete mode 100644 vendor/go.starlark.net/syntax/parse.go
delete mode 100644 vendor/go.starlark.net/syntax/quote.go
delete mode 100644 vendor/go.starlark.net/syntax/scan.go
delete mode 100644 vendor/go.starlark.net/syntax/syntax.go
delete mode 100644 vendor/go.starlark.net/syntax/walk.go
rename vendor/go.uber.org/zap/{LICENSE.txt => LICENSE} (100%)
rename vendor/{sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml => go.yaml.in/yaml/v3}/LICENSE (100%)
rename vendor/{sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml => go.yaml.in/yaml/v3}/NOTICE (100%)
create mode 100644 vendor/go.yaml.in/yaml/v3/README.md
rename vendor/{sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml => go.yaml.in/yaml/v3}/apic.go (99%)
rename vendor/{sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml => go.yaml.in/yaml/v3}/decode.go (97%)
rename vendor/{sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml => go.yaml.in/yaml/v3}/emitterc.go (94%)
rename vendor/{sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml => go.yaml.in/yaml/v3}/encode.go (100%)
rename vendor/{sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml => go.yaml.in/yaml/v3}/parserc.go (93%)
rename vendor/{sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml => go.yaml.in/yaml/v3}/readerc.go (99%)
rename vendor/{sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml => go.yaml.in/yaml/v3}/resolve.go (100%)
rename vendor/{sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml => go.yaml.in/yaml/v3}/scannerc.go (99%)
rename vendor/{sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml => go.yaml.in/yaml/v3}/sorter.go (100%)
rename vendor/{sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml => go.yaml.in/yaml/v3}/writerc.go (99%)
rename vendor/{sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml => go.yaml.in/yaml/v3}/yaml.go (92%)
rename vendor/{sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml => go.yaml.in/yaml/v3}/yamlh.go (99%)
rename vendor/{sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml => go.yaml.in/yaml/v3}/yamlprivateh.go (97%)
delete mode 100644 vendor/golang.org/x/exp/constraints/constraints.go
delete mode 100644 vendor/golang.org/x/exp/slices/cmp.go
delete mode 100644 vendor/golang.org/x/exp/slices/zsortanyfunc.go
delete mode 100644 vendor/golang.org/x/exp/slices/zsortordered.go
delete mode 100644 vendor/golang.org/x/net/internal/socks/client.go
delete mode 100644 vendor/golang.org/x/net/internal/socks/socks.go
delete mode 100644 vendor/golang.org/x/net/proxy/dial.go
delete mode 100644 vendor/golang.org/x/net/proxy/direct.go
delete mode 100644 vendor/golang.org/x/net/proxy/per_host.go
delete mode 100644 vendor/golang.org/x/net/proxy/proxy.go
delete mode 100644 vendor/golang.org/x/net/proxy/socks5.go
create mode 100644 vendor/google.golang.org/grpc/internal/mem/buffer_pool.go
create mode 100644 vendor/google.golang.org/protobuf/encoding/protodelim/protodelim.go
delete mode 100644 vendor/gopkg.in/djherbis/times.v1/.travis.sh
delete mode 100644 vendor/gopkg.in/djherbis/times.v1/.travis.yml
rename vendor/{github.com/evanphx/json-patch => gopkg.in/evanphx/json-patch.v4}/.gitignore (100%)
rename vendor/{github.com/evanphx/json-patch => gopkg.in/evanphx/json-patch.v4}/LICENSE (100%)
rename vendor/{github.com/evanphx/json-patch => gopkg.in/evanphx/json-patch.v4}/README.md (98%)
rename vendor/{github.com/evanphx/json-patch => gopkg.in/evanphx/json-patch.v4}/errors.go (100%)
rename vendor/{github.com/evanphx/json-patch => gopkg.in/evanphx/json-patch.v4}/merge.go (100%)
rename vendor/{github.com/evanphx/json-patch => gopkg.in/evanphx/json-patch.v4}/patch.go (76%)
create mode 100644 vendor/k8s.io/api/admission/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/admission/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/admission/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/admission/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/admission/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/admissionregistration/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/admissionregistration/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/admissionregistration/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/admissionregistration/v1alpha1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/admissionregistration/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/admissionregistration/v1alpha1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/admissionregistration/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/admissionregistration/v1beta1/zz_generated.model_name.go
rename vendor/k8s.io/api/{networking/v1alpha1 => apidiscovery/v2}/doc.go (82%)
create mode 100644 vendor/k8s.io/api/apidiscovery/v2/generated.pb.go
create mode 100644 vendor/k8s.io/api/apidiscovery/v2/generated.proto
create mode 100644 vendor/k8s.io/api/apidiscovery/v2/generated.protomessage.pb.go
rename vendor/k8s.io/{apiserver/pkg/apis/config => api/apidiscovery/v2}/register.go (73%)
create mode 100644 vendor/k8s.io/api/apidiscovery/v2/types.go
create mode 100644 vendor/k8s.io/api/apidiscovery/v2/zz_generated.deepcopy.go
create mode 100644 vendor/k8s.io/api/apidiscovery/v2/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/apidiscovery/v2/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/apidiscovery/v2beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/apidiscovery/v2beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/apiserverinternal/v1alpha1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/apiserverinternal/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/apps/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/apps/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/apps/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/apps/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/apps/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/apps/v1beta2/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/apps/v1beta2/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/authentication/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/authentication/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/authentication/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/authentication/v1alpha1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/authentication/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/authentication/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/authentication/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/authorization/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/authorization/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/authorization/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/authorization/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/authorization/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/autoscaling/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/autoscaling/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/autoscaling/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/autoscaling/v2/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/autoscaling/v2/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/autoscaling/v2/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/autoscaling/v2beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/autoscaling/v2beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/autoscaling/v2beta2/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/autoscaling/v2beta2/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/batch/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/batch/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/batch/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/batch/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/batch/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/certificates/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/certificates/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/certificates/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/certificates/v1alpha1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/certificates/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/certificates/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/certificates/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/coordination/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/coordination/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/coordination/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/coordination/v1alpha2/doc.go
create mode 100644 vendor/k8s.io/api/coordination/v1alpha2/generated.pb.go
create mode 100644 vendor/k8s.io/api/coordination/v1alpha2/generated.proto
create mode 100644 vendor/k8s.io/api/coordination/v1alpha2/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/coordination/v1alpha2/register.go
create mode 100644 vendor/k8s.io/api/coordination/v1alpha2/types.go
create mode 100644 vendor/k8s.io/api/coordination/v1alpha2/types_swagger_doc_generated.go
create mode 100644 vendor/k8s.io/api/coordination/v1alpha2/zz_generated.deepcopy.go
create mode 100644 vendor/k8s.io/api/coordination/v1alpha2/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/coordination/v1alpha2/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/coordination/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/coordination/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/core/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/core/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/core/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/discovery/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/discovery/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/discovery/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/discovery/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/discovery/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/events/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/events/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/events/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/events/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/events/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/extensions/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/extensions/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/extensions/v1beta1/zz_generated.validations.go
create mode 100644 vendor/k8s.io/api/flowcontrol/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/flowcontrol/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/flowcontrol/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/flowcontrol/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/flowcontrol/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/flowcontrol/v1beta2/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/flowcontrol/v1beta2/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/flowcontrol/v1beta3/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/flowcontrol/v1beta3/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/imagepolicy/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/networking/v1/generated.protomessage.pb.go
rename vendor/k8s.io/api/networking/{v1alpha1 => v1}/well_known_labels.go (98%)
create mode 100644 vendor/k8s.io/api/networking/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/networking/v1/zz_generated.prerelease-lifecycle.go
delete mode 100644 vendor/k8s.io/api/networking/v1alpha1/generated.proto
delete mode 100644 vendor/k8s.io/api/networking/v1alpha1/types.go
delete mode 100644 vendor/k8s.io/api/networking/v1alpha1/types_swagger_doc_generated.go
delete mode 100644 vendor/k8s.io/api/networking/v1alpha1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/networking/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/networking/v1beta1/well_known_labels.go
create mode 100644 vendor/k8s.io/api/networking/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/node/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/node/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/node/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/node/v1alpha1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/node/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/node/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/node/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/policy/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/policy/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/policy/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/policy/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/policy/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/rbac/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/rbac/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/rbac/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/rbac/v1alpha1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/rbac/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/rbac/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/rbac/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/resource/v1/devicetaint.go
create mode 100644 vendor/k8s.io/api/resource/v1/doc.go
create mode 100644 vendor/k8s.io/api/resource/v1/generated.pb.go
create mode 100644 vendor/k8s.io/api/resource/v1/generated.proto
create mode 100644 vendor/k8s.io/api/resource/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/resource/v1/register.go
create mode 100644 vendor/k8s.io/api/resource/v1/types.go
create mode 100644 vendor/k8s.io/api/resource/v1/types_swagger_doc_generated.go
create mode 100644 vendor/k8s.io/api/resource/v1/zz_generated.deepcopy.go
create mode 100644 vendor/k8s.io/api/resource/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/resource/v1/zz_generated.prerelease-lifecycle.go
delete mode 100644 vendor/k8s.io/api/resource/v1alpha2/generated.pb.go
delete mode 100644 vendor/k8s.io/api/resource/v1alpha2/generated.proto
delete mode 100644 vendor/k8s.io/api/resource/v1alpha2/types.go
delete mode 100644 vendor/k8s.io/api/resource/v1alpha2/types_swagger_doc_generated.go
delete mode 100644 vendor/k8s.io/api/resource/v1alpha2/zz_generated.deepcopy.go
create mode 100644 vendor/k8s.io/api/resource/v1alpha3/devicetaint.go
create mode 100644 vendor/k8s.io/api/resource/v1alpha3/doc.go
rename vendor/k8s.io/api/{networking/v1alpha1 => resource/v1alpha3}/generated.pb.go (55%)
create mode 100644 vendor/k8s.io/api/resource/v1alpha3/generated.proto
create mode 100644 vendor/k8s.io/api/resource/v1alpha3/generated.protomessage.pb.go
rename vendor/k8s.io/{apiserver/pkg/apis/config/v1 => api/resource/v1alpha3}/register.go (59%)
create mode 100644 vendor/k8s.io/api/resource/v1alpha3/types.go
create mode 100644 vendor/k8s.io/api/resource/v1alpha3/types_swagger_doc_generated.go
rename vendor/k8s.io/api/{networking/v1alpha1 => resource/v1alpha3}/zz_generated.deepcopy.go (59%)
create mode 100644 vendor/k8s.io/api/resource/v1alpha3/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/resource/v1alpha3/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/resource/v1beta1/devicetaint.go
rename vendor/k8s.io/api/resource/{v1alpha2 => v1beta1}/doc.go (79%)
create mode 100644 vendor/k8s.io/api/resource/v1beta1/generated.pb.go
create mode 100644 vendor/k8s.io/api/resource/v1beta1/generated.proto
create mode 100644 vendor/k8s.io/api/resource/v1beta1/generated.protomessage.pb.go
rename vendor/k8s.io/api/resource/{v1alpha2 => v1beta1}/register.go (89%)
create mode 100644 vendor/k8s.io/api/resource/v1beta1/types.go
create mode 100644 vendor/k8s.io/api/resource/v1beta1/types_swagger_doc_generated.go
create mode 100644 vendor/k8s.io/api/resource/v1beta1/zz_generated.deepcopy.go
create mode 100644 vendor/k8s.io/api/resource/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/resource/v1beta1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/resource/v1beta2/devicetaint.go
create mode 100644 vendor/k8s.io/api/resource/v1beta2/doc.go
create mode 100644 vendor/k8s.io/api/resource/v1beta2/generated.pb.go
create mode 100644 vendor/k8s.io/api/resource/v1beta2/generated.proto
create mode 100644 vendor/k8s.io/api/resource/v1beta2/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/resource/v1beta2/register.go
create mode 100644 vendor/k8s.io/api/resource/v1beta2/types.go
create mode 100644 vendor/k8s.io/api/resource/v1beta2/types_swagger_doc_generated.go
create mode 100644 vendor/k8s.io/api/resource/v1beta2/zz_generated.deepcopy.go
create mode 100644 vendor/k8s.io/api/resource/v1beta2/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/resource/v1beta2/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/scheduling/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/scheduling/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/scheduling/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/scheduling/v1alpha1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/scheduling/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/scheduling/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/scheduling/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/storage/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/storage/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/storage/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/storage/v1alpha1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/storage/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/storage/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/api/storage/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/storagemigration/v1beta1/doc.go
create mode 100644 vendor/k8s.io/api/storagemigration/v1beta1/generated.pb.go
create mode 100644 vendor/k8s.io/api/storagemigration/v1beta1/generated.proto
create mode 100644 vendor/k8s.io/api/storagemigration/v1beta1/generated.protomessage.pb.go
rename vendor/k8s.io/api/{networking/v1alpha1 => storagemigration/v1beta1}/register.go (67%)
create mode 100644 vendor/k8s.io/api/storagemigration/v1beta1/types.go
create mode 100644 vendor/k8s.io/api/storagemigration/v1beta1/types_swagger_doc_generated.go
create mode 100644 vendor/k8s.io/api/storagemigration/v1beta1/zz_generated.deepcopy.go
create mode 100644 vendor/k8s.io/api/storagemigration/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/api/storagemigration/v1beta1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/selectablefield.go
create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/selectablefield.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/meta/testrestmapper/test_restmapper.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/operation/operation.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/resource/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/resource/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/safe/safe.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/README.md
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/common.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/constraints/constraints.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/content/decimal_int.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/content/dns.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/content/errors.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/content/identifier.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/content/kube.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/doc.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/each.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/enum.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/equality.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/immutable.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/item.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/limits.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/options.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/required.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/strfmt.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/subfield.go
rename vendor/k8s.io/{utils/exec/fixup_go119.go => apimachinery/pkg/api/validate/testing.go} (52%)
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/union.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/update.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validate/zeroorone.go
rename vendor/k8s.io/{component-base/config => apimachinery/pkg/api/validation}/OWNERS (84%)
create mode 100644 vendor/k8s.io/apimachinery/pkg/apis/asn1/oid.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/cbor.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/direct/direct.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/framer.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/buffers.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/decode.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/diagnostic.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/encode.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/transcoding.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/raw.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/collections.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/serializer/protobuf/collections.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/util/diff/cmp.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/util/diff/legacy_diff.go
delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/connection.go
delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go
delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/upgrade.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/util/intstr/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/util/intstr/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/runtimetypeconverter.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/util/portforward/constants.go
delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/proxy/dial.go
delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/proxy/transport.go
delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/proxy/upgradeaware.go
delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/sets/ordered.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/util/sort/sort.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/util/validation/OWNERS
create mode 100644 vendor/k8s.io/apimachinery/pkg/util/validation/field/error_matcher.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/util/validation/ip.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/util/yaml/stream_reader.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/version/zz_generated.model_name.go
delete mode 100644 vendor/k8s.io/apimachinery/third_party/forked/golang/netutil/addr.go
rename vendor/k8s.io/apiserver/pkg/admission/plugin/{validatingadmissionpolicy => authorizer}/caching_authorizer.go (67%)
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/cel/activation.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/cel/condition.go
delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/cel/filter.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/cel/mutation.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/accessor.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/interfaces.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/plugin.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_dispatcher.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_matcher.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_source.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_test_context.go
rename vendor/k8s.io/apiserver/pkg/admission/plugin/{validatingadmissionpolicy => policy}/internal/generic/controller.go (88%)
rename vendor/k8s.io/apiserver/pkg/admission/plugin/{validatingadmissionpolicy => policy}/internal/generic/doc.go (100%)
rename vendor/k8s.io/apiserver/pkg/admission/plugin/{validatingadmissionpolicy => policy}/internal/generic/informer.go (79%)
rename vendor/k8s.io/apiserver/pkg/admission/plugin/{validatingadmissionpolicy => policy}/internal/generic/interface.go (100%)
rename vendor/k8s.io/apiserver/pkg/admission/plugin/{validatingadmissionpolicy => policy}/internal/generic/lister.go (100%)
rename vendor/k8s.io/apiserver/pkg/admission/plugin/{validatingadmissionpolicy => policy}/matching/matching.go (92%)
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/accessor.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/compilation.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/dispatcher.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/errors.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/metrics/errors.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/metrics/metrics.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/patch/interface.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/patch/json_patch.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/patch/smd.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/patch/typeconverter.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/plugin.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/mutating/reinvocationcontext.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/accessor.go
rename vendor/k8s.io/apiserver/pkg/admission/plugin/{validatingadmissionpolicy/controller.go => policy/validating/dispatcher.go} (50%)
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/errors.go
rename vendor/k8s.io/apiserver/pkg/admission/plugin/{validatingadmissionpolicy => policy/validating}/initializer.go (96%)
rename vendor/k8s.io/apiserver/pkg/admission/plugin/{validatingadmissionpolicy => policy/validating}/interface.go (75%)
rename vendor/k8s.io/apiserver/pkg/admission/plugin/{validatingadmissionpolicy => policy/validating}/message.go (96%)
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/metrics/errors.go
rename vendor/k8s.io/apiserver/pkg/admission/{cel => plugin/policy/validating/metrics}/metrics.go (61%)
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/policy/validating/plugin.go
rename vendor/k8s.io/apiserver/pkg/admission/plugin/{validatingadmissionpolicy => policy/validating}/policy_decision.go (98%)
rename vendor/k8s.io/apiserver/pkg/admission/plugin/{validatingadmissionpolicy => policy/validating}/typechecking.go (74%)
rename vendor/k8s.io/apiserver/pkg/admission/plugin/{validatingadmissionpolicy => policy/validating}/validator.go (93%)
delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/OWNERS
delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/admission.go
delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/controller_reconcile.go
delete mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matcher.go
create mode 100644 vendor/k8s.io/apiserver/pkg/apis/apidiscovery/v2/conversion.go
rename vendor/k8s.io/{component-base/config => apiserver/pkg/apis/apidiscovery/v2}/doc.go (81%)
create mode 100644 vendor/k8s.io/apiserver/pkg/apis/apidiscovery/v2/register.go
rename vendor/k8s.io/apiserver/pkg/apis/{config/types.go => apiserver/types_encryption.go} (99%)
rename vendor/k8s.io/apiserver/pkg/apis/{config => apiserver}/v1/defaults.go (74%)
rename vendor/k8s.io/apiserver/pkg/apis/{config/v1/types.go => apiserver/v1/types_encryption.go} (100%)
create mode 100644 vendor/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/defaults.go
rename vendor/k8s.io/apiserver/pkg/apis/{config/validation/validation.go => apiserver/validation/validation_encryption.go} (91%)
create mode 100644 vendor/k8s.io/apiserver/pkg/apis/audit/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/apiserver/pkg/apis/audit/v1/zz_generated.model_name.go
delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/config/v1/zz_generated.conversion.go
delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/config/v1/zz_generated.deepcopy.go
delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/config/v1/zz_generated.defaults.go
delete mode 100644 vendor/k8s.io/apiserver/pkg/apis/config/zz_generated.deepcopy.go
create mode 100644 vendor/k8s.io/apiserver/pkg/authorization/cel/metrics.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/cidr.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/common/typeprovider.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/common/valuesreflect.go
rename vendor/k8s.io/apiserver/pkg/cel/common/{values.go => valuesunstructured.go} (98%)
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/format.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/ip.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/cidr.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/format.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/ip.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/jsonpatch.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/libraries.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/semverlib.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/mutation/dynamic/objects.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/mutation/jsonpatch.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/mutation/typeresolver.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/semver.go
create mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/peer_aggregated_handler.go
create mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/filters/impersonation/OWNERS
create mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/filters/impersonation/cache.go
create mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/filters/impersonation/constrained_impersonation.go
rename vendor/k8s.io/apiserver/pkg/endpoints/filters/{ => impersonation}/impersonation.go (94%)
create mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/filters/impersonation/mode.go
create mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/request/methods.go
create mode 100644 vendor/k8s.io/apiserver/pkg/registry/generic/registry/corrupt_obj_deleter.go
create mode 100644 vendor/k8s.io/apiserver/pkg/registry/rest/validate.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/flagz/OWNERS
rename vendor/k8s.io/apiserver/pkg/{apis/config/v1 => server/flagz/api/v1alpha1}/doc.go (69%)
create mode 100644 vendor/k8s.io/apiserver/pkg/server/flagz/api/v1alpha1/register.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/flagz/api/v1alpha1/types.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/flagz/api/v1alpha1/zz_generated.deepcopy.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/flagz/api/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/flagz/flagreader.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/flagz/flagz.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/flagz/negotiate/negotiation.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/flagz/registry.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/flagz/textserializer.go
delete mode 100644 vendor/k8s.io/apiserver/pkg/server/options/deprecated_insecure_serving.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/routine/routine.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/statusz/OWNERS
create mode 100644 vendor/k8s.io/apiserver/pkg/server/statusz/api/v1alpha1/doc.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/statusz/api/v1alpha1/register.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/statusz/api/v1alpha1/types.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/statusz/api/v1alpha1/zz_generated.deepcopy.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/statusz/api/v1alpha1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/statusz/negotiate/negotiation.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/statusz/registry.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/statusz/statusz.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/statusz/textserializer.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/storage_readiness_hook.go
create mode 100644 vendor/k8s.io/apiserver/pkg/storage/cacher/compactor.go
create mode 100644 vendor/k8s.io/apiserver/pkg/storage/cacher/delegator.go
create mode 100644 vendor/k8s.io/apiserver/pkg/storage/cacher/delegator/interface.go
rename vendor/k8s.io/apiserver/pkg/storage/cacher/{ => progress}/watch_progress.go (75%)
create mode 100644 vendor/k8s.io/apiserver/pkg/storage/cacher/store.go
create mode 100644 vendor/k8s.io/apiserver/pkg/storage/cacher/store_btree.go
create mode 100644 vendor/k8s.io/apiserver/pkg/storage/etcd3/corrupt_obj_deleter.go
create mode 100644 vendor/k8s.io/apiserver/pkg/storage/etcd3/decoder.go
create mode 100644 vendor/k8s.io/apiserver/pkg/storage/etcd3/stats.go
create mode 100644 vendor/k8s.io/apiserver/pkg/storage/feature/feature_support_checker.go
create mode 100644 vendor/k8s.io/apiserver/pkg/util/compatibility/registry.go
create mode 100644 vendor/k8s.io/apiserver/pkg/util/compatibility/version.go
create mode 100644 vendor/k8s.io/apiserver/pkg/util/configmetrics/info_collector.go
create mode 100644 vendor/k8s.io/apiserver/pkg/validation/metrics.go
delete mode 100644 vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/metrics.go
create mode 100644 vendor/k8s.io/apiserver/plugin/pkg/authorizer/webhook/metrics/metrics.go
create mode 100644 vendor/k8s.io/cli-runtime/pkg/printers/kyaml.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/OWNERS
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/auditannotation.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/expressionwarning.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/matchresources.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/namedrulewithoperations.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/paramkind.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/paramref.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/typechecking.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybindingspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicyspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicystatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validation.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/variable.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/applyconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/jsonpatch.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/mutatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/mutatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/mutatingadmissionpolicybindingspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/mutatingadmissionpolicyspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/mutation.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/applyconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/jsonpatch.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingadmissionpolicybindingspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingadmissionpolicyspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutation.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/batch/v1/successpolicy.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/batch/v1/successpolicyrule.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/clustertrustbundle.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/clustertrustbundlespec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/podcertificaterequest.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/podcertificaterequestspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/podcertificaterequeststatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/coordination/v1alpha2/leasecandidate.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/coordination/v1alpha2/leasecandidatespec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasecandidate.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasecandidatespec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/apparmorprofile.go
delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/claimsource.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/containerextendedresourcerequest.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/containerrestartrule.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/containerrestartruleonexitcodes.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/containeruser.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/filekeyselector.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/imagevolumesource.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/linuxcontaineruser.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/nodefeatures.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/noderuntimehandler.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/noderuntimehandlerfeatures.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/nodeswapstatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/podcertificateprojection.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/podextendedresourceclaimstatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/resourcehealth.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/resourcestatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/volumemountstatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/workloadreference.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/discovery/v1/fornode.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/fornode.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/doc.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereview.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewcontainerspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewstatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/meta/v1/groupresource.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1/ipaddress.go
rename vendor/k8s.io/client-go/applyconfigurations/networking/{v1alpha1 => v1}/ipaddressspec.go (76%)
rename vendor/k8s.io/client-go/applyconfigurations/networking/{v1alpha1 => v1}/parentreference.go (79%)
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidr.go
rename vendor/k8s.io/client-go/applyconfigurations/networking/{v1alpha1 => v1}/servicecidrspec.go (70%)
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidrstatus.go
rename vendor/k8s.io/client-go/applyconfigurations/networking/{v1alpha1 => v1beta1}/ipaddress.go (68%)
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ipaddressspec.go
rename vendor/k8s.io/client-go/applyconfigurations/{resource/v1alpha2/resourceclassparametersreference.go => networking/v1beta1/parentreference.go} (50%)
rename vendor/k8s.io/client-go/applyconfigurations/networking/{v1alpha1 => v1beta1}/servicecidr.go (68%)
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/servicecidrspec.go
rename vendor/k8s.io/client-go/applyconfigurations/networking/{v1alpha1 => v1beta1}/servicecidrstatus.go (77%)
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/allocateddevicestatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/allocationresult.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/capacityrequestpolicy.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/capacityrequestpolicyrange.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/capacityrequirements.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/celdeviceselector.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/counter.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/counterset.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/device.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceallocationconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceallocationresult.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceattribute.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicecapacity.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclaim.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclaimconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclass.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclassconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclassspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceconstraint.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicecounterconsumption.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicerequest.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicerequestallocationresult.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceselector.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicesubrequest.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicetaint.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicetoleration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/exactdevicerequest.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/networkdevicedata.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/opaquedeviceconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceclaim.go
rename vendor/k8s.io/client-go/applyconfigurations/resource/{v1alpha2 => v1}/resourceclaimconsumerreference.go (75%)
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceclaimspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceclaimstatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceclaimtemplate.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceclaimtemplatespec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourcepool.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceslice.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceslicespec.go
delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/allocationresult.go
delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/podschedulingcontextspec.go
delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/podschedulingcontextstatus.go
delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimschedulingstatus.go
delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimspec.go
delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimstatus.go
delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclass.go
delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcehandle.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaint.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintrule.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintrulespec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintrulestatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintselector.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/allocateddevicestatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/allocationresult.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/basicdevice.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/capacityrequestpolicy.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/capacityrequestpolicyrange.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/capacityrequirements.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/celdeviceselector.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/counter.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/counterset.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/device.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceallocationconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceallocationresult.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceattribute.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicecapacity.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclaim.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclaimconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclass.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclassconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclassspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceconstraint.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicecounterconsumption.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicerequest.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicerequestallocationresult.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceselector.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicesubrequest.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicetaint.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicetoleration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/networkdevicedata.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/opaquedeviceconfiguration.go
rename vendor/k8s.io/client-go/applyconfigurations/resource/{v1alpha2 => v1beta1}/resourceclaim.go (68%)
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceclaimconsumerreference.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceclaimspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceclaimstatus.go
rename vendor/k8s.io/client-go/applyconfigurations/resource/{v1alpha2 => v1beta1}/resourceclaimtemplate.go (71%)
rename vendor/k8s.io/client-go/applyconfigurations/resource/{v1alpha2 => v1beta1}/resourceclaimtemplatespec.go (77%)
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourcepool.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceslice.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceslicespec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/allocateddevicestatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/allocationresult.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/capacityrequestpolicy.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/capacityrequestpolicyrange.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/capacityrequirements.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/celdeviceselector.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/counter.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/counterset.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/device.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceallocationconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceallocationresult.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceattribute.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicecapacity.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclaim.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclaimconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclass.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclassconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclassspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceconstraint.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicecounterconsumption.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicerequest.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicerequestallocationresult.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceselector.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicesubrequest.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicetaint.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicetoleration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/exactdevicerequest.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/networkdevicedata.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/opaquedeviceconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaim.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimconsumerreference.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimstatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimtemplate.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimtemplatespec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourcepool.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceslice.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceslicespec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha1/gangschedulingpolicy.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha1/podgroup.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha1/podgrouppolicy.go
rename vendor/k8s.io/client-go/applyconfigurations/{resource/v1alpha2/resourceclaimparametersreference.go => scheduling/v1alpha1/typedlocalobjectreference.go} (52%)
rename vendor/k8s.io/client-go/applyconfigurations/{resource/v1alpha2/podschedulingcontext.go => scheduling/v1alpha1/workload.go} (53%)
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha1/workloadspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/storage/v1/volumeattributesclass.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/volumeattributesclass.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1beta1/storageversionmigration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1beta1/storageversionmigrationspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1beta1/storageversionmigrationstatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/utils.go
create mode 100644 vendor/k8s.io/client-go/discovery/fake/discovery.go
create mode 100644 vendor/k8s.io/client-go/dynamic/fake/simple.go
create mode 100644 vendor/k8s.io/client-go/features/envvar.go
create mode 100644 vendor/k8s.io/client-go/features/features.go
create mode 100644 vendor/k8s.io/client-go/features/known_features.go
create mode 100644 vendor/k8s.io/client-go/gentype/fake.go
create mode 100644 vendor/k8s.io/client-go/gentype/type.go
create mode 100644 vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/mutatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/mutatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/informers/certificates/v1beta1/clustertrustbundle.go
create mode 100644 vendor/k8s.io/client-go/informers/certificates/v1beta1/podcertificaterequest.go
rename vendor/k8s.io/client-go/informers/{networking/v1alpha1 => coordination/v1alpha2}/interface.go (69%)
create mode 100644 vendor/k8s.io/client-go/informers/coordination/v1alpha2/leasecandidate.go
create mode 100644 vendor/k8s.io/client-go/informers/coordination/v1beta1/leasecandidate.go
create mode 100644 vendor/k8s.io/client-go/informers/networking/v1/ipaddress.go
create mode 100644 vendor/k8s.io/client-go/informers/networking/v1/servicecidr.go
rename vendor/k8s.io/client-go/informers/networking/{v1alpha1 => v1beta1}/ipaddress.go (70%)
rename vendor/k8s.io/client-go/informers/networking/{v1alpha1 => v1beta1}/servicecidr.go (70%)
create mode 100644 vendor/k8s.io/client-go/informers/resource/v1/deviceclass.go
rename vendor/k8s.io/client-go/informers/resource/{v1alpha2 => v1}/interface.go (74%)
create mode 100644 vendor/k8s.io/client-go/informers/resource/v1/resourceclaim.go
create mode 100644 vendor/k8s.io/client-go/informers/resource/v1/resourceclaimtemplate.go
create mode 100644 vendor/k8s.io/client-go/informers/resource/v1/resourceslice.go
delete mode 100644 vendor/k8s.io/client-go/informers/resource/v1alpha2/podschedulingcontext.go
create mode 100644 vendor/k8s.io/client-go/informers/resource/v1alpha3/devicetaintrule.go
create mode 100644 vendor/k8s.io/client-go/informers/resource/v1alpha3/interface.go
create mode 100644 vendor/k8s.io/client-go/informers/resource/v1beta1/deviceclass.go
create mode 100644 vendor/k8s.io/client-go/informers/resource/v1beta1/interface.go
create mode 100644 vendor/k8s.io/client-go/informers/resource/v1beta1/resourceclaim.go
rename vendor/k8s.io/client-go/informers/resource/{v1alpha2 => v1beta1}/resourceclaimtemplate.go (69%)
rename vendor/k8s.io/client-go/informers/resource/{v1alpha2/resourceclass.go => v1beta1/resourceslice.go} (53%)
create mode 100644 vendor/k8s.io/client-go/informers/resource/v1beta2/deviceclass.go
create mode 100644 vendor/k8s.io/client-go/informers/resource/v1beta2/interface.go
rename vendor/k8s.io/client-go/informers/resource/{v1alpha2 => v1beta2}/resourceclaim.go (70%)
create mode 100644 vendor/k8s.io/client-go/informers/resource/v1beta2/resourceclaimtemplate.go
create mode 100644 vendor/k8s.io/client-go/informers/resource/v1beta2/resourceslice.go
create mode 100644 vendor/k8s.io/client-go/informers/scheduling/v1alpha1/workload.go
create mode 100644 vendor/k8s.io/client-go/informers/storage/v1/volumeattributesclass.go
create mode 100644 vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattributesclass.go
create mode 100644 vendor/k8s.io/client-go/informers/storagemigration/interface.go
create mode 100644 vendor/k8s.io/client-go/informers/storagemigration/v1beta1/interface.go
create mode 100644 vendor/k8s.io/client-go/informers/storagemigration/v1beta1/storageversionmigration.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/fake/clientset_generated.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/fake/register.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_admissionregistration_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_mutatingwebhookconfiguration.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake/fake_validatingwebhookconfiguration.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_mutatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_mutatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/mutatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/mutatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_admissionregistration_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/fake/fake_apiserverinternal_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1/fake/fake_storageversion.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_apps_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_daemonset.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_deployment.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_replicaset.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1/fake/fake_statefulset.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_apps_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_apps_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_authentication_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_selfsubjectreview.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake/fake_authentication_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake/fake_selfsubjectreview.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_authentication_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_selfsubjectreview.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_authorization_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_authorization_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_autoscaling_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2/fake/fake_autoscaling_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2/fake/fake_horizontalpodautoscaler.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_autoscaling_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_autoscaling_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_batch_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_cronjob.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_batch_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/fake/fake_certificates_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/fake/fake_certificatesigningrequest.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificates_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_clustertrustbundle.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/clustertrustbundle.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificates_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest_expansion.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_clustertrustbundle.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake/fake_podcertificaterequest.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/podcertificaterequest.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/fake/fake_coordination_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/fake/fake_lease.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha2/coordination_client.go
rename vendor/k8s.io/client-go/kubernetes/typed/{resource => coordination}/v1alpha2/doc.go (100%)
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha2/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha2/fake/fake_coordination_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha2/fake/fake_leasecandidate.go
rename vendor/k8s.io/client-go/kubernetes/typed/{networking/v1alpha1 => coordination/v1alpha2}/generated_expansion.go (86%)
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha2/leasecandidate.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_coordination_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_lease.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake/fake_leasecandidate.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/leasecandidate.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_core_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event_expansion.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace_expansion.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node_expansion.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod_expansion.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go
rename vendor/k8s.io/{apimachinery/pkg/util/proxy/doc.go => client-go/kubernetes/typed/core/v1/fake/fake_service_expansion.go} (63%)
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/discovery/v1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/discovery/v1/fake/fake_discovery_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/discovery/v1/fake/fake_endpointslice.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake/fake_discovery_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake/fake_endpointslice.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/events/v1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/events/v1/fake/fake_event.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/events/v1/fake/fake_events_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_event_expansion.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/fake/fake_events_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment_expansion.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_extensions_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_networkpolicy.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowcontrol_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowcontrol_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowschema.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1/fake/fake_prioritylevelconfiguration.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowcontrol_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowschema.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake/fake_prioritylevelconfiguration.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowcontrol_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowschema.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/fake_prioritylevelconfiguration.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_ingress.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_ingressclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_ipaddress.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networking_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1/fake/fake_servicecidr.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1/ipaddress.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1/servicecidr.go
delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/ipaddress.go
delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/servicecidr.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ingress.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ingressclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_ipaddress.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_networking_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake/fake_servicecidr.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/ipaddress.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/servicecidr.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/node/v1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/node/v1/fake/fake_node_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/node/v1/fake/fake_runtimeclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake/fake_node_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake/fake_runtimeclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/fake/fake_node_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/fake/fake_runtimeclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_eviction.go
rename vendor/k8s.io/{utils/clock/testing/simple_interval_clock.go => client-go/kubernetes/typed/policy/v1/fake/fake_eviction_expansion.go} (50%)
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_poddisruptionbudget.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1/fake/fake_policy_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_eviction.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_eviction_expansion.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_policy_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rbac_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_role.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rbac_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rbac_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_role.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1/deviceclass.go
rename vendor/k8s.io/client-go/kubernetes/typed/{networking/v1alpha1 => resource/v1}/doc.go (97%)
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1/fake/fake_deviceclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1/fake/fake_resource_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1/fake/fake_resourceclaim.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1/fake/fake_resourceclaimtemplate.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1/fake/fake_resourceslice.go
rename vendor/k8s.io/client-go/kubernetes/typed/resource/{v1alpha2 => v1}/generated_expansion.go (87%)
rename vendor/k8s.io/client-go/kubernetes/typed/resource/{v1alpha2 => v1}/resource_client.go (51%)
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1/resourceclaim.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1/resourceclaimtemplate.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1/resourceslice.go
delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go
delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclaim.go
delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go
delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/devicetaintrule.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_devicetaintrule.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/generated_expansion.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resource_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta1/deviceclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta1/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta1/fake/fake_deviceclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta1/fake/fake_resource_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta1/fake/fake_resourceclaim.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta1/fake/fake_resourceclaimtemplate.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta1/fake/fake_resourceslice.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta1/generated_expansion.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta1/resource_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta1/resourceclaim.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta1/resourceclaimtemplate.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta1/resourceslice.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/deviceclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_deviceclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resource_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resourceclaim.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resourceclaimtemplate.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/fake/fake_resourceslice.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/generated_expansion.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resource_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resourceclaim.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resourceclaimtemplate.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1beta2/resourceslice.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/fake/fake_priorityclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/fake/fake_scheduling_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_scheduling_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/fake/fake_workload.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/workload.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake/fake_priorityclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/fake/fake_scheduling_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_csidriver.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_csinode.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_csistoragecapacity.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storageclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_volumeattributesclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/volumeattributesclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_csistoragecapacity.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_storage_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csinode.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_csistoragecapacity.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_volumeattributesclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/volumeattributesclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1beta1/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1beta1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1beta1/fake/fake_storagemigration_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1beta1/fake/fake_storageversionmigration.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1beta1/generated_expansion.go
rename vendor/k8s.io/client-go/kubernetes/typed/{networking/v1alpha1/networking_client.go => storagemigration/v1beta1/storagemigration_client.go} (50%)
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1beta1/storageversionmigration.go
create mode 100644 vendor/k8s.io/client-go/listers/admissionregistration/v1/validatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/listers/admissionregistration/v1/validatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/mutatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/mutatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/mutatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/mutatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/listers/certificates/v1beta1/clustertrustbundle.go
create mode 100644 vendor/k8s.io/client-go/listers/certificates/v1beta1/podcertificaterequest.go
create mode 100644 vendor/k8s.io/client-go/listers/coordination/v1alpha2/expansion_generated.go
create mode 100644 vendor/k8s.io/client-go/listers/coordination/v1alpha2/leasecandidate.go
create mode 100644 vendor/k8s.io/client-go/listers/coordination/v1beta1/leasecandidate.go
rename vendor/k8s.io/{apiserver/pkg/apis/config => client-go/listers}/doc.go (80%)
create mode 100644 vendor/k8s.io/client-go/listers/generic_helpers.go
rename vendor/k8s.io/client-go/listers/networking/{v1alpha1 => v1}/ipaddress.go (55%)
rename vendor/k8s.io/client-go/listers/networking/{v1alpha1 => v1}/servicecidr.go (55%)
create mode 100644 vendor/k8s.io/client-go/listers/networking/v1beta1/ipaddress.go
create mode 100644 vendor/k8s.io/client-go/listers/networking/v1beta1/servicecidr.go
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1/deviceclass.go
rename vendor/k8s.io/client-go/listers/resource/{v1alpha2 => v1}/expansion_generated.go (71%)
rename vendor/k8s.io/client-go/listers/resource/{v1alpha2 => v1}/resourceclaim.go (56%)
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1/resourceclaimtemplate.go
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1/resourceslice.go
delete mode 100644 vendor/k8s.io/client-go/listers/resource/v1alpha2/podschedulingcontext.go
delete mode 100644 vendor/k8s.io/client-go/listers/resource/v1alpha2/resourceclass.go
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1alpha3/devicetaintrule.go
rename vendor/k8s.io/client-go/listers/{networking/v1alpha1 => resource/v1alpha3}/expansion_generated.go (68%)
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1beta1/deviceclass.go
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1beta1/expansion_generated.go
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1beta1/resourceclaim.go
rename vendor/k8s.io/client-go/listers/resource/{v1alpha2 => v1beta1}/resourceclaimtemplate.go (57%)
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1beta1/resourceslice.go
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1beta2/deviceclass.go
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1beta2/expansion_generated.go
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1beta2/resourceclaim.go
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1beta2/resourceclaimtemplate.go
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1beta2/resourceslice.go
create mode 100644 vendor/k8s.io/client-go/listers/scheduling/v1alpha1/workload.go
create mode 100644 vendor/k8s.io/client-go/listers/storage/v1/volumeattributesclass.go
create mode 100644 vendor/k8s.io/client-go/listers/storage/v1beta1/volumeattributesclass.go
create mode 100644 vendor/k8s.io/client-go/listers/storagemigration/v1beta1/expansion_generated.go
create mode 100644 vendor/k8s.io/client-go/listers/storagemigration/v1beta1/storageversionmigration.go
create mode 100644 vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/client-go/rest/.mockery.yaml
create mode 100644 vendor/k8s.io/client-go/rest/fake/fake.go
create mode 100644 vendor/k8s.io/client-go/tools/cache/the_real_fifo.go
create mode 100644 vendor/k8s.io/client-go/tools/clientcmd/merge.go
create mode 100644 vendor/k8s.io/client-go/tools/leaderelection/leasecandidate.go
delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/doc.go
delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/errorstream.go
delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/fallback.go
delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/reader.go
delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/remotecommand.go
delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/resize.go
delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/spdy.go
delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/v1.go
delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/v2.go
delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/v3.go
delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/v4.go
delete mode 100644 vendor/k8s.io/client-go/tools/remotecommand/websocket.go
delete mode 100644 vendor/k8s.io/client-go/transport/spdy/spdy.go
delete mode 100644 vendor/k8s.io/client-go/transport/websocket/roundtripper.go
create mode 100644 vendor/k8s.io/client-go/util/apply/apply.go
create mode 100644 vendor/k8s.io/client-go/util/consistencydetector/data_consistency_detector.go
delete mode 100644 vendor/k8s.io/client-go/util/exec/exec.go
create mode 100644 vendor/k8s.io/client-go/util/watchlist/watch_list.go
create mode 100644 vendor/k8s.io/component-base/cli/flag/tracker_flag.go
create mode 100644 vendor/k8s.io/component-base/cli/withoutrace.go
rename vendor/k8s.io/{utils/exec/fixup_go118.go => component-base/cli/withrace.go} (71%)
create mode 100644 vendor/k8s.io/component-base/compatibility/OWNERS
create mode 100644 vendor/k8s.io/component-base/compatibility/registry.go
create mode 100644 vendor/k8s.io/component-base/compatibility/version.go
delete mode 100644 vendor/k8s.io/component-base/config/types.go
delete mode 100644 vendor/k8s.io/component-base/config/v1alpha1/conversion.go
delete mode 100644 vendor/k8s.io/component-base/config/v1alpha1/defaults.go
delete mode 100644 vendor/k8s.io/component-base/config/v1alpha1/doc.go
delete mode 100644 vendor/k8s.io/component-base/config/v1alpha1/register.go
delete mode 100644 vendor/k8s.io/component-base/config/v1alpha1/types.go
delete mode 100644 vendor/k8s.io/component-base/config/v1alpha1/zz_generated.conversion.go
delete mode 100644 vendor/k8s.io/component-base/config/v1alpha1/zz_generated.deepcopy.go
delete mode 100644 vendor/k8s.io/component-base/config/zz_generated.deepcopy.go
rename vendor/{github.com/google/gofuzz/doc.go => k8s.io/component-base/logs/api/v1/options_no_slog.go} (76%)
rename vendor/k8s.io/{client-go/tools/remotecommand/v5.go => component-base/logs/api/v1/options_slog.go} (51%)
create mode 100644 vendor/k8s.io/component-base/logs/api/v1/text.go
create mode 100644 vendor/k8s.io/component-base/logs/api/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/component-base/metrics/prometheus/compatversion/metrics.go
create mode 100644 vendor/k8s.io/component-base/tracing/api/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/component-base/zpages/features/doc.go
create mode 100644 vendor/k8s.io/component-base/zpages/features/kube_features.go
create mode 100644 vendor/k8s.io/klog/v2/internal/verbosity/verbosity.go
create mode 100644 vendor/k8s.io/klog/v2/textlogger/options.go
create mode 100644 vendor/k8s.io/klog/v2/textlogger/textlogger.go
create mode 100644 vendor/k8s.io/klog/v2/textlogger/textlogger_slog.go
create mode 100644 vendor/k8s.io/kms/apis/v1beta1/api_grpc.pb.go
create mode 100644 vendor/k8s.io/kms/apis/v2/api_grpc.pb.go
create mode 100644 vendor/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1/generated.protomessage.pb.go
create mode 100644 vendor/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1/zz_generated.model_name.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/alias.go
delete mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/decode.go
delete mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/encode.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/internal.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonflags/flags.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonopts/options.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/decode.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/encode.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/wire.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/alias.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/decode.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/doc.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/encode.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/errors.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/export.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/options.go
rename vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/{ => jsontext}/pools.go (64%)
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/quote.go
rename vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/{ => jsontext}/state.go (63%)
rename vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/{ => jsontext}/token.go (87%)
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/value.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/migrate.sh
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/options.go
delete mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/value.go
rename vendor/{sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/qri-io/starlib/util => k8s.io/kube-openapi/pkg/internal/third_party/govalidator}/LICENSE (88%)
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/govalidator/patterns.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/govalidator/validator.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/validation/strfmt/kubernetes-extensions.go
create mode 100644 vendor/k8s.io/kubectl/pkg/cmd/util/caching_verifier.go
create mode 100644 vendor/k8s.io/utils/buffer/ring_fixed.go
delete mode 100644 vendor/k8s.io/utils/clock/testing/fake_clock.go
delete mode 100644 vendor/k8s.io/utils/integer/integer.go
delete mode 100644 vendor/k8s.io/utils/strings/slices/slices.go
create mode 100644 vendor/sigs.k8s.io/controller-runtime/.gomodcheck.yaml
create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/client/applyconfigurations.go
create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/typeconverter.go
create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/versioned_tracker.go
create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/client/fieldowner.go
create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/client/fieldvalidation.go
delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/config/config.go
delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/config/doc.go
delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1/doc.go
delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1/register.go
delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1/types.go
delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1/zz_generated.deepcopy.go
rename vendor/sigs.k8s.io/controller-runtime/pkg/{ratelimiter/ratelimiter.go => controller/name.go} (50%)
create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/controller/priorityqueue/metrics.go
create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/controller/priorityqueue/priorityqueue.go
create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/envtest/binaries.go
create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/internal/metrics/workqueue.go
create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/internal/syncs/syncs.go
create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/internal/testing/process/procattr_other.go
create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/internal/testing/process/procattr_unix.go
delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/ratelimiter/doc.go
delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/webhook/admission/defaulter.go
create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/webhook/admission/metrics/metrics.go
delete mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/webhook/admission/validator.go
create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/webhook/conversion/conversion_hubspoke.go
create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/webhook/conversion/conversion_registry.go
create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/webhook/conversion/metrics/metrics.go
rename vendor/sigs.k8s.io/kustomize/api/{ => internal}/image/image.go (100%)
rename vendor/sigs.k8s.io/kustomize/api/{ => internal}/konfig/builtinpluginconsts/commonannotations.go (100%)
rename vendor/sigs.k8s.io/kustomize/api/{ => internal}/konfig/builtinpluginconsts/commonlabels.go (100%)
rename vendor/sigs.k8s.io/kustomize/api/{ => internal}/konfig/builtinpluginconsts/defaultconfig.go (100%)
rename vendor/sigs.k8s.io/kustomize/api/{ => internal}/konfig/builtinpluginconsts/doc.go (100%)
rename vendor/sigs.k8s.io/kustomize/api/{ => internal}/konfig/builtinpluginconsts/images.go (75%)
rename vendor/sigs.k8s.io/kustomize/api/{ => internal}/konfig/builtinpluginconsts/metadatalabels.go (100%)
rename vendor/sigs.k8s.io/kustomize/api/{ => internal}/konfig/builtinpluginconsts/nameprefix.go (100%)
rename vendor/sigs.k8s.io/kustomize/api/{ => internal}/konfig/builtinpluginconsts/namereference.go (98%)
rename vendor/sigs.k8s.io/kustomize/api/{ => internal}/konfig/builtinpluginconsts/namespace.go (100%)
rename vendor/sigs.k8s.io/kustomize/api/{ => internal}/konfig/builtinpluginconsts/namesuffix.go (100%)
rename vendor/sigs.k8s.io/kustomize/api/{ => internal}/konfig/builtinpluginconsts/replicas.go (100%)
rename vendor/sigs.k8s.io/kustomize/api/{ => internal}/konfig/builtinpluginconsts/templatelabels.go (100%)
rename vendor/sigs.k8s.io/kustomize/api/{ => internal}/konfig/builtinpluginconsts/varreference.go (100%)
rename vendor/sigs.k8s.io/kustomize/api/{ => internal}/loader/errors.go (100%)
rename vendor/sigs.k8s.io/kustomize/api/{ => internal}/loader/fileloader.go (74%)
rename vendor/sigs.k8s.io/kustomize/api/{ => internal}/loader/loader.go (93%)
rename vendor/sigs.k8s.io/kustomize/api/{ => internal}/loader/loadrestrictions.go (100%)
create mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/plugins/execplugin/shlex.go
create mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/plugins/loader/load_go_plugin.go
create mode 100644 vendor/sigs.k8s.io/kustomize/api/internal/plugins/loader/load_go_plugin_disabled.go
delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/fn/runtime/starlark/context.go
delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/fn/runtime/starlark/doc.go
delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/fn/runtime/starlark/starlark.go
delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml/README.md
delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/qri-io/starlib/util/doc.go
delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/qri-io/starlib/util/util.go
delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/filters/filters.go
delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/filters/fmtr.go
delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/filters/grep.go
delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/filters/local.go
delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/filters/merge.go
delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/filters/merge3.go
delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/filters/modify.go
delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/kio/filters/stripcomments.go
delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/merge3/merge3.go
delete mode 100644 vendor/sigs.k8s.io/kustomize/kyaml/yaml/merge3/visitor.go
create mode 100644 vendor/sigs.k8s.io/randfill/CONTRIBUTING.md
create mode 100644 vendor/sigs.k8s.io/randfill/LICENSE
create mode 100644 vendor/sigs.k8s.io/randfill/NOTICE
create mode 100644 vendor/sigs.k8s.io/randfill/OWNERS
create mode 100644 vendor/sigs.k8s.io/randfill/OWNERS_ALIASES
rename vendor/{github.com/google/gofuzz => sigs.k8s.io/randfill}/README.md (53%)
create mode 100644 vendor/sigs.k8s.io/randfill/SECURITY_CONTACTS
rename vendor/{github.com/google/gofuzz => sigs.k8s.io/randfill}/bytesource/bytesource.go (100%)
create mode 100644 vendor/sigs.k8s.io/randfill/code-of-conduct.md
create mode 100644 vendor/sigs.k8s.io/randfill/randfill.go
rename vendor/{github.com/matttproud/golang_protobuf_extensions/v2 => sigs.k8s.io/structured-merge-diff/v6}/LICENSE (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/fieldpath/doc.go (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/fieldpath/element.go (78%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/fieldpath/fromvalue.go (98%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/fieldpath/managers.go (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/fieldpath/path.go (98%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/fieldpath/pathelementmap.go (98%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/fieldpath/serialize-pe.go (84%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/fieldpath/serialize.go (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/fieldpath/set.go (95%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/merge/conflict.go (98%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/merge/update.go (99%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/schema/doc.go (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/schema/elements.go (93%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/schema/equals.go (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/schema/schemaschema.go (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/typed/compare.go (98%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/typed/doc.go (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/typed/helpers.go (93%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/typed/merge.go (98%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/typed/parser.go (97%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/typed/reconcile_schema.go (98%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/typed/remove.go (64%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/typed/tofieldset.go (96%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/typed/typed.go (98%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/typed/validate.go (97%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/value/allocator.go (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/value/doc.go (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/value/fields.go (92%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/value/jsontagutil.go (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/value/list.go (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/value/listreflect.go (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/value/listunstructured.go (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/value/map.go (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/value/mapreflect.go (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/value/mapunstructured.go (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/value/reflectcache.go (99%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/value/scalar.go (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/value/structreflect.go (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/value/value.go (94%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/value/valuereflect.go (100%)
rename vendor/sigs.k8s.io/structured-merge-diff/{v4 => v6}/value/valueunstructured.go (100%)
delete mode 100644 vendor/sigs.k8s.io/yaml/goyaml.v2/README.md
delete mode 100644 vendor/sigs.k8s.io/yaml/goyaml.v2/yaml_aliases.go
create mode 100644 vendor/sigs.k8s.io/yaml/kyaml/kyaml.go
diff --git a/api/go.mod b/api/go.mod
index 8cdd354ffe16..0263e76b49f2 100644
--- a/api/go.mod
+++ b/api/go.mod
@@ -7,9 +7,9 @@ toolchain go1.26.2
require (
github.com/openshift/assisted-service/models v0.0.0
github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87
- github.com/openshift/hive/apis v0.0.0-20260415205034-aa1db747a6ba
- k8s.io/api v0.34.2
- k8s.io/apimachinery v0.34.2
+ github.com/openshift/hive/apis v0.0.0-20260729204917-c0b802fe5402
+ k8s.io/api v0.35.6
+ k8s.io/apimachinery v0.35.6
sigs.k8s.io/yaml v1.6.0
)
@@ -17,36 +17,38 @@ require (
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
github.com/go-logr/logr v1.4.3 // indirect
- github.com/go-openapi/analysis v0.21.4 // indirect
- github.com/go-openapi/errors v0.20.4 // indirect
- github.com/go-openapi/jsonpointer v0.21.0 // indirect
- github.com/go-openapi/jsonreference v0.20.2 // indirect
- github.com/go-openapi/loads v0.21.2 // indirect
- github.com/go-openapi/spec v0.20.9 // indirect
- github.com/go-openapi/strfmt v0.21.7 // indirect
- github.com/go-openapi/swag v0.23.0 // indirect
- github.com/go-openapi/validate v0.22.2 // indirect
- github.com/gogo/protobuf v1.3.2 // indirect
+ github.com/go-openapi/analysis v0.23.0 // indirect
+ github.com/go-openapi/errors v0.22.1 // indirect
+ github.com/go-openapi/jsonpointer v0.21.1 // indirect
+ github.com/go-openapi/jsonreference v0.21.0 // indirect
+ github.com/go-openapi/loads v0.22.0 // indirect
+ github.com/go-openapi/spec v0.21.0 // indirect
+ github.com/go-openapi/strfmt v0.23.0 // indirect
+ github.com/go-openapi/swag v0.23.1 // indirect
+ github.com/go-openapi/validate v0.24.0 // indirect
+ github.com/google/uuid v1.6.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.4 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/lib/pq v1.10.9 // indirect
- github.com/mailru/easyjson v0.7.7 // indirect
+ github.com/mailru/easyjson v0.9.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/oklog/ulid v1.3.1 // indirect
- github.com/openshift/api v0.0.0-20251120220512-cb382c9eaf42 // indirect
+ github.com/openshift/api v0.0.0-20260318185450-1f2fa3f09f4e // indirect
+ github.com/openshift/installer v1.4.22-ec5 // indirect
github.com/x448/float16 v0.8.4 // indirect
- go.mongodb.org/mongo-driver v1.12.0 // indirect
+ go.mongodb.org/mongo-driver v1.17.4 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
- golang.org/x/net v0.54.0 // indirect
+ golang.org/x/net v0.55.0 // indirect
golang.org/x/text v0.37.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gorm.io/gorm v1.24.5 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20260304202019-5b3e3fdb0acf // indirect
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
diff --git a/api/go.sum b/api/go.sum
index 16489a78ce20..d06d6cc2de88 100644
--- a/api/go.sum
+++ b/api/go.sum
@@ -4,7 +4,6 @@ github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb0
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
-github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
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/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
@@ -37,41 +36,33 @@ github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbV
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
-github.com/go-openapi/analysis v0.21.4 h1:ZDFLvSNxpDaomuCueM0BlSXxpANBlFYiBvr+GXrvIHc=
-github.com/go-openapi/analysis v0.21.4/go.mod h1:4zQ35W4neeZTqh3ol0rv/O8JBbka9QyAgQRPp9y3pfo=
-github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M=
-github.com/go-openapi/errors v0.20.4 h1:unTcVm6PispJsMECE3zWgvG4xTiKda1LIR5rCRWLG6M=
-github.com/go-openapi/errors v0.20.4/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk=
+github.com/go-openapi/analysis v0.23.0 h1:aGday7OWupfMs+LbmLZG4k0MYXIANxcuBTYUC03zFCU=
+github.com/go-openapi/analysis v0.23.0/go.mod h1:9mz9ZWaSlV8TvjQHLl2mUW2PbZtemkE8yA5v22ohupo=
+github.com/go-openapi/errors v0.22.1 h1:kslMRRnK7NCb/CvR1q1VWuEQCEIsBGn5GgKD9e+HYhU=
+github.com/go-openapi/errors v0.22.1/go.mod h1:+n/5UdIqdVnLIJ6Q9Se8HNGUXYaY6CN8ImWzfi/Gzp0=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
-github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
-github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
-github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
+github.com/go-openapi/jsonpointer v0.21.1 h1:whnzv/pNXtK2FbX/W9yJfRmE2gsmkfahjMKB0fZvcic=
+github.com/go-openapi/jsonpointer v0.21.1/go.mod h1:50I1STOfbY1ycR8jGz8DaMeLCdXiI6aDteEdRNNzpdk=
github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg=
github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns=
-github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo=
-github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
-github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
-github.com/go-openapi/loads v0.21.2 h1:r2a/xFIYeZ4Qd2TnGpWDIQNcP80dIaZgf704za8enro=
-github.com/go-openapi/loads v0.21.2/go.mod h1:Jq58Os6SSGz0rzh62ptiu8Z31I+OTHqmULx5e/gJbNw=
-github.com/go-openapi/spec v0.20.6/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA=
-github.com/go-openapi/spec v0.20.9 h1:xnlYNQAwKd2VQRRfwTEI0DcK+2cbuvI/0c7jx3gA8/8=
-github.com/go-openapi/spec v0.20.9/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA=
-github.com/go-openapi/strfmt v0.21.3/go.mod h1:k+RzNO0Da+k3FrrynSNN8F7n/peCmQQqbbXjtDfvmGg=
-github.com/go-openapi/strfmt v0.21.7 h1:rspiXgNWgeUzhjo1YU01do6qsahtJNByjLVbPLNHb8k=
-github.com/go-openapi/strfmt v0.21.7/go.mod h1:adeGTkxE44sPyLk0JV235VQAO/ZXUr8KAzYjclFs3ew=
+github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
+github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
+github.com/go-openapi/loads v0.22.0 h1:ECPGd4jX1U6NApCGG1We+uEozOAvXvJSF4nnwHZ8Aco=
+github.com/go-openapi/loads v0.22.0/go.mod h1:yLsaTCS92mnSAZX5WWoxszLj0u+Ojl+Zs5Stn1oF+rs=
+github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY=
+github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk=
+github.com/go-openapi/strfmt v0.23.0 h1:nlUS6BCqcnAk0pyhi9Y+kdDVZdZMHfEKQiS4HaMgO/c=
+github.com/go-openapi/strfmt v0.23.0/go.mod h1:NrtIpfKtWIygRkKVsxh7XQMDQW5HKQl6S5ik2elW+K4=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
-github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
-github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
-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-openapi/validate v0.22.2 h1:Lda8nadL/5kIvS5mdXCAIuZ7IVXvKFIppLnw+EZh+n0=
-github.com/go-openapi/validate v0.22.2/go.mod h1:kVxh31KbfsxU8ZyoHaDbLBWU5CnMdqBUEtadQ2G4d5M=
+github.com/go-openapi/swag v0.23.1 h1:lpsStH0n2ittzTnbaSloVZLuB5+fvSY/+hnagBjSNZU=
+github.com/go-openapi/swag v0.23.1/go.mod h1:STZs8TbRvEQQKUA+JZNAm3EWlgaOBGpyFDqQnDHMef0=
+github.com/go-openapi/validate v0.24.0 h1:LdfDKwNbpB6Vn40xhTdNZAnfLECL81w+VX3BumrGD58=
+github.com/go-openapi/validate v0.24.0/go.mod h1:iyeX1sEufmv3nPbBdX3ieNviWnOZaJ1+zquzJEf2BAQ=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
-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 v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
@@ -86,12 +77,10 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
-github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
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.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
@@ -99,7 +88,6 @@ github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX
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/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2/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=
@@ -120,10 +108,8 @@ 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.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
-github.com/kr/pretty v0.2.1/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=
@@ -135,11 +121,10 @@ github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
-github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
+github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
+github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
-github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
-github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c=
@@ -150,7 +135,6 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
-github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
@@ -169,12 +153,14 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
-github.com/openshift/api v0.0.0-20251120220512-cb382c9eaf42 h1:Mo2FlDdoCZ+BE2W4C0lNcxEDeIIhfsYFP6vj4Sggp8w=
-github.com/openshift/api v0.0.0-20251120220512-cb382c9eaf42/go.mod h1:d5uzF0YN2nQQFA0jIEWzzOZ+edmo6wzlGLvx5Fhz4uY=
+github.com/openshift/api v0.0.0-20260318185450-1f2fa3f09f4e h1:n2fW82JRX5B/+eCULWIe06MAhJVaE8fUsvy0A0Gn9n4=
+github.com/openshift/api v0.0.0-20260318185450-1f2fa3f09f4e/go.mod h1:pyVjK0nZ4sRs4fuQVQ4rubsJdahI1PB94LnQ8sGdvxo=
github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87 h1:cHyxR+Y8rAMT6m1jQCaYGRwikqahI0OjjUDhFNf3ySQ=
github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87/go.mod h1:DB/Mf2oTeiAmVVX1gN+NEqweonAPY0TKUwADizj8+ZA=
-github.com/openshift/hive/apis v0.0.0-20260415205034-aa1db747a6ba h1:GXPfNjWwWpi65XNnsDKqgVKiQ4EM2A3uuHgXNgtSK/4=
-github.com/openshift/hive/apis v0.0.0-20260415205034-aa1db747a6ba/go.mod h1:98U/kA+A9nenhu0mCqaxaKyYJ+C/YEZoAUkPYDT/m+c=
+github.com/openshift/hive/apis v0.0.0-20260729204917-c0b802fe5402 h1:irvOhERXc7TgNTvNVyfaLBV/+Wvx0/G07cMPaQB+FPQ=
+github.com/openshift/hive/apis v0.0.0-20260729204917-c0b802fe5402/go.mod h1:OfDFUHvU2+Caq6HPEtISSR2g+j3GhdxJNRquhhhNjww=
+github.com/openshift/installer v1.4.22-ec5 h1:NG9X2iZG5mbUVZIBhpMtMrGNK7Tbm9dDGAI6aXh/QZc=
+github.com/openshift/installer v1.4.22-ec5/go.mod h1:PbGvWlLRbmmSsaTQBAjhXPzliz9XJAYUdXcY0t/3UiY=
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=
@@ -188,35 +174,22 @@ github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
-github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
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.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
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.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
-github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
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/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
-github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g=
-github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4=
-github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8=
-github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM=
-github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
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.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
-go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8=
-go.mongodb.org/mongo-driver v1.12.0 h1:aPx33jmn/rQuJXPQLZQ8NtfPQG8CaqgLThFtqRb0PiE=
-go.mongodb.org/mongo-driver v1.12.0/go.mod h1:AZkxhPnFJUoH7kZlFkVKucV20K387miPfm7oimrSmK0=
+go.mongodb.org/mongo-driver v1.17.4 h1:jUorfmVzljjr0FLzYQsGP8cgN/qzzxlY9Vh0C9KFXVw=
+go.mongodb.org/mongo-driver v1.17.4/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
@@ -316,8 +289,6 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
-golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
-golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc=
golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38=
@@ -388,10 +359,8 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/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=
-gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
@@ -401,11 +370,11 @@ gorm.io/gorm v1.24.5/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA=
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.23.3/go.mod h1:w258XdGyvCmnBj/vGzQMj6kzdufJZVUwEM1U2fRJwSQ=
-k8s.io/api v0.34.2 h1:fsSUNZhV+bnL6Aqrp6O7lMTy6o5x2C4XLjnh//8SLYY=
-k8s.io/api v0.34.2/go.mod h1:MMBPaWlED2a8w4RSeanD76f7opUoypY8TFYkSM+3XHw=
+k8s.io/api v0.35.6 h1:phPzP79F3kcONsD2TzmDiITNCV6/1Z5U3CCEcjtsXzI=
+k8s.io/api v0.35.6/go.mod h1:GWKUaIp24fuDFigAgnhr9EJOKDqspnwPjYlpDca5B4U=
k8s.io/apimachinery v0.23.3/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM=
-k8s.io/apimachinery v0.34.2 h1:zQ12Uk3eMHPxrsbUJgNF8bTauTVR2WgqJsTmwTE/NW4=
-k8s.io/apimachinery v0.34.2/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw=
+k8s.io/apimachinery v0.35.6 h1:ASSpfmmsOArKb2Hsu8gGlIcbIcEMVTboI3FfsfYuQ8k=
+k8s.io/apimachinery v0.35.6/go.mod h1:NNi1taPOpep0jOj+oRha3mBJPqvi0hGdaV8TCqGQ+cc=
k8s.io/code-generator v0.23.3/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk=
k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
@@ -417,6 +386,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-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk=
k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk=
+k8s.io/kube-openapi v0.0.0-20260304202019-5b3e3fdb0acf h1:btPscg4cMql0XdYK2jLsJcNEKmACJz8l+U7geC06FiM=
+k8s.io/kube-openapi v0.0.0-20260304202019-5b3e3fdb0acf/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ=
k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck=
diff --git a/api/vendor/github.com/go-openapi/analysis/.golangci.yml b/api/vendor/github.com/go-openapi/analysis/.golangci.yml
index e24a6c14e6b5..22f8d21cca19 100644
--- a/api/vendor/github.com/go-openapi/analysis/.golangci.yml
+++ b/api/vendor/github.com/go-openapi/analysis/.golangci.yml
@@ -4,53 +4,58 @@ linters-settings:
golint:
min-confidence: 0
gocyclo:
- min-complexity: 40
- gocognit:
- min-complexity: 40
+ min-complexity: 45
maligned:
suggest-new: true
dupl:
- threshold: 150
+ threshold: 200
goconst:
min-len: 2
- min-occurrences: 4
+ min-occurrences: 3
linters:
enable-all: true
disable:
- maligned
+ - unparam
- lll
- - gochecknoglobals
- gochecknoinits
- # scopelint is useful, but also reports false positives
- # that unfortunately can't be disabled. So we disable the
- # linter rather than changing code that works.
- # see: https://github.com/kyoh86/scopelint/issues/4
- - scopelint
+ - gochecknoglobals
+ - funlen
- godox
- gocognit
- #- whitespace
+ - whitespace
- wsl
- - funlen
- - testpackage
- wrapcheck
- #- nlreturn
+ - testpackage
+ - nlreturn
- gomnd
- - goerr113
- exhaustivestruct
- #- errorlint
- #- nestif
- - gofumpt
+ - goerr113
+ - errorlint
+ - nestif
- godot
- - gci
- - dogsled
+ - gofumpt
- paralleltest
- tparallel
- thelper
- ifshort
- - forbidigo
- - cyclop
- - varnamelen
- exhaustruct
+ - varnamelen
+ - gci
+ - depguard
+ - errchkjson
+ - inamedparam
- nonamedreturns
+ - musttag
+ - ireturn
+ - forcetypeassert
+ - cyclop
+ # deprecated linters
+ - deadcode
+ - interfacer
+ - scopelint
+ - varcheck
+ - structcheck
+ - golint
- nosnakecase
diff --git a/api/vendor/github.com/go-openapi/analysis/README.md b/api/vendor/github.com/go-openapi/analysis/README.md
index aad6da10fe79..e005d4b37b7f 100644
--- a/api/vendor/github.com/go-openapi/analysis/README.md
+++ b/api/vendor/github.com/go-openapi/analysis/README.md
@@ -1,8 +1,5 @@
-# OpenAPI initiative analysis
+# OpenAPI analysis [](https://github.com/go-openapi/analysis/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/analysis)
-[](https://travis-ci.org/go-openapi/analysis)
-[](https://ci.appveyor.com/project/casualjim/go-openapi/analysis/branch/master)
-[](https://codecov.io/gh/go-openapi/analysis)
[](https://slackin.goswagger.io)
[](https://raw.githubusercontent.com/go-openapi/analysis/master/LICENSE)
[](https://pkg.go.dev/github.com/go-openapi/analysis)
@@ -13,12 +10,12 @@ A foundational library to analyze an OAI specification document for easier reaso
## What's inside?
-* A analyzer providing methods to walk the functional content of a specification
+* An analyzer providing methods to walk the functional content of a specification
* A spec flattener producing a self-contained document bundle, while preserving `$ref`s
* A spec merger ("mixin") to merge several spec documents into a primary spec
* A spec "fixer" ensuring that response descriptions are non empty
-[Documentation](https://godoc.org/github.com/go-openapi/analysis)
+[Documentation](https://pkg.go.dev/github.com/go-openapi/analysis)
## FAQ
@@ -28,4 +25,3 @@ A foundational library to analyze an OAI specification document for easier reaso
> This package currently only supports OpenAPI 2.0 (aka Swagger 2.0).
> There is no plan to make it evolve toward supporting OpenAPI 3.x.
> This [discussion thread](https://github.com/go-openapi/spec/issues/21) relates the full story.
->
diff --git a/api/vendor/github.com/go-openapi/analysis/appveyor.yml b/api/vendor/github.com/go-openapi/analysis/appveyor.yml
deleted file mode 100644
index c2f6fd733a93..000000000000
--- a/api/vendor/github.com/go-openapi/analysis/appveyor.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-version: "0.1.{build}"
-
-clone_folder: C:\go-openapi\analysis
-shallow_clone: true # for startup speed
-pull_requests:
- do_not_increment_build_number: true
-
-#skip_tags: true
-#skip_branch_with_pr: true
-
-# appveyor.yml
-build: off
-
-environment:
- GOPATH: c:\gopath
-
-stack: go 1.16
-
-test_script:
- - go test -v -timeout 20m ./...
-
-deploy: off
-
-notifications:
- - provider: Slack
- incoming_webhook: https://hooks.slack.com/services/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
- auth_token:
- secure: Sf7kZf7ZGbnwWUMpffHwMu5A0cHkLK2MYY32LNTPj4+/3qC3Ghl7+9v4TSLOqOlCwdRNjOGblAq7s+GDJed6/xgRQl1JtCi1klzZNrYX4q01pgTPvvGcwbBkIYgeMaPeIRcK9OZnud7sRXdttozgTOpytps2U6Js32ip7uj5mHSg2ub0FwoSJwlS6dbezZ8+eDhoha0F/guY99BEwx8Bd+zROrT2TFGsSGOFGN6wFc7moCqTHO/YkWib13a2QNXqOxCCVBy/lt76Wp+JkeFppjHlzs/2lP3EAk13RIUAaesdEUHvIHrzCyNJEd3/+KO2DzsWOYfpktd+KBCvgaYOsoo7ubdT3IROeAegZdCgo/6xgCEsmFc9ZcqCfN5yNx2A+BZ2Vwmpws+bQ1E1+B5HDzzaiLcYfG4X2O210QVGVDLWsv1jqD+uPYeHY2WRfh5ZsIUFvaqgUEnwHwrK44/8REAhQavt1QAj5uJpsRd7CkRVPWRNK+yIky+wgbVUFEchRNmS55E7QWf+W4+4QZkQi7vUTMc9nbTUu2Es9NfvfudOpM2wZbn98fjpb/qq/nRv6Bk+ca+7XD5/IgNLMbWp2ouDdzbiHLCOfDUiHiDJhLfFZx9Bwo7ZwfzeOlbrQX66bx7xRKYmOe4DLrXhNcpbsMa8qbfxlZRCmYbubB/Y8h4=
- channel: bots
- on_build_success: false
- on_build_failure: true
- on_build_status_changed: true
diff --git a/api/vendor/github.com/go-openapi/analysis/doc.go b/api/vendor/github.com/go-openapi/analysis/doc.go
index d5294c0950b6..e8d9f9b13120 100644
--- a/api/vendor/github.com/go-openapi/analysis/doc.go
+++ b/api/vendor/github.com/go-openapi/analysis/doc.go
@@ -16,27 +16,27 @@
Package analysis provides methods to work with a Swagger specification document from
package go-openapi/spec.
-Analyzing a specification
+## Analyzing a specification
An analysed specification object (type Spec) provides methods to work with swagger definition.
-Flattening or expanding a specification
+## Flattening or expanding a specification
Flattening a specification bundles all remote $ref in the main spec document.
Depending on flattening options, additional preprocessing may take place:
- full flattening: replacing all inline complex constructs by a named entry in #/definitions
- expand: replace all $ref's in the document by their expanded content
-Merging several specifications
+## Merging several specifications
Mixin several specifications merges all Swagger constructs, and warns about found conflicts.
-Fixing a specification
+## Fixing a specification
Unmarshalling a specification with golang json unmarshalling may lead to
some unwanted result on present but empty fields.
-Analyzing a Swagger schema
+## Analyzing a Swagger schema
Swagger schemas are analyzed to determine their complexity and qualify their content.
*/
diff --git a/api/vendor/github.com/go-openapi/analysis/flatten.go b/api/vendor/github.com/go-openapi/analysis/flatten.go
index 0576220fb3d7..ebedcc9df325 100644
--- a/api/vendor/github.com/go-openapi/analysis/flatten.go
+++ b/api/vendor/github.com/go-openapi/analysis/flatten.go
@@ -62,28 +62,26 @@ func newContext() *context {
//
// There is a minimal and a full flattening mode.
//
-//
// Minimally flattening a spec means:
-// - Expanding parameters, responses, path items, parameter items and header items (references to schemas are left
-// unscathed)
-// - Importing external (http, file) references so they become internal to the document
-// - Moving every JSON pointer to a $ref to a named definition (i.e. the reworked spec does not contain pointers
-// like "$ref": "#/definitions/myObject/allOfs/1")
+// - Expanding parameters, responses, path items, parameter items and header items (references to schemas are left
+// unscathed)
+// - Importing external (http, file) references so they become internal to the document
+// - Moving every JSON pointer to a $ref to a named definition (i.e. the reworked spec does not contain pointers
+// like "$ref": "#/definitions/myObject/allOfs/1")
//
// A minimally flattened spec thus guarantees the following properties:
-// - all $refs point to a local definition (i.e. '#/definitions/...')
-// - definitions are unique
+// - all $refs point to a local definition (i.e. '#/definitions/...')
+// - definitions are unique
//
// NOTE: arbitrary JSON pointers (other than $refs to top level definitions) are rewritten as definitions if they
// represent a complex schema or express commonality in the spec.
// Otherwise, they are simply expanded.
// Self-referencing JSON pointers cannot resolve to a type and trigger an error.
//
-//
// Minimal flattening is necessary and sufficient for codegen rendering using go-swagger.
//
// Fully flattening a spec means:
-// - Moving every complex inline schema to be a definition with an auto-generated name in a depth-first fashion.
+// - Moving every complex inline schema to be a definition with an auto-generated name in a depth-first fashion.
//
// By complex, we mean every JSON object with some properties.
// Arrays, when they do not define a tuple,
@@ -93,22 +91,21 @@ func newContext() *context {
// have been created.
//
// Available flattening options:
-// - Minimal: stops flattening after minimal $ref processing, leaving schema constructs untouched
-// - Expand: expand all $ref's in the document (inoperant if Minimal set to true)
-// - Verbose: croaks about name conflicts detected
-// - RemoveUnused: removes unused parameters, responses and definitions after expansion/flattening
+// - Minimal: stops flattening after minimal $ref processing, leaving schema constructs untouched
+// - Expand: expand all $ref's in the document (inoperant if Minimal set to true)
+// - Verbose: croaks about name conflicts detected
+// - RemoveUnused: removes unused parameters, responses and definitions after expansion/flattening
//
// NOTE: expansion removes all $ref save circular $ref, which remain in place
//
// TODO: additional options
-// - ProgagateNameExtensions: ensure that created entries properly follow naming rules when their parent have set a
-// x-go-name extension
-// - LiftAllOfs:
-// - limit the flattening of allOf members when simple objects
-// - merge allOf with validation only
-// - merge allOf with extensions only
-// - ...
-//
+// - ProgagateNameExtensions: ensure that created entries properly follow naming rules when their parent have set a
+// x-go-name extension
+// - LiftAllOfs:
+// - limit the flattening of allOf members when simple objects
+// - merge allOf with validation only
+// - merge allOf with extensions only
+// - ...
func Flatten(opts FlattenOpts) error {
debugLog("FlattenOpts: %#v", opts)
@@ -270,6 +267,12 @@ func nameInlinedSchemas(opts *FlattenOpts) error {
}
func removeUnused(opts *FlattenOpts) {
+ for removeUnusedSinglePass(opts) {
+ // continue until no unused definition remains
+ }
+}
+
+func removeUnusedSinglePass(opts *FlattenOpts) (hasRemoved bool) {
expected := make(map[string]struct{})
for k := range opts.Swagger().Definitions {
expected[path.Join(definitionsPath, jsonpointer.Escape(k))] = struct{}{}
@@ -280,6 +283,7 @@ func removeUnused(opts *FlattenOpts) {
}
for k := range expected {
+ hasRemoved = true
debugLog("removing unused definition %s", path.Base(k))
if opts.Verbose {
log.Printf("info: removing unused definition: %s", path.Base(k))
@@ -288,6 +292,8 @@ func removeUnused(opts *FlattenOpts) {
}
opts.Spec.reload() // re-analyze
+
+ return hasRemoved
}
func importKnownRef(entry sortref.RefRevIdx, refStr, newName string, opts *FlattenOpts) error {
@@ -334,7 +340,7 @@ func importNewRef(entry sortref.RefRevIdx, refStr string, opts *FlattenOpts) err
}
// generate a unique name - isOAIGen means that a naming conflict was resolved by changing the name
- newName, isOAIGen = uniqifyName(opts.Swagger().Definitions, nameFromRef(entry.Ref))
+ newName, isOAIGen = uniqifyName(opts.Swagger().Definitions, nameFromRef(entry.Ref, opts))
debugLog("new name for [%s]: %s - with name conflict:%t", strings.Join(entry.Keys, ", "), newName, isOAIGen)
opts.flattenContext.resolved[refStr] = newName
@@ -488,9 +494,9 @@ func stripPointersAndOAIGen(opts *FlattenOpts) error {
// stripOAIGen strips the spec from unnecessary OAIGen constructs, initially created to dedupe flattened definitions.
//
// A dedupe is deemed unnecessary whenever:
-// - the only conflict is with its (single) parent: OAIGen is merged into its parent (reinlining)
-// - there is a conflict with multiple parents: merge OAIGen in first parent, the rewrite other parents to point to
-// the first parent.
+// - the only conflict is with its (single) parent: OAIGen is merged into its parent (reinlining)
+// - there is a conflict with multiple parents: merge OAIGen in first parent, the rewrite other parents to point to
+// the first parent.
//
// This function returns true whenever it re-inlined a complex schema, so the caller may chose to iterate
// pointer and name resolution again.
@@ -652,6 +658,7 @@ func namePointers(opts *FlattenOpts) error {
refsToReplace := make(map[string]SchemaRef, len(opts.Spec.references.schemas))
for k, ref := range opts.Spec.references.allRefs {
+ debugLog("name pointers: %q => %#v", k, ref)
if path.Dir(ref.String()) == definitionsPath {
// this a ref to a top-level definition: ok
continue
@@ -769,6 +776,10 @@ func flattenAnonPointer(key string, v SchemaRef, refsToReplace map[string]Schema
// identifying edge case when the namer did nothing because we point to a non-schema object
// no definition is created and we expand the $ref for all callers
+ debugLog("decide what to do with the schema pointed to: asch.IsSimpleSchema=%t, len(callers)=%d, parts.IsSharedParam=%t, parts.IsSharedResponse=%t",
+ asch.IsSimpleSchema, len(callers), parts.IsSharedParam(), parts.IsSharedResponse(),
+ )
+
if (!asch.IsSimpleSchema || len(callers) > 1) && !parts.IsSharedParam() && !parts.IsSharedResponse() {
debugLog("replace JSON pointer at [%s] by definition: %s", key, v.Ref.String())
if err := namer.Name(v.Ref.String(), v.Schema, asch); err != nil {
@@ -791,6 +802,7 @@ func flattenAnonPointer(key string, v SchemaRef, refsToReplace map[string]Schema
return nil
}
+ // everything that is a simple schema and not factorizable is expanded
debugLog("expand JSON pointer for key=%s", key)
if err := replace.UpdateRefWithSchema(opts.Swagger(), key, v.Schema); err != nil {
diff --git a/api/vendor/github.com/go-openapi/analysis/flatten_name.go b/api/vendor/github.com/go-openapi/analysis/flatten_name.go
index 3ad2ccfbfd55..c7d7938ebe6b 100644
--- a/api/vendor/github.com/go-openapi/analysis/flatten_name.go
+++ b/api/vendor/github.com/go-openapi/analysis/flatten_name.go
@@ -33,12 +33,14 @@ func (isn *InlineSchemaNamer) Name(key string, schema *spec.Schema, aschema *Ana
}
// create unique name
- newName, isOAIGen := uniqifyName(isn.Spec.Definitions, swag.ToJSONName(name))
+ mangle := mangler(isn.opts)
+ newName, isOAIGen := uniqifyName(isn.Spec.Definitions, mangle(name))
// clone schema
sch := schutils.Clone(schema)
// replace values on schema
+ debugLog("rewriting schema to ref: key=%s with new name: %s", key, newName)
if err := replace.RewriteSchemaToRef(isn.Spec, key,
spec.MustCreateRef(path.Join(definitionsPath, newName))); err != nil {
return fmt.Errorf("error while creating definition %q from inline schema: %w", newName, err)
@@ -149,13 +151,15 @@ func namesFromKey(parts sortref.SplitKey, aschema *AnalyzedSchema, operations ma
startIndex int
)
- if parts.IsOperation() {
+ switch {
+ case parts.IsOperation():
baseNames, startIndex = namesForOperation(parts, operations)
- }
-
- // definitions
- if parts.IsDefinition() {
+ case parts.IsDefinition():
baseNames, startIndex = namesForDefinition(parts)
+ default:
+ // this a non-standard pointer: build a name by concatenating its parts
+ baseNames = [][]string{parts}
+ startIndex = len(baseNames) + 1
}
result := make([]string, 0, len(baseNames))
@@ -169,6 +173,7 @@ func namesFromKey(parts sortref.SplitKey, aschema *AnalyzedSchema, operations ma
}
sort.Strings(result)
+ debugLog("names from parts: %v => %v", parts, result)
return result
}
@@ -256,10 +261,20 @@ func partAdder(aschema *AnalyzedSchema) sortref.PartAdder {
}
}
-func nameFromRef(ref spec.Ref) string {
+func mangler(o *FlattenOpts) func(string) string {
+ if o.KeepNames {
+ return func(in string) string { return in }
+ }
+
+ return swag.ToJSONName
+}
+
+func nameFromRef(ref spec.Ref, o *FlattenOpts) string {
+ mangle := mangler(o)
+
u := ref.GetURL()
if u.Fragment != "" {
- return swag.ToJSONName(path.Base(u.Fragment))
+ return mangle(path.Base(u.Fragment))
}
if u.Path != "" {
@@ -267,19 +282,19 @@ func nameFromRef(ref spec.Ref) string {
if bn != "" && bn != "/" {
ext := path.Ext(bn)
if ext != "" {
- return swag.ToJSONName(bn[:len(bn)-len(ext)])
+ return mangle(bn[:len(bn)-len(ext)])
}
- return swag.ToJSONName(bn)
+ return mangle(bn)
}
}
- return swag.ToJSONName(strings.ReplaceAll(u.Host, ".", " "))
+ return mangle(strings.ReplaceAll(u.Host, ".", " "))
}
// GenLocation indicates from which section of the specification (models or operations) a definition has been created.
//
-// This is reflected in the output spec with a "x-go-gen-location" extension. At the moment, this is is provided
+// This is reflected in the output spec with a "x-go-gen-location" extension. At the moment, this is provided
// for information only.
func GenLocation(parts sortref.SplitKey) string {
switch {
diff --git a/api/vendor/github.com/go-openapi/analysis/flatten_options.go b/api/vendor/github.com/go-openapi/analysis/flatten_options.go
index c5bb97b0a693..c943fe1e84a3 100644
--- a/api/vendor/github.com/go-openapi/analysis/flatten_options.go
+++ b/api/vendor/github.com/go-openapi/analysis/flatten_options.go
@@ -26,6 +26,7 @@ type FlattenOpts struct {
Verbose bool // enable some reporting on possible name conflicts detected
RemoveUnused bool // When true, remove unused parameters, responses and definitions after expansion/flattening
ContinueOnError bool // Continue when spec expansion issues are found
+ KeepNames bool // Do not attempt to jsonify names from references when flattening
/* Extra keys */
_ struct{} // require keys
diff --git a/api/vendor/github.com/go-openapi/analysis/internal/debug/debug.go b/api/vendor/github.com/go-openapi/analysis/internal/debug/debug.go
index ec0fec022986..39f55a97bfdc 100644
--- a/api/vendor/github.com/go-openapi/analysis/internal/debug/debug.go
+++ b/api/vendor/github.com/go-openapi/analysis/internal/debug/debug.go
@@ -29,7 +29,7 @@ var (
// GetLogger provides a prefix debug logger
func GetLogger(prefix string, debug bool) func(string, ...interface{}) {
if debug {
- logger := log.New(output, fmt.Sprintf("%s:", prefix), log.LstdFlags)
+ logger := log.New(output, prefix+":", log.LstdFlags)
return func(msg string, args ...interface{}) {
_, file1, pos1, _ := runtime.Caller(1)
@@ -37,5 +37,5 @@ func GetLogger(prefix string, debug bool) func(string, ...interface{}) {
}
}
- return func(msg string, args ...interface{}) {}
+ return func(_ string, _ ...interface{}) {}
}
diff --git a/api/vendor/github.com/go-openapi/analysis/internal/flatten/replace/replace.go b/api/vendor/github.com/go-openapi/analysis/internal/flatten/replace/replace.go
index 26c2a05a3101..c0f43e728a3f 100644
--- a/api/vendor/github.com/go-openapi/analysis/internal/flatten/replace/replace.go
+++ b/api/vendor/github.com/go-openapi/analysis/internal/flatten/replace/replace.go
@@ -1,6 +1,7 @@
package replace
import (
+ "encoding/json"
"fmt"
"net/url"
"os"
@@ -40,6 +41,8 @@ func RewriteSchemaToRef(sp *spec.Swagger, key string, ref spec.Ref) error {
if refable.Schema != nil {
refable.Schema = &spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
}
+ case map[string]interface{}: // this happens e.g. if a schema points to an extension unmarshaled as map[string]interface{}
+ return rewriteParentRef(sp, key, ref)
default:
return fmt.Errorf("no schema with ref found at %s for %T", key, value)
}
@@ -120,6 +123,9 @@ func rewriteParentRef(sp *spec.Swagger, key string, ref spec.Ref) error {
case spec.SchemaProperties:
container[entry] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
+ case *interface{}:
+ *container = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
+
// NOTE: can't have case *spec.SchemaOrBool = parent in this case is *Schema
default:
@@ -318,8 +324,8 @@ type DeepestRefResult struct {
}
// DeepestRef finds the first definition ref, from a cascade of nested refs which are not definitions.
-// - if no definition is found, returns the deepest ref.
-// - pointers to external files are expanded
+// - if no definition is found, returns the deepest ref.
+// - pointers to external files are expanded
//
// NOTE: all external $ref's are assumed to be already expanded at this stage.
func DeepestRef(sp *spec.Swagger, opts *spec.ExpandOptions, ref spec.Ref) (*DeepestRefResult, error) {
@@ -385,8 +391,9 @@ DOWNREF:
err := asSchema.UnmarshalJSON(asJSON)
if err != nil {
return nil,
- fmt.Errorf("invalid type for resolved JSON pointer %s. Expected a schema a, got: %T",
- currentRef.String(), value)
+ fmt.Errorf("invalid type for resolved JSON pointer %s. Expected a schema a, got: %T (%v)",
+ currentRef.String(), value, err,
+ )
}
warnings = append(warnings, fmt.Sprintf("found $ref %q (response) interpreted as schema", currentRef.String()))
@@ -402,8 +409,9 @@ DOWNREF:
var asSchema spec.Schema
if err := asSchema.UnmarshalJSON(asJSON); err != nil {
return nil,
- fmt.Errorf("invalid type for resolved JSON pointer %s. Expected a schema a, got: %T",
- currentRef.String(), value)
+ fmt.Errorf("invalid type for resolved JSON pointer %s. Expected a schema a, got: %T (%v)",
+ currentRef.String(), value, err,
+ )
}
warnings = append(warnings, fmt.Sprintf("found $ref %q (parameter) interpreted as schema", currentRef.String()))
@@ -414,9 +422,25 @@ DOWNREF:
currentRef = asSchema.Ref
default:
- return nil,
- fmt.Errorf("unhandled type to resolve JSON pointer %s. Expected a Schema, got: %T",
- currentRef.String(), value)
+ // fallback: attempts to resolve the pointer as a schema
+ if refable == nil {
+ break DOWNREF
+ }
+
+ asJSON, _ := json.Marshal(refable)
+ var asSchema spec.Schema
+ if err := asSchema.UnmarshalJSON(asJSON); err != nil {
+ return nil,
+ fmt.Errorf("unhandled type to resolve JSON pointer %s. Expected a Schema, got: %T (%v)",
+ currentRef.String(), value, err,
+ )
+ }
+ warnings = append(warnings, fmt.Sprintf("found $ref %q (%T) interpreted as schema", currentRef.String(), refable))
+
+ if asSchema.Ref.String() == "" {
+ break DOWNREF
+ }
+ currentRef = asSchema.Ref
}
}
diff --git a/api/vendor/github.com/go-openapi/analysis/internal/flatten/sortref/keys.go b/api/vendor/github.com/go-openapi/analysis/internal/flatten/sortref/keys.go
index 18e552eadcef..ac80fc2e8320 100644
--- a/api/vendor/github.com/go-openapi/analysis/internal/flatten/sortref/keys.go
+++ b/api/vendor/github.com/go-openapi/analysis/internal/flatten/sortref/keys.go
@@ -69,7 +69,7 @@ func KeyParts(key string) SplitKey {
return res
}
-// SplitKey holds of the parts of a /-separated key, soi that their location may be determined.
+// SplitKey holds of the parts of a /-separated key, so that their location may be determined.
type SplitKey []string
// IsDefinition is true when the split key is in the #/definitions section of a spec
diff --git a/api/vendor/github.com/go-openapi/analysis/mixin.go b/api/vendor/github.com/go-openapi/analysis/mixin.go
index b253052648cd..7785a29b27dd 100644
--- a/api/vendor/github.com/go-openapi/analysis/mixin.go
+++ b/api/vendor/github.com/go-openapi/analysis/mixin.go
@@ -53,7 +53,7 @@ import (
// collisions.
func Mixin(primary *spec.Swagger, mixins ...*spec.Swagger) []string {
skipped := make([]string, 0, len(mixins))
- opIds := getOpIds(primary)
+ opIDs := getOpIDs(primary)
initPrimary(primary)
for i, m := range mixins {
@@ -74,7 +74,7 @@ func Mixin(primary *spec.Swagger, mixins ...*spec.Swagger) []string {
skipped = append(skipped, mergeDefinitions(primary, m)...)
// merging paths requires a map of operationIDs to work with
- skipped = append(skipped, mergePaths(primary, m, opIds, i)...)
+ skipped = append(skipped, mergePaths(primary, m, opIDs, i)...)
skipped = append(skipped, mergeParameters(primary, m)...)
@@ -84,9 +84,9 @@ func Mixin(primary *spec.Swagger, mixins ...*spec.Swagger) []string {
return skipped
}
-// getOpIds extracts all the paths..operationIds from the given
+// getOpIDs extracts all the paths..operationIds from the given
// spec and returns them as the keys in a map with 'true' values.
-func getOpIds(s *spec.Swagger) map[string]bool {
+func getOpIDs(s *spec.Swagger) map[string]bool {
rv := make(map[string]bool)
if s.Paths == nil {
return rv
@@ -179,7 +179,7 @@ func mergeDefinitions(primary *spec.Swagger, m *spec.Swagger) (skipped []string)
return
}
-func mergePaths(primary *spec.Swagger, m *spec.Swagger, opIds map[string]bool, mixIndex int) (skipped []string) {
+func mergePaths(primary *spec.Swagger, m *spec.Swagger, opIDs map[string]bool, mixIndex int) (skipped []string) {
if m.Paths != nil {
for k, v := range m.Paths.Paths {
if _, exists := primary.Paths.Paths[k]; exists {
@@ -198,10 +198,10 @@ func mergePaths(primary *spec.Swagger, m *spec.Swagger, opIds map[string]bool, m
// all the proivded specs are already unique.
piops := pathItemOps(v)
for _, piop := range piops {
- if opIds[piop.ID] {
+ if opIDs[piop.ID] {
piop.ID = fmt.Sprintf("%v%v%v", piop.ID, "Mixin", mixIndex)
}
- opIds[piop.ID] = true
+ opIDs[piop.ID] = true
}
primary.Paths.Paths[k] = v
}
@@ -367,7 +367,7 @@ func mergeSwaggerProps(primary *spec.Swagger, m *spec.Swagger) []string {
return skipped
}
-// nolint: unparam
+//nolint:unparam
func mergeExternalDocs(primary *spec.ExternalDocumentation, m *spec.ExternalDocumentation) []string {
if primary.Description == "" {
primary.Description = m.Description
diff --git a/api/vendor/github.com/go-openapi/analysis/schema.go b/api/vendor/github.com/go-openapi/analysis/schema.go
index fc055095cbb6..ab190db5b785 100644
--- a/api/vendor/github.com/go-openapi/analysis/schema.go
+++ b/api/vendor/github.com/go-openapi/analysis/schema.go
@@ -1,7 +1,7 @@
package analysis
import (
- "fmt"
+ "errors"
"github.com/go-openapi/spec"
"github.com/go-openapi/strfmt"
@@ -19,7 +19,7 @@ type SchemaOpts struct {
// patterns.
func Schema(opts SchemaOpts) (*AnalyzedSchema, error) {
if opts.Schema == nil {
- return nil, fmt.Errorf("no schema to analyze")
+ return nil, errors.New("no schema to analyze")
}
a := &AnalyzedSchema{
@@ -247,10 +247,10 @@ func (a *AnalyzedSchema) isArrayType() bool {
// isAnalyzedAsComplex determines if an analyzed schema is eligible to flattening (i.e. it is "complex").
//
// Complex means the schema is any of:
-// - a simple type (primitive)
-// - an array of something (items are possibly complex ; if this is the case, items will generate a definition)
-// - a map of something (additionalProperties are possibly complex ; if this is the case, additionalProperties will
-// generate a definition)
+// - a simple type (primitive)
+// - an array of something (items are possibly complex ; if this is the case, items will generate a definition)
+// - a map of something (additionalProperties are possibly complex ; if this is the case, additionalProperties will
+// generate a definition)
func (a *AnalyzedSchema) isAnalyzedAsComplex() bool {
return !a.IsSimpleSchema && !a.IsArray && !a.IsMap
}
diff --git a/api/vendor/github.com/go-openapi/errors/.golangci.yml b/api/vendor/github.com/go-openapi/errors/.golangci.yml
index 4e1fc0c7d482..ee8b9bd1f141 100644
--- a/api/vendor/github.com/go-openapi/errors/.golangci.yml
+++ b/api/vendor/github.com/go-openapi/errors/.golangci.yml
@@ -1,48 +1,55 @@
linters-settings:
- govet:
- check-shadowing: true
- golint:
- min-confidence: 0
gocyclo:
- min-complexity: 30
- maligned:
- suggest-new: true
+ min-complexity: 45
dupl:
- threshold: 100
+ threshold: 200
goconst:
min-len: 2
- min-occurrences: 4
+ min-occurrences: 3
+
linters:
enable-all: true
disable:
- - maligned
+ - unparam
- lll
+ - gochecknoinits
- gochecknoglobals
+ - funlen
- godox
- gocognit
- whitespace
- wsl
- - funlen
- - gochecknoglobals
- - gochecknoinits
- - scopelint
- wrapcheck
- - exhaustivestruct
- - exhaustive
- - nlreturn
- testpackage
- - gci
- - gofumpt
- - goerr113
- - gomnd
- - tparallel
+ - nlreturn
+ - errorlint
- nestif
- godot
- - errorlint
+ - gofumpt
- paralleltest
- tparallel
- - cyclop
- - errname
- - varnamelen
+ - thelper
- exhaustruct
- - maintidx
+ - varnamelen
+ - gci
+ - depguard
+ - errchkjson
+ - inamedparam
+ - nonamedreturns
+ - musttag
+ - ireturn
+ - forcetypeassert
+ - cyclop
+ # deprecated linters
+ #- deadcode
+ #- interfacer
+ #- scopelint
+ #- varcheck
+ #- structcheck
+ #- golint
+ #- nosnakecase
+ #- maligned
+ #- goerr113
+ #- ifshort
+ #- gomnd
+ #- exhaustivestruct
diff --git a/api/vendor/github.com/go-openapi/errors/README.md b/api/vendor/github.com/go-openapi/errors/README.md
index 4aac049e608d..6d57ea55c7c1 100644
--- a/api/vendor/github.com/go-openapi/errors/README.md
+++ b/api/vendor/github.com/go-openapi/errors/README.md
@@ -1,11 +1,8 @@
-# OpenAPI errors
+# OpenAPI errors [](https://github.com/go-openapi/errors/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/errors)
-[](https://travis-ci.org/go-openapi/errors)
-[](https://codecov.io/gh/go-openapi/errors)
[](https://slackin.goswagger.io)
[](https://raw.githubusercontent.com/go-openapi/errors/master/LICENSE)
[](https://pkg.go.dev/github.com/go-openapi/errors)
-[](https://golangci.com)
[](https://goreportcard.com/report/github.com/go-openapi/errors)
Shared errors and error interface used throughout the various libraries found in the go-openapi toolkit.
diff --git a/api/vendor/github.com/go-openapi/errors/api.go b/api/vendor/github.com/go-openapi/errors/api.go
index c13f3435fa83..d6f507f42de2 100644
--- a/api/vendor/github.com/go-openapi/errors/api.go
+++ b/api/vendor/github.com/go-openapi/errors/api.go
@@ -55,9 +55,15 @@ func (a apiError) MarshalJSON() ([]byte, error) {
// New creates a new API error with a code and a message
func New(code int32, message string, args ...interface{}) Error {
if len(args) > 0 {
- return &apiError{code, fmt.Sprintf(message, args...)}
+ return &apiError{
+ code: code,
+ message: fmt.Sprintf(message, args...),
+ }
+ }
+ return &apiError{
+ code: code,
+ message: message,
}
- return &apiError{code, message}
}
// NotFound creates a new not found error
@@ -130,10 +136,14 @@ func flattenComposite(errs *CompositeError) *CompositeError {
// MethodNotAllowed creates a new method not allowed error
func MethodNotAllowed(requested string, allow []string) Error {
msg := fmt.Sprintf("method %s is not allowed, but [%s] are", requested, strings.Join(allow, ","))
- return &MethodNotAllowedError{code: http.StatusMethodNotAllowed, Allowed: allow, message: msg}
+ return &MethodNotAllowedError{
+ code: http.StatusMethodNotAllowed,
+ Allowed: allow,
+ message: msg,
+ }
}
-// ServeError the error handler interface implementation
+// ServeError implements the http error handler interface
func ServeError(rw http.ResponseWriter, r *http.Request, err error) {
rw.Header().Set("Content-Type", "application/json")
switch e := err.(type) {
@@ -175,7 +185,7 @@ func ServeError(rw http.ResponseWriter, r *http.Request, err error) {
}
func asHTTPCode(input int) int {
- if input >= 600 {
+ if input >= maximumValidHTTPCode {
return DefaultHTTPCode
}
return input
diff --git a/api/vendor/github.com/go-openapi/errors/headers.go b/api/vendor/github.com/go-openapi/errors/headers.go
index dfebe8f95f08..6ea1151f4155 100644
--- a/api/vendor/github.com/go-openapi/errors/headers.go
+++ b/api/vendor/github.com/go-openapi/errors/headers.go
@@ -21,7 +21,7 @@ import (
)
// Validation represents a failure of a precondition
-type Validation struct {
+type Validation struct { //nolint: errname
code int32
Name string
In string
diff --git a/api/vendor/github.com/go-openapi/errors/middleware.go b/api/vendor/github.com/go-openapi/errors/middleware.go
index 963472d1f34b..67f80386a2ec 100644
--- a/api/vendor/github.com/go-openapi/errors/middleware.go
+++ b/api/vendor/github.com/go-openapi/errors/middleware.go
@@ -22,7 +22,7 @@ import (
// APIVerificationFailed is an error that contains all the missing info for a mismatched section
// between the api registrations and the api spec
-type APIVerificationFailed struct {
+type APIVerificationFailed struct { //nolint: errname
Section string `json:"section,omitempty"`
MissingSpecification []string `json:"missingSpecification,omitempty"`
MissingRegistration []string `json:"missingRegistration,omitempty"`
diff --git a/api/vendor/github.com/go-openapi/errors/parsing.go b/api/vendor/github.com/go-openapi/errors/parsing.go
index 5096e1ea7be5..ce1ef9cb675d 100644
--- a/api/vendor/github.com/go-openapi/errors/parsing.go
+++ b/api/vendor/github.com/go-openapi/errors/parsing.go
@@ -17,6 +17,7 @@ package errors
import (
"encoding/json"
"fmt"
+ "net/http"
)
// ParseError represents a parsing error
@@ -68,7 +69,7 @@ func NewParseError(name, in, value string, reason error) *ParseError {
msg = fmt.Sprintf(parseErrorTemplContent, name, in, value, reason)
}
return &ParseError{
- code: 400,
+ code: http.StatusBadRequest,
Name: name,
In: in,
Value: value,
diff --git a/api/vendor/github.com/go-openapi/errors/schema.go b/api/vendor/github.com/go-openapi/errors/schema.go
index da5f6c78cb5d..8f3239dfd9bd 100644
--- a/api/vendor/github.com/go-openapi/errors/schema.go
+++ b/api/vendor/github.com/go-openapi/errors/schema.go
@@ -17,6 +17,7 @@ package errors
import (
"encoding/json"
"fmt"
+ "net/http"
"strings"
)
@@ -32,12 +33,12 @@ const (
patternFail = "%s in %s should match '%s'"
enumFail = "%s in %s should be one of %v"
multipleOfFail = "%s in %s should be a multiple of %v"
- maxIncFail = "%s in %s should be less than or equal to %v"
- maxExcFail = "%s in %s should be less than %v"
+ maximumIncFail = "%s in %s should be less than or equal to %v"
+ maximumExcFail = "%s in %s should be less than %v"
minIncFail = "%s in %s should be greater than or equal to %v"
minExcFail = "%s in %s should be greater than %v"
uniqueFail = "%s in %s shouldn't contain duplicates"
- maxItemsFail = "%s in %s should have at most %d items"
+ maximumItemsFail = "%s in %s should have at most %d items"
minItemsFail = "%s in %s should have at least %d items"
typeFailNoIn = "%s must be of type %s"
typeFailWithDataNoIn = "%s must be of type %s: %q"
@@ -49,12 +50,12 @@ const (
patternFailNoIn = "%s should match '%s'"
enumFailNoIn = "%s should be one of %v"
multipleOfFailNoIn = "%s should be a multiple of %v"
- maxIncFailNoIn = "%s should be less than or equal to %v"
- maxExcFailNoIn = "%s should be less than %v"
+ maximumIncFailNoIn = "%s should be less than or equal to %v"
+ maximumExcFailNoIn = "%s should be less than %v"
minIncFailNoIn = "%s should be greater than or equal to %v"
minExcFailNoIn = "%s should be greater than %v"
uniqueFailNoIn = "%s shouldn't contain duplicates"
- maxItemsFailNoIn = "%s should have at most %d items"
+ maximumItemsFailNoIn = "%s should have at most %d items"
minItemsFailNoIn = "%s should have at least %d items"
noAdditionalItems = "%s in %s can't have additional items"
noAdditionalItemsNoIn = "%s can't have additional items"
@@ -69,14 +70,17 @@ const (
multipleOfMustBePositive = "factor MultipleOf declared for %s must be positive: %v"
)
+const maximumValidHTTPCode = 600
+
// All code responses can be used to differentiate errors for different handling
// by the consuming program
const (
// CompositeErrorCode remains 422 for backwards-compatibility
// and to separate it from validation errors with cause
- CompositeErrorCode = 422
+ CompositeErrorCode = http.StatusUnprocessableEntity
+
// InvalidTypeCode is used for any subclass of invalid types
- InvalidTypeCode = 600 + iota
+ InvalidTypeCode = maximumValidHTTPCode + iota
RequiredFailCode
TooLongFailCode
TooShortFailCode
@@ -120,6 +124,10 @@ func (c *CompositeError) Error() string {
return c.message
}
+func (c *CompositeError) Unwrap() []error {
+ return c.Errors
+}
+
// MarshalJSON implements the JSON encoding interface
func (c CompositeError) MarshalJSON() ([]byte, error) {
return json.Marshal(map[string]interface{}{
@@ -133,7 +141,7 @@ func (c CompositeError) MarshalJSON() ([]byte, error) {
func CompositeValidationError(errors ...error) *CompositeError {
return &CompositeError{
code: CompositeErrorCode,
- Errors: append([]error{}, errors...),
+ Errors: append(make([]error, 0, len(errors)), errors...),
message: "validation failure list",
}
}
@@ -294,10 +302,10 @@ func DuplicateItems(name, in string) *Validation {
}
// TooManyItems error for when an array contains too many items
-func TooManyItems(name, in string, max int64, value interface{}) *Validation {
- msg := fmt.Sprintf(maxItemsFail, name, in, max)
+func TooManyItems(name, in string, maximum int64, value interface{}) *Validation {
+ msg := fmt.Sprintf(maximumItemsFail, name, in, maximum)
if in == "" {
- msg = fmt.Sprintf(maxItemsFailNoIn, name, max)
+ msg = fmt.Sprintf(maximumItemsFailNoIn, name, maximum)
}
return &Validation{
@@ -310,10 +318,10 @@ func TooManyItems(name, in string, max int64, value interface{}) *Validation {
}
// TooFewItems error for when an array contains too few items
-func TooFewItems(name, in string, min int64, value interface{}) *Validation {
- msg := fmt.Sprintf(minItemsFail, name, in, min)
+func TooFewItems(name, in string, minimum int64, value interface{}) *Validation {
+ msg := fmt.Sprintf(minItemsFail, name, in, minimum)
if in == "" {
- msg = fmt.Sprintf(minItemsFailNoIn, name, min)
+ msg = fmt.Sprintf(minItemsFailNoIn, name, minimum)
}
return &Validation{
code: MinItemsFailCode,
@@ -324,21 +332,21 @@ func TooFewItems(name, in string, min int64, value interface{}) *Validation {
}
}
-// ExceedsMaximumInt error for when maximum validation fails
-func ExceedsMaximumInt(name, in string, max int64, exclusive bool, value interface{}) *Validation {
+// ExceedsMaximumInt error for when maximumimum validation fails
+func ExceedsMaximumInt(name, in string, maximum int64, exclusive bool, value interface{}) *Validation {
var message string
if in == "" {
- m := maxIncFailNoIn
+ m := maximumIncFailNoIn
if exclusive {
- m = maxExcFailNoIn
+ m = maximumExcFailNoIn
}
- message = fmt.Sprintf(m, name, max)
+ message = fmt.Sprintf(m, name, maximum)
} else {
- m := maxIncFail
+ m := maximumIncFail
if exclusive {
- m = maxExcFail
+ m = maximumExcFail
}
- message = fmt.Sprintf(m, name, in, max)
+ message = fmt.Sprintf(m, name, in, maximum)
}
return &Validation{
code: MaxFailCode,
@@ -349,21 +357,21 @@ func ExceedsMaximumInt(name, in string, max int64, exclusive bool, value interfa
}
}
-// ExceedsMaximumUint error for when maximum validation fails
-func ExceedsMaximumUint(name, in string, max uint64, exclusive bool, value interface{}) *Validation {
+// ExceedsMaximumUint error for when maximumimum validation fails
+func ExceedsMaximumUint(name, in string, maximum uint64, exclusive bool, value interface{}) *Validation {
var message string
if in == "" {
- m := maxIncFailNoIn
+ m := maximumIncFailNoIn
if exclusive {
- m = maxExcFailNoIn
+ m = maximumExcFailNoIn
}
- message = fmt.Sprintf(m, name, max)
+ message = fmt.Sprintf(m, name, maximum)
} else {
- m := maxIncFail
+ m := maximumIncFail
if exclusive {
- m = maxExcFail
+ m = maximumExcFail
}
- message = fmt.Sprintf(m, name, in, max)
+ message = fmt.Sprintf(m, name, in, maximum)
}
return &Validation{
code: MaxFailCode,
@@ -374,21 +382,21 @@ func ExceedsMaximumUint(name, in string, max uint64, exclusive bool, value inter
}
}
-// ExceedsMaximum error for when maximum validation fails
-func ExceedsMaximum(name, in string, max float64, exclusive bool, value interface{}) *Validation {
+// ExceedsMaximum error for when maximumimum validation fails
+func ExceedsMaximum(name, in string, maximum float64, exclusive bool, value interface{}) *Validation {
var message string
if in == "" {
- m := maxIncFailNoIn
+ m := maximumIncFailNoIn
if exclusive {
- m = maxExcFailNoIn
+ m = maximumExcFailNoIn
}
- message = fmt.Sprintf(m, name, max)
+ message = fmt.Sprintf(m, name, maximum)
} else {
- m := maxIncFail
+ m := maximumIncFail
if exclusive {
- m = maxExcFail
+ m = maximumExcFail
}
- message = fmt.Sprintf(m, name, in, max)
+ message = fmt.Sprintf(m, name, in, maximum)
}
return &Validation{
code: MaxFailCode,
@@ -400,20 +408,20 @@ func ExceedsMaximum(name, in string, max float64, exclusive bool, value interfac
}
// ExceedsMinimumInt error for when minimum validation fails
-func ExceedsMinimumInt(name, in string, min int64, exclusive bool, value interface{}) *Validation {
+func ExceedsMinimumInt(name, in string, minimum int64, exclusive bool, value interface{}) *Validation {
var message string
if in == "" {
m := minIncFailNoIn
if exclusive {
m = minExcFailNoIn
}
- message = fmt.Sprintf(m, name, min)
+ message = fmt.Sprintf(m, name, minimum)
} else {
m := minIncFail
if exclusive {
m = minExcFail
}
- message = fmt.Sprintf(m, name, in, min)
+ message = fmt.Sprintf(m, name, in, minimum)
}
return &Validation{
code: MinFailCode,
@@ -425,20 +433,20 @@ func ExceedsMinimumInt(name, in string, min int64, exclusive bool, value interfa
}
// ExceedsMinimumUint error for when minimum validation fails
-func ExceedsMinimumUint(name, in string, min uint64, exclusive bool, value interface{}) *Validation {
+func ExceedsMinimumUint(name, in string, minimum uint64, exclusive bool, value interface{}) *Validation {
var message string
if in == "" {
m := minIncFailNoIn
if exclusive {
m = minExcFailNoIn
}
- message = fmt.Sprintf(m, name, min)
+ message = fmt.Sprintf(m, name, minimum)
} else {
m := minIncFail
if exclusive {
m = minExcFail
}
- message = fmt.Sprintf(m, name, in, min)
+ message = fmt.Sprintf(m, name, in, minimum)
}
return &Validation{
code: MinFailCode,
@@ -450,20 +458,20 @@ func ExceedsMinimumUint(name, in string, min uint64, exclusive bool, value inter
}
// ExceedsMinimum error for when minimum validation fails
-func ExceedsMinimum(name, in string, min float64, exclusive bool, value interface{}) *Validation {
+func ExceedsMinimum(name, in string, minimum float64, exclusive bool, value interface{}) *Validation {
var message string
if in == "" {
m := minIncFailNoIn
if exclusive {
m = minExcFailNoIn
}
- message = fmt.Sprintf(m, name, min)
+ message = fmt.Sprintf(m, name, minimum)
} else {
m := minIncFail
if exclusive {
m = minExcFail
}
- message = fmt.Sprintf(m, name, in, min)
+ message = fmt.Sprintf(m, name, in, minimum)
}
return &Validation{
code: MinFailCode,
@@ -545,12 +553,12 @@ func ReadOnly(name, in string, value interface{}) *Validation {
}
// TooLong error for when a string is too long
-func TooLong(name, in string, max int64, value interface{}) *Validation {
+func TooLong(name, in string, maximum int64, value interface{}) *Validation {
var msg string
if in == "" {
- msg = fmt.Sprintf(tooLongMessageNoIn, name, max)
+ msg = fmt.Sprintf(tooLongMessageNoIn, name, maximum)
} else {
- msg = fmt.Sprintf(tooLongMessage, name, in, max)
+ msg = fmt.Sprintf(tooLongMessage, name, in, maximum)
}
return &Validation{
code: TooLongFailCode,
@@ -562,12 +570,12 @@ func TooLong(name, in string, max int64, value interface{}) *Validation {
}
// TooShort error for when a string is too short
-func TooShort(name, in string, min int64, value interface{}) *Validation {
+func TooShort(name, in string, minimum int64, value interface{}) *Validation {
var msg string
if in == "" {
- msg = fmt.Sprintf(tooShortMessageNoIn, name, min)
+ msg = fmt.Sprintf(tooShortMessageNoIn, name, minimum)
} else {
- msg = fmt.Sprintf(tooShortMessage, name, in, min)
+ msg = fmt.Sprintf(tooShortMessage, name, in, minimum)
}
return &Validation{
diff --git a/api/vendor/github.com/go-openapi/jsonpointer/.golangci.yml b/api/vendor/github.com/go-openapi/jsonpointer/.golangci.yml
index 22f8d21cca19..d2fafb8a2bb0 100644
--- a/api/vendor/github.com/go-openapi/jsonpointer/.golangci.yml
+++ b/api/vendor/github.com/go-openapi/jsonpointer/.golangci.yml
@@ -1,12 +1,6 @@
linters-settings:
- govet:
- check-shadowing: true
- golint:
- min-confidence: 0
gocyclo:
min-complexity: 45
- maligned:
- suggest-new: true
dupl:
threshold: 200
goconst:
@@ -16,7 +10,7 @@ linters-settings:
linters:
enable-all: true
disable:
- - maligned
+ - recvcheck
- unparam
- lll
- gochecknoinits
@@ -29,9 +23,6 @@ linters:
- wrapcheck
- testpackage
- nlreturn
- - gomnd
- - exhaustivestruct
- - goerr113
- errorlint
- nestif
- godot
@@ -39,7 +30,6 @@ linters:
- paralleltest
- tparallel
- thelper
- - ifshort
- exhaustruct
- varnamelen
- gci
@@ -52,10 +42,15 @@ linters:
- forcetypeassert
- cyclop
# deprecated linters
- - deadcode
- - interfacer
- - scopelint
- - varcheck
- - structcheck
- - golint
- - nosnakecase
+ #- deadcode
+ #- interfacer
+ #- scopelint
+ #- varcheck
+ #- structcheck
+ #- golint
+ #- nosnakecase
+ #- maligned
+ #- goerr113
+ #- ifshort
+ #- gomnd
+ #- exhaustivestruct
diff --git a/api/vendor/github.com/go-openapi/jsonpointer/errors.go b/api/vendor/github.com/go-openapi/jsonpointer/errors.go
new file mode 100644
index 000000000000..b84343d9d74e
--- /dev/null
+++ b/api/vendor/github.com/go-openapi/jsonpointer/errors.go
@@ -0,0 +1,18 @@
+package jsonpointer
+
+type pointerError string
+
+func (e pointerError) Error() string {
+ return string(e)
+}
+
+const (
+ // ErrPointer is an error raised by the jsonpointer package
+ ErrPointer pointerError = "JSON pointer error"
+
+ // ErrInvalidStart states that a JSON pointer must start with a separator ("/")
+ ErrInvalidStart pointerError = `JSON pointer must be empty or start with a "` + pointerSeparator
+
+ // ErrUnsupportedValueType indicates that a value of the wrong type is being set
+ ErrUnsupportedValueType pointerError = "only structs, pointers, maps and slices are supported for setting values"
+)
diff --git a/api/vendor/github.com/go-openapi/jsonpointer/pointer.go b/api/vendor/github.com/go-openapi/jsonpointer/pointer.go
index d970c7cf448e..a08cd68ac04e 100644
--- a/api/vendor/github.com/go-openapi/jsonpointer/pointer.go
+++ b/api/vendor/github.com/go-openapi/jsonpointer/pointer.go
@@ -39,9 +39,6 @@ import (
const (
emptyPointer = ``
pointerSeparator = `/`
-
- invalidStart = `JSON pointer must be empty or start with a "` + pointerSeparator
- notFound = `Can't find the pointer in the document`
)
var jsonPointableType = reflect.TypeOf(new(JSONPointable)).Elem()
@@ -80,7 +77,7 @@ func (p *Pointer) parse(jsonPointerString string) error {
if jsonPointerString != emptyPointer {
if !strings.HasPrefix(jsonPointerString, pointerSeparator) {
- err = errors.New(invalidStart)
+ err = errors.Join(ErrInvalidStart, ErrPointer)
} else {
referenceTokens := strings.Split(jsonPointerString, pointerSeparator)
p.referenceTokens = append(p.referenceTokens, referenceTokens[1:]...)
@@ -128,7 +125,7 @@ func getSingleImpl(node any, decodedToken string, nameProvider *swag.NameProvide
rValue := reflect.Indirect(reflect.ValueOf(node))
kind := rValue.Kind()
if isNil(node) {
- return nil, kind, fmt.Errorf("nil value has not field %q", decodedToken)
+ return nil, kind, fmt.Errorf("nil value has no field %q: %w", decodedToken, ErrPointer)
}
switch typed := node.(type) {
@@ -146,7 +143,7 @@ func getSingleImpl(node any, decodedToken string, nameProvider *swag.NameProvide
case reflect.Struct:
nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
if !ok {
- return nil, kind, fmt.Errorf("object has no field %q", decodedToken)
+ return nil, kind, fmt.Errorf("object has no field %q: %w", decodedToken, ErrPointer)
}
fld := rValue.FieldByName(nm)
return fld.Interface(), kind, nil
@@ -158,7 +155,7 @@ func getSingleImpl(node any, decodedToken string, nameProvider *swag.NameProvide
if mv.IsValid() {
return mv.Interface(), kind, nil
}
- return nil, kind, fmt.Errorf("object has no key %q", decodedToken)
+ return nil, kind, fmt.Errorf("object has no key %q: %w", decodedToken, ErrPointer)
case reflect.Slice:
tokenIndex, err := strconv.Atoi(decodedToken)
@@ -167,14 +164,14 @@ func getSingleImpl(node any, decodedToken string, nameProvider *swag.NameProvide
}
sLength := rValue.Len()
if tokenIndex < 0 || tokenIndex >= sLength {
- return nil, kind, fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength-1, tokenIndex)
+ return nil, kind, fmt.Errorf("index out of bounds array[0,%d] index '%d': %w", sLength-1, tokenIndex, ErrPointer)
}
elem := rValue.Index(tokenIndex)
return elem.Interface(), kind, nil
default:
- return nil, kind, fmt.Errorf("invalid token reference %q", decodedToken)
+ return nil, kind, fmt.Errorf("invalid token reference %q: %w", decodedToken, ErrPointer)
}
}
@@ -194,7 +191,7 @@ func setSingleImpl(node, data any, decodedToken string, nameProvider *swag.NameP
case reflect.Struct:
nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
if !ok {
- return fmt.Errorf("object has no field %q", decodedToken)
+ return fmt.Errorf("object has no field %q: %w", decodedToken, ErrPointer)
}
fld := rValue.FieldByName(nm)
if fld.IsValid() {
@@ -214,18 +211,18 @@ func setSingleImpl(node, data any, decodedToken string, nameProvider *swag.NameP
}
sLength := rValue.Len()
if tokenIndex < 0 || tokenIndex >= sLength {
- return fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength, tokenIndex)
+ return fmt.Errorf("index out of bounds array[0,%d] index '%d': %w", sLength, tokenIndex, ErrPointer)
}
elem := rValue.Index(tokenIndex)
if !elem.CanSet() {
- return fmt.Errorf("can't set slice index %s to %v", decodedToken, data)
+ return fmt.Errorf("can't set slice index %s to %v: %w", decodedToken, data, ErrPointer)
}
elem.Set(reflect.ValueOf(data))
return nil
default:
- return fmt.Errorf("invalid token reference %q", decodedToken)
+ return fmt.Errorf("invalid token reference %q: %w", decodedToken, ErrPointer)
}
}
@@ -244,7 +241,6 @@ func (p *Pointer) get(node any, nameProvider *swag.NameProvider) (any, reflect.K
}
for _, token := range p.referenceTokens {
-
decodedToken := Unescape(token)
r, knd, err := getSingleImpl(node, decodedToken, nameProvider)
@@ -264,7 +260,10 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
knd := reflect.ValueOf(node).Kind()
if knd != reflect.Ptr && knd != reflect.Struct && knd != reflect.Map && knd != reflect.Slice && knd != reflect.Array {
- return errors.New("only structs, pointers, maps and slices are supported for setting values")
+ return errors.Join(
+ ErrUnsupportedValueType,
+ ErrPointer,
+ )
}
if nameProvider == nil {
@@ -307,7 +306,7 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
case reflect.Struct:
nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
if !ok {
- return fmt.Errorf("object has no field %q", decodedToken)
+ return fmt.Errorf("object has no field %q: %w", decodedToken, ErrPointer)
}
fld := rValue.FieldByName(nm)
if fld.CanAddr() && fld.Kind() != reflect.Interface && fld.Kind() != reflect.Map && fld.Kind() != reflect.Slice && fld.Kind() != reflect.Ptr {
@@ -321,7 +320,7 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
mv := rValue.MapIndex(kv)
if !mv.IsValid() {
- return fmt.Errorf("object has no key %q", decodedToken)
+ return fmt.Errorf("object has no key %q: %w", decodedToken, ErrPointer)
}
if mv.CanAddr() && mv.Kind() != reflect.Interface && mv.Kind() != reflect.Map && mv.Kind() != reflect.Slice && mv.Kind() != reflect.Ptr {
node = mv.Addr().Interface()
@@ -336,7 +335,7 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
}
sLength := rValue.Len()
if tokenIndex < 0 || tokenIndex >= sLength {
- return fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength, tokenIndex)
+ return fmt.Errorf("index out of bounds array[0,%d] index '%d': %w", sLength, tokenIndex, ErrPointer)
}
elem := rValue.Index(tokenIndex)
@@ -347,7 +346,7 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
node = elem.Interface()
default:
- return fmt.Errorf("invalid token reference %q", decodedToken)
+ return fmt.Errorf("invalid token reference %q: %w", decodedToken, ErrPointer)
}
}
@@ -404,10 +403,10 @@ func (p *Pointer) Offset(document string) (int64, error) {
return 0, err
}
default:
- return 0, fmt.Errorf("invalid token %#v", tk)
+ return 0, fmt.Errorf("invalid token %#v: %w", tk, ErrPointer)
}
default:
- return 0, fmt.Errorf("invalid token %#v", tk)
+ return 0, fmt.Errorf("invalid token %#v: %w", tk, ErrPointer)
}
}
return offset, nil
@@ -437,16 +436,16 @@ func offsetSingleObject(dec *json.Decoder, decodedToken string) (int64, error) {
return offset, nil
}
default:
- return 0, fmt.Errorf("invalid token %#v", tk)
+ return 0, fmt.Errorf("invalid token %#v: %w", tk, ErrPointer)
}
}
- return 0, fmt.Errorf("token reference %q not found", decodedToken)
+ return 0, fmt.Errorf("token reference %q not found: %w", decodedToken, ErrPointer)
}
func offsetSingleArray(dec *json.Decoder, decodedToken string) (int64, error) {
idx, err := strconv.Atoi(decodedToken)
if err != nil {
- return 0, fmt.Errorf("token reference %q is not a number: %v", decodedToken, err)
+ return 0, fmt.Errorf("token reference %q is not a number: %v: %w", decodedToken, err, ErrPointer)
}
var i int
for i = 0; i < idx && dec.More(); i++ {
@@ -470,7 +469,7 @@ func offsetSingleArray(dec *json.Decoder, decodedToken string) (int64, error) {
}
if !dec.More() {
- return 0, fmt.Errorf("token reference %q not found", decodedToken)
+ return 0, fmt.Errorf("token reference %q not found: %w", decodedToken, ErrPointer)
}
return dec.InputOffset(), nil
}
diff --git a/api/vendor/github.com/go-openapi/jsonreference/.golangci.yml b/api/vendor/github.com/go-openapi/jsonreference/.golangci.yml
index 013fc1943a9e..22f8d21cca19 100644
--- a/api/vendor/github.com/go-openapi/jsonreference/.golangci.yml
+++ b/api/vendor/github.com/go-openapi/jsonreference/.golangci.yml
@@ -1,50 +1,61 @@
linters-settings:
govet:
check-shadowing: true
+ golint:
+ min-confidence: 0
gocyclo:
- min-complexity: 30
+ min-complexity: 45
maligned:
suggest-new: true
dupl:
- threshold: 100
+ threshold: 200
goconst:
min-len: 2
- min-occurrences: 4
- paralleltest:
- ignore-missing: true
+ min-occurrences: 3
+
linters:
enable-all: true
disable:
- maligned
+ - unparam
- lll
+ - gochecknoinits
- gochecknoglobals
+ - funlen
- godox
- gocognit
- whitespace
- wsl
- - funlen
- - gochecknoglobals
- - gochecknoinits
- - scopelint
- wrapcheck
- - exhaustivestruct
- - exhaustive
- - nlreturn
- testpackage
- - gci
- - gofumpt
- - goerr113
+ - nlreturn
- gomnd
- - tparallel
+ - exhaustivestruct
+ - goerr113
+ - errorlint
- nestif
- godot
- - errorlint
- - varcheck
- - interfacer
- - deadcode
- - golint
+ - gofumpt
+ - paralleltest
+ - tparallel
+ - thelper
- ifshort
+ - exhaustruct
+ - varnamelen
+ - gci
+ - depguard
+ - errchkjson
+ - inamedparam
+ - nonamedreturns
+ - musttag
+ - ireturn
+ - forcetypeassert
+ - cyclop
+ # deprecated linters
+ - deadcode
+ - interfacer
+ - scopelint
+ - varcheck
- structcheck
+ - golint
- nosnakecase
- - varnamelen
- - exhaustruct
diff --git a/api/vendor/github.com/go-openapi/jsonreference/README.md b/api/vendor/github.com/go-openapi/jsonreference/README.md
index b94753aa527e..c7fc2049c1d8 100644
--- a/api/vendor/github.com/go-openapi/jsonreference/README.md
+++ b/api/vendor/github.com/go-openapi/jsonreference/README.md
@@ -1,15 +1,19 @@
-# gojsonreference [](https://travis-ci.org/go-openapi/jsonreference) [](https://codecov.io/gh/go-openapi/jsonreference) [](https://slackin.goswagger.io)
+# gojsonreference [](https://github.com/go-openapi/jsonreference/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/jsonreference)
+
+[](https://slackin.goswagger.io)
+[](https://raw.githubusercontent.com/go-openapi/jsonreference/master/LICENSE)
+[](https://pkg.go.dev/github.com/go-openapi/jsonreference)
+[](https://goreportcard.com/report/github.com/go-openapi/jsonreference)
-[](https://raw.githubusercontent.com/go-openapi/jsonreference/master/LICENSE) [](http://godoc.org/github.com/go-openapi/jsonreference)
An implementation of JSON Reference - Go language
## Status
Feature complete. Stable API
## Dependencies
-https://github.com/go-openapi/jsonpointer
+* https://github.com/go-openapi/jsonpointer
## References
-http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07
-http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03
+* http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07
+* http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03
diff --git a/api/vendor/github.com/go-openapi/loads/.golangci.yml b/api/vendor/github.com/go-openapi/loads/.golangci.yml
index d48b4a5156e2..22f8d21cca19 100644
--- a/api/vendor/github.com/go-openapi/loads/.golangci.yml
+++ b/api/vendor/github.com/go-openapi/loads/.golangci.yml
@@ -4,41 +4,58 @@ linters-settings:
golint:
min-confidence: 0
gocyclo:
- min-complexity: 30
+ min-complexity: 45
maligned:
suggest-new: true
dupl:
- threshold: 100
+ threshold: 200
goconst:
min-len: 2
- min-occurrences: 4
+ min-occurrences: 3
linters:
enable-all: true
disable:
- maligned
+ - unparam
- lll
- - gochecknoglobals
- gochecknoinits
+ - gochecknoglobals
+ - funlen
- godox
- gocognit
- whitespace
- wsl
- - funlen
- - gochecknoglobals
- - gochecknoinits
- - scopelint
- wrapcheck
- - exhaustivestruct
- - exhaustive
- - nlreturn
- testpackage
- - gci
- - gofumpt
- - goerr113
+ - nlreturn
- gomnd
- - tparallel
+ - exhaustivestruct
+ - goerr113
+ - errorlint
- nestif
- godot
- - errorlint
+ - gofumpt
- paralleltest
+ - tparallel
+ - thelper
+ - ifshort
+ - exhaustruct
+ - varnamelen
+ - gci
+ - depguard
+ - errchkjson
+ - inamedparam
+ - nonamedreturns
+ - musttag
+ - ireturn
+ - forcetypeassert
+ - cyclop
+ # deprecated linters
+ - deadcode
+ - interfacer
+ - scopelint
+ - varcheck
+ - structcheck
+ - golint
+ - nosnakecase
diff --git a/api/vendor/github.com/go-openapi/loads/README.md b/api/vendor/github.com/go-openapi/loads/README.md
index df1f6264623e..f8bd440dfc27 100644
--- a/api/vendor/github.com/go-openapi/loads/README.md
+++ b/api/vendor/github.com/go-openapi/loads/README.md
@@ -1,4 +1,4 @@
-# Loads OAI specs [](https://travis-ci.org/go-openapi/loads) [](https://codecov.io/gh/go-openapi/loads) [](https://slackin.goswagger.io) [](https://github.com/go-openapi/loads/actions?query=workflow%3A"Go+Test")
+# Loads OAI specs [](https://github.com/go-openapi/loads/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/loads)
[](https://raw.githubusercontent.com/go-openapi/loads/master/LICENSE) [](http://godoc.org/github.com/go-openapi/loads)
[](https://goreportcard.com/report/github.com/go-openapi/loads)
diff --git a/api/vendor/github.com/go-openapi/loads/doc.go b/api/vendor/github.com/go-openapi/loads/doc.go
index 3046da4cef39..5bcaef5dbccb 100644
--- a/api/vendor/github.com/go-openapi/loads/doc.go
+++ b/api/vendor/github.com/go-openapi/loads/doc.go
@@ -12,10 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-/*
-Package loads provides document loading methods for swagger (OAI) specifications.
-
-It is used by other go-openapi packages to load and run analysis on local or remote spec documents.
-
-*/
+// Package loads provides document loading methods for swagger (OAI) specifications.
+//
+// It is used by other go-openapi packages to load and run analysis on local or remote spec documents.
package loads
diff --git a/api/vendor/github.com/go-openapi/loads/loaders.go b/api/vendor/github.com/go-openapi/loads/loaders.go
index 44bd32b5b887..b2d1e034c523 100644
--- a/api/vendor/github.com/go-openapi/loads/loaders.go
+++ b/api/vendor/github.com/go-openapi/loads/loaders.go
@@ -21,7 +21,7 @@ var (
func init() {
jsonLoader := &loader{
DocLoaderWithMatch: DocLoaderWithMatch{
- Match: func(pth string) bool {
+ Match: func(_ string) bool {
return true
},
Fn: JSONDoc,
@@ -86,7 +86,7 @@ func (l *loader) Load(path string) (json.RawMessage, error) {
return nil, erp
}
- var lastErr error = errors.New("no loader matched") // default error if no match was found
+ lastErr := errors.New("no loader matched") // default error if no match was found
for ldr := l; ldr != nil; ldr = ldr.Next {
if ldr.Match != nil && !ldr.Match(path) {
continue
@@ -118,9 +118,8 @@ func JSONDoc(path string) (json.RawMessage, error) {
// This sets the configuration at the package level.
//
// NOTE:
-// * this updates the default loader used by github.com/go-openapi/spec
-// * since this sets package level globals, you shouln't call this concurrently
-//
+// - this updates the default loader used by github.com/go-openapi/spec
+// - since this sets package level globals, you shouln't call this concurrently
func AddLoader(predicate DocMatcher, load DocLoader) {
loaders = loaders.WithHead(&loader{
DocLoaderWithMatch: DocLoaderWithMatch{
diff --git a/api/vendor/github.com/go-openapi/loads/spec.go b/api/vendor/github.com/go-openapi/loads/spec.go
index 93c8d4b8955e..c9039cd5d7ed 100644
--- a/api/vendor/github.com/go-openapi/loads/spec.go
+++ b/api/vendor/github.com/go-openapi/loads/spec.go
@@ -38,8 +38,8 @@ type Document struct {
specFilePath string
origSpec *spec.Swagger
schema *spec.Schema
- raw json.RawMessage
pathLoader *loader
+ raw json.RawMessage
}
// JSONSpec loads a spec from a json document
@@ -49,7 +49,14 @@ func JSONSpec(path string, options ...LoaderOption) (*Document, error) {
return nil, err
}
// convert to json
- return Analyzed(data, "", options...)
+ doc, err := Analyzed(data, "", options...)
+ if err != nil {
+ return nil, err
+ }
+
+ doc.specFilePath = path
+
+ return doc, nil
}
// Embedded returns a Document based on embedded specs. No analysis is required
@@ -71,7 +78,6 @@ func Embedded(orig, flat json.RawMessage, options ...LoaderOption) (*Document, e
// Spec loads a new spec document from a local or remote path
func Spec(path string, options ...LoaderOption) (*Document, error) {
-
ldr := loaderFromOptions(options)
b, err := ldr.Load(path)
@@ -84,12 +90,10 @@ func Spec(path string, options ...LoaderOption) (*Document, error) {
return nil, err
}
- if document != nil {
- document.specFilePath = path
- document.pathLoader = ldr
- }
+ document.specFilePath = path
+ document.pathLoader = ldr
- return document, err
+ return document, nil
}
// Analyzed creates a new analyzed spec document for a root json.RawMessage.
@@ -117,7 +121,7 @@ func Analyzed(data json.RawMessage, version string, options ...LoaderOption) (*D
}
d := &Document{
- Analyzer: analysis.New(swspec),
+ Analyzer: analysis.New(swspec), // NOTE: at this moment, analysis does not follow $refs to documents outside the root doc
schema: spec.MustLoadSwagger20Schema(),
spec: swspec,
raw: raw,
@@ -152,9 +156,8 @@ func trimData(in json.RawMessage) (json.RawMessage, error) {
return d, nil
}
-// Expanded expands the ref fields in the spec document and returns a new spec document
+// Expanded expands the $ref fields in the spec document and returns a new spec document
func (d *Document) Expanded(options ...*spec.ExpandOptions) (*Document, error) {
-
swspec := new(spec.Swagger)
if err := json.Unmarshal(d.raw, swspec); err != nil {
return nil, err
@@ -163,6 +166,9 @@ func (d *Document) Expanded(options ...*spec.ExpandOptions) (*Document, error) {
var expandOptions *spec.ExpandOptions
if len(options) > 0 {
expandOptions = options[0]
+ if expandOptions.RelativeBase == "" {
+ expandOptions.RelativeBase = d.specFilePath
+ }
} else {
expandOptions = &spec.ExpandOptions{
RelativeBase: d.specFilePath,
@@ -194,7 +200,7 @@ func (d *Document) Expanded(options ...*spec.ExpandOptions) (*Document, error) {
return dd, nil
}
-// BasePath the base path for this spec
+// BasePath the base path for the API specified by this spec
func (d *Document) BasePath() string {
return d.spec.BasePath
}
@@ -242,8 +248,11 @@ func (d *Document) ResetDefinitions() *Document {
// Pristine creates a new pristine document instance based on the input data
func (d *Document) Pristine() *Document {
- dd, _ := Analyzed(d.Raw(), d.Version())
+ raw, _ := json.Marshal(d.Spec())
+ dd, _ := Analyzed(raw, d.Version())
dd.pathLoader = d.pathLoader
+ dd.specFilePath = d.specFilePath
+
return dd
}
diff --git a/api/vendor/github.com/go-openapi/spec/.gitignore b/api/vendor/github.com/go-openapi/spec/.gitignore
index dd91ed6a04e6..f47cb2045f13 100644
--- a/api/vendor/github.com/go-openapi/spec/.gitignore
+++ b/api/vendor/github.com/go-openapi/spec/.gitignore
@@ -1,2 +1 @@
-secrets.yml
-coverage.out
+*.out
diff --git a/api/vendor/github.com/go-openapi/spec/.golangci.yml b/api/vendor/github.com/go-openapi/spec/.golangci.yml
index 835d55e74250..22f8d21cca19 100644
--- a/api/vendor/github.com/go-openapi/spec/.golangci.yml
+++ b/api/vendor/github.com/go-openapi/spec/.golangci.yml
@@ -11,7 +11,7 @@ linters-settings:
threshold: 200
goconst:
min-len: 2
- min-occurrences: 2
+ min-occurrences: 3
linters:
enable-all: true
@@ -40,3 +40,22 @@ linters:
- tparallel
- thelper
- ifshort
+ - exhaustruct
+ - varnamelen
+ - gci
+ - depguard
+ - errchkjson
+ - inamedparam
+ - nonamedreturns
+ - musttag
+ - ireturn
+ - forcetypeassert
+ - cyclop
+ # deprecated linters
+ - deadcode
+ - interfacer
+ - scopelint
+ - varcheck
+ - structcheck
+ - golint
+ - nosnakecase
diff --git a/api/vendor/github.com/go-openapi/spec/README.md b/api/vendor/github.com/go-openapi/spec/README.md
index 18782c6dafeb..7fd2810c6983 100644
--- a/api/vendor/github.com/go-openapi/spec/README.md
+++ b/api/vendor/github.com/go-openapi/spec/README.md
@@ -1,8 +1,5 @@
-# OAI object model
+# OpenAPI v2 object model [](https://github.com/go-openapi/spec/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/spec)
-[](https://travis-ci.org/go-openapi/spec)
-
-[](https://codecov.io/gh/go-openapi/spec)
[](https://slackin.goswagger.io)
[](https://raw.githubusercontent.com/go-openapi/spec/master/LICENSE)
[](https://pkg.go.dev/github.com/go-openapi/spec)
@@ -32,3 +29,26 @@ The object model for OpenAPI specification documents.
> This [discussion thread](https://github.com/go-openapi/spec/issues/21) relates the full story.
>
> An early attempt to support Swagger 3 may be found at: https://github.com/go-openapi/spec3
+
+* Does the unmarshaling support YAML?
+
+> Not directly. The exposed types know only how to unmarshal from JSON.
+>
+> In order to load a YAML document as a Swagger spec, you need to use the loaders provided by
+> github.com/go-openapi/loads
+>
+> Take a look at the example there: https://pkg.go.dev/github.com/go-openapi/loads#example-Spec
+>
+> See also https://github.com/go-openapi/spec/issues/164
+
+* How can I validate a spec?
+
+> Validation is provided by [the validate package](http://github.com/go-openapi/validate)
+
+* Why do we have an `ID` field for `Schema` which is not part of the swagger spec?
+
+> We found jsonschema compatibility more important: since `id` in jsonschema influences
+> how `$ref` are resolved.
+> This `id` does not conflict with any property named `id`.
+>
+> See also https://github.com/go-openapi/spec/issues/23
diff --git a/api/vendor/github.com/go-openapi/spec/appveyor.yml b/api/vendor/github.com/go-openapi/spec/appveyor.yml
deleted file mode 100644
index 0903593916e2..000000000000
--- a/api/vendor/github.com/go-openapi/spec/appveyor.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-version: "0.1.{build}"
-
-clone_folder: C:\go-openapi\spec
-shallow_clone: true # for startup speed
-pull_requests:
- do_not_increment_build_number: true
-
-#skip_tags: true
-#skip_branch_with_pr: true
-
-# appveyor.yml
-build: off
-
-environment:
- GOPATH: c:\gopath
-
-stack: go 1.15
-
-test_script:
- - go test -v -timeout 20m ./...
-
-deploy: off
-
-notifications:
- - provider: Slack
- incoming_webhook: https://hooks.slack.com/services/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
- auth_token:
- secure: Sf7kZf7ZGbnwWUMpffHwMu5A0cHkLK2MYY32LNTPj4+/3qC3Ghl7+9v4TSLOqOlCwdRNjOGblAq7s+GDJed6/xgRQl1JtCi1klzZNrYX4q01pgTPvvGcwbBkIYgeMaPeIRcK9OZnud7sRXdttozgTOpytps2U6Js32ip7uj5mHSg2ub0FwoSJwlS6dbezZ8+eDhoha0F/guY99BEwx8Bd+zROrT2TFGsSGOFGN6wFc7moCqTHO/YkWib13a2QNXqOxCCVBy/lt76Wp+JkeFppjHlzs/2lP3EAk13RIUAaesdEUHvIHrzCyNJEd3/+KO2DzsWOYfpktd+KBCvgaYOsoo7ubdT3IROeAegZdCgo/6xgCEsmFc9ZcqCfN5yNx2A+BZ2Vwmpws+bQ1E1+B5HDzzaiLcYfG4X2O210QVGVDLWsv1jqD+uPYeHY2WRfh5ZsIUFvaqgUEnwHwrK44/8REAhQavt1QAj5uJpsRd7CkRVPWRNK+yIky+wgbVUFEchRNmS55E7QWf+W4+4QZkQi7vUTMc9nbTUu2Es9NfvfudOpM2wZbn98fjpb/qq/nRv6Bk+ca+7XD5/IgNLMbWp2ouDdzbiHLCOfDUiHiDJhLfFZx9Bwo7ZwfzeOlbrQX66bx7xRKYmOe4DLrXhNcpbsMa8qbfxlZRCmYbubB/Y8h4=
- channel: bots
- on_build_success: false
- on_build_failure: true
- on_build_status_changed: true
diff --git a/api/vendor/github.com/go-openapi/spec/bindata.go b/api/vendor/github.com/go-openapi/spec/bindata.go
deleted file mode 100644
index afc83850c2e8..000000000000
--- a/api/vendor/github.com/go-openapi/spec/bindata.go
+++ /dev/null
@@ -1,297 +0,0 @@
-// Code generated by go-bindata. DO NOT EDIT.
-// sources:
-// schemas/jsonschema-draft-04.json (4.357kB)
-// schemas/v2/schema.json (40.248kB)
-
-package spec
-
-import (
- "bytes"
- "compress/gzip"
- "crypto/sha256"
- "fmt"
- "io"
- "io/ioutil"
- "os"
- "path/filepath"
- "strings"
- "time"
-)
-
-func bindataRead(data []byte, name string) ([]byte, error) {
- gz, err := gzip.NewReader(bytes.NewBuffer(data))
- if err != nil {
- return nil, fmt.Errorf("read %q: %v", name, err)
- }
-
- var buf bytes.Buffer
- _, err = io.Copy(&buf, gz)
- clErr := gz.Close()
-
- if err != nil {
- return nil, fmt.Errorf("read %q: %v", name, err)
- }
- if clErr != nil {
- return nil, err
- }
-
- return buf.Bytes(), nil
-}
-
-type asset struct {
- bytes []byte
- info os.FileInfo
- digest [sha256.Size]byte
-}
-
-type bindataFileInfo struct {
- name string
- size int64
- mode os.FileMode
- modTime time.Time
-}
-
-func (fi bindataFileInfo) Name() string {
- return fi.name
-}
-func (fi bindataFileInfo) Size() int64 {
- return fi.size
-}
-func (fi bindataFileInfo) Mode() os.FileMode {
- return fi.mode
-}
-func (fi bindataFileInfo) ModTime() time.Time {
- return fi.modTime
-}
-func (fi bindataFileInfo) IsDir() bool {
- return false
-}
-func (fi bindataFileInfo) Sys() interface{} {
- return nil
-}
-
-var _jsonschemaDraft04Json = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x57\x3d\x6f\xdb\x3c\x10\xde\xf3\x2b\x08\x26\x63\xf2\x2a\x2f\xd0\xc9\x5b\xd1\x2e\x01\x5a\x34\x43\x37\x23\x03\x6d\x9d\x6c\x06\x14\xa9\x50\x54\x60\xc3\xd0\x7f\x2f\x28\x4a\x14\x29\x91\x92\x2d\xa7\x8d\x97\x28\xbc\xaf\xe7\x8e\xf7\xc5\xd3\x0d\x42\x08\x61\x9a\xe2\x15\xc2\x7b\xa5\x8a\x55\x92\xbc\x96\x82\x3f\x94\xdb\x3d\xe4\xe4\x3f\x21\x77\x49\x2a\x49\xa6\x1e\x1e\xbf\x24\xe6\xec\x16\xdf\x1b\xa1\x3b\xf3\xff\x02\xc9\x14\xca\xad\xa4\x85\xa2\x82\x6b\xe9\x6f\x42\x02\x32\x2c\x28\x07\x45\x5a\x15\x3d\x77\x46\x39\xd5\xcc\x25\x5e\x21\x83\xb8\x21\x18\xb6\xaf\x52\x92\xa3\x47\x68\x88\xea\x58\x80\x56\x4e\x1a\xf2\xbd\x4f\xcc\x29\x7f\x52\x90\x6b\x7d\xff\x0f\x48\xb4\x3d\x3f\x21\x7c\x27\x21\xd3\x2a\x6e\x31\xaa\x2d\x53\xdd\xf3\xe3\x42\x94\x54\xd1\x77\x78\xe2\x0a\x76\x20\xe3\x20\x68\xcb\x30\x86\x41\xf3\x2a\xc7\x2b\xf4\x78\x8e\xfe\xef\x90\x91\x8a\xa9\xc7\xb1\x1d\xc2\xd8\x2f\x0d\x75\xed\xc1\x4e\x9c\xc8\x25\x43\xac\xa8\xbe\xd7\xcc\xa9\xd1\xa9\x21\xa0\x1a\xbd\x04\x61\x94\x34\x2f\x18\xfc\x3e\x16\x50\x8e\x4d\x03\x6f\x1c\x58\xdb\x48\x23\xbc\x11\x82\x01\xe1\xfa\xd3\x3a\x8e\x30\xaf\x18\x33\x7f\xf3\x8d\x39\x11\x9b\x57\xd8\x2a\xfd\x55\x2a\x49\xf9\x0e\xc7\xec\x37\xd4\x25\xf7\xec\x5c\x66\xc7\xd7\x99\xaa\xcf\x4f\x89\x8a\xd3\xb7\x0a\x3a\xaa\x92\x15\xf4\x30\x6f\x1c\xb0\xd6\x46\xe7\x98\x39\x2d\xa4\x28\x40\x2a\x3a\x88\x9e\x29\xba\x88\x37\x2d\xca\x60\x38\xfa\xba\x5b\x20\xac\xa8\x62\xb0\x4c\xd4\xaf\xda\x45\x0a\xba\x5c\x3b\xb9\xc7\x79\xc5\x14\x2d\x18\x34\x19\x1c\x51\xdb\x25\x4d\xb4\x7e\x06\x14\x38\x6c\x59\x55\xd2\x77\xf8\x69\x59\xfc\x7b\x73\xed\x93\x43\xcb\x32\x6d\x3c\x28\xdc\x1b\x9a\xd3\x62\xab\xc2\x27\xf7\x41\xc9\x08\x2b\x23\x08\xad\x13\x57\x21\x9c\xd3\x72\x0d\x42\x72\xf8\x01\x7c\xa7\xf6\x83\xce\x39\xd7\x82\x3c\x1f\x2f\xd6\x60\x1b\xa2\xdf\x35\x89\x52\x20\xe7\x73\x74\xe0\x66\x26\x64\x4e\xb4\x97\x58\xc2\x0e\x0e\xe1\x60\x92\x34\x6d\xa0\x10\xd6\xb5\x83\x61\x27\xe6\x47\xd3\x89\xbd\x63\xfd\x3b\x8d\x03\x3d\x6c\x42\x2d\x5b\x70\xee\xe8\xdf\x4b\xf4\x66\x4e\xe1\x01\x45\x17\x80\x74\xad\x4f\xc3\xf3\xae\xc6\x1d\xc6\xd7\xc2\xce\xc9\xe1\x29\x30\x86\x2f\x4a\xa6\x4b\x15\x84\x73\xc9\x6f\xfd\x7f\xa5\x6e\x9e\xbd\xf1\xb0\xd4\xdd\x45\x5a\xc2\x3e\x4b\x78\xab\xa8\x84\x74\x4a\x91\x3b\x92\x23\x05\xf2\x1c\x1e\x7b\xf3\x09\xf8\xcf\xab\x24\xb6\x60\xa2\xe8\x4c\x9f\x75\x77\xaa\x8c\xe6\x01\x45\x36\x86\xcf\xc3\x63\x3a\xea\xd4\x8d\x7e\x06\xac\x14\x0a\xe0\x29\xf0\xed\x07\x22\x1a\x65\xda\x44\xae\xa2\x73\x1a\xe6\x90\x69\xa2\x8c\x46\xb2\x2f\xde\x49\x38\x08\xed\xfe\xfd\x41\xaf\x9f\xa9\x55\xd7\xdd\x22\x8d\xfa\x45\x63\xc5\x0f\x80\xf3\xb4\x08\xd6\x79\x30\x9e\x93\xee\x59\xa6\xd0\x4b\xee\x22\xe3\x33\xc1\x3a\x27\x68\x36\x78\x7e\x87\x0a\x06\xd5\x2e\x20\xd3\xaf\x15\xfb\xd8\x3b\x73\x14\xbb\x92\xed\x05\x5d\x2e\x29\x38\x2c\x94\xe4\x42\x45\x5e\xd3\xb5\x7d\xdf\x47\xca\x38\xb4\x5c\xaf\xfb\x7d\xdd\x6d\xf4\xa1\x2d\x77\xdd\x2f\xce\x6d\xc4\x7b\x8b\x4e\x67\xa9\x6f\xfe\x04\x00\x00\xff\xff\xb1\xd1\x27\x78\x05\x11\x00\x00")
-
-func jsonschemaDraft04JsonBytes() ([]byte, error) {
- return bindataRead(
- _jsonschemaDraft04Json,
- "jsonschema-draft-04.json",
- )
-}
-
-func jsonschemaDraft04Json() (*asset, error) {
- bytes, err := jsonschemaDraft04JsonBytes()
- if err != nil {
- return nil, err
- }
-
- info := bindataFileInfo{name: "jsonschema-draft-04.json", size: 4357, mode: os.FileMode(0640), modTime: time.Unix(1568963823, 0)}
- a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe1, 0x48, 0x9d, 0xb, 0x47, 0x55, 0xf0, 0x27, 0x93, 0x30, 0x25, 0x91, 0xd3, 0xfc, 0xb8, 0xf0, 0x7b, 0x68, 0x93, 0xa8, 0x2a, 0x94, 0xf2, 0x48, 0x95, 0xf8, 0xe4, 0xed, 0xf1, 0x1b, 0x82, 0xe2}}
- return a, nil
-}
-
-var _v2SchemaJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5d\x4f\x93\xdb\x36\xb2\xbf\xfb\x53\xa0\x14\x57\xd9\xae\xd8\x92\xe3\xf7\x2e\xcf\x97\xd4\xbc\xd8\x49\x66\x37\x5e\x4f\x79\x26\xbb\x87\x78\x5c\x05\x91\x2d\x09\x09\x09\x30\x00\x38\x33\x5a\xef\x7c\xf7\x2d\xf0\x9f\x08\x02\x20\x41\x8a\xd2\xc8\x0e\x0f\xa9\x78\x28\xa0\xd1\xdd\x68\x34\x7e\xdd\xf8\xf7\xf9\x11\x42\x33\x49\x64\x04\xb3\xd7\x68\x76\x86\xfe\x76\xf9\xfe\x1f\xe8\x32\xd8\x40\x8c\xd1\x8a\x71\x74\x79\x8b\xd7\x6b\xe0\xe8\xd5\xfc\x25\x3a\xbb\x38\x9f\xcf\x9e\xab\x0a\x24\x54\xa5\x37\x52\x26\xaf\x17\x0b\x91\x17\x99\x13\xb6\xb8\x79\xb5\x10\x59\xdd\xf9\xef\x82\xd1\x6f\xf2\xc2\x8f\xf3\x4f\xb5\x1a\xea\xc7\x17\x45\x41\xc6\xd7\x8b\x90\xe3\x95\x7c\xf1\xf2\x7f\x8b\xca\x45\x3d\xb9\x4d\x32\xa6\xd8\xf2\x77\x08\x64\xfe\x8d\xc3\x9f\x29\xe1\xa0\x9a\xff\xed\x11\x42\x08\xcd\x8a\xd6\xb3\x9f\x15\x67\x74\xc5\xca\x7f\x27\x58\x6e\xc4\xec\x11\x42\xd7\x59\x5d\x1c\x86\x44\x12\x46\x71\x74\xc1\x59\x02\x5c\x12\x10\xb3\xd7\x68\x85\x23\x01\x59\x81\x04\x4b\x09\x9c\x6a\xbf\x7e\xce\x49\x7d\xba\x7b\x51\xfd\xa1\x44\xe2\xb0\x52\xac\x7d\xb3\x08\x61\x45\x68\x46\x56\x2c\x6e\x80\x86\x8c\xbf\xbd\x93\x40\x05\x61\x74\x96\x95\xbe\x7f\x84\xd0\x7d\x4e\xde\x42\xb7\xe4\xbe\x46\xbb\x14\x5b\x48\x4e\xe8\xba\x90\x05\xa1\x19\xd0\x34\xae\xc4\xce\xbe\xbc\x9a\xbf\x9c\x15\x7f\x5d\x57\xc5\x42\x10\x01\x27\x89\xe2\x48\x51\xb9\xda\x40\xd5\x87\x37\xc0\x15\x5f\x88\xad\x90\xdc\x10\x81\x42\x16\xa4\x31\x50\x39\x2f\x38\xad\xab\xb0\x53\xd8\xac\x94\x56\x6f\xc3\x84\xf4\x11\xa4\x50\xb3\xfa\xe9\xd3\x6f\x9f\x3e\xdf\x2f\xd0\xeb\x8f\x1f\x3f\x7e\xbc\xfe\xf6\xe9\xf7\xaf\x5f\x7f\xfc\x18\x7e\xfb\xec\xfb\xc7\xb3\x36\x79\x54\x43\xe8\x29\xc5\x31\x20\xc6\x11\x49\x9e\xe5\x12\x41\x66\xa0\xe8\xed\x1d\x8e\x93\x08\x5e\xa3\x27\x3b\xc3\x7c\xa2\x73\xba\xc4\x02\x2e\xb0\xdc\xf4\xe5\x76\xd1\xca\x96\xa2\x8a\x94\xcd\x21\xc9\x6c\xec\x2c\x70\x42\x9e\x34\x74\x9d\x19\x7c\xcd\x20\x9c\xea\x2e\x0a\xfe\x42\x84\xd4\x29\x04\x8c\x8a\xb4\x41\xa2\xc1\xdc\x19\x8a\x88\x90\x4a\x49\xef\xce\xdf\xbd\x45\x4a\x52\x81\x70\x10\x40\x22\x21\x44\xcb\x6d\xc5\xec\x4e\x3c\x1c\x45\xef\x57\x9a\xb5\x7d\xae\xfe\xe5\xe4\x31\x86\x90\xe0\xab\x6d\x02\x3b\x2e\xcb\x11\x90\xd9\xa8\xc6\x77\xc2\x59\x98\x06\xfd\xf9\x2e\x78\x45\x01\xa6\xa8\xa0\x71\x5c\xbe\x33\xa7\xd2\xd9\x5f\x95\xef\xd9\xd5\xac\xfd\xdc\x5d\xbf\x5e\xb8\xd1\x3e\xc7\x31\x48\xe0\x5e\x4c\x14\x65\xdf\xb8\xa8\x71\x10\x09\xa3\xc2\xc7\x02\xcb\xa2\x4e\x5a\x02\x82\x94\x13\xb9\xf5\x30\xe6\xb2\xa4\xb5\xfe\x9b\x3e\x7a\xb2\x55\xd2\xa8\x4a\xbc\x16\xb6\x71\x8e\x39\xc7\xdb\x9d\xe1\x10\x09\x71\xbd\x9c\xb3\x41\x89\xd7\xa5\x89\xdc\x57\xb5\x53\x4a\xfe\x4c\xe1\xbc\xa0\x21\x79\x0a\x1a\x0f\x70\xa7\x5c\x08\x8e\xde\xb0\xc0\x43\x24\xad\x74\x63\x0e\xb1\xd9\x90\xe1\xb0\x2d\x13\xa7\x6d\x78\xfd\x04\x14\x38\x8e\x90\xaa\xce\x63\xac\x3e\x23\xbc\x64\xa9\xb4\xf8\x03\x63\xde\xcd\xbe\x16\x13\x4a\x55\xac\x82\x12\xc6\xac\xd4\x35\xf7\x22\xd4\x3a\xff\x22\x73\x0e\x6e\x51\xa0\x75\x1e\xae\x8f\xe8\x5d\xc7\x59\xe6\xe4\x9a\x18\x8d\xd6\x1c\x53\x84\x4d\xb7\x67\x28\x37\x09\x84\x69\x88\x12\x0e\x01\x11\x80\x32\xa2\xf5\xb9\xaa\xc6\xd9\x73\x53\xab\xfb\xb4\x2e\x20\xc6\x54\x92\xa0\x9a\xf3\x69\x1a\x2f\x81\x77\x37\xae\x53\x1a\xce\x40\xc4\xa8\x82\x1c\xb5\xef\xda\x24\x7d\xb9\x61\x69\x14\xa2\x25\xa0\x90\xac\x56\xc0\x81\x4a\xb4\xe2\x2c\xce\x4a\x64\x7a\x9a\x23\xf4\x13\x91\x3f\xa7\x4b\xf4\x63\x84\x6f\x18\x87\x10\xbd\xc3\xfc\x8f\x90\xdd\x52\x44\x04\xc2\x51\xc4\x6e\x21\x74\x48\x21\x81\xc7\xe2\xfd\xea\x12\xf8\x0d\x09\xf6\xe9\x47\x35\xaf\x67\xc4\x14\xf7\x22\x27\x97\xe1\xe2\x76\x2d\x06\x8c\x4a\x1c\x48\x3f\x73\x2d\x0b\x5b\x29\x45\x24\x00\x2a\x0c\x11\xec\x94\xca\xc2\xa6\xc1\x37\x21\x43\x83\x3b\x5f\x97\xf1\x43\x5e\x53\x73\x19\xa5\x36\xd8\x2d\x05\x2e\x34\x0b\xeb\x39\xfc\x1d\x63\x51\x01\xbd\x3d\xbb\x90\x84\x40\x25\x59\x6d\x09\x5d\xa3\x1c\x37\xe6\x5c\x16\x9a\x40\x09\x70\xc1\xe8\x82\xf1\x35\xa6\xe4\xdf\x99\x5c\x8e\x9e\x4d\x79\xb4\x27\x2f\xbf\x7e\xf8\x05\x25\x8c\x50\xa9\x98\x29\x90\x62\x60\xea\x75\xae\x13\xca\xbf\x2b\x1a\x29\x27\x76\xd6\x20\xc6\x64\x5f\xe6\x32\x1a\x08\x87\x21\x07\x21\xbc\xb4\xe4\xe0\x32\x67\xa6\xcd\xf3\x1e\xcd\xd9\x6b\xb6\x6f\x8e\x27\xa7\xed\xdb\xe7\xbc\xcc\x1a\x07\xce\x6f\x87\x33\xf0\xba\x51\x17\x22\x66\x78\x79\x8e\xce\xe5\x13\x81\x80\x06\x2c\xe5\x78\x0d\xa1\xb2\xb8\x54\xa8\x79\x09\xbd\xbf\x3c\x47\x01\x8b\x13\x2c\xc9\x32\xaa\xaa\x1d\xd5\xee\xab\x36\xbd\x6c\xfd\x54\x6c\xc8\x08\x01\x3c\xbd\xe7\x07\x88\xb0\x24\x37\x79\x90\x28\x4a\x1d\x10\x1a\x92\x1b\x12\xa6\x38\x42\x40\xc3\x4c\x43\x62\x8e\xae\x36\xb0\x45\x71\x2a\xa4\x9a\x23\x79\x59\xb1\xa8\xf2\xa4\x0c\x60\x9f\xcc\x8d\x40\xf5\x80\xca\xa8\x99\xc3\xa7\x85\x1f\x31\x25\xa9\x82\xc5\x6d\xbd\xd8\x36\x76\x7c\x02\x28\x97\xf6\x1d\x74\x3b\x11\x7e\x91\xae\x32\xf8\x6c\xf4\xe6\x7b\x9a\xa5\x1f\x62\xc6\x21\xcf\x9a\xe5\xed\x8b\x02\xf3\x2c\x33\x33\xdf\x00\xca\xc9\x09\xb4\x04\xf5\xa5\x08\xd7\xc3\x02\x18\x66\xf1\xab\x1e\x83\x37\x4c\xcd\x12\xc1\x1d\x50\xf6\xaa\xbd\xfe\xe2\x73\x48\x38\x08\xa0\x32\x9b\x18\x44\x86\x0b\x6a\xc1\xaa\x26\x96\x2d\x96\x3c\xa0\x54\x65\x73\xe3\x08\xb5\x8b\x99\xbd\x82\xbc\x9e\xc2\xe8\x53\x46\x83\x3f\x33\x54\x2b\x5b\xad\x92\x79\xd9\x8f\x5d\x93\x98\xf2\xe6\xc6\x1c\xe6\x9a\x9e\xfc\x43\x82\x31\x66\x8e\x53\x77\xfe\x90\xe7\xf3\xf6\xe9\x62\x23\x3f\x10\x93\x18\xae\x72\x1a\x9d\xf9\x48\xcb\xcc\x5a\x65\xc7\x4a\x04\xf0\xf3\xd5\xd5\x05\x8a\x41\x08\xbc\x86\x86\x43\x51\x6c\xe0\x46\x57\xf6\x44\x40\x0d\xfb\xff\xa2\xc3\x7c\x3d\x39\x84\xdc\x09\x22\x64\x4f\x12\xd9\xba\xaa\xf6\xe3\xbd\x56\xdd\x91\x25\x6a\x14\x9c\x89\x34\x8e\x31\xdf\xee\x15\x7e\x2f\x39\x81\x15\x2a\x28\x95\x66\x51\xf5\xfd\x83\xc5\xfe\x15\x07\xcf\xf7\x08\xee\x1d\x8e\xb6\xc5\x52\xcc\x8c\x5a\x93\x66\xc5\xd8\x79\x38\x46\xd6\xa7\x88\x37\xc9\x2e\xe3\xd2\xa5\x7b\x4b\x3a\xdc\xa1\xdc\x9e\x29\xf1\x8c\x8a\x99\x16\x47\x8d\xd4\x78\x8b\xf6\x1c\xe9\x71\x54\x1b\x69\xa8\x4a\x93\x37\xe5\xb2\x2c\x4f\x0c\x92\xab\xa0\x73\x32\x72\x59\xd3\xf0\x2d\x8d\xed\xca\x37\x16\x19\x9e\xdb\x1c\xab\x17\x49\xc3\x0f\x37\xdc\x88\xb1\xb4\xd4\x42\xcb\x58\x5e\x6a\x52\x0b\x15\x10\x0a\xb0\x04\xe7\xf8\x58\x32\x16\x01\xa6\xcd\x01\xb2\xc2\x69\x24\x35\x38\x6f\x30\x6a\xae\x1b\xb4\x71\xaa\xad\x1d\xa0\xd6\x20\x2d\x8b\x3c\xc6\x82\x62\x27\x34\x6d\x15\x84\x7b\x43\xb1\x35\x78\xa6\x24\x77\x28\xc1\x6e\xfc\xe9\x48\x74\xf4\x15\xe3\xe1\x84\x42\x88\x40\x7a\x26\x49\x3b\x48\xb1\xa4\x19\x8e\x0c\xa7\xb5\x01\x6c\x0c\x97\x61\x8a\xc2\x32\xd8\x8c\x44\x69\x24\xbf\x65\x1d\x74\xd6\xe5\x44\xef\xec\x48\x5e\xb7\x8a\xa3\x29\x8e\x41\x64\xce\x1f\x88\xdc\x00\x47\x4b\x40\x98\x6e\xd1\x0d\x8e\x48\x98\x63\x5c\x21\xb1\x4c\x05\x0a\x58\x98\xc5\x6d\x4f\x0a\x77\x53\x4f\x8b\xc4\x44\x1f\xb2\xdf\x8d\x3b\xea\x9f\xfe\xf6\xf2\xc5\xff\x5d\x7f\xfe\x9f\xfb\x67\x8f\xff\xf3\xe9\x69\xd1\xfe\xb3\xc7\xfd\x3c\xf8\x3f\x71\x94\x82\x23\xd1\x72\x00\xb7\x42\x99\x6c\xc0\x60\x7b\x0f\x79\xea\xa8\x53\x4b\x56\x31\xfa\x0b\x52\x9f\x96\xdb\xcd\x2f\xd7\x67\xcd\x04\x19\x85\xfe\xdb\x02\x9a\x59\x03\xad\x63\x3c\xea\xff\x2e\x18\xfd\x00\xd9\xe2\x56\x60\x59\x93\xb9\xb6\xb2\x3e\x3c\x2c\xab\x0f\xa7\xb2\x89\x43\xc7\xf6\xd5\xce\x2e\xad\xa6\xa9\xed\xa6\xc6\x5a\xb4\xa6\x67\xdf\x8c\x26\x7b\x50\x5a\x91\x08\x2e\x6d\xd4\x3a\xc1\x9d\xf2\xdb\xde\x1e\xb2\x2c\x6c\xa5\x64\xc9\x16\xb4\x90\xaa\x4a\xb7\x0c\xde\x13\xc3\x2a\x9a\x11\x9b\x7a\x1b\x3d\x95\x97\x37\x31\x6b\x69\x7e\x34\xc0\x67\x1f\x66\x19\x49\xef\xf1\x25\xf5\xac\x0e\xea\x0a\x28\x8d\x4d\x7e\xd9\x57\x4b\x49\xe5\xc6\xb3\x25\xfd\xe6\x57\x42\x25\xac\xcd\xcf\x36\x74\x8e\xca\x24\x47\xe7\x80\xa8\x92\x72\xbd\x3d\x84\x2d\x65\xe2\x82\x1a\x9c\xc4\x44\x92\x1b\x10\x79\x8a\xc4\x4a\x2f\x60\x51\x04\x81\xaa\xf0\xa3\x95\x27\xd7\x12\x7b\xa3\x96\x03\x45\x96\xc1\x8a\x07\xc9\xb2\xb0\x95\x52\x8c\xef\x48\x9c\xc6\x7e\x94\xca\xc2\x0e\x07\x12\x44\xa9\x20\x37\xf0\xae\x0f\x49\xa3\x96\x9d\x4b\x42\x7b\x70\x59\x14\xee\xe0\xb2\x0f\x49\xa3\x96\x4b\x97\xbf\x00\x5d\x4b\x4f\xfc\xbb\x2b\xee\x92\xb9\x17\xb5\xaa\xb8\x0b\x97\x17\x9b\x43\xfd\xd6\xc2\xb2\xc2\x2e\x29\xcf\xfd\x87\x4a\x55\xda\x25\x63\x1f\x5a\x65\x69\x2b\x2d\x3d\x67\xe9\x41\xae\x5e\xc1\x6e\x2b\xd4\xdb\x3e\xa8\xd3\x26\xd2\x48\x92\x24\xca\x61\x86\x8f\x8c\xbb\xf2\x8e\x91\xdf\x1f\x06\x19\x33\xf3\x03\x4d\xba\xcd\xe2\x2d\xfb\x69\xe9\x16\x15\x13\xd5\x56\x85\x4e\x3c\x5b\x8a\xbf\x25\x72\x83\xee\x5e\x20\x22\xf2\xc8\xaa\x7b\xdb\x8e\xe4\x29\x58\xca\x38\xb7\x3f\x2e\x59\xb8\xbd\xa8\x16\x16\xf7\xdb\x79\x51\x9f\x5a\xb4\x8d\x87\x3a\x6e\xbc\x3e\xc5\xb4\xcd\x58\xf9\xf5\x3c\xb9\x6f\x49\xaf\x57\xc1\xfa\x1c\x5d\x6d\x88\x8a\x8b\xd3\x28\xcc\xb7\xef\x10\x8a\x4a\x74\xa9\x4a\xa7\x62\xbf\x0d\x76\x23\x6f\x59\xd9\x31\xee\x40\x11\xfb\x28\xec\x8d\x22\x1c\x13\x5a\x64\x94\x23\x16\x60\xbb\xd2\x7c\xa0\x98\xb2\xe5\x6e\xbc\x54\x33\xe0\x3e\xb9\x52\x17\xdb\xb7\x1b\xc8\x12\x20\x8c\x23\xca\x64\x7e\x78\xa3\x62\x5b\x75\x56\xd9\x9e\x2a\x91\x27\xb0\x70\x34\x1f\x90\x89\xb5\x86\x73\x7e\x71\xda\x1e\xfb\x3a\x72\xdc\x5e\x79\x88\xcb\x74\x79\xd9\x64\xe4\xd4\xc2\x9e\xce\xb1\xfe\x85\x5a\xc0\xe9\x0c\x34\x3d\xd0\x43\xce\xa1\x36\x39\xd5\xa1\x4e\xf5\xf8\xb1\xa9\x23\x08\x75\x84\xac\x53\x6c\x3a\xc5\xa6\x53\x6c\x3a\xc5\xa6\x7f\xc5\xd8\xf4\x51\xfd\xff\x25\x4e\xfa\x33\x05\xbe\x9d\x60\xd2\x04\x93\x6a\x5f\x33\x9b\x98\x50\xd2\xe1\x50\x52\xc6\xcc\xdb\x38\x91\xdb\xe6\xaa\xa2\x8f\xa1\x6a\xa6\xd4\xc6\x56\xd6\x8c\x40\x02\x68\x48\xe8\x1a\xe1\x9a\xd9\x2e\xb7\x05\xc3\x34\xda\x2a\xbb\xcd\x12\x36\x98\x22\x50\x4c\xa1\x1b\xc5\xd5\x84\xf0\xbe\x24\x84\xf7\x2f\x22\x37\xef\x94\xd7\x9f\xa0\xde\x04\xf5\x26\xa8\x37\x41\x3d\x64\x40\x3d\xe5\xf2\xde\x60\x89\x27\xb4\x37\xa1\xbd\xda\xd7\xd2\x2c\x26\xc0\x37\x01\x3e\x1b\xef\x5f\x06\xe0\x6b\x7c\x5c\x91\x08\x26\x10\x38\x81\xc0\x09\x04\x76\x4a\x3d\x81\xc0\xbf\x12\x08\x4c\xb0\xdc\x7c\x99\x00\xd0\x75\x70\xb4\xf8\x5a\x7c\xea\xde\x3e\x39\x08\x30\x5a\x27\x35\xed\xb4\x65\xad\x69\x74\x10\x88\x79\xe2\x30\x52\x19\xd6\x04\x21\xa7\x95\xd5\x0e\x03\xf8\xda\x20\xd7\x84\xb4\x26\xa4\x35\x21\xad\x09\x69\x21\x03\x69\x51\x46\xff\xff\x18\x9b\x54\xed\x87\x47\x06\x9d\x4e\x73\x6e\x9a\xb3\xa9\xce\x83\x5e\x4b\xc6\x71\x20\x45\xd7\x72\xf5\x40\x72\x0e\x34\x6c\xf4\x6c\xf3\xba\x5e\x4b\x97\x0e\x52\xb8\xbe\x8b\x79\xa0\x10\x86\xa1\x75\xb0\x6f\xec\xc8\xf4\x3d\x4d\x7b\x86\xc2\x02\x31\x12\x51\xbf\x07\x94\xad\x10\xd6\x2e\x79\xcf\xe9\x1c\xf5\x1e\x31\x23\x5c\x18\xfb\x9c\xfb\x70\xe0\x62\xbd\xf7\xb5\x94\xcf\xf3\xf6\xfa\xc5\x4e\x9c\x85\x76\x1d\xae\x37\xbc\xde\xa3\x41\xcb\x29\xd0\x5e\x70\x67\x50\x93\x6d\x98\xa8\xd3\x67\x0f\x68\xb1\xeb\x38\x47\x07\x10\x1b\xd2\xe2\x18\x68\x6d\x40\xbb\xa3\x40\xba\x21\xf2\x8e\x81\xfb\xf6\x92\x77\x2f\x70\xe8\xdb\xb2\x36\xbf\x30\x91\xc5\x21\xe7\x45\xcc\x34\x0c\x48\x8e\xd0\xf2\x9b\x7c\x3c\xbd\x1c\x04\x3e\x07\xe8\x7c\x2f\x84\x7a\x48\x4d\x1f\xba\xe1\x76\x45\x7b\x60\xe0\x01\xca\xee\x04\xca\x31\xbe\x73\x5f\xa3\x70\x0c\xad\x1f\xa5\xf5\x76\xd5\xbb\xd2\x7e\xfb\x30\x90\xcf\xfa\x67\x7a\xe6\xc3\x37\x42\x19\xe2\xc9\x9c\x61\x4c\xe7\xd1\x77\x55\x86\x6e\x8f\x7b\x85\x42\x33\xa3\xaa\x57\xae\xfd\xd5\xcc\x9c\x56\x68\xe2\xde\x0e\xa8\x2c\xa9\xb0\x7d\xf0\x54\x2d\x80\xf2\x48\x39\x3d\x98\x1a\x6d\x0b\x9d\xba\x53\xfb\xce\xf8\xd1\x7e\xbb\x60\x4f\x06\xf5\xce\xda\xab\xeb\xca\xcb\xd5\xac\x20\xda\x72\x3b\xa2\x4b\x38\xd7\xb5\x89\xbe\x42\xd9\xb9\x73\xc4\x0c\x6d\xb7\xd9\xf8\x8d\xbd\x3e\x9c\xf5\x53\x68\x48\x14\x36\x8f\x09\xc5\x92\xf1\x21\xd1\x09\x07\x1c\xbe\xa7\x91\xf3\x6a\xc8\xc1\x57\xb0\xdd\xc5\xc6\x1d\xad\x76\x1d\xa8\x82\x0e\x4c\x38\xfe\xa5\x8c\xc5\x0a\x40\x5d\xa1\xbb\x98\xd1\xfb\x74\x61\xed\x1a\x98\xaf\x3c\x8c\x1e\xe3\xc2\x92\x29\x74\x3e\x99\xd0\xf9\x41\x50\xd0\x38\x4b\x57\x7e\x5b\x7a\x0e\xe6\xce\x4e\xd7\x19\x35\x57\xbb\x3c\x3c\xd2\x5e\x4f\x4b\x4c\xf7\x0f\x4d\x2b\x91\x5d\x94\xa6\x95\xc8\x69\x25\x72\x5a\x89\x7c\xb8\x95\xc8\x07\x80\x8c\xda\x9c\x64\x7b\xb7\x71\xdf\x57\x12\x4b\x9a\x1f\x72\x0c\x13\x03\xad\x3c\xd5\x4e\xde\x8e\x57\x13\x6d\x34\x86\xcf\x97\xe6\xa4\x68\xc4\xb0\xf6\xc9\xc2\xeb\x8d\x0b\xd7\xcd\xfe\xba\xa6\xf5\x30\xeb\x30\x33\xbe\xc7\x56\x27\xab\x08\xd9\x6d\xbb\x09\xee\x7c\x2d\xcf\xee\x87\x38\xac\xc8\xdd\x90\x9a\x58\x4a\x4e\x96\xa9\x79\x79\xf3\xde\x20\xf0\x96\xe3\x24\x19\xeb\xba\xf2\x53\x19\xab\x12\xaf\x47\xb3\xa0\x3e\xef\x9b\x8d\x6d\x6d\x7b\xde\x3b\x3b\x1a\xc0\x3f\x95\x7e\xed\x78\xfb\x76\xb8\xaf\xb3\xdd\xc5\xeb\x95\xed\x5a\x62\x41\x82\xb3\x54\x6e\x80\x4a\x92\x6f\x36\xbd\x34\xae\xde\x6f\xa4\xc0\xbc\x08\xe3\x84\xfc\x1d\xb6\xe3\xd0\x62\x38\x95\x9b\x57\xe7\x71\x12\x91\x80\xc8\x31\x69\x5e\x60\x21\x6e\x19\x0f\xc7\xa4\x79\x96\x28\x3e\x47\x54\x65\x41\x36\x08\x40\x88\x1f\x58\x08\x56\xaa\xd5\xbf\xaf\xad\x96\xd7\xd6\xcf\x87\xf5\x34\x0f\x71\x93\x6e\x26\xed\x98\x5b\x9f\x4f\xcf\x95\x34\xc6\xd7\x11\xfa\xb0\x81\x22\x1a\xdb\xdf\x8e\xdc\xc3\xb9\xf8\xdd\x5d\x3c\x74\xe6\xea\xb7\x8b\xbf\xf5\x6e\xb3\x46\x2e\x64\xf4\xab\x3c\x4e\xcf\x36\x1d\xfe\xfa\xb8\x36\xba\x8a\xd8\xad\xf6\xc6\x41\x2a\x37\x8c\x17\x0f\xda\xfe\xda\xe7\x65\xbc\x71\x2c\x36\x57\x8a\x47\x12\x4c\xf1\xbd\x77\x6b\xa4\x50\x7e\x77\x7b\x22\x60\x89\xef\xcd\xf5\xb9\x0c\x97\x79\x0d\x2b\x35\x43\xcb\x3d\x24\xf1\x78\xfc\xf8\xcb\x1f\x15\x06\xe2\x78\xd8\x51\x21\xd9\x1f\xf0\xf5\x8f\x86\xa4\x50\xfa\xb1\x47\x43\xa5\xdd\x69\x14\xe8\xa3\xc0\x86\x91\xa7\x81\x50\xb4\x7c\xc0\x81\x80\x77\x7a\x9f\xc6\xc2\xa9\x8c\x05\x33\xb0\x3b\x31\xa4\xf4\xd7\x1b\x26\x55\x97\x7c\x65\xf8\x69\x1a\x84\x8e\x41\x78\xd9\xec\xc5\x11\x16\x1e\x74\x91\xf5\x56\xf5\x57\x49\x47\x5c\x92\xa9\x1e\x99\x36\xf4\xdb\xb1\x0e\xd3\x78\x02\xb0\x9b\x25\xcb\xe9\xe9\x1d\x0d\x44\x01\x42\x08\x91\x64\xd9\xdd\x37\x08\x17\xef\xf9\xe5\x0f\xbd\x46\x91\xf5\xf9\x89\x92\x37\xdd\x89\x59\x44\x1f\x9c\xee\x34\x1e\xbe\x47\x83\x32\x72\x8e\x37\xdf\xac\x69\x38\xef\x75\xb0\xda\xdb\xac\x83\x94\x2f\x39\xa6\x62\x05\x1c\x25\x9c\x49\x16\xb0\xa8\x3c\xc7\x7e\x76\x71\x3e\x6f\xb5\x24\xe7\xe8\xb7\xb9\xc7\x6c\x43\x92\xee\x21\xd4\x17\xa1\x7f\xba\x35\xfe\xae\x39\xbc\xde\xba\x69\xd9\x8e\xe1\x62\xde\x64\x7d\x16\x88\x1b\xed\x29\x11\xfd\x4f\xa9\xff\x99\x90\xc4\xf6\xf4\xf9\x6e\xe9\x28\x23\xd7\xca\xe5\xee\xee\x9f\x63\xb1\x5b\xfb\x10\xd7\x2f\x1d\xf2\xe3\xbf\xb9\xb5\x6f\xa4\x6d\x7d\x25\x79\xfb\x24\x31\xea\x56\xbe\x5d\x53\xcd\x2d\x36\xa3\x6d\xdf\xab\x1c\xb8\x6d\x6f\xc0\x98\xa7\xdd\xaa\x86\x8c\x1d\x39\xa3\x9d\x70\x2b\x9b\x68\xd9\xfd\x33\xfe\xa9\xb6\x4a\x2e\x63\x0f\xcf\x68\x27\xd9\x4c\xb9\x46\x6d\xcb\xbe\xa1\xa8\xd6\x5f\xc6\xd6\x9f\xf1\x4f\xf4\xd4\xb4\x78\xd0\xd6\xf4\x13\x3c\x3b\xac\xd0\xdc\x90\x34\xda\xc9\xb4\x9a\x1a\x8d\xbd\x93\x87\xd4\xe2\x21\x1b\xb3\x2b\xd1\xbe\xe7\x69\xd4\x53\x67\xd5\x40\xa0\xe3\x19\x3f\x6d\x1a\xbc\x0e\x86\x3c\x10\xb4\x3d\x2a\xcd\x78\x32\xe6\xab\xbd\x36\xc9\xf4\x3a\x58\xae\xc3\xf4\x47\xea\xbf\xfb\x47\xff\x0d\x00\x00\xff\xff\xd2\x32\x5a\x28\x38\x9d\x00\x00")
-
-func v2SchemaJsonBytes() ([]byte, error) {
- return bindataRead(
- _v2SchemaJson,
- "v2/schema.json",
- )
-}
-
-func v2SchemaJson() (*asset, error) {
- bytes, err := v2SchemaJsonBytes()
- if err != nil {
- return nil, err
- }
-
- info := bindataFileInfo{name: "v2/schema.json", size: 40248, mode: os.FileMode(0640), modTime: time.Unix(1568964748, 0)}
- a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xab, 0x88, 0x5e, 0xf, 0xbf, 0x17, 0x74, 0x0, 0xb2, 0x5a, 0x7f, 0xbc, 0x58, 0xcd, 0xc, 0x25, 0x73, 0xd5, 0x29, 0x1c, 0x7a, 0xd0, 0xce, 0x79, 0xd4, 0x89, 0x31, 0x27, 0x90, 0xf2, 0xff, 0xe6}}
- return a, nil
-}
-
-// Asset loads and returns the asset for the given name.
-// It returns an error if the asset could not be found or
-// could not be loaded.
-func Asset(name string) ([]byte, error) {
- canonicalName := strings.Replace(name, "\\", "/", -1)
- if f, ok := _bindata[canonicalName]; ok {
- a, err := f()
- if err != nil {
- return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
- }
- return a.bytes, nil
- }
- return nil, fmt.Errorf("Asset %s not found", name)
-}
-
-// AssetString returns the asset contents as a string (instead of a []byte).
-func AssetString(name string) (string, error) {
- data, err := Asset(name)
- return string(data), err
-}
-
-// MustAsset is like Asset but panics when Asset would return an error.
-// It simplifies safe initialization of global variables.
-func MustAsset(name string) []byte {
- a, err := Asset(name)
- if err != nil {
- panic("asset: Asset(" + name + "): " + err.Error())
- }
-
- return a
-}
-
-// MustAssetString is like AssetString but panics when Asset would return an
-// error. It simplifies safe initialization of global variables.
-func MustAssetString(name string) string {
- return string(MustAsset(name))
-}
-
-// AssetInfo loads and returns the asset info for the given name.
-// It returns an error if the asset could not be found or
-// could not be loaded.
-func AssetInfo(name string) (os.FileInfo, error) {
- canonicalName := strings.Replace(name, "\\", "/", -1)
- if f, ok := _bindata[canonicalName]; ok {
- a, err := f()
- if err != nil {
- return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
- }
- return a.info, nil
- }
- return nil, fmt.Errorf("AssetInfo %s not found", name)
-}
-
-// AssetDigest returns the digest of the file with the given name. It returns an
-// error if the asset could not be found or the digest could not be loaded.
-func AssetDigest(name string) ([sha256.Size]byte, error) {
- canonicalName := strings.Replace(name, "\\", "/", -1)
- if f, ok := _bindata[canonicalName]; ok {
- a, err := f()
- if err != nil {
- return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err)
- }
- return a.digest, nil
- }
- return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name)
-}
-
-// Digests returns a map of all known files and their checksums.
-func Digests() (map[string][sha256.Size]byte, error) {
- mp := make(map[string][sha256.Size]byte, len(_bindata))
- for name := range _bindata {
- a, err := _bindata[name]()
- if err != nil {
- return nil, err
- }
- mp[name] = a.digest
- }
- return mp, nil
-}
-
-// AssetNames returns the names of the assets.
-func AssetNames() []string {
- names := make([]string, 0, len(_bindata))
- for name := range _bindata {
- names = append(names, name)
- }
- return names
-}
-
-// _bindata is a table, holding each asset generator, mapped to its name.
-var _bindata = map[string]func() (*asset, error){
- "jsonschema-draft-04.json": jsonschemaDraft04Json,
-
- "v2/schema.json": v2SchemaJson,
-}
-
-// AssetDir returns the file names below a certain
-// directory embedded in the file by go-bindata.
-// For example if you run go-bindata on data/... and data contains the
-// following hierarchy:
-// data/
-// foo.txt
-// img/
-// a.png
-// b.png
-// then AssetDir("data") would return []string{"foo.txt", "img"},
-// AssetDir("data/img") would return []string{"a.png", "b.png"},
-// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and
-// AssetDir("") will return []string{"data"}.
-func AssetDir(name string) ([]string, error) {
- node := _bintree
- if len(name) != 0 {
- canonicalName := strings.Replace(name, "\\", "/", -1)
- pathList := strings.Split(canonicalName, "/")
- for _, p := range pathList {
- node = node.Children[p]
- if node == nil {
- return nil, fmt.Errorf("Asset %s not found", name)
- }
- }
- }
- if node.Func != nil {
- return nil, fmt.Errorf("Asset %s not found", name)
- }
- rv := make([]string, 0, len(node.Children))
- for childName := range node.Children {
- rv = append(rv, childName)
- }
- return rv, nil
-}
-
-type bintree struct {
- Func func() (*asset, error)
- Children map[string]*bintree
-}
-
-var _bintree = &bintree{nil, map[string]*bintree{
- "jsonschema-draft-04.json": {jsonschemaDraft04Json, map[string]*bintree{}},
- "v2": {nil, map[string]*bintree{
- "schema.json": {v2SchemaJson, map[string]*bintree{}},
- }},
-}}
-
-// RestoreAsset restores an asset under the given directory.
-func RestoreAsset(dir, name string) error {
- data, err := Asset(name)
- if err != nil {
- return err
- }
- info, err := AssetInfo(name)
- if err != nil {
- return err
- }
- err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
- if err != nil {
- return err
- }
- err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
- if err != nil {
- return err
- }
- return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
-}
-
-// RestoreAssets restores an asset under the given directory recursively.
-func RestoreAssets(dir, name string) error {
- children, err := AssetDir(name)
- // File
- if err != nil {
- return RestoreAsset(dir, name)
- }
- // Dir
- for _, child := range children {
- err = RestoreAssets(dir, filepath.Join(name, child))
- if err != nil {
- return err
- }
- }
- return nil
-}
-
-func _filePath(dir, name string) string {
- canonicalName := strings.Replace(name, "\\", "/", -1)
- return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...)
-}
diff --git a/api/vendor/github.com/go-openapi/spec/embed.go b/api/vendor/github.com/go-openapi/spec/embed.go
new file mode 100644
index 000000000000..1f4284750ab5
--- /dev/null
+++ b/api/vendor/github.com/go-openapi/spec/embed.go
@@ -0,0 +1,17 @@
+package spec
+
+import (
+ "embed"
+ "path"
+)
+
+//go:embed schemas/*.json schemas/*/*.json
+var assets embed.FS
+
+func jsonschemaDraft04JSONBytes() ([]byte, error) {
+ return assets.ReadFile(path.Join("schemas", "jsonschema-draft-04.json"))
+}
+
+func v2SchemaJSONBytes() ([]byte, error) {
+ return assets.ReadFile(path.Join("schemas", "v2", "schema.json"))
+}
diff --git a/api/vendor/github.com/go-openapi/spec/expander.go b/api/vendor/github.com/go-openapi/spec/expander.go
index d4ea889d44d5..b81a5699a03e 100644
--- a/api/vendor/github.com/go-openapi/spec/expander.go
+++ b/api/vendor/github.com/go-openapi/spec/expander.go
@@ -27,7 +27,6 @@ import (
// all relative $ref's will be resolved from there.
//
// PathLoader injects a document loading method. By default, this resolves to the function provided by the SpecLoader package variable.
-//
type ExpandOptions struct {
RelativeBase string // the path to the root document to expand. This is a file, not a directory
SkipSchemas bool // do not expand schemas, just paths, parameters and responses
@@ -58,7 +57,7 @@ func ExpandSpec(spec *Swagger, options *ExpandOptions) error {
if !options.SkipSchemas {
for key, definition := range spec.Definitions {
parentRefs := make([]string, 0, 10)
- parentRefs = append(parentRefs, fmt.Sprintf("#/definitions/%s", key))
+ parentRefs = append(parentRefs, "#/definitions/"+key)
def, err := expandSchema(definition, parentRefs, resolver, specBasePath)
if resolver.shouldStopOnError(err) {
@@ -103,15 +102,21 @@ const rootBase = ".root"
// baseForRoot loads in the cache the root document and produces a fake ".root" base path entry
// for further $ref resolution
-//
-// Setting the cache is optional and this parameter may safely be left to nil.
func baseForRoot(root interface{}, cache ResolutionCache) string {
+ // cache the root document to resolve $ref's
+ normalizedBase := normalizeBase(rootBase)
+
if root == nil {
- return ""
+ // ensure that we never leave a nil root: always cache the root base pseudo-document
+ cachedRoot, found := cache.Get(normalizedBase)
+ if found && cachedRoot != nil {
+ // the cache is already preloaded with a root
+ return normalizedBase
+ }
+
+ root = map[string]interface{}{}
}
- // cache the root document to resolve $ref's
- normalizedBase := normalizeBase(rootBase)
cache.Set(normalizedBase, root)
return normalizedBase
@@ -208,7 +213,19 @@ func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, ba
}
if target.Ref.String() != "" {
- return expandSchemaRef(target, parentRefs, resolver, basePath)
+ if !resolver.options.SkipSchemas {
+ return expandSchemaRef(target, parentRefs, resolver, basePath)
+ }
+
+ // when "expand" with SkipSchema, we just rebase the existing $ref without replacing
+ // the full schema.
+ rebasedRef, err := NewRef(normalizeURI(target.Ref.String(), basePath))
+ if err != nil {
+ return nil, err
+ }
+ target.Ref = denormalizeRef(&rebasedRef, resolver.context.basePath, resolver.context.rootID)
+
+ return &target, nil
}
for k := range target.Definitions {
@@ -520,21 +537,25 @@ func getRefAndSchema(input interface{}) (*Ref, *Schema, error) {
}
func expandParameterOrResponse(input interface{}, resolver *schemaLoader, basePath string) error {
- ref, _, err := getRefAndSchema(input)
+ ref, sch, err := getRefAndSchema(input)
if err != nil {
return err
}
- if ref == nil {
+ if ref == nil && sch == nil { // nothing to do
return nil
}
parentRefs := make([]string, 0, 10)
- if err = resolver.deref(input, parentRefs, basePath); resolver.shouldStopOnError(err) {
- return err
+ if ref != nil {
+ // dereference this $ref
+ if err = resolver.deref(input, parentRefs, basePath); resolver.shouldStopOnError(err) {
+ return err
+ }
+
+ ref, sch, _ = getRefAndSchema(input)
}
- ref, sch, _ := getRefAndSchema(input)
if ref.String() != "" {
transitiveResolver := resolver.transitiveResolver(basePath, *ref)
basePath = resolver.updateBasePath(transitiveResolver, basePath)
@@ -546,6 +567,7 @@ func expandParameterOrResponse(input interface{}, resolver *schemaLoader, basePa
if ref != nil {
*ref = Ref{}
}
+
return nil
}
@@ -555,38 +577,29 @@ func expandParameterOrResponse(input interface{}, resolver *schemaLoader, basePa
return ern
}
- switch {
- case resolver.isCircular(&rebasedRef, basePath, parentRefs...):
+ if resolver.isCircular(&rebasedRef, basePath, parentRefs...) {
// this is a circular $ref: stop expansion
if !resolver.options.AbsoluteCircularRef {
sch.Ref = denormalizeRef(&rebasedRef, resolver.context.basePath, resolver.context.rootID)
} else {
sch.Ref = rebasedRef
}
- case !resolver.options.SkipSchemas:
- // schema expanded to a $ref in another root
- sch.Ref = rebasedRef
- debugLog("rebased to: %s", sch.Ref.String())
- default:
- // skip schema expansion but rebase $ref to schema
- sch.Ref = denormalizeRef(&rebasedRef, resolver.context.basePath, resolver.context.rootID)
}
}
+ // $ref expansion or rebasing is performed by expandSchema below
if ref != nil {
*ref = Ref{}
}
// expand schema
- if !resolver.options.SkipSchemas {
- s, err := expandSchema(*sch, parentRefs, resolver, basePath)
- if resolver.shouldStopOnError(err) {
- return err
- }
- if s == nil {
- // guard for when continuing on error
- return nil
- }
+ // yes, we do it even if options.SkipSchema is true: we have to go down that rabbit hole and rebase nested $ref)
+ s, err := expandSchema(*sch, parentRefs, resolver, basePath)
+ if resolver.shouldStopOnError(err) {
+ return err
+ }
+
+ if s != nil { // guard for when continuing on error
*sch = *s
}
diff --git a/api/vendor/github.com/go-openapi/spec/normalizer_nonwindows.go b/api/vendor/github.com/go-openapi/spec/normalizer_nonwindows.go
index 2df0723154f2..f19f1a8fb651 100644
--- a/api/vendor/github.com/go-openapi/spec/normalizer_nonwindows.go
+++ b/api/vendor/github.com/go-openapi/spec/normalizer_nonwindows.go
@@ -40,5 +40,5 @@ func repairURI(in string) (*url.URL, string) {
return u, ""
}
-func fixWindowsURI(u *url.URL, in string) {
+func fixWindowsURI(_ *url.URL, _ string) {
}
diff --git a/api/vendor/github.com/go-openapi/spec/operation.go b/api/vendor/github.com/go-openapi/spec/operation.go
index 995ce6acb17b..a69cca881474 100644
--- a/api/vendor/github.com/go-openapi/spec/operation.go
+++ b/api/vendor/github.com/go-openapi/spec/operation.go
@@ -217,9 +217,12 @@ func (o *Operation) AddParam(param *Parameter) *Operation {
for i, p := range o.Parameters {
if p.Name == param.Name && p.In == param.In {
- params := append(o.Parameters[:i], *param)
+ params := make([]Parameter, 0, len(o.Parameters)+1)
+ params = append(params, o.Parameters[:i]...)
+ params = append(params, *param)
params = append(params, o.Parameters[i+1:]...)
o.Parameters = params
+
return o
}
}
diff --git a/api/vendor/github.com/go-openapi/spec/parameter.go b/api/vendor/github.com/go-openapi/spec/parameter.go
index 2b2b89b67bf3..bd4f1cdb0760 100644
--- a/api/vendor/github.com/go-openapi/spec/parameter.go
+++ b/api/vendor/github.com/go-openapi/spec/parameter.go
@@ -84,27 +84,27 @@ type ParamProps struct {
// Parameter a unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn).
//
// There are five possible parameter types.
-// * Path - Used together with [Path Templating](#pathTemplating), where the parameter value is actually part
-// of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`,
-// the path parameter is `itemId`.
-// * Query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`.
-// * Header - Custom headers that are expected as part of the request.
-// * Body - The payload that's appended to the HTTP request. Since there can only be one payload, there can only be
-// _one_ body parameter. The name of the body parameter has no effect on the parameter itself and is used for
-// documentation purposes only. Since Form parameters are also in the payload, body and form parameters cannot exist
-// together for the same operation.
-// * Form - Used to describe the payload of an HTTP request when either `application/x-www-form-urlencoded` or
-// `multipart/form-data` are used as the content type of the request (in Swagger's definition,
-// the [`consumes`](#operationConsumes) property of an operation). This is the only parameter type that can be used
-// to send files, thus supporting the `file` type. Since form parameters are sent in the payload, they cannot be
-// declared together with a body parameter for the same operation. Form parameters have a different format based on
-// the content-type used (for further details, consult http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4).
-// * `application/x-www-form-urlencoded` - Similar to the format of Query parameters but as a payload.
-// For example, `foo=1&bar=swagger` - both `foo` and `bar` are form parameters. This is normally used for simple
-// parameters that are being transferred.
-// * `multipart/form-data` - each parameter takes a section in the payload with an internal header.
-// For example, for the header `Content-Disposition: form-data; name="submit-name"` the name of the parameter is
-// `submit-name`. This type of form parameters is more commonly used for file transfers.
+// - Path - Used together with [Path Templating](#pathTemplating), where the parameter value is actually part
+// of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`,
+// the path parameter is `itemId`.
+// - Query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`.
+// - Header - Custom headers that are expected as part of the request.
+// - Body - The payload that's appended to the HTTP request. Since there can only be one payload, there can only be
+// _one_ body parameter. The name of the body parameter has no effect on the parameter itself and is used for
+// documentation purposes only. Since Form parameters are also in the payload, body and form parameters cannot exist
+// together for the same operation.
+// - Form - Used to describe the payload of an HTTP request when either `application/x-www-form-urlencoded` or
+// `multipart/form-data` are used as the content type of the request (in Swagger's definition,
+// the [`consumes`](#operationConsumes) property of an operation). This is the only parameter type that can be used
+// to send files, thus supporting the `file` type. Since form parameters are sent in the payload, they cannot be
+// declared together with a body parameter for the same operation. Form parameters have a different format based on
+// the content-type used (for further details, consult http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4).
+// - `application/x-www-form-urlencoded` - Similar to the format of Query parameters but as a payload.
+// For example, `foo=1&bar=swagger` - both `foo` and `bar` are form parameters. This is normally used for simple
+// parameters that are being transferred.
+// - `multipart/form-data` - each parameter takes a section in the payload with an internal header.
+// For example, for the header `Content-Disposition: form-data; name="submit-name"` the name of the parameter is
+// `submit-name`. This type of form parameters is more commonly used for file transfers.
//
// For more information: http://goo.gl/8us55a#parameterObject
type Parameter struct {
diff --git a/api/vendor/github.com/go-openapi/spec/schema_loader.go b/api/vendor/github.com/go-openapi/spec/schema_loader.go
index b81175afdf42..0059b99aed52 100644
--- a/api/vendor/github.com/go-openapi/spec/schema_loader.go
+++ b/api/vendor/github.com/go-openapi/spec/schema_loader.go
@@ -168,14 +168,7 @@ func (r *schemaLoader) load(refURL *url.URL) (interface{}, url.URL, bool, error)
normalized := normalizeBase(pth)
debugLog("loading doc from: %s", normalized)
- unescaped, err := url.PathUnescape(normalized)
- if err != nil {
- return nil, url.URL{}, false, err
- }
-
- u := url.URL{Path: unescaped}
-
- data, fromCache := r.cache.Get(u.RequestURI())
+ data, fromCache := r.cache.Get(normalized)
if fromCache {
return data, toFetch, fromCache, nil
}
diff --git a/api/vendor/github.com/go-openapi/spec/schemas/jsonschema-draft-04.json b/api/vendor/github.com/go-openapi/spec/schemas/jsonschema-draft-04.json
new file mode 100644
index 000000000000..bcbb84743e38
--- /dev/null
+++ b/api/vendor/github.com/go-openapi/spec/schemas/jsonschema-draft-04.json
@@ -0,0 +1,149 @@
+{
+ "id": "http://json-schema.org/draft-04/schema#",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "description": "Core schema meta-schema",
+ "definitions": {
+ "schemaArray": {
+ "type": "array",
+ "minItems": 1,
+ "items": { "$ref": "#" }
+ },
+ "positiveInteger": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "positiveIntegerDefault0": {
+ "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
+ },
+ "simpleTypes": {
+ "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
+ },
+ "stringArray": {
+ "type": "array",
+ "items": { "type": "string" },
+ "minItems": 1,
+ "uniqueItems": true
+ }
+ },
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "$schema": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "default": {},
+ "multipleOf": {
+ "type": "number",
+ "minimum": 0,
+ "exclusiveMinimum": true
+ },
+ "maximum": {
+ "type": "number"
+ },
+ "exclusiveMaximum": {
+ "type": "boolean",
+ "default": false
+ },
+ "minimum": {
+ "type": "number"
+ },
+ "exclusiveMinimum": {
+ "type": "boolean",
+ "default": false
+ },
+ "maxLength": { "$ref": "#/definitions/positiveInteger" },
+ "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
+ "pattern": {
+ "type": "string",
+ "format": "regex"
+ },
+ "additionalItems": {
+ "anyOf": [
+ { "type": "boolean" },
+ { "$ref": "#" }
+ ],
+ "default": {}
+ },
+ "items": {
+ "anyOf": [
+ { "$ref": "#" },
+ { "$ref": "#/definitions/schemaArray" }
+ ],
+ "default": {}
+ },
+ "maxItems": { "$ref": "#/definitions/positiveInteger" },
+ "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
+ "uniqueItems": {
+ "type": "boolean",
+ "default": false
+ },
+ "maxProperties": { "$ref": "#/definitions/positiveInteger" },
+ "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
+ "required": { "$ref": "#/definitions/stringArray" },
+ "additionalProperties": {
+ "anyOf": [
+ { "type": "boolean" },
+ { "$ref": "#" }
+ ],
+ "default": {}
+ },
+ "definitions": {
+ "type": "object",
+ "additionalProperties": { "$ref": "#" },
+ "default": {}
+ },
+ "properties": {
+ "type": "object",
+ "additionalProperties": { "$ref": "#" },
+ "default": {}
+ },
+ "patternProperties": {
+ "type": "object",
+ "additionalProperties": { "$ref": "#" },
+ "default": {}
+ },
+ "dependencies": {
+ "type": "object",
+ "additionalProperties": {
+ "anyOf": [
+ { "$ref": "#" },
+ { "$ref": "#/definitions/stringArray" }
+ ]
+ }
+ },
+ "enum": {
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true
+ },
+ "type": {
+ "anyOf": [
+ { "$ref": "#/definitions/simpleTypes" },
+ {
+ "type": "array",
+ "items": { "$ref": "#/definitions/simpleTypes" },
+ "minItems": 1,
+ "uniqueItems": true
+ }
+ ]
+ },
+ "format": { "type": "string" },
+ "allOf": { "$ref": "#/definitions/schemaArray" },
+ "anyOf": { "$ref": "#/definitions/schemaArray" },
+ "oneOf": { "$ref": "#/definitions/schemaArray" },
+ "not": { "$ref": "#" }
+ },
+ "dependencies": {
+ "exclusiveMaximum": [ "maximum" ],
+ "exclusiveMinimum": [ "minimum" ]
+ },
+ "default": {}
+}
diff --git a/api/vendor/github.com/go-openapi/spec/schemas/v2/schema.json b/api/vendor/github.com/go-openapi/spec/schemas/v2/schema.json
new file mode 100644
index 000000000000..ebe10ed32d60
--- /dev/null
+++ b/api/vendor/github.com/go-openapi/spec/schemas/v2/schema.json
@@ -0,0 +1,1607 @@
+{
+ "title": "A JSON Schema for Swagger 2.0 API.",
+ "id": "http://swagger.io/v2/schema.json#",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "required": [
+ "swagger",
+ "info",
+ "paths"
+ ],
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "swagger": {
+ "type": "string",
+ "enum": [
+ "2.0"
+ ],
+ "description": "The Swagger version of this document."
+ },
+ "info": {
+ "$ref": "#/definitions/info"
+ },
+ "host": {
+ "type": "string",
+ "pattern": "^[^{}/ :\\\\]+(?::\\d+)?$",
+ "description": "The host (name or ip) of the API. Example: 'swagger.io'"
+ },
+ "basePath": {
+ "type": "string",
+ "pattern": "^/",
+ "description": "The base path to the API. Example: '/api'."
+ },
+ "schemes": {
+ "$ref": "#/definitions/schemesList"
+ },
+ "consumes": {
+ "description": "A list of MIME types accepted by the API.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/mediaTypeList"
+ }
+ ]
+ },
+ "produces": {
+ "description": "A list of MIME types the API can produce.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/mediaTypeList"
+ }
+ ]
+ },
+ "paths": {
+ "$ref": "#/definitions/paths"
+ },
+ "definitions": {
+ "$ref": "#/definitions/definitions"
+ },
+ "parameters": {
+ "$ref": "#/definitions/parameterDefinitions"
+ },
+ "responses": {
+ "$ref": "#/definitions/responseDefinitions"
+ },
+ "security": {
+ "$ref": "#/definitions/security"
+ },
+ "securityDefinitions": {
+ "$ref": "#/definitions/securityDefinitions"
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/tag"
+ },
+ "uniqueItems": true
+ },
+ "externalDocs": {
+ "$ref": "#/definitions/externalDocs"
+ }
+ },
+ "definitions": {
+ "info": {
+ "type": "object",
+ "description": "General information about the API.",
+ "required": [
+ "version",
+ "title"
+ ],
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "title": {
+ "type": "string",
+ "description": "A unique and precise title of the API."
+ },
+ "version": {
+ "type": "string",
+ "description": "A semantic version number of the API."
+ },
+ "description": {
+ "type": "string",
+ "description": "A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed."
+ },
+ "termsOfService": {
+ "type": "string",
+ "description": "The terms of service for the API."
+ },
+ "contact": {
+ "$ref": "#/definitions/contact"
+ },
+ "license": {
+ "$ref": "#/definitions/license"
+ }
+ }
+ },
+ "contact": {
+ "type": "object",
+ "description": "Contact information for the owners of the API.",
+ "additionalProperties": false,
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The identifying name of the contact person/organization."
+ },
+ "url": {
+ "type": "string",
+ "description": "The URL pointing to the contact information.",
+ "format": "uri"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the contact person/organization.",
+ "format": "email"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "license": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "additionalProperties": false,
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the license type. It's encouraged to use an OSI compatible license."
+ },
+ "url": {
+ "type": "string",
+ "description": "The URL pointing to the license.",
+ "format": "uri"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "paths": {
+ "type": "object",
+ "description": "Relative paths to the individual endpoints. They must be relative to the 'basePath'.",
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ },
+ "^/": {
+ "$ref": "#/definitions/pathItem"
+ }
+ },
+ "additionalProperties": false
+ },
+ "definitions": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/schema"
+ },
+ "description": "One or more JSON objects describing the schemas being consumed and produced by the API."
+ },
+ "parameterDefinitions": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/parameter"
+ },
+ "description": "One or more JSON representations for parameters"
+ },
+ "responseDefinitions": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/response"
+ },
+ "description": "One or more JSON representations for responses"
+ },
+ "externalDocs": {
+ "type": "object",
+ "additionalProperties": false,
+ "description": "information about external documentation",
+ "required": [
+ "url"
+ ],
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string",
+ "format": "uri"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "examples": {
+ "type": "object",
+ "additionalProperties": true
+ },
+ "mimeType": {
+ "type": "string",
+ "description": "The MIME type of the HTTP message."
+ },
+ "operation": {
+ "type": "object",
+ "required": [
+ "responses"
+ ],
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "uniqueItems": true
+ },
+ "summary": {
+ "type": "string",
+ "description": "A brief summary of the operation."
+ },
+ "description": {
+ "type": "string",
+ "description": "A longer description of the operation, GitHub Flavored Markdown is allowed."
+ },
+ "externalDocs": {
+ "$ref": "#/definitions/externalDocs"
+ },
+ "operationId": {
+ "type": "string",
+ "description": "A unique identifier of the operation."
+ },
+ "produces": {
+ "description": "A list of MIME types the API can produce.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/mediaTypeList"
+ }
+ ]
+ },
+ "consumes": {
+ "description": "A list of MIME types the API can consume.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/mediaTypeList"
+ }
+ ]
+ },
+ "parameters": {
+ "$ref": "#/definitions/parametersList"
+ },
+ "responses": {
+ "$ref": "#/definitions/responses"
+ },
+ "schemes": {
+ "$ref": "#/definitions/schemesList"
+ },
+ "deprecated": {
+ "type": "boolean",
+ "default": false
+ },
+ "security": {
+ "$ref": "#/definitions/security"
+ }
+ }
+ },
+ "pathItem": {
+ "type": "object",
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "$ref": {
+ "type": "string"
+ },
+ "get": {
+ "$ref": "#/definitions/operation"
+ },
+ "put": {
+ "$ref": "#/definitions/operation"
+ },
+ "post": {
+ "$ref": "#/definitions/operation"
+ },
+ "delete": {
+ "$ref": "#/definitions/operation"
+ },
+ "options": {
+ "$ref": "#/definitions/operation"
+ },
+ "head": {
+ "$ref": "#/definitions/operation"
+ },
+ "patch": {
+ "$ref": "#/definitions/operation"
+ },
+ "parameters": {
+ "$ref": "#/definitions/parametersList"
+ }
+ }
+ },
+ "responses": {
+ "type": "object",
+ "description": "Response objects names can either be any valid HTTP status code or 'default'.",
+ "minProperties": 1,
+ "additionalProperties": false,
+ "patternProperties": {
+ "^([0-9]{3})$|^(default)$": {
+ "$ref": "#/definitions/responseValue"
+ },
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "not": {
+ "type": "object",
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ }
+ },
+ "responseValue": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/response"
+ },
+ {
+ "$ref": "#/definitions/jsonReference"
+ }
+ ]
+ },
+ "response": {
+ "type": "object",
+ "required": [
+ "description"
+ ],
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "schema": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/schema"
+ },
+ {
+ "$ref": "#/definitions/fileSchema"
+ }
+ ]
+ },
+ "headers": {
+ "$ref": "#/definitions/headers"
+ },
+ "examples": {
+ "$ref": "#/definitions/examples"
+ }
+ },
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "headers": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/header"
+ }
+ },
+ "header": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "string",
+ "number",
+ "integer",
+ "boolean",
+ "array"
+ ]
+ },
+ "format": {
+ "type": "string"
+ },
+ "items": {
+ "$ref": "#/definitions/primitivesItems"
+ },
+ "collectionFormat": {
+ "$ref": "#/definitions/collectionFormat"
+ },
+ "default": {
+ "$ref": "#/definitions/default"
+ },
+ "maximum": {
+ "$ref": "#/definitions/maximum"
+ },
+ "exclusiveMaximum": {
+ "$ref": "#/definitions/exclusiveMaximum"
+ },
+ "minimum": {
+ "$ref": "#/definitions/minimum"
+ },
+ "exclusiveMinimum": {
+ "$ref": "#/definitions/exclusiveMinimum"
+ },
+ "maxLength": {
+ "$ref": "#/definitions/maxLength"
+ },
+ "minLength": {
+ "$ref": "#/definitions/minLength"
+ },
+ "pattern": {
+ "$ref": "#/definitions/pattern"
+ },
+ "maxItems": {
+ "$ref": "#/definitions/maxItems"
+ },
+ "minItems": {
+ "$ref": "#/definitions/minItems"
+ },
+ "uniqueItems": {
+ "$ref": "#/definitions/uniqueItems"
+ },
+ "enum": {
+ "$ref": "#/definitions/enum"
+ },
+ "multipleOf": {
+ "$ref": "#/definitions/multipleOf"
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "vendorExtension": {
+ "description": "Any property starting with x- is valid.",
+ "additionalProperties": true,
+ "additionalItems": true
+ },
+ "bodyParameter": {
+ "type": "object",
+ "required": [
+ "name",
+ "in",
+ "schema"
+ ],
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the parameter."
+ },
+ "in": {
+ "type": "string",
+ "description": "Determines the location of the parameter.",
+ "enum": [
+ "body"
+ ]
+ },
+ "required": {
+ "type": "boolean",
+ "description": "Determines whether or not this parameter is required or optional.",
+ "default": false
+ },
+ "schema": {
+ "$ref": "#/definitions/schema"
+ }
+ },
+ "additionalProperties": false
+ },
+ "headerParameterSubSchema": {
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "required": {
+ "type": "boolean",
+ "description": "Determines whether or not this parameter is required or optional.",
+ "default": false
+ },
+ "in": {
+ "type": "string",
+ "description": "Determines the location of the parameter.",
+ "enum": [
+ "header"
+ ]
+ },
+ "description": {
+ "type": "string",
+ "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the parameter."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "string",
+ "number",
+ "boolean",
+ "integer",
+ "array"
+ ]
+ },
+ "format": {
+ "type": "string"
+ },
+ "items": {
+ "$ref": "#/definitions/primitivesItems"
+ },
+ "collectionFormat": {
+ "$ref": "#/definitions/collectionFormat"
+ },
+ "default": {
+ "$ref": "#/definitions/default"
+ },
+ "maximum": {
+ "$ref": "#/definitions/maximum"
+ },
+ "exclusiveMaximum": {
+ "$ref": "#/definitions/exclusiveMaximum"
+ },
+ "minimum": {
+ "$ref": "#/definitions/minimum"
+ },
+ "exclusiveMinimum": {
+ "$ref": "#/definitions/exclusiveMinimum"
+ },
+ "maxLength": {
+ "$ref": "#/definitions/maxLength"
+ },
+ "minLength": {
+ "$ref": "#/definitions/minLength"
+ },
+ "pattern": {
+ "$ref": "#/definitions/pattern"
+ },
+ "maxItems": {
+ "$ref": "#/definitions/maxItems"
+ },
+ "minItems": {
+ "$ref": "#/definitions/minItems"
+ },
+ "uniqueItems": {
+ "$ref": "#/definitions/uniqueItems"
+ },
+ "enum": {
+ "$ref": "#/definitions/enum"
+ },
+ "multipleOf": {
+ "$ref": "#/definitions/multipleOf"
+ }
+ }
+ },
+ "queryParameterSubSchema": {
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "required": {
+ "type": "boolean",
+ "description": "Determines whether or not this parameter is required or optional.",
+ "default": false
+ },
+ "in": {
+ "type": "string",
+ "description": "Determines the location of the parameter.",
+ "enum": [
+ "query"
+ ]
+ },
+ "description": {
+ "type": "string",
+ "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the parameter."
+ },
+ "allowEmptyValue": {
+ "type": "boolean",
+ "default": false,
+ "description": "allows sending a parameter by name only or with an empty value."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "string",
+ "number",
+ "boolean",
+ "integer",
+ "array"
+ ]
+ },
+ "format": {
+ "type": "string"
+ },
+ "items": {
+ "$ref": "#/definitions/primitivesItems"
+ },
+ "collectionFormat": {
+ "$ref": "#/definitions/collectionFormatWithMulti"
+ },
+ "default": {
+ "$ref": "#/definitions/default"
+ },
+ "maximum": {
+ "$ref": "#/definitions/maximum"
+ },
+ "exclusiveMaximum": {
+ "$ref": "#/definitions/exclusiveMaximum"
+ },
+ "minimum": {
+ "$ref": "#/definitions/minimum"
+ },
+ "exclusiveMinimum": {
+ "$ref": "#/definitions/exclusiveMinimum"
+ },
+ "maxLength": {
+ "$ref": "#/definitions/maxLength"
+ },
+ "minLength": {
+ "$ref": "#/definitions/minLength"
+ },
+ "pattern": {
+ "$ref": "#/definitions/pattern"
+ },
+ "maxItems": {
+ "$ref": "#/definitions/maxItems"
+ },
+ "minItems": {
+ "$ref": "#/definitions/minItems"
+ },
+ "uniqueItems": {
+ "$ref": "#/definitions/uniqueItems"
+ },
+ "enum": {
+ "$ref": "#/definitions/enum"
+ },
+ "multipleOf": {
+ "$ref": "#/definitions/multipleOf"
+ }
+ }
+ },
+ "formDataParameterSubSchema": {
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "required": {
+ "type": "boolean",
+ "description": "Determines whether or not this parameter is required or optional.",
+ "default": false
+ },
+ "in": {
+ "type": "string",
+ "description": "Determines the location of the parameter.",
+ "enum": [
+ "formData"
+ ]
+ },
+ "description": {
+ "type": "string",
+ "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the parameter."
+ },
+ "allowEmptyValue": {
+ "type": "boolean",
+ "default": false,
+ "description": "allows sending a parameter by name only or with an empty value."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "string",
+ "number",
+ "boolean",
+ "integer",
+ "array",
+ "file"
+ ]
+ },
+ "format": {
+ "type": "string"
+ },
+ "items": {
+ "$ref": "#/definitions/primitivesItems"
+ },
+ "collectionFormat": {
+ "$ref": "#/definitions/collectionFormatWithMulti"
+ },
+ "default": {
+ "$ref": "#/definitions/default"
+ },
+ "maximum": {
+ "$ref": "#/definitions/maximum"
+ },
+ "exclusiveMaximum": {
+ "$ref": "#/definitions/exclusiveMaximum"
+ },
+ "minimum": {
+ "$ref": "#/definitions/minimum"
+ },
+ "exclusiveMinimum": {
+ "$ref": "#/definitions/exclusiveMinimum"
+ },
+ "maxLength": {
+ "$ref": "#/definitions/maxLength"
+ },
+ "minLength": {
+ "$ref": "#/definitions/minLength"
+ },
+ "pattern": {
+ "$ref": "#/definitions/pattern"
+ },
+ "maxItems": {
+ "$ref": "#/definitions/maxItems"
+ },
+ "minItems": {
+ "$ref": "#/definitions/minItems"
+ },
+ "uniqueItems": {
+ "$ref": "#/definitions/uniqueItems"
+ },
+ "enum": {
+ "$ref": "#/definitions/enum"
+ },
+ "multipleOf": {
+ "$ref": "#/definitions/multipleOf"
+ }
+ }
+ },
+ "pathParameterSubSchema": {
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "required": [
+ "required"
+ ],
+ "properties": {
+ "required": {
+ "type": "boolean",
+ "enum": [
+ true
+ ],
+ "description": "Determines whether or not this parameter is required or optional."
+ },
+ "in": {
+ "type": "string",
+ "description": "Determines the location of the parameter.",
+ "enum": [
+ "path"
+ ]
+ },
+ "description": {
+ "type": "string",
+ "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the parameter."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "string",
+ "number",
+ "boolean",
+ "integer",
+ "array"
+ ]
+ },
+ "format": {
+ "type": "string"
+ },
+ "items": {
+ "$ref": "#/definitions/primitivesItems"
+ },
+ "collectionFormat": {
+ "$ref": "#/definitions/collectionFormat"
+ },
+ "default": {
+ "$ref": "#/definitions/default"
+ },
+ "maximum": {
+ "$ref": "#/definitions/maximum"
+ },
+ "exclusiveMaximum": {
+ "$ref": "#/definitions/exclusiveMaximum"
+ },
+ "minimum": {
+ "$ref": "#/definitions/minimum"
+ },
+ "exclusiveMinimum": {
+ "$ref": "#/definitions/exclusiveMinimum"
+ },
+ "maxLength": {
+ "$ref": "#/definitions/maxLength"
+ },
+ "minLength": {
+ "$ref": "#/definitions/minLength"
+ },
+ "pattern": {
+ "$ref": "#/definitions/pattern"
+ },
+ "maxItems": {
+ "$ref": "#/definitions/maxItems"
+ },
+ "minItems": {
+ "$ref": "#/definitions/minItems"
+ },
+ "uniqueItems": {
+ "$ref": "#/definitions/uniqueItems"
+ },
+ "enum": {
+ "$ref": "#/definitions/enum"
+ },
+ "multipleOf": {
+ "$ref": "#/definitions/multipleOf"
+ }
+ }
+ },
+ "nonBodyParameter": {
+ "type": "object",
+ "required": [
+ "name",
+ "in",
+ "type"
+ ],
+ "oneOf": [
+ {
+ "$ref": "#/definitions/headerParameterSubSchema"
+ },
+ {
+ "$ref": "#/definitions/formDataParameterSubSchema"
+ },
+ {
+ "$ref": "#/definitions/queryParameterSubSchema"
+ },
+ {
+ "$ref": "#/definitions/pathParameterSubSchema"
+ }
+ ]
+ },
+ "parameter": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/bodyParameter"
+ },
+ {
+ "$ref": "#/definitions/nonBodyParameter"
+ }
+ ]
+ },
+ "schema": {
+ "type": "object",
+ "description": "A deterministic version of a JSON Schema object.",
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "$ref": {
+ "type": "string"
+ },
+ "format": {
+ "type": "string"
+ },
+ "title": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/title"
+ },
+ "description": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/description"
+ },
+ "default": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/default"
+ },
+ "multipleOf": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf"
+ },
+ "maximum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum"
+ },
+ "exclusiveMaximum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"
+ },
+ "minimum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum"
+ },
+ "exclusiveMinimum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"
+ },
+ "maxLength": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
+ },
+ "minLength": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
+ },
+ "pattern": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern"
+ },
+ "maxItems": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
+ },
+ "minItems": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
+ },
+ "uniqueItems": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems"
+ },
+ "maxProperties": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
+ },
+ "minProperties": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
+ },
+ "required": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray"
+ },
+ "enum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/enum"
+ },
+ "additionalProperties": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/schema"
+ },
+ {
+ "type": "boolean"
+ }
+ ],
+ "default": {}
+ },
+ "type": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/type"
+ },
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/schema"
+ },
+ {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "$ref": "#/definitions/schema"
+ }
+ }
+ ],
+ "default": {}
+ },
+ "allOf": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "$ref": "#/definitions/schema"
+ }
+ },
+ "properties": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/schema"
+ },
+ "default": {}
+ },
+ "discriminator": {
+ "type": "string"
+ },
+ "readOnly": {
+ "type": "boolean",
+ "default": false
+ },
+ "xml": {
+ "$ref": "#/definitions/xml"
+ },
+ "externalDocs": {
+ "$ref": "#/definitions/externalDocs"
+ },
+ "example": {}
+ },
+ "additionalProperties": false
+ },
+ "fileSchema": {
+ "type": "object",
+ "description": "A deterministic version of a JSON Schema object.",
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "format": {
+ "type": "string"
+ },
+ "title": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/title"
+ },
+ "description": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/description"
+ },
+ "default": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/default"
+ },
+ "required": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "file"
+ ]
+ },
+ "readOnly": {
+ "type": "boolean",
+ "default": false
+ },
+ "externalDocs": {
+ "$ref": "#/definitions/externalDocs"
+ },
+ "example": {}
+ },
+ "additionalProperties": false
+ },
+ "primitivesItems": {
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "string",
+ "number",
+ "integer",
+ "boolean",
+ "array"
+ ]
+ },
+ "format": {
+ "type": "string"
+ },
+ "items": {
+ "$ref": "#/definitions/primitivesItems"
+ },
+ "collectionFormat": {
+ "$ref": "#/definitions/collectionFormat"
+ },
+ "default": {
+ "$ref": "#/definitions/default"
+ },
+ "maximum": {
+ "$ref": "#/definitions/maximum"
+ },
+ "exclusiveMaximum": {
+ "$ref": "#/definitions/exclusiveMaximum"
+ },
+ "minimum": {
+ "$ref": "#/definitions/minimum"
+ },
+ "exclusiveMinimum": {
+ "$ref": "#/definitions/exclusiveMinimum"
+ },
+ "maxLength": {
+ "$ref": "#/definitions/maxLength"
+ },
+ "minLength": {
+ "$ref": "#/definitions/minLength"
+ },
+ "pattern": {
+ "$ref": "#/definitions/pattern"
+ },
+ "maxItems": {
+ "$ref": "#/definitions/maxItems"
+ },
+ "minItems": {
+ "$ref": "#/definitions/minItems"
+ },
+ "uniqueItems": {
+ "$ref": "#/definitions/uniqueItems"
+ },
+ "enum": {
+ "$ref": "#/definitions/enum"
+ },
+ "multipleOf": {
+ "$ref": "#/definitions/multipleOf"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "security": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/securityRequirement"
+ },
+ "uniqueItems": true
+ },
+ "securityRequirement": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "uniqueItems": true
+ }
+ },
+ "xml": {
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "namespace": {
+ "type": "string"
+ },
+ "prefix": {
+ "type": "string"
+ },
+ "attribute": {
+ "type": "boolean",
+ "default": false
+ },
+ "wrapped": {
+ "type": "boolean",
+ "default": false
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "tag": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "externalDocs": {
+ "$ref": "#/definitions/externalDocs"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "securityDefinitions": {
+ "type": "object",
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/basicAuthenticationSecurity"
+ },
+ {
+ "$ref": "#/definitions/apiKeySecurity"
+ },
+ {
+ "$ref": "#/definitions/oauth2ImplicitSecurity"
+ },
+ {
+ "$ref": "#/definitions/oauth2PasswordSecurity"
+ },
+ {
+ "$ref": "#/definitions/oauth2ApplicationSecurity"
+ },
+ {
+ "$ref": "#/definitions/oauth2AccessCodeSecurity"
+ }
+ ]
+ }
+ },
+ "basicAuthenticationSecurity": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "basic"
+ ]
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "apiKeySecurity": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "type",
+ "name",
+ "in"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "apiKey"
+ ]
+ },
+ "name": {
+ "type": "string"
+ },
+ "in": {
+ "type": "string",
+ "enum": [
+ "header",
+ "query"
+ ]
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "oauth2ImplicitSecurity": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "type",
+ "flow",
+ "authorizationUrl"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "oauth2"
+ ]
+ },
+ "flow": {
+ "type": "string",
+ "enum": [
+ "implicit"
+ ]
+ },
+ "scopes": {
+ "$ref": "#/definitions/oauth2Scopes"
+ },
+ "authorizationUrl": {
+ "type": "string",
+ "format": "uri"
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "oauth2PasswordSecurity": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "type",
+ "flow",
+ "tokenUrl"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "oauth2"
+ ]
+ },
+ "flow": {
+ "type": "string",
+ "enum": [
+ "password"
+ ]
+ },
+ "scopes": {
+ "$ref": "#/definitions/oauth2Scopes"
+ },
+ "tokenUrl": {
+ "type": "string",
+ "format": "uri"
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "oauth2ApplicationSecurity": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "type",
+ "flow",
+ "tokenUrl"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "oauth2"
+ ]
+ },
+ "flow": {
+ "type": "string",
+ "enum": [
+ "application"
+ ]
+ },
+ "scopes": {
+ "$ref": "#/definitions/oauth2Scopes"
+ },
+ "tokenUrl": {
+ "type": "string",
+ "format": "uri"
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "oauth2AccessCodeSecurity": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "type",
+ "flow",
+ "authorizationUrl",
+ "tokenUrl"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "oauth2"
+ ]
+ },
+ "flow": {
+ "type": "string",
+ "enum": [
+ "accessCode"
+ ]
+ },
+ "scopes": {
+ "$ref": "#/definitions/oauth2Scopes"
+ },
+ "authorizationUrl": {
+ "type": "string",
+ "format": "uri"
+ },
+ "tokenUrl": {
+ "type": "string",
+ "format": "uri"
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "oauth2Scopes": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "mediaTypeList": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/mimeType"
+ },
+ "uniqueItems": true
+ },
+ "parametersList": {
+ "type": "array",
+ "description": "The parameters needed to send a valid API call.",
+ "additionalItems": false,
+ "items": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/parameter"
+ },
+ {
+ "$ref": "#/definitions/jsonReference"
+ }
+ ]
+ },
+ "uniqueItems": true
+ },
+ "schemesList": {
+ "type": "array",
+ "description": "The transfer protocol of the API.",
+ "items": {
+ "type": "string",
+ "enum": [
+ "http",
+ "https",
+ "ws",
+ "wss"
+ ]
+ },
+ "uniqueItems": true
+ },
+ "collectionFormat": {
+ "type": "string",
+ "enum": [
+ "csv",
+ "ssv",
+ "tsv",
+ "pipes"
+ ],
+ "default": "csv"
+ },
+ "collectionFormatWithMulti": {
+ "type": "string",
+ "enum": [
+ "csv",
+ "ssv",
+ "tsv",
+ "pipes",
+ "multi"
+ ],
+ "default": "csv"
+ },
+ "title": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/title"
+ },
+ "description": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/description"
+ },
+ "default": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/default"
+ },
+ "multipleOf": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf"
+ },
+ "maximum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum"
+ },
+ "exclusiveMaximum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"
+ },
+ "minimum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum"
+ },
+ "exclusiveMinimum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"
+ },
+ "maxLength": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
+ },
+ "minLength": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
+ },
+ "pattern": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern"
+ },
+ "maxItems": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
+ },
+ "minItems": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
+ },
+ "uniqueItems": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems"
+ },
+ "enum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/enum"
+ },
+ "jsonReference": {
+ "type": "object",
+ "required": [
+ "$ref"
+ ],
+ "additionalProperties": false,
+ "properties": {
+ "$ref": {
+ "type": "string"
+ }
+ }
+ }
+ }
+}
diff --git a/api/vendor/github.com/go-openapi/spec/spec.go b/api/vendor/github.com/go-openapi/spec/spec.go
index 7d38b6e6251e..876aa12759db 100644
--- a/api/vendor/github.com/go-openapi/spec/spec.go
+++ b/api/vendor/github.com/go-openapi/spec/spec.go
@@ -26,7 +26,7 @@ import (
const (
// SwaggerSchemaURL the url for the swagger 2.0 schema to validate specs
SwaggerSchemaURL = "http://swagger.io/v2/schema.json#"
- // JSONSchemaURL the url for the json schema schema
+ // JSONSchemaURL the url for the json schema
JSONSchemaURL = "http://json-schema.org/draft-04/schema#"
)
@@ -41,7 +41,7 @@ func MustLoadJSONSchemaDraft04() *Schema {
// JSONSchemaDraft04 loads the json schema document for json shema draft04
func JSONSchemaDraft04() (*Schema, error) {
- b, err := Asset("jsonschema-draft-04.json")
+ b, err := jsonschemaDraft04JSONBytes()
if err != nil {
return nil, err
}
@@ -65,7 +65,7 @@ func MustLoadSwagger20Schema() *Schema {
// Swagger20Schema loads the swagger 2.0 schema from the embedded assets
func Swagger20Schema() (*Schema, error) {
- b, err := Asset("v2/schema.json")
+ b, err := v2SchemaJSONBytes()
if err != nil {
return nil, err
}
diff --git a/api/vendor/github.com/go-openapi/spec/swagger.go b/api/vendor/github.com/go-openapi/spec/swagger.go
index 44722ffd5adc..1590fd1751b2 100644
--- a/api/vendor/github.com/go-openapi/spec/swagger.go
+++ b/api/vendor/github.com/go-openapi/spec/swagger.go
@@ -253,7 +253,7 @@ func (s SchemaOrBool) MarshalJSON() ([]byte, error) {
// UnmarshalJSON converts this bool or schema object from a JSON structure
func (s *SchemaOrBool) UnmarshalJSON(data []byte) error {
var nw SchemaOrBool
- if len(data) >= 4 {
+ if len(data) > 0 {
if data[0] == '{' {
var sch Schema
if err := json.Unmarshal(data, &sch); err != nil {
@@ -261,7 +261,7 @@ func (s *SchemaOrBool) UnmarshalJSON(data []byte) error {
}
nw.Schema = &sch
}
- nw.Allows = !(data[0] == 'f' && data[1] == 'a' && data[2] == 'l' && data[3] == 's' && data[4] == 'e')
+ nw.Allows = !bytes.Equal(data, []byte("false"))
}
*s = nw
return nil
diff --git a/api/vendor/github.com/go-openapi/spec/url_go18.go b/api/vendor/github.com/go-openapi/spec/url_go18.go
deleted file mode 100644
index 60b78515363a..000000000000
--- a/api/vendor/github.com/go-openapi/spec/url_go18.go
+++ /dev/null
@@ -1,8 +0,0 @@
-//go:build !go1.19
-// +build !go1.19
-
-package spec
-
-import "net/url"
-
-var parseURL = url.Parse
diff --git a/api/vendor/github.com/go-openapi/spec/url_go19.go b/api/vendor/github.com/go-openapi/spec/url_go19.go
index 392e3e6395b0..5bdfe40bcc19 100644
--- a/api/vendor/github.com/go-openapi/spec/url_go19.go
+++ b/api/vendor/github.com/go-openapi/spec/url_go19.go
@@ -1,6 +1,3 @@
-//go:build go1.19
-// +build go1.19
-
package spec
import "net/url"
diff --git a/api/vendor/github.com/go-openapi/strfmt/.golangci.yml b/api/vendor/github.com/go-openapi/strfmt/.golangci.yml
index be4899cb1257..22f8d21cca19 100644
--- a/api/vendor/github.com/go-openapi/strfmt/.golangci.yml
+++ b/api/vendor/github.com/go-openapi/strfmt/.golangci.yml
@@ -4,56 +4,58 @@ linters-settings:
golint:
min-confidence: 0
gocyclo:
- min-complexity: 31
+ min-complexity: 45
maligned:
suggest-new: true
dupl:
- threshold: 100
+ threshold: 200
goconst:
min-len: 2
- min-occurrences: 4
+ min-occurrences: 3
linters:
- enable:
- - revive
- - goimports
- - gosec
+ enable-all: true
+ disable:
+ - maligned
- unparam
- - unconvert
- - predeclared
- - prealloc
- - misspell
-
- # disable:
- # - maligned
- # - lll
- # - gochecknoinits
- # - gochecknoglobals
- # - godox
- # - gocognit
- # - whitespace
- # - wsl
- # - funlen
- # - wrapcheck
- # - testpackage
- # - nlreturn
- # - gofumpt
- # - goerr113
- # - gci
- # - gomnd
- # - godot
- # - exhaustivestruct
- # - paralleltest
- # - varnamelen
- # - ireturn
- # - exhaustruct
- # #- thelper
-
-issues:
- exclude-rules:
- - path: bson.go
- text: "should be .*ObjectID"
- linters:
- - golint
- - stylecheck
-
+ - lll
+ - gochecknoinits
+ - gochecknoglobals
+ - funlen
+ - godox
+ - gocognit
+ - whitespace
+ - wsl
+ - wrapcheck
+ - testpackage
+ - nlreturn
+ - gomnd
+ - exhaustivestruct
+ - goerr113
+ - errorlint
+ - nestif
+ - godot
+ - gofumpt
+ - paralleltest
+ - tparallel
+ - thelper
+ - ifshort
+ - exhaustruct
+ - varnamelen
+ - gci
+ - depguard
+ - errchkjson
+ - inamedparam
+ - nonamedreturns
+ - musttag
+ - ireturn
+ - forcetypeassert
+ - cyclop
+ # deprecated linters
+ - deadcode
+ - interfacer
+ - scopelint
+ - varcheck
+ - structcheck
+ - golint
+ - nosnakecase
diff --git a/api/vendor/github.com/go-openapi/strfmt/README.md b/api/vendor/github.com/go-openapi/strfmt/README.md
index 0cf89d776615..f6b39c6c56c5 100644
--- a/api/vendor/github.com/go-openapi/strfmt/README.md
+++ b/api/vendor/github.com/go-openapi/strfmt/README.md
@@ -1,8 +1,7 @@
-# Strfmt [](https://travis-ci.org/go-openapi/strfmt) [](https://codecov.io/gh/go-openapi/strfmt) [](https://slackin.goswagger.io)
-
+# Strfmt [](https://github.com/go-openapi/strfmt/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/strfmt)
+[](https://slackin.goswagger.io)
[](https://raw.githubusercontent.com/go-openapi/strfmt/master/LICENSE)
[](http://godoc.org/github.com/go-openapi/strfmt)
-[](https://golangci.com)
[](https://goreportcard.com/report/github.com/go-openapi/strfmt)
This package exposes a registry of data types to support string formats in the go-openapi toolkit.
diff --git a/api/vendor/github.com/go-openapi/strfmt/bson.go b/api/vendor/github.com/go-openapi/strfmt/bson.go
index a8a3604a2c3b..cfa9a526feb9 100644
--- a/api/vendor/github.com/go-openapi/strfmt/bson.go
+++ b/api/vendor/github.com/go-openapi/strfmt/bson.go
@@ -39,10 +39,10 @@ func IsBSONObjectID(str string) bool {
// ObjectId represents a BSON object ID (alias to go.mongodb.org/mongo-driver/bson/primitive.ObjectID)
//
// swagger:strfmt bsonobjectid
-type ObjectId bsonprim.ObjectID //nolint:revive
+type ObjectId bsonprim.ObjectID //nolint:revive,stylecheck
// NewObjectId creates a ObjectId from a Hex String
-func NewObjectId(hex string) ObjectId { //nolint:revive
+func NewObjectId(hex string) ObjectId { //nolint:revive,stylecheck
oid, err := bsonprim.ObjectIDFromHex(hex)
if err != nil {
panic(err)
@@ -135,7 +135,7 @@ func (id *ObjectId) UnmarshalBSON(data []byte) error {
// BSON document if the error is nil.
func (id ObjectId) MarshalBSONValue() (bsontype.Type, []byte, error) {
oid := bsonprim.ObjectID(id)
- return bsontype.ObjectID, oid[:], nil
+ return bson.TypeObjectID, oid[:], nil
}
// UnmarshalBSONValue is an interface implemented by types that can unmarshal a
diff --git a/api/vendor/github.com/go-openapi/strfmt/default.go b/api/vendor/github.com/go-openapi/strfmt/default.go
index a89a4de3f38d..2813714060eb 100644
--- a/api/vendor/github.com/go-openapi/strfmt/default.go
+++ b/api/vendor/github.com/go-openapi/strfmt/default.go
@@ -25,6 +25,7 @@ import (
"strings"
"github.com/asaskevich/govalidator"
+ "github.com/google/uuid"
"go.mongodb.org/mongo-driver/bson"
)
@@ -57,24 +58,35 @@ const (
// - long top-level domain names (e.g. example.london) are permitted
// - symbol unicode points are permitted (e.g. emoji) (not for top-level domain)
HostnamePattern = `^([a-zA-Z0-9\p{S}\p{L}]((-?[a-zA-Z0-9\p{S}\p{L}]{0,62})?)|([a-zA-Z0-9\p{S}\p{L}](([a-zA-Z0-9-\p{S}\p{L}]{0,61}[a-zA-Z0-9\p{S}\p{L}])?)(\.)){1,}([a-zA-Z\p{L}]){2,63})$`
+
+ // json null type
+ jsonNull = "null"
+)
+
+const (
// UUIDPattern Regex for UUID that allows uppercase
- UUIDPattern = `(?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$`
+ //
+ // Deprecated: strfmt no longer uses regular expressions to validate UUIDs.
+ UUIDPattern = `(?i)(^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$)|(^[0-9a-f]{32}$)`
+
// UUID3Pattern Regex for UUID3 that allows uppercase
- UUID3Pattern = `(?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?3[0-9a-f]{3}-?[0-9a-f]{4}-?[0-9a-f]{12}$`
+ //
+ // Deprecated: strfmt no longer uses regular expressions to validate UUIDs.
+ UUID3Pattern = `(?i)(^[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$)|(^[0-9a-f]{12}3[0-9a-f]{3}?[0-9a-f]{16}$)`
+
// UUID4Pattern Regex for UUID4 that allows uppercase
- UUID4Pattern = `(?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?4[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$`
+ //
+ // Deprecated: strfmt no longer uses regular expressions to validate UUIDs.
+ UUID4Pattern = `(?i)(^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$)|(^[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15}$)`
+
// UUID5Pattern Regex for UUID5 that allows uppercase
- UUID5Pattern = `(?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?5[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$`
- // json null type
- jsonNull = "null"
+ //
+ // Deprecated: strfmt no longer uses regular expressions to validate UUIDs.
+ UUID5Pattern = `(?i)(^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$)|(^[0-9a-f]{12}5[0-9a-f]{3}[89ab][0-9a-f]{15}$)`
)
var (
rxHostname = regexp.MustCompile(HostnamePattern)
- rxUUID = regexp.MustCompile(UUIDPattern)
- rxUUID3 = regexp.MustCompile(UUID3Pattern)
- rxUUID4 = regexp.MustCompile(UUID4Pattern)
- rxUUID5 = regexp.MustCompile(UUID5Pattern)
)
// IsHostname returns true when the string is a valid hostname
@@ -99,24 +111,28 @@ func IsHostname(str string) bool {
return valid
}
-// IsUUID returns true is the string matches a UUID, upper case is allowed
+// IsUUID returns true is the string matches a UUID (in any version, including v6 and v7), upper case is allowed
func IsUUID(str string) bool {
- return rxUUID.MatchString(str)
+ _, err := uuid.Parse(str)
+ return err == nil
}
-// IsUUID3 returns true is the string matches a UUID, upper case is allowed
+// IsUUID3 returns true is the string matches a UUID v3, upper case is allowed
func IsUUID3(str string) bool {
- return rxUUID3.MatchString(str)
+ id, err := uuid.Parse(str)
+ return err == nil && id.Version() == uuid.Version(3)
}
-// IsUUID4 returns true is the string matches a UUID, upper case is allowed
+// IsUUID4 returns true is the string matches a UUID v4, upper case is allowed
func IsUUID4(str string) bool {
- return rxUUID4.MatchString(str)
+ id, err := uuid.Parse(str)
+ return err == nil && id.Version() == uuid.Version(4)
}
-// IsUUID5 returns true is the string matches a UUID, upper case is allowed
+// IsUUID5 returns true is the string matches a UUID v5, upper case is allowed
func IsUUID5(str string) bool {
- return rxUUID5.MatchString(str)
+ id, err := uuid.Parse(str)
+ return err == nil && id.Version() == uuid.Version(5)
}
// IsEmail validates an email address.
diff --git a/api/vendor/github.com/go-openapi/strfmt/format.go b/api/vendor/github.com/go-openapi/strfmt/format.go
index ad3b3c355ba9..888e107c381e 100644
--- a/api/vendor/github.com/go-openapi/strfmt/format.go
+++ b/api/vendor/github.com/go-openapi/strfmt/format.go
@@ -16,6 +16,7 @@ package strfmt
import (
"encoding"
+ stderrors "errors"
"fmt"
"reflect"
"strings"
@@ -94,7 +95,7 @@ func NewSeededFormats(seeds []knownFormat, normalizer NameNormalizer) Registry {
}
// MapStructureHookFunc is a decode hook function for mapstructure
-func (f *defaultFormats) MapStructureHookFunc() mapstructure.DecodeHookFunc { //nolint:gocyclo,cyclop
+func (f *defaultFormats) MapStructureHookFunc() mapstructure.DecodeHookFunc {
return func(from reflect.Type, to reflect.Type, obj interface{}) (interface{}, error) {
if from.Kind() != reflect.String {
return obj, nil
@@ -117,7 +118,7 @@ func (f *defaultFormats) MapStructureHookFunc() mapstructure.DecodeHookFunc { //
case "datetime":
input := data
if len(input) == 0 {
- return nil, fmt.Errorf("empty string is an invalid datetime format")
+ return nil, stderrors.New("empty string is an invalid datetime format")
}
return ParseDateTime(input)
case "duration":
diff --git a/api/vendor/github.com/go-openapi/strfmt/time.go b/api/vendor/github.com/go-openapi/strfmt/time.go
index 9bef4c3b3354..f08ba4da5d42 100644
--- a/api/vendor/github.com/go-openapi/strfmt/time.go
+++ b/api/vendor/github.com/go-openapi/strfmt/time.go
@@ -76,6 +76,8 @@ const (
ISO8601TimeWithReducedPrecisionLocaltime = "2006-01-02T15:04"
// ISO8601TimeUniversalSortableDateTimePattern represents a ISO8601 universal sortable date time pattern.
ISO8601TimeUniversalSortableDateTimePattern = "2006-01-02 15:04:05"
+ // short form of ISO8601TimeUniversalSortableDateTimePattern
+ ISO8601TimeUniversalSortableDateTimePatternShortForm = "2006-01-02"
// DateTimePattern pattern to match for the date-time format from http://tools.ietf.org/html/rfc3339#section-5.6
DateTimePattern = `^([0-9]{2}):([0-9]{2}):([0-9]{2})(.[0-9]+)?(z|([+-][0-9]{2}:[0-9]{2}))$`
)
@@ -84,7 +86,7 @@ var (
rxDateTime = regexp.MustCompile(DateTimePattern)
// DateTimeFormats is the collection of formats used by ParseDateTime()
- DateTimeFormats = []string{RFC3339Micro, RFC3339MicroNoColon, RFC3339Millis, RFC3339MillisNoColon, time.RFC3339, time.RFC3339Nano, ISO8601LocalTime, ISO8601TimeWithReducedPrecision, ISO8601TimeWithReducedPrecisionLocaltime, ISO8601TimeUniversalSortableDateTimePattern}
+ DateTimeFormats = []string{RFC3339Micro, RFC3339MicroNoColon, RFC3339Millis, RFC3339MillisNoColon, time.RFC3339, time.RFC3339Nano, ISO8601LocalTime, ISO8601TimeWithReducedPrecision, ISO8601TimeWithReducedPrecisionLocaltime, ISO8601TimeUniversalSortableDateTimePattern, ISO8601TimeUniversalSortableDateTimePatternShortForm}
// MarshalFormat sets the time resolution format used for marshaling time (set to milliseconds)
MarshalFormat = RFC3339Millis
@@ -245,7 +247,7 @@ func (t DateTime) MarshalBSONValue() (bsontype.Type, []byte, error) {
buf := make([]byte, 8)
binary.LittleEndian.PutUint64(buf, uint64(i64))
- return bsontype.DateTime, buf, nil
+ return bson.TypeDateTime, buf, nil
}
// UnmarshalBSONValue is an interface implemented by types that can unmarshal a
@@ -253,7 +255,7 @@ func (t DateTime) MarshalBSONValue() (bsontype.Type, []byte, error) {
// assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it
// wishes to retain the data after returning.
func (t *DateTime) UnmarshalBSONValue(tpe bsontype.Type, data []byte) error {
- if tpe == bsontype.Null {
+ if tpe == bson.TypeNull {
*t = DateTime{}
return nil
}
diff --git a/api/vendor/github.com/go-openapi/swag/.golangci.yml b/api/vendor/github.com/go-openapi/swag/.golangci.yml
index 80e2be0042f1..d2fafb8a2bb0 100644
--- a/api/vendor/github.com/go-openapi/swag/.golangci.yml
+++ b/api/vendor/github.com/go-openapi/swag/.golangci.yml
@@ -1,22 +1,17 @@
linters-settings:
- govet:
- check-shadowing: true
- golint:
- min-confidence: 0
gocyclo:
min-complexity: 45
- maligned:
- suggest-new: true
dupl:
threshold: 200
goconst:
- min-len: 3
+ min-len: 2
min-occurrences: 3
linters:
enable-all: true
disable:
- - maligned
+ - recvcheck
+ - unparam
- lll
- gochecknoinits
- gochecknoglobals
@@ -28,9 +23,6 @@ linters:
- wrapcheck
- testpackage
- nlreturn
- - gomnd
- - exhaustivestruct
- - goerr113
- errorlint
- nestif
- godot
@@ -38,7 +30,6 @@ linters:
- paralleltest
- tparallel
- thelper
- - ifshort
- exhaustruct
- varnamelen
- gci
@@ -51,10 +42,15 @@ linters:
- forcetypeassert
- cyclop
# deprecated linters
- - deadcode
- - interfacer
- - scopelint
- - varcheck
- - structcheck
- - golint
- - nosnakecase
+ #- deadcode
+ #- interfacer
+ #- scopelint
+ #- varcheck
+ #- structcheck
+ #- golint
+ #- nosnakecase
+ #- maligned
+ #- goerr113
+ #- ifshort
+ #- gomnd
+ #- exhaustivestruct
diff --git a/api/vendor/github.com/go-openapi/swag/errors.go b/api/vendor/github.com/go-openapi/swag/errors.go
new file mode 100644
index 000000000000..6c67fbf92e35
--- /dev/null
+++ b/api/vendor/github.com/go-openapi/swag/errors.go
@@ -0,0 +1,15 @@
+package swag
+
+type swagError string
+
+const (
+ // ErrYAML is an error raised by YAML utilities
+ ErrYAML swagError = "yaml error"
+
+ // ErrLoader is an error raised by the file loader utility
+ ErrLoader swagError = "loader error"
+)
+
+func (e swagError) Error() string {
+ return string(e)
+}
diff --git a/api/vendor/github.com/go-openapi/swag/json.go b/api/vendor/github.com/go-openapi/swag/json.go
index 7e9902ca314b..c7caa9908fea 100644
--- a/api/vendor/github.com/go-openapi/swag/json.go
+++ b/api/vendor/github.com/go-openapi/swag/json.go
@@ -126,7 +126,8 @@ func ConcatJSON(blobs ...[]byte) []byte {
continue // don't know how to concatenate non container objects
}
- if len(b) < 3 { // yep empty but also the last one, so closing this thing
+ const minLengthIfNotEmpty = 3
+ if len(b) < minLengthIfNotEmpty { // yep empty but also the last one, so closing this thing
if i == last && a > 0 {
if err := buf.WriteByte(closing); err != nil {
log.Println(err)
diff --git a/api/vendor/github.com/go-openapi/swag/loading.go b/api/vendor/github.com/go-openapi/swag/loading.go
index 783442fddf63..658a24b789b5 100644
--- a/api/vendor/github.com/go-openapi/swag/loading.go
+++ b/api/vendor/github.com/go-openapi/swag/loading.go
@@ -168,7 +168,7 @@ func loadHTTPBytes(timeout time.Duration) func(path string) ([]byte, error) {
}
if resp.StatusCode != http.StatusOK {
- return nil, fmt.Errorf("could not access document at %q [%s] ", path, resp.Status)
+ return nil, fmt.Errorf("could not access document at %q [%s]: %w", path, resp.Status, ErrLoader)
}
return io.ReadAll(resp.Body)
diff --git a/api/vendor/github.com/go-openapi/swag/yaml.go b/api/vendor/github.com/go-openapi/swag/yaml.go
index f59e0259320c..575346539ac8 100644
--- a/api/vendor/github.com/go-openapi/swag/yaml.go
+++ b/api/vendor/github.com/go-openapi/swag/yaml.go
@@ -16,7 +16,6 @@ package swag
import (
"encoding/json"
- "errors"
"fmt"
"path/filepath"
"reflect"
@@ -51,7 +50,7 @@ func BytesToYAMLDoc(data []byte) (interface{}, error) {
return nil, err
}
if document.Kind != yaml.DocumentNode || len(document.Content) != 1 || document.Content[0].Kind != yaml.MappingNode {
- return nil, errors.New("only YAML documents that are objects are supported")
+ return nil, fmt.Errorf("only YAML documents that are objects are supported: %w", ErrYAML)
}
return &document, nil
}
@@ -69,31 +68,32 @@ func yamlNode(root *yaml.Node) (interface{}, error) {
case yaml.AliasNode:
return yamlNode(root.Alias)
default:
- return nil, fmt.Errorf("unsupported YAML node type: %v", root.Kind)
+ return nil, fmt.Errorf("unsupported YAML node type: %v: %w", root.Kind, ErrYAML)
}
}
func yamlDocument(node *yaml.Node) (interface{}, error) {
if len(node.Content) != 1 {
- return nil, fmt.Errorf("unexpected YAML Document node content length: %d", len(node.Content))
+ return nil, fmt.Errorf("unexpected YAML Document node content length: %d: %w", len(node.Content), ErrYAML)
}
return yamlNode(node.Content[0])
}
func yamlMapping(node *yaml.Node) (interface{}, error) {
- m := make(JSONMapSlice, len(node.Content)/2)
+ const sensibleAllocDivider = 2
+ m := make(JSONMapSlice, len(node.Content)/sensibleAllocDivider)
var j int
for i := 0; i < len(node.Content); i += 2 {
var nmi JSONMapItem
k, err := yamlStringScalarC(node.Content[i])
if err != nil {
- return nil, fmt.Errorf("unable to decode YAML map key: %w", err)
+ return nil, fmt.Errorf("unable to decode YAML map key: %w: %w", err, ErrYAML)
}
nmi.Key = k
v, err := yamlNode(node.Content[i+1])
if err != nil {
- return nil, fmt.Errorf("unable to process YAML map value for key %q: %w", k, err)
+ return nil, fmt.Errorf("unable to process YAML map value for key %q: %w: %w", k, err, ErrYAML)
}
nmi.Value = v
m[j] = nmi
@@ -109,7 +109,7 @@ func yamlSequence(node *yaml.Node) (interface{}, error) {
v, err := yamlNode(node.Content[i])
if err != nil {
- return nil, fmt.Errorf("unable to decode YAML sequence value: %w", err)
+ return nil, fmt.Errorf("unable to decode YAML sequence value: %w: %w", err, ErrYAML)
}
s = append(s, v)
}
@@ -132,19 +132,19 @@ func yamlScalar(node *yaml.Node) (interface{}, error) {
case yamlBoolScalar:
b, err := strconv.ParseBool(node.Value)
if err != nil {
- return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting bool content: %w", node.Value, err)
+ return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting bool content: %w: %w", node.Value, err, ErrYAML)
}
return b, nil
case yamlIntScalar:
i, err := strconv.ParseInt(node.Value, 10, 64)
if err != nil {
- return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting integer content: %w", node.Value, err)
+ return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting integer content: %w: %w", node.Value, err, ErrYAML)
}
return i, nil
case yamlFloatScalar:
f, err := strconv.ParseFloat(node.Value, 64)
if err != nil {
- return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting float content: %w", node.Value, err)
+ return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting float content: %w: %w", node.Value, err, ErrYAML)
}
return f, nil
case yamlTimestamp:
@@ -152,19 +152,19 @@ func yamlScalar(node *yaml.Node) (interface{}, error) {
case yamlNull:
return nil, nil //nolint:nilnil
default:
- return nil, fmt.Errorf("YAML tag %q is not supported", node.LongTag())
+ return nil, fmt.Errorf("YAML tag %q is not supported: %w", node.LongTag(), ErrYAML)
}
}
func yamlStringScalarC(node *yaml.Node) (string, error) {
if node.Kind != yaml.ScalarNode {
- return "", fmt.Errorf("expecting a string scalar but got %q", node.Kind)
+ return "", fmt.Errorf("expecting a string scalar but got %q: %w", node.Kind, ErrYAML)
}
switch node.LongTag() {
case yamlStringScalar, yamlIntScalar, yamlFloatScalar:
return node.Value, nil
default:
- return "", fmt.Errorf("YAML tag %q is not supported as map key", node.LongTag())
+ return "", fmt.Errorf("YAML tag %q is not supported as map key: %w", node.LongTag(), ErrYAML)
}
}
@@ -349,7 +349,7 @@ func json2yaml(item interface{}) (*yaml.Node, error) {
Value: strconv.FormatBool(val),
}, nil
default:
- return nil, fmt.Errorf("unhandled type: %T", val)
+ return nil, fmt.Errorf("unhandled type: %T: %w", val, ErrYAML)
}
}
@@ -416,7 +416,7 @@ func transformData(input interface{}) (out interface{}, err error) {
case int64:
return strconv.FormatInt(k, 10), nil
default:
- return "", fmt.Errorf("unexpected map key type, got: %T", k)
+ return "", fmt.Errorf("unexpected map key type, got: %T: %w", k, ErrYAML)
}
}
diff --git a/api/vendor/github.com/go-openapi/validate/.golangci.yml b/api/vendor/github.com/go-openapi/validate/.golangci.yml
index 348b9b45fa64..22f8d21cca19 100644
--- a/api/vendor/github.com/go-openapi/validate/.golangci.yml
+++ b/api/vendor/github.com/go-openapi/validate/.golangci.yml
@@ -1,12 +1,14 @@
linters-settings:
govet:
check-shadowing: true
+ golint:
+ min-confidence: 0
gocyclo:
- min-complexity: 50
+ min-complexity: 45
maligned:
suggest-new: true
dupl:
- threshold: 100
+ threshold: 200
goconst:
min-len: 2
min-occurrences: 3
@@ -15,41 +17,45 @@ linters:
enable-all: true
disable:
- maligned
+ - unparam
- lll
+ - gochecknoinits
+ - gochecknoglobals
+ - funlen
- godox
- gocognit
- whitespace
- wsl
- - funlen
- - gochecknoglobals
- - gochecknoinits
- - scopelint
- wrapcheck
- - exhaustivestruct
- - exhaustive
- - nlreturn
- testpackage
- - gci
- - gofumpt
- - goerr113
+ - nlreturn
- gomnd
- - tparallel
+ - exhaustivestruct
+ - goerr113
+ - errorlint
- nestif
- godot
- - tparallel
+ - gofumpt
- paralleltest
- - cyclop # because we have gocyclo already
- - depguard # we do not add a config for this
- # TODO: review the linters below. We disabled them to make the CI pass first.
- - nonamedreturns
+ - tparallel
+ - thelper
+ - ifshort
- exhaustruct
- - nosnakecase
- - nolintlint
- - ireturn
- varnamelen
+ - gci
+ - depguard
+ - errchkjson
+ - inamedparam
+ - nonamedreturns
+ - musttag
+ - ireturn
- forcetypeassert
- - thelper
- # Disable deprecated linters.
- # They will be removed from golangci-lint in future.
+ - cyclop
+ # deprecated linters
+ - deadcode
- interfacer
- - golint
\ No newline at end of file
+ - scopelint
+ - varcheck
+ - structcheck
+ - golint
+ - nosnakecase
diff --git a/api/vendor/github.com/go-openapi/validate/BENCHMARK.md b/api/vendor/github.com/go-openapi/validate/BENCHMARK.md
new file mode 100644
index 000000000000..79cf6a077ba2
--- /dev/null
+++ b/api/vendor/github.com/go-openapi/validate/BENCHMARK.md
@@ -0,0 +1,31 @@
+# Benchmark
+
+Validating the Kubernetes Swagger API
+
+## v0.22.6: 60,000,000 allocs
+```
+goos: linux
+goarch: amd64
+pkg: github.com/go-openapi/validate
+cpu: AMD Ryzen 7 5800X 8-Core Processor
+Benchmark_KubernetesSpec/validating_kubernetes_API-16 1 8549863982 ns/op 7067424936 B/op 59583275 allocs/op
+```
+
+## After refact PR: minor but noticable improvements: 25,000,000 allocs
+```
+go test -bench Spec
+goos: linux
+goarch: amd64
+pkg: github.com/go-openapi/validate
+cpu: AMD Ryzen 7 5800X 8-Core Processor
+Benchmark_KubernetesSpec/validating_kubernetes_API-16 1 4064535557 ns/op 3379715592 B/op 25320330 allocs/op
+```
+
+## After reduce GC pressure PR: 17,000,000 allocs
+```
+goos: linux
+goarch: amd64
+pkg: github.com/go-openapi/validate
+cpu: AMD Ryzen 7 5800X 8-Core Processor
+Benchmark_KubernetesSpec/validating_kubernetes_API-16 1 3758414145 ns/op 2593881496 B/op 17111373 allocs/op
+```
diff --git a/api/vendor/github.com/go-openapi/validate/README.md b/api/vendor/github.com/go-openapi/validate/README.md
index ea2d68cb683a..e8e1bb218d9a 100644
--- a/api/vendor/github.com/go-openapi/validate/README.md
+++ b/api/vendor/github.com/go-openapi/validate/README.md
@@ -1,7 +1,5 @@
-# Validation helpers
-[](https://travis-ci.org/go-openapi/validate)
-[](https://ci.appveyor.com/project/fredbi/validate/branch/master)
-[](https://codecov.io/gh/go-openapi/validate)
+# Validation helpers [](https://github.com/go-openapi/validate/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/validate)
+
[](https://slackin.goswagger.io)
[](https://raw.githubusercontent.com/go-openapi/validate/master/LICENSE)
[](https://pkg.go.dev/github.com/go-openapi/validate)
@@ -24,7 +22,7 @@ Reference can be found here: https://github.com/OAI/OpenAPI-Specification/blob/m
* Minimum, Maximum, MultipleOf
* FormatOf
-[Documentation](https://godoc.org/github.com/go-openapi/validate)
+[Documentation](https://pkg.go.dev/github.com/go-openapi/validate)
## FAQ
diff --git a/api/vendor/github.com/go-openapi/validate/default_validator.go b/api/vendor/github.com/go-openapi/validate/default_validator.go
index 670a1773accd..e0dd93839eca 100644
--- a/api/vendor/github.com/go-openapi/validate/default_validator.go
+++ b/api/vendor/github.com/go-openapi/validate/default_validator.go
@@ -25,48 +25,55 @@ import (
// According to Swagger spec, default values MUST validate their schema.
type defaultValidator struct {
SpecValidator *SpecValidator
- visitedSchemas map[string]bool
+ visitedSchemas map[string]struct{}
+ schemaOptions *SchemaValidatorOptions
}
// resetVisited resets the internal state of visited schemas
func (d *defaultValidator) resetVisited() {
- d.visitedSchemas = map[string]bool{}
+ if d.visitedSchemas == nil {
+ d.visitedSchemas = make(map[string]struct{})
+
+ return
+ }
+
+ // TODO(go1.21): clear(ex.visitedSchemas)
+ for k := range d.visitedSchemas {
+ delete(d.visitedSchemas, k)
+ }
}
-func isVisited(path string, visitedSchemas map[string]bool) bool {
- found := visitedSchemas[path]
- if !found {
- // search for overlapping paths
- frags := strings.Split(path, ".")
- if len(frags) < 2 {
- // shortcut exit on smaller paths
- return found
+func isVisited(path string, visitedSchemas map[string]struct{}) bool {
+ _, found := visitedSchemas[path]
+ if found {
+ return true
+ }
+
+ // search for overlapping paths
+ var (
+ parent string
+ suffix string
+ )
+ for i := len(path) - 2; i >= 0; i-- {
+ r := path[i]
+ if r != '.' {
+ continue
}
- last := len(frags) - 1
- var currentFragStr, parent string
- for i := range frags {
- if i == 0 {
- currentFragStr = frags[last]
- } else {
- currentFragStr = strings.Join([]string{frags[last-i], currentFragStr}, ".")
- }
- if i < last {
- parent = strings.Join(frags[0:last-i], ".")
- } else {
- parent = ""
- }
- if strings.HasSuffix(parent, currentFragStr) {
- found = true
- break
- }
+
+ parent = path[0:i]
+ suffix = path[i+1:]
+
+ if strings.HasSuffix(parent, suffix) {
+ return true
}
}
- return found
+
+ return false
}
// beingVisited asserts a schema is being visited
func (d *defaultValidator) beingVisited(path string) {
- d.visitedSchemas[path] = true
+ d.visitedSchemas[path] = struct{}{}
}
// isVisited tells if a path has already been visited
@@ -75,8 +82,9 @@ func (d *defaultValidator) isVisited(path string) bool {
}
// Validate validates the default values declared in the swagger spec
-func (d *defaultValidator) Validate() (errs *Result) {
- errs = new(Result)
+func (d *defaultValidator) Validate() *Result {
+ errs := pools.poolOfResults.BorrowResult() // will redeem when merged
+
if d == nil || d.SpecValidator == nil {
return errs
}
@@ -89,7 +97,7 @@ func (d *defaultValidator) validateDefaultValueValidAgainstSchema() *Result {
// every default value that is specified must validate against the schema for that property
// headers, items, parameters, schema
- res := new(Result)
+ res := pools.poolOfResults.BorrowResult() // will redeem when merged
s := d.SpecValidator
for method, pathItem := range s.expandedAnalyzer().Operations() {
@@ -107,10 +115,12 @@ func (d *defaultValidator) validateDefaultValueValidAgainstSchema() *Result {
// default values provided must validate against their inline definition (no explicit schema)
if param.Default != nil && param.Schema == nil {
// check param default value is valid
- red := NewParamValidator(¶m, s.KnownFormats).Validate(param.Default) //#nosec
+ red := newParamValidator(¶m, s.KnownFormats, d.schemaOptions).Validate(param.Default) //#nosec
if red.HasErrorsOrWarnings() {
res.AddErrors(defaultValueDoesNotValidateMsg(param.Name, param.In))
res.Merge(red)
+ } else if red.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(red)
}
}
@@ -120,6 +130,8 @@ func (d *defaultValidator) validateDefaultValueValidAgainstSchema() *Result {
if red.HasErrorsOrWarnings() {
res.AddErrors(defaultValueItemsDoesNotValidateMsg(param.Name, param.In))
res.Merge(red)
+ } else if red.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(red)
}
}
@@ -129,6 +141,8 @@ func (d *defaultValidator) validateDefaultValueValidAgainstSchema() *Result {
if red.HasErrorsOrWarnings() {
res.AddErrors(defaultValueDoesNotValidateMsg(param.Name, param.In))
res.Merge(red)
+ } else if red.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(red)
}
}
}
@@ -154,7 +168,7 @@ func (d *defaultValidator) validateDefaultValueValidAgainstSchema() *Result {
// reset explored schemas to get depth-first recursive-proof exploration
d.resetVisited()
for nm, sch := range s.spec.Spec().Definitions {
- res.Merge(d.validateDefaultValueSchemaAgainstSchema(fmt.Sprintf("definitions.%s", nm), "body", &sch)) //#nosec
+ res.Merge(d.validateDefaultValueSchemaAgainstSchema("definitions."+nm, "body", &sch)) //#nosec
}
}
return res
@@ -170,17 +184,18 @@ func (d *defaultValidator) validateDefaultInResponse(resp *spec.Response, respon
responseName, responseCodeAsStr := responseHelp.responseMsgVariants(responseType, responseCode)
- //nolint: dupl
if response.Headers != nil { // Safeguard
for nm, h := range response.Headers {
// reset explored schemas to get depth-first recursive-proof exploration
d.resetVisited()
if h.Default != nil {
- red := NewHeaderValidator(nm, &h, s.KnownFormats).Validate(h.Default) //#nosec
+ red := newHeaderValidator(nm, &h, s.KnownFormats, d.schemaOptions).Validate(h.Default) //#nosec
if red.HasErrorsOrWarnings() {
res.AddErrors(defaultValueHeaderDoesNotValidateMsg(operationID, nm, responseName))
res.Merge(red)
+ } else if red.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(red)
}
}
@@ -190,6 +205,8 @@ func (d *defaultValidator) validateDefaultInResponse(resp *spec.Response, respon
if red.HasErrorsOrWarnings() {
res.AddErrors(defaultValueHeaderItemsDoesNotValidateMsg(operationID, nm, responseName))
res.Merge(red)
+ } else if red.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(red)
}
}
@@ -209,6 +226,8 @@ func (d *defaultValidator) validateDefaultInResponse(resp *spec.Response, respon
// Additional message to make sure the context of the error is not lost
res.AddErrors(defaultValueInDoesNotValidateMsg(operationID, responseName))
res.Merge(red)
+ } else if red.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(red)
}
}
return res
@@ -220,11 +239,13 @@ func (d *defaultValidator) validateDefaultValueSchemaAgainstSchema(path, in stri
return nil
}
d.beingVisited(path)
- res := new(Result)
+ res := pools.poolOfResults.BorrowResult()
s := d.SpecValidator
if schema.Default != nil {
- res.Merge(NewSchemaValidator(schema, s.spec.Spec(), path+".default", s.KnownFormats, SwaggerSchema(true)).Validate(schema.Default))
+ res.Merge(
+ newSchemaValidator(schema, s.spec.Spec(), path+".default", s.KnownFormats, d.schemaOptions).Validate(schema.Default),
+ )
}
if schema.Items != nil {
if schema.Items.Schema != nil {
@@ -242,7 +263,7 @@ func (d *defaultValidator) validateDefaultValueSchemaAgainstSchema(path, in stri
}
if schema.AdditionalItems != nil && schema.AdditionalItems.Schema != nil {
// NOTE: we keep validating values, even though additionalItems is not supported by Swagger 2.0 (and 3.0 as well)
- res.Merge(d.validateDefaultValueSchemaAgainstSchema(fmt.Sprintf("%s.additionalItems", path), in, schema.AdditionalItems.Schema))
+ res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+".additionalItems", in, schema.AdditionalItems.Schema))
}
for propName, prop := range schema.Properties {
res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+"."+propName, in, &prop)) //#nosec
@@ -251,7 +272,7 @@ func (d *defaultValidator) validateDefaultValueSchemaAgainstSchema(path, in stri
res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+"."+propName, in, &prop)) //#nosec
}
if schema.AdditionalProperties != nil && schema.AdditionalProperties.Schema != nil {
- res.Merge(d.validateDefaultValueSchemaAgainstSchema(fmt.Sprintf("%s.additionalProperties", path), in, schema.AdditionalProperties.Schema))
+ res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+".additionalProperties", in, schema.AdditionalProperties.Schema))
}
if schema.AllOf != nil {
for i, aoSch := range schema.AllOf {
@@ -263,13 +284,14 @@ func (d *defaultValidator) validateDefaultValueSchemaAgainstSchema(path, in stri
// TODO: Temporary duplicated code. Need to refactor with examples
-// nolint: dupl
func (d *defaultValidator) validateDefaultValueItemsAgainstSchema(path, in string, root interface{}, items *spec.Items) *Result {
- res := new(Result)
+ res := pools.poolOfResults.BorrowResult()
s := d.SpecValidator
if items != nil {
if items.Default != nil {
- res.Merge(newItemsValidator(path, in, items, root, s.KnownFormats).Validate(0, items.Default))
+ res.Merge(
+ newItemsValidator(path, in, items, root, s.KnownFormats, d.schemaOptions).Validate(0, items.Default),
+ )
}
if items.Items != nil {
res.Merge(d.validateDefaultValueItemsAgainstSchema(path+"[0].default", in, root, items.Items))
diff --git a/api/vendor/github.com/go-openapi/validate/example_validator.go b/api/vendor/github.com/go-openapi/validate/example_validator.go
index 930b47e53009..d08956973ce5 100644
--- a/api/vendor/github.com/go-openapi/validate/example_validator.go
+++ b/api/vendor/github.com/go-openapi/validate/example_validator.go
@@ -23,17 +23,27 @@ import (
// ExampleValidator validates example values defined in a spec
type exampleValidator struct {
SpecValidator *SpecValidator
- visitedSchemas map[string]bool
+ visitedSchemas map[string]struct{}
+ schemaOptions *SchemaValidatorOptions
}
// resetVisited resets the internal state of visited schemas
func (ex *exampleValidator) resetVisited() {
- ex.visitedSchemas = map[string]bool{}
+ if ex.visitedSchemas == nil {
+ ex.visitedSchemas = make(map[string]struct{})
+
+ return
+ }
+
+ // TODO(go1.21): clear(ex.visitedSchemas)
+ for k := range ex.visitedSchemas {
+ delete(ex.visitedSchemas, k)
+ }
}
// beingVisited asserts a schema is being visited
func (ex *exampleValidator) beingVisited(path string) {
- ex.visitedSchemas[path] = true
+ ex.visitedSchemas[path] = struct{}{}
}
// isVisited tells if a path has already been visited
@@ -48,8 +58,9 @@ func (ex *exampleValidator) isVisited(path string) bool {
// - schemas
// - individual property
// - responses
-func (ex *exampleValidator) Validate() (errs *Result) {
- errs = new(Result)
+func (ex *exampleValidator) Validate() *Result {
+ errs := pools.poolOfResults.BorrowResult()
+
if ex == nil || ex.SpecValidator == nil {
return errs
}
@@ -64,7 +75,7 @@ func (ex *exampleValidator) validateExampleValueValidAgainstSchema() *Result {
// in: schemas, properties, object, items
// not in: headers, parameters without schema
- res := new(Result)
+ res := pools.poolOfResults.BorrowResult()
s := ex.SpecValidator
for method, pathItem := range s.expandedAnalyzer().Operations() {
@@ -82,10 +93,12 @@ func (ex *exampleValidator) validateExampleValueValidAgainstSchema() *Result {
// default values provided must validate against their inline definition (no explicit schema)
if param.Example != nil && param.Schema == nil {
// check param default value is valid
- red := NewParamValidator(¶m, s.KnownFormats).Validate(param.Example) //#nosec
+ red := newParamValidator(¶m, s.KnownFormats, ex.schemaOptions).Validate(param.Example) //#nosec
if red.HasErrorsOrWarnings() {
res.AddWarnings(exampleValueDoesNotValidateMsg(param.Name, param.In))
res.MergeAsWarnings(red)
+ } else if red.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(red)
}
}
@@ -95,6 +108,8 @@ func (ex *exampleValidator) validateExampleValueValidAgainstSchema() *Result {
if red.HasErrorsOrWarnings() {
res.AddWarnings(exampleValueItemsDoesNotValidateMsg(param.Name, param.In))
res.Merge(red)
+ } else if red.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(red)
}
}
@@ -104,6 +119,8 @@ func (ex *exampleValidator) validateExampleValueValidAgainstSchema() *Result {
if red.HasErrorsOrWarnings() {
res.AddWarnings(exampleValueDoesNotValidateMsg(param.Name, param.In))
res.Merge(red)
+ } else if red.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(red)
}
}
}
@@ -129,7 +146,7 @@ func (ex *exampleValidator) validateExampleValueValidAgainstSchema() *Result {
// reset explored schemas to get depth-first recursive-proof exploration
ex.resetVisited()
for nm, sch := range s.spec.Spec().Definitions {
- res.Merge(ex.validateExampleValueSchemaAgainstSchema(fmt.Sprintf("definitions.%s", nm), "body", &sch)) //#nosec
+ res.Merge(ex.validateExampleValueSchemaAgainstSchema("definitions."+nm, "body", &sch)) //#nosec
}
}
return res
@@ -145,17 +162,18 @@ func (ex *exampleValidator) validateExampleInResponse(resp *spec.Response, respo
responseName, responseCodeAsStr := responseHelp.responseMsgVariants(responseType, responseCode)
- // nolint: dupl
if response.Headers != nil { // Safeguard
for nm, h := range response.Headers {
// reset explored schemas to get depth-first recursive-proof exploration
ex.resetVisited()
if h.Example != nil {
- red := NewHeaderValidator(nm, &h, s.KnownFormats).Validate(h.Example) //#nosec
+ red := newHeaderValidator(nm, &h, s.KnownFormats, ex.schemaOptions).Validate(h.Example) //#nosec
if red.HasErrorsOrWarnings() {
res.AddWarnings(exampleValueHeaderDoesNotValidateMsg(operationID, nm, responseName))
res.MergeAsWarnings(red)
+ } else if red.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(red)
}
}
@@ -165,6 +183,8 @@ func (ex *exampleValidator) validateExampleInResponse(resp *spec.Response, respo
if red.HasErrorsOrWarnings() {
res.AddWarnings(exampleValueHeaderItemsDoesNotValidateMsg(operationID, nm, responseName))
res.MergeAsWarnings(red)
+ } else if red.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(red)
}
}
@@ -184,13 +204,17 @@ func (ex *exampleValidator) validateExampleInResponse(resp *spec.Response, respo
// Additional message to make sure the context of the error is not lost
res.AddWarnings(exampleValueInDoesNotValidateMsg(operationID, responseName))
res.Merge(red)
+ } else if red.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(red)
}
}
if response.Examples != nil {
if response.Schema != nil {
if example, ok := response.Examples["application/json"]; ok {
- res.MergeAsWarnings(NewSchemaValidator(response.Schema, s.spec.Spec(), path+".examples", s.KnownFormats, SwaggerSchema(true)).Validate(example))
+ res.MergeAsWarnings(
+ newSchemaValidator(response.Schema, s.spec.Spec(), path+".examples", s.KnownFormats, s.schemaOptions).Validate(example),
+ )
} else {
// TODO: validate other media types too
res.AddWarnings(examplesMimeNotSupportedMsg(operationID, responseName))
@@ -209,10 +233,12 @@ func (ex *exampleValidator) validateExampleValueSchemaAgainstSchema(path, in str
}
ex.beingVisited(path)
s := ex.SpecValidator
- res := new(Result)
+ res := pools.poolOfResults.BorrowResult()
if schema.Example != nil {
- res.MergeAsWarnings(NewSchemaValidator(schema, s.spec.Spec(), path+".example", s.KnownFormats, SwaggerSchema(true)).Validate(schema.Example))
+ res.MergeAsWarnings(
+ newSchemaValidator(schema, s.spec.Spec(), path+".example", s.KnownFormats, ex.schemaOptions).Validate(schema.Example),
+ )
}
if schema.Items != nil {
if schema.Items.Schema != nil {
@@ -230,7 +256,7 @@ func (ex *exampleValidator) validateExampleValueSchemaAgainstSchema(path, in str
}
if schema.AdditionalItems != nil && schema.AdditionalItems.Schema != nil {
// NOTE: we keep validating values, even though additionalItems is unsupported in Swagger 2.0 (and 3.0 as well)
- res.Merge(ex.validateExampleValueSchemaAgainstSchema(fmt.Sprintf("%s.additionalItems", path), in, schema.AdditionalItems.Schema))
+ res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+".additionalItems", in, schema.AdditionalItems.Schema))
}
for propName, prop := range schema.Properties {
res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+"."+propName, in, &prop)) //#nosec
@@ -239,7 +265,7 @@ func (ex *exampleValidator) validateExampleValueSchemaAgainstSchema(path, in str
res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+"."+propName, in, &prop)) //#nosec
}
if schema.AdditionalProperties != nil && schema.AdditionalProperties.Schema != nil {
- res.Merge(ex.validateExampleValueSchemaAgainstSchema(fmt.Sprintf("%s.additionalProperties", path), in, schema.AdditionalProperties.Schema))
+ res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+".additionalProperties", in, schema.AdditionalProperties.Schema))
}
if schema.AllOf != nil {
for i, aoSch := range schema.AllOf {
@@ -250,13 +276,16 @@ func (ex *exampleValidator) validateExampleValueSchemaAgainstSchema(path, in str
}
// TODO: Temporary duplicated code. Need to refactor with examples
-// nolint: dupl
+//
+
func (ex *exampleValidator) validateExampleValueItemsAgainstSchema(path, in string, root interface{}, items *spec.Items) *Result {
- res := new(Result)
+ res := pools.poolOfResults.BorrowResult()
s := ex.SpecValidator
if items != nil {
if items.Example != nil {
- res.MergeAsWarnings(newItemsValidator(path, in, items, root, s.KnownFormats).Validate(0, items.Example))
+ res.MergeAsWarnings(
+ newItemsValidator(path, in, items, root, s.KnownFormats, ex.schemaOptions).Validate(0, items.Example),
+ )
}
if items.Items != nil {
res.Merge(ex.validateExampleValueItemsAgainstSchema(path+"[0].example", in, root, items.Items))
@@ -265,5 +294,6 @@ func (ex *exampleValidator) validateExampleValueItemsAgainstSchema(path, in stri
res.AddErrors(invalidPatternInMsg(path, in, items.Pattern))
}
}
+
return res
}
diff --git a/api/vendor/github.com/go-openapi/validate/formats.go b/api/vendor/github.com/go-openapi/validate/formats.go
index 0ad996cbbc2f..f4e355213060 100644
--- a/api/vendor/github.com/go-openapi/validate/formats.go
+++ b/api/vendor/github.com/go-openapi/validate/formats.go
@@ -22,10 +22,32 @@ import (
)
type formatValidator struct {
- Format string
Path string
In string
+ Format string
KnownFormats strfmt.Registry
+ Options *SchemaValidatorOptions
+}
+
+func newFormatValidator(path, in, format string, formats strfmt.Registry, opts *SchemaValidatorOptions) *formatValidator {
+ if opts == nil {
+ opts = new(SchemaValidatorOptions)
+ }
+
+ var f *formatValidator
+ if opts.recycleValidators {
+ f = pools.poolOfFormatValidators.BorrowValidator()
+ } else {
+ f = new(formatValidator)
+ }
+
+ f.Path = path
+ f.In = in
+ f.Format = format
+ f.KnownFormats = formats
+ f.Options = opts
+
+ return f
}
func (f *formatValidator) SetPath(path string) {
@@ -33,37 +55,45 @@ func (f *formatValidator) SetPath(path string) {
}
func (f *formatValidator) Applies(source interface{}, kind reflect.Kind) bool {
- doit := func() bool {
- if source == nil {
- return false
- }
- switch source := source.(type) {
- case *spec.Items:
- return kind == reflect.String && f.KnownFormats.ContainsName(source.Format)
- case *spec.Parameter:
- return kind == reflect.String && f.KnownFormats.ContainsName(source.Format)
- case *spec.Schema:
- return kind == reflect.String && f.KnownFormats.ContainsName(source.Format)
- case *spec.Header:
- return kind == reflect.String && f.KnownFormats.ContainsName(source.Format)
- }
+ if source == nil || f.KnownFormats == nil {
+ return false
+ }
+
+ switch source := source.(type) {
+ case *spec.Items:
+ return kind == reflect.String && f.KnownFormats.ContainsName(source.Format)
+ case *spec.Parameter:
+ return kind == reflect.String && f.KnownFormats.ContainsName(source.Format)
+ case *spec.Schema:
+ return kind == reflect.String && f.KnownFormats.ContainsName(source.Format)
+ case *spec.Header:
+ return kind == reflect.String && f.KnownFormats.ContainsName(source.Format)
+ default:
return false
}
- r := doit()
- debugLog("format validator for %q applies %t for %T (kind: %v)\n", f.Path, r, source, kind)
- return r
}
func (f *formatValidator) Validate(val interface{}) *Result {
- result := new(Result)
- debugLog("validating \"%v\" against format: %s", val, f.Format)
+ if f.Options.recycleValidators {
+ defer func() {
+ f.redeem()
+ }()
+ }
+
+ var result *Result
+ if f.Options.recycleResult {
+ result = pools.poolOfResults.BorrowResult()
+ } else {
+ result = new(Result)
+ }
if err := FormatOf(f.Path, f.In, f.Format, val.(string), f.KnownFormats); err != nil {
result.AddErrors(err)
}
- if result.HasErrors() {
- return result
- }
- return nil
+ return result
+}
+
+func (f *formatValidator) redeem() {
+ pools.poolOfFormatValidators.RedeemValidator(f)
}
diff --git a/api/vendor/github.com/go-openapi/validate/helpers.go b/api/vendor/github.com/go-openapi/validate/helpers.go
index dc376f7f93d3..757e403d912d 100644
--- a/api/vendor/github.com/go-openapi/validate/helpers.go
+++ b/api/vendor/github.com/go-openapi/validate/helpers.go
@@ -101,9 +101,17 @@ type errorHelper struct {
// A collection of unexported helpers for error construction
}
-func (h *errorHelper) sErr(err errors.Error) *Result {
+func (h *errorHelper) sErr(err errors.Error, recycle bool) *Result {
// Builds a Result from standard errors.Error
- return &Result{Errors: []error{err}}
+ var result *Result
+ if recycle {
+ result = pools.poolOfResults.BorrowResult()
+ } else {
+ result = new(Result)
+ }
+ result.Errors = []error{err}
+
+ return result
}
func (h *errorHelper) addPointerError(res *Result, err error, ref string, fromPath string) *Result {
@@ -157,7 +165,7 @@ func (h *valueHelper) asInt64(val interface{}) int64 {
// Number conversion function for int64, without error checking
// (implements an implicit type upgrade).
v := reflect.ValueOf(val)
- switch v.Kind() {
+ switch v.Kind() { //nolint:exhaustive
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
return v.Int()
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
@@ -174,7 +182,7 @@ func (h *valueHelper) asUint64(val interface{}) uint64 {
// Number conversion function for uint64, without error checking
// (implements an implicit type upgrade).
v := reflect.ValueOf(val)
- switch v.Kind() {
+ switch v.Kind() { //nolint:exhaustive
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
return uint64(v.Int())
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
@@ -192,7 +200,7 @@ func (h *valueHelper) asFloat64(val interface{}) float64 {
// Number conversion function for float64, without error checking
// (implements an implicit type upgrade).
v := reflect.ValueOf(val)
- switch v.Kind() {
+ switch v.Kind() { //nolint:exhaustive
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
return float64(v.Int())
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
@@ -225,7 +233,7 @@ func (h *paramHelper) safeExpandedParamsFor(path, method, operationID string, re
operation.Parameters = resolvedParams
for _, ppr := range s.expandedAnalyzer().SafeParamsFor(method, path,
- func(p spec.Parameter, err error) bool {
+ func(_ spec.Parameter, err error) bool {
// since params have already been expanded, there are few causes for error
res.AddErrors(someParametersBrokenMsg(path, method, operationID))
// original error from analyzer
@@ -306,6 +314,7 @@ func (r *responseHelper) expandResponseRef(
errorHelp.addPointerError(res, err, response.Ref.String(), path)
return nil, res
}
+
return response, res
}
diff --git a/api/vendor/github.com/go-openapi/validate/object_validator.go b/api/vendor/github.com/go-openapi/validate/object_validator.go
index 7bb12615d8e2..dff73fa98a15 100644
--- a/api/vendor/github.com/go-openapi/validate/object_validator.go
+++ b/api/vendor/github.com/go-openapi/validate/object_validator.go
@@ -15,8 +15,8 @@
package validate
import (
+ "fmt"
"reflect"
- "regexp"
"strings"
"github.com/go-openapi/errors"
@@ -35,62 +35,116 @@ type objectValidator struct {
PatternProperties map[string]spec.Schema
Root interface{}
KnownFormats strfmt.Registry
- Options SchemaValidatorOptions
+ Options *SchemaValidatorOptions
+ splitPath []string
+}
+
+func newObjectValidator(path, in string,
+ maxProperties, minProperties *int64, required []string, properties spec.SchemaProperties,
+ additionalProperties *spec.SchemaOrBool, patternProperties spec.SchemaProperties,
+ root interface{}, formats strfmt.Registry, opts *SchemaValidatorOptions) *objectValidator {
+ if opts == nil {
+ opts = new(SchemaValidatorOptions)
+ }
+
+ var v *objectValidator
+ if opts.recycleValidators {
+ v = pools.poolOfObjectValidators.BorrowValidator()
+ } else {
+ v = new(objectValidator)
+ }
+
+ v.Path = path
+ v.In = in
+ v.MaxProperties = maxProperties
+ v.MinProperties = minProperties
+ v.Required = required
+ v.Properties = properties
+ v.AdditionalProperties = additionalProperties
+ v.PatternProperties = patternProperties
+ v.Root = root
+ v.KnownFormats = formats
+ v.Options = opts
+ v.splitPath = strings.Split(v.Path, ".")
+
+ return v
}
func (o *objectValidator) SetPath(path string) {
o.Path = path
+ o.splitPath = strings.Split(path, ".")
}
func (o *objectValidator) Applies(source interface{}, kind reflect.Kind) bool {
// TODO: this should also work for structs
// there is a problem in the type validator where it will be unhappy about null values
// so that requires more testing
- r := reflect.TypeOf(source) == specSchemaType && (kind == reflect.Map || kind == reflect.Struct)
- debugLog("object validator for %q applies %t for %T (kind: %v)\n", o.Path, r, source, kind)
- return r
+ _, isSchema := source.(*spec.Schema)
+ return isSchema && (kind == reflect.Map || kind == reflect.Struct)
}
func (o *objectValidator) isProperties() bool {
- p := strings.Split(o.Path, ".")
+ p := o.splitPath
return len(p) > 1 && p[len(p)-1] == jsonProperties && p[len(p)-2] != jsonProperties
}
func (o *objectValidator) isDefault() bool {
- p := strings.Split(o.Path, ".")
+ p := o.splitPath
return len(p) > 1 && p[len(p)-1] == jsonDefault && p[len(p)-2] != jsonDefault
}
func (o *objectValidator) isExample() bool {
- p := strings.Split(o.Path, ".")
+ p := o.splitPath
return len(p) > 1 && (p[len(p)-1] == swaggerExample || p[len(p)-1] == swaggerExamples) && p[len(p)-2] != swaggerExample
}
func (o *objectValidator) checkArrayMustHaveItems(res *Result, val map[string]interface{}) {
// for swagger 2.0 schemas, there is an additional constraint to have array items defined explicitly.
// with pure jsonschema draft 4, one may have arrays with undefined items (i.e. any type).
- if t, typeFound := val[jsonType]; typeFound {
- if tpe, ok := t.(string); ok && tpe == arrayType {
- if item, itemsKeyFound := val[jsonItems]; !itemsKeyFound {
- res.AddErrors(errors.Required(jsonItems, o.Path, item))
- }
- }
+ if val == nil {
+ return
+ }
+
+ t, typeFound := val[jsonType]
+ if !typeFound {
+ return
+ }
+
+ tpe, isString := t.(string)
+ if !isString || tpe != arrayType {
+ return
+ }
+
+ item, itemsKeyFound := val[jsonItems]
+ if itemsKeyFound {
+ return
}
+
+ res.AddErrors(errors.Required(jsonItems, o.Path, item))
}
func (o *objectValidator) checkItemsMustBeTypeArray(res *Result, val map[string]interface{}) {
- if !o.isProperties() && !o.isDefault() && !o.isExample() {
- if _, itemsKeyFound := val[jsonItems]; itemsKeyFound {
- t, typeFound := val[jsonType]
- if typeFound {
- if tpe, ok := t.(string); !ok || tpe != arrayType {
- res.AddErrors(errors.InvalidType(o.Path, o.In, arrayType, nil))
- }
- } else {
- // there is no type
- res.AddErrors(errors.Required(jsonType, o.Path, t))
- }
- }
+ if val == nil {
+ return
+ }
+
+ if o.isProperties() || o.isDefault() || o.isExample() {
+ return
+ }
+
+ _, itemsKeyFound := val[jsonItems]
+ if !itemsKeyFound {
+ return
+ }
+
+ t, typeFound := val[jsonType]
+ if !typeFound {
+ // there is no type
+ res.AddErrors(errors.Required(jsonType, o.Path, t))
+ }
+
+ if tpe, isString := t.(string); !isString || tpe != arrayType {
+ res.AddErrors(errors.InvalidType(o.Path, o.In, arrayType, nil))
}
}
@@ -104,176 +158,274 @@ func (o *objectValidator) precheck(res *Result, val map[string]interface{}) {
}
func (o *objectValidator) Validate(data interface{}) *Result {
- val := data.(map[string]interface{})
- // TODO: guard against nil data
+ if o.Options.recycleValidators {
+ defer func() {
+ o.redeem()
+ }()
+ }
+
+ var val map[string]interface{}
+ if data != nil {
+ var ok bool
+ val, ok = data.(map[string]interface{})
+ if !ok {
+ return errorHelp.sErr(invalidObjectMsg(o.Path, o.In), o.Options.recycleResult)
+ }
+ }
numKeys := int64(len(val))
if o.MinProperties != nil && numKeys < *o.MinProperties {
- return errorHelp.sErr(errors.TooFewProperties(o.Path, o.In, *o.MinProperties))
+ return errorHelp.sErr(errors.TooFewProperties(o.Path, o.In, *o.MinProperties), o.Options.recycleResult)
}
if o.MaxProperties != nil && numKeys > *o.MaxProperties {
- return errorHelp.sErr(errors.TooManyProperties(o.Path, o.In, *o.MaxProperties))
+ return errorHelp.sErr(errors.TooManyProperties(o.Path, o.In, *o.MaxProperties), o.Options.recycleResult)
}
- res := new(Result)
+ var res *Result
+ if o.Options.recycleResult {
+ res = pools.poolOfResults.BorrowResult()
+ } else {
+ res = new(Result)
+ }
o.precheck(res, val)
// check validity of field names
if o.AdditionalProperties != nil && !o.AdditionalProperties.Allows {
// Case: additionalProperties: false
- for k := range val {
- _, regularProperty := o.Properties[k]
- matched := false
-
- for pk := range o.PatternProperties {
- if matches, _ := regexp.MatchString(pk, k); matches {
- matched = true
- break
- }
+ o.validateNoAdditionalProperties(val, res)
+ } else {
+ // Cases: empty additionalProperties (implying: true), or additionalProperties: true, or additionalProperties: { <> }
+ o.validateAdditionalProperties(val, res)
+ }
+
+ o.validatePropertiesSchema(val, res)
+
+ // Check patternProperties
+ // TODO: it looks like we have done that twice in many cases
+ for key, value := range val {
+ _, regularProperty := o.Properties[key]
+ matched, _, patterns := o.validatePatternProperty(key, value, res) // applies to regular properties as well
+ if regularProperty || !matched {
+ continue
+ }
+
+ for _, pName := range patterns {
+ if v, ok := o.PatternProperties[pName]; ok {
+ r := newSchemaValidator(&v, o.Root, o.Path+"."+key, o.KnownFormats, o.Options).Validate(value)
+ res.mergeForField(data.(map[string]interface{}), key, r)
}
+ }
+ }
- if !regularProperty && k != "$schema" && k != "id" && !matched {
- // Special properties "$schema" and "id" are ignored
- res.AddErrors(errors.PropertyNotAllowed(o.Path, o.In, k))
-
- // BUG(fredbi): This section should move to a part dedicated to spec validation as
- // it will conflict with regular schemas where a property "headers" is defined.
-
- //
- // Croaks a more explicit message on top of the standard one
- // on some recognized cases.
- //
- // NOTE: edge cases with invalid type assertion are simply ignored here.
- // NOTE: prefix your messages here by "IMPORTANT!" so there are not filtered
- // by higher level callers (the IMPORTANT! tag will be eventually
- // removed).
- if k == "headers" && val[k] != nil {
- // $ref is forbidden in header
- if headers, mapOk := val[k].(map[string]interface{}); mapOk {
- for headerKey, headerBody := range headers {
- if headerBody != nil {
- if headerSchema, mapOfMapOk := headerBody.(map[string]interface{}); mapOfMapOk {
- if _, found := headerSchema["$ref"]; found {
- var msg string
- if refString, stringOk := headerSchema["$ref"].(string); stringOk {
- msg = strings.Join([]string{", one may not use $ref=\":", refString, "\""}, "")
- }
- res.AddErrors(refNotAllowedInHeaderMsg(o.Path, headerKey, msg))
- }
- }
- }
- }
- }
- /*
- case "$ref":
- if val[k] != nil {
- // TODO: check context of that ref: warn about siblings, check against invalid context
- }
- */
- }
+ return res
+}
+
+func (o *objectValidator) validateNoAdditionalProperties(val map[string]interface{}, res *Result) {
+ for k := range val {
+ if k == "$schema" || k == "id" {
+ // special properties "$schema" and "id" are ignored
+ continue
+ }
+
+ _, regularProperty := o.Properties[k]
+ if regularProperty {
+ continue
+ }
+
+ matched := false
+ for pk := range o.PatternProperties {
+ re, err := compileRegexp(pk)
+ if err != nil {
+ continue
+ }
+ if matches := re.MatchString(k); matches {
+ matched = true
+ break
}
}
- } else {
- // Cases: no additionalProperties (implying: true), or additionalProperties: true, or additionalProperties: { <> }
- for key, value := range val {
- _, regularProperty := o.Properties[key]
-
- // Validates property against "patternProperties" if applicable
- // BUG(fredbi): succeededOnce is always false
-
- // NOTE: how about regular properties which do not match patternProperties?
- matched, succeededOnce, _ := o.validatePatternProperty(key, value, res)
-
- if !(regularProperty || matched || succeededOnce) {
-
- // Cases: properties which are not regular properties and have not been matched by the PatternProperties validator
- if o.AdditionalProperties != nil && o.AdditionalProperties.Schema != nil {
- // AdditionalProperties as Schema
- r := NewSchemaValidator(o.AdditionalProperties.Schema, o.Root, o.Path+"."+key, o.KnownFormats, o.Options.Options()...).Validate(value)
- res.mergeForField(data.(map[string]interface{}), key, r)
- } else if regularProperty && !(matched || succeededOnce) {
- // TODO: this is dead code since regularProperty=false here
- res.AddErrors(errors.FailedAllPatternProperties(o.Path, o.In, key))
- }
+ if matched {
+ continue
+ }
+
+ res.AddErrors(errors.PropertyNotAllowed(o.Path, o.In, k))
+
+ // BUG(fredbi): This section should move to a part dedicated to spec validation as
+ // it will conflict with regular schemas where a property "headers" is defined.
+
+ //
+ // Croaks a more explicit message on top of the standard one
+ // on some recognized cases.
+ //
+ // NOTE: edge cases with invalid type assertion are simply ignored here.
+ // NOTE: prefix your messages here by "IMPORTANT!" so there are not filtered
+ // by higher level callers (the IMPORTANT! tag will be eventually
+ // removed).
+ if k != "headers" || val[k] == nil {
+ continue
+ }
+
+ // $ref is forbidden in header
+ headers, mapOk := val[k].(map[string]interface{})
+ if !mapOk {
+ continue
+ }
+
+ for headerKey, headerBody := range headers {
+ if headerBody == nil {
+ continue
+ }
+
+ headerSchema, mapOfMapOk := headerBody.(map[string]interface{})
+ if !mapOfMapOk {
+ continue
+ }
+
+ _, found := headerSchema["$ref"]
+ if !found {
+ continue
+ }
+
+ refString, stringOk := headerSchema["$ref"].(string)
+ if !stringOk {
+ continue
}
+
+ msg := strings.Join([]string{", one may not use $ref=\":", refString, "\""}, "")
+ res.AddErrors(refNotAllowedInHeaderMsg(o.Path, headerKey, msg))
+ /*
+ case "$ref":
+ if val[k] != nil {
+ // TODO: check context of that ref: warn about siblings, check against invalid context
+ }
+ */
+ }
+ }
+}
+
+func (o *objectValidator) validateAdditionalProperties(val map[string]interface{}, res *Result) {
+ for key, value := range val {
+ _, regularProperty := o.Properties[key]
+ if regularProperty {
+ continue
+ }
+
+ // Validates property against "patternProperties" if applicable
+ // BUG(fredbi): succeededOnce is always false
+
+ // NOTE: how about regular properties which do not match patternProperties?
+ matched, succeededOnce, _ := o.validatePatternProperty(key, value, res)
+ if matched || succeededOnce {
+ continue
+ }
+
+ if o.AdditionalProperties == nil || o.AdditionalProperties.Schema == nil {
+ continue
}
- // Valid cases: additionalProperties: true or undefined
+
+ // Cases: properties which are not regular properties and have not been matched by the PatternProperties validator
+ // AdditionalProperties as Schema
+ r := newSchemaValidator(o.AdditionalProperties.Schema, o.Root, o.Path+"."+key, o.KnownFormats, o.Options).Validate(value)
+ res.mergeForField(val, key, r)
}
+ // Valid cases: additionalProperties: true or undefined
+}
- createdFromDefaults := map[string]bool{}
+func (o *objectValidator) validatePropertiesSchema(val map[string]interface{}, res *Result) {
+ createdFromDefaults := map[string]struct{}{}
// Property types:
// - regular Property
+ pSchema := pools.poolOfSchemas.BorrowSchema() // recycle a spec.Schema object which lifespan extends only to the validation of properties
+ defer func() {
+ pools.poolOfSchemas.RedeemSchema(pSchema)
+ }()
+
for pName := range o.Properties {
- pSchema := o.Properties[pName] // one instance per iteration
- rName := pName
- if o.Path != "" {
+ *pSchema = o.Properties[pName]
+ var rName string
+ if o.Path == "" {
+ rName = pName
+ } else {
rName = o.Path + "." + pName
}
// Recursively validates each property against its schema
- if v, ok := val[pName]; ok {
- r := NewSchemaValidator(&pSchema, o.Root, rName, o.KnownFormats, o.Options.Options()...).Validate(v)
- res.mergeForField(data.(map[string]interface{}), pName, r)
- } else if pSchema.Default != nil {
- // If a default value is defined, creates the property from defaults
- // NOTE: JSON schema does not enforce default values to be valid against schema. Swagger does.
- createdFromDefaults[pName] = true
- res.addPropertySchemata(data.(map[string]interface{}), pName, &pSchema)
+ v, ok := val[pName]
+ if ok {
+ r := newSchemaValidator(pSchema, o.Root, rName, o.KnownFormats, o.Options).Validate(v)
+ res.mergeForField(val, pName, r)
+
+ continue
}
- }
- // Check required properties
- if len(o.Required) > 0 {
- for _, k := range o.Required {
- if v, ok := val[k]; !ok && !createdFromDefaults[k] {
- res.AddErrors(errors.Required(o.Path+"."+k, o.In, v))
- continue
+ if pSchema.Default != nil {
+ // if a default value is defined, creates the property from defaults
+ // NOTE: JSON schema does not enforce default values to be valid against schema. Swagger does.
+ createdFromDefaults[pName] = struct{}{}
+ if !o.Options.skipSchemataResult {
+ res.addPropertySchemata(val, pName, pSchema) // this shallow-clones the content of the pSchema pointer
}
}
}
- // Check patternProperties
- // TODO: it looks like we have done that twice in many cases
- for key, value := range val {
- _, regularProperty := o.Properties[key]
- matched, _ /*succeededOnce*/, patterns := o.validatePatternProperty(key, value, res)
- if !regularProperty && (matched /*|| succeededOnce*/) {
- for _, pName := range patterns {
- if v, ok := o.PatternProperties[pName]; ok {
- r := NewSchemaValidator(&v, o.Root, o.Path+"."+key, o.KnownFormats, o.Options.Options()...).Validate(value)
- res.mergeForField(data.(map[string]interface{}), key, r)
- }
- }
+ if len(o.Required) == 0 {
+ return
+ }
+
+ // Check required properties
+ for _, k := range o.Required {
+ v, ok := val[k]
+ if ok {
+ continue
+ }
+ _, isCreatedFromDefaults := createdFromDefaults[k]
+ if isCreatedFromDefaults {
+ continue
}
+
+ res.AddErrors(errors.Required(fmt.Sprintf("%s.%s", o.Path, k), o.In, v))
}
- return res
}
// TODO: succeededOnce is not used anywhere
func (o *objectValidator) validatePatternProperty(key string, value interface{}, result *Result) (bool, bool, []string) {
+ if len(o.PatternProperties) == 0 {
+ return false, false, nil
+ }
+
matched := false
succeededOnce := false
- var patterns []string
+ patterns := make([]string, 0, len(o.PatternProperties))
- for k, schema := range o.PatternProperties {
- sch := schema
- if match, _ := regexp.MatchString(k, key); match {
- patterns = append(patterns, k)
- matched = true
- validator := NewSchemaValidator(&sch, o.Root, o.Path+"."+key, o.KnownFormats, o.Options.Options()...)
+ schema := pools.poolOfSchemas.BorrowSchema()
+ defer func() {
+ pools.poolOfSchemas.RedeemSchema(schema)
+ }()
- res := validator.Validate(value)
- result.Merge(res)
+ for k := range o.PatternProperties {
+ re, err := compileRegexp(k)
+ if err != nil {
+ continue
}
- }
- // BUG(fredbi): can't get to here. Should remove dead code (commented out).
+ match := re.MatchString(key)
+ if !match {
+ continue
+ }
- // if succeededOnce {
- // result.Inc()
- // }
+ *schema = o.PatternProperties[k]
+ patterns = append(patterns, k)
+ matched = true
+ validator := newSchemaValidator(schema, o.Root, fmt.Sprintf("%s.%s", o.Path, key), o.KnownFormats, o.Options)
+
+ res := validator.Validate(value)
+ result.Merge(res)
+ }
return matched, succeededOnce, patterns
}
+
+func (o *objectValidator) redeem() {
+ pools.poolOfObjectValidators.RedeemValidator(o)
+}
diff --git a/api/vendor/github.com/go-openapi/validate/options.go b/api/vendor/github.com/go-openapi/validate/options.go
index 8a22ce991148..cfe9b0660f60 100644
--- a/api/vendor/github.com/go-openapi/validate/options.go
+++ b/api/vendor/github.com/go-openapi/validate/options.go
@@ -31,6 +31,7 @@ type Opts struct {
// GET:/v1/{shelve} and GET:/v1/{book}, where the IDs are "shelve/*" and
// /"shelve/*/book/*" respectively.
StrictPathParamUniqueness bool
+ SkipSchemataResult bool
}
var (
diff --git a/api/vendor/github.com/go-openapi/validate/pools.go b/api/vendor/github.com/go-openapi/validate/pools.go
new file mode 100644
index 000000000000..3ddce4dcc2b4
--- /dev/null
+++ b/api/vendor/github.com/go-openapi/validate/pools.go
@@ -0,0 +1,366 @@
+//go:build !validatedebug
+
+package validate
+
+import (
+ "sync"
+
+ "github.com/go-openapi/spec"
+)
+
+var pools allPools
+
+func init() {
+ resetPools()
+}
+
+func resetPools() {
+ // NOTE: for testing purpose, we might want to reset pools after calling Validate twice.
+ // The pool is corrupted in that case: calling Put twice inserts a duplicate in the pool
+ // and further calls to Get are mishandled.
+
+ pools = allPools{
+ poolOfSchemaValidators: schemaValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &SchemaValidator{}
+
+ return s
+ },
+ },
+ },
+ poolOfObjectValidators: objectValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &objectValidator{}
+
+ return s
+ },
+ },
+ },
+ poolOfSliceValidators: sliceValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &schemaSliceValidator{}
+
+ return s
+ },
+ },
+ },
+ poolOfItemsValidators: itemsValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &itemsValidator{}
+
+ return s
+ },
+ },
+ },
+ poolOfBasicCommonValidators: basicCommonValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &basicCommonValidator{}
+
+ return s
+ },
+ },
+ },
+ poolOfHeaderValidators: headerValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &HeaderValidator{}
+
+ return s
+ },
+ },
+ },
+ poolOfParamValidators: paramValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &ParamValidator{}
+
+ return s
+ },
+ },
+ },
+ poolOfBasicSliceValidators: basicSliceValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &basicSliceValidator{}
+
+ return s
+ },
+ },
+ },
+ poolOfNumberValidators: numberValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &numberValidator{}
+
+ return s
+ },
+ },
+ },
+ poolOfStringValidators: stringValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &stringValidator{}
+
+ return s
+ },
+ },
+ },
+ poolOfSchemaPropsValidators: schemaPropsValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &schemaPropsValidator{}
+
+ return s
+ },
+ },
+ },
+ poolOfFormatValidators: formatValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &formatValidator{}
+
+ return s
+ },
+ },
+ },
+ poolOfTypeValidators: typeValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &typeValidator{}
+
+ return s
+ },
+ },
+ },
+ poolOfSchemas: schemasPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &spec.Schema{}
+
+ return s
+ },
+ },
+ },
+ poolOfResults: resultsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &Result{}
+
+ return s
+ },
+ },
+ },
+ }
+}
+
+type (
+ allPools struct {
+ // memory pools for all validator objects.
+ //
+ // Each pool can be borrowed from and redeemed to.
+ poolOfSchemaValidators schemaValidatorsPool
+ poolOfObjectValidators objectValidatorsPool
+ poolOfSliceValidators sliceValidatorsPool
+ poolOfItemsValidators itemsValidatorsPool
+ poolOfBasicCommonValidators basicCommonValidatorsPool
+ poolOfHeaderValidators headerValidatorsPool
+ poolOfParamValidators paramValidatorsPool
+ poolOfBasicSliceValidators basicSliceValidatorsPool
+ poolOfNumberValidators numberValidatorsPool
+ poolOfStringValidators stringValidatorsPool
+ poolOfSchemaPropsValidators schemaPropsValidatorsPool
+ poolOfFormatValidators formatValidatorsPool
+ poolOfTypeValidators typeValidatorsPool
+ poolOfSchemas schemasPool
+ poolOfResults resultsPool
+ }
+
+ schemaValidatorsPool struct {
+ *sync.Pool
+ }
+
+ objectValidatorsPool struct {
+ *sync.Pool
+ }
+
+ sliceValidatorsPool struct {
+ *sync.Pool
+ }
+
+ itemsValidatorsPool struct {
+ *sync.Pool
+ }
+
+ basicCommonValidatorsPool struct {
+ *sync.Pool
+ }
+
+ headerValidatorsPool struct {
+ *sync.Pool
+ }
+
+ paramValidatorsPool struct {
+ *sync.Pool
+ }
+
+ basicSliceValidatorsPool struct {
+ *sync.Pool
+ }
+
+ numberValidatorsPool struct {
+ *sync.Pool
+ }
+
+ stringValidatorsPool struct {
+ *sync.Pool
+ }
+
+ schemaPropsValidatorsPool struct {
+ *sync.Pool
+ }
+
+ formatValidatorsPool struct {
+ *sync.Pool
+ }
+
+ typeValidatorsPool struct {
+ *sync.Pool
+ }
+
+ schemasPool struct {
+ *sync.Pool
+ }
+
+ resultsPool struct {
+ *sync.Pool
+ }
+)
+
+func (p schemaValidatorsPool) BorrowValidator() *SchemaValidator {
+ return p.Get().(*SchemaValidator)
+}
+
+func (p schemaValidatorsPool) RedeemValidator(s *SchemaValidator) {
+ // NOTE: s might be nil. In that case, Put is a noop.
+ p.Put(s)
+}
+
+func (p objectValidatorsPool) BorrowValidator() *objectValidator {
+ return p.Get().(*objectValidator)
+}
+
+func (p objectValidatorsPool) RedeemValidator(s *objectValidator) {
+ p.Put(s)
+}
+
+func (p sliceValidatorsPool) BorrowValidator() *schemaSliceValidator {
+ return p.Get().(*schemaSliceValidator)
+}
+
+func (p sliceValidatorsPool) RedeemValidator(s *schemaSliceValidator) {
+ p.Put(s)
+}
+
+func (p itemsValidatorsPool) BorrowValidator() *itemsValidator {
+ return p.Get().(*itemsValidator)
+}
+
+func (p itemsValidatorsPool) RedeemValidator(s *itemsValidator) {
+ p.Put(s)
+}
+
+func (p basicCommonValidatorsPool) BorrowValidator() *basicCommonValidator {
+ return p.Get().(*basicCommonValidator)
+}
+
+func (p basicCommonValidatorsPool) RedeemValidator(s *basicCommonValidator) {
+ p.Put(s)
+}
+
+func (p headerValidatorsPool) BorrowValidator() *HeaderValidator {
+ return p.Get().(*HeaderValidator)
+}
+
+func (p headerValidatorsPool) RedeemValidator(s *HeaderValidator) {
+ p.Put(s)
+}
+
+func (p paramValidatorsPool) BorrowValidator() *ParamValidator {
+ return p.Get().(*ParamValidator)
+}
+
+func (p paramValidatorsPool) RedeemValidator(s *ParamValidator) {
+ p.Put(s)
+}
+
+func (p basicSliceValidatorsPool) BorrowValidator() *basicSliceValidator {
+ return p.Get().(*basicSliceValidator)
+}
+
+func (p basicSliceValidatorsPool) RedeemValidator(s *basicSliceValidator) {
+ p.Put(s)
+}
+
+func (p numberValidatorsPool) BorrowValidator() *numberValidator {
+ return p.Get().(*numberValidator)
+}
+
+func (p numberValidatorsPool) RedeemValidator(s *numberValidator) {
+ p.Put(s)
+}
+
+func (p stringValidatorsPool) BorrowValidator() *stringValidator {
+ return p.Get().(*stringValidator)
+}
+
+func (p stringValidatorsPool) RedeemValidator(s *stringValidator) {
+ p.Put(s)
+}
+
+func (p schemaPropsValidatorsPool) BorrowValidator() *schemaPropsValidator {
+ return p.Get().(*schemaPropsValidator)
+}
+
+func (p schemaPropsValidatorsPool) RedeemValidator(s *schemaPropsValidator) {
+ p.Put(s)
+}
+
+func (p formatValidatorsPool) BorrowValidator() *formatValidator {
+ return p.Get().(*formatValidator)
+}
+
+func (p formatValidatorsPool) RedeemValidator(s *formatValidator) {
+ p.Put(s)
+}
+
+func (p typeValidatorsPool) BorrowValidator() *typeValidator {
+ return p.Get().(*typeValidator)
+}
+
+func (p typeValidatorsPool) RedeemValidator(s *typeValidator) {
+ p.Put(s)
+}
+
+func (p schemasPool) BorrowSchema() *spec.Schema {
+ return p.Get().(*spec.Schema)
+}
+
+func (p schemasPool) RedeemSchema(s *spec.Schema) {
+ p.Put(s)
+}
+
+func (p resultsPool) BorrowResult() *Result {
+ return p.Get().(*Result).cleared()
+}
+
+func (p resultsPool) RedeemResult(s *Result) {
+ if s == emptyResult {
+ return
+ }
+ p.Put(s)
+}
diff --git a/api/vendor/github.com/go-openapi/validate/pools_debug.go b/api/vendor/github.com/go-openapi/validate/pools_debug.go
new file mode 100644
index 000000000000..12949f02a7e9
--- /dev/null
+++ b/api/vendor/github.com/go-openapi/validate/pools_debug.go
@@ -0,0 +1,1012 @@
+//go:build validatedebug
+
+package validate
+
+import (
+ "fmt"
+ "runtime"
+ "sync"
+ "testing"
+
+ "github.com/go-openapi/spec"
+)
+
+// This version of the pools is to be used for debugging and testing, with build tag "validatedebug".
+//
+// In this mode, the pools are tracked for allocation and redemption of borrowed objects, so we can
+// verify a few behaviors of the validators. The debug pools panic when an invalid usage pattern is detected.
+
+var pools allPools
+
+func init() {
+ resetPools()
+}
+
+func resetPools() {
+ // NOTE: for testing purpose, we might want to reset pools after calling Validate twice.
+ // The pool is corrupted in that case: calling Put twice inserts a duplicate in the pool
+ // and further calls to Get are mishandled.
+
+ pools = allPools{
+ poolOfSchemaValidators: schemaValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &SchemaValidator{}
+
+ return s
+ },
+ },
+ debugMap: make(map[*SchemaValidator]status),
+ allocMap: make(map[*SchemaValidator]string),
+ redeemMap: make(map[*SchemaValidator]string),
+ },
+ poolOfObjectValidators: objectValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &objectValidator{}
+
+ return s
+ },
+ },
+ debugMap: make(map[*objectValidator]status),
+ allocMap: make(map[*objectValidator]string),
+ redeemMap: make(map[*objectValidator]string),
+ },
+ poolOfSliceValidators: sliceValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &schemaSliceValidator{}
+
+ return s
+ },
+ },
+ debugMap: make(map[*schemaSliceValidator]status),
+ allocMap: make(map[*schemaSliceValidator]string),
+ redeemMap: make(map[*schemaSliceValidator]string),
+ },
+ poolOfItemsValidators: itemsValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &itemsValidator{}
+
+ return s
+ },
+ },
+ debugMap: make(map[*itemsValidator]status),
+ allocMap: make(map[*itemsValidator]string),
+ redeemMap: make(map[*itemsValidator]string),
+ },
+ poolOfBasicCommonValidators: basicCommonValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &basicCommonValidator{}
+
+ return s
+ },
+ },
+ debugMap: make(map[*basicCommonValidator]status),
+ allocMap: make(map[*basicCommonValidator]string),
+ redeemMap: make(map[*basicCommonValidator]string),
+ },
+ poolOfHeaderValidators: headerValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &HeaderValidator{}
+
+ return s
+ },
+ },
+ debugMap: make(map[*HeaderValidator]status),
+ allocMap: make(map[*HeaderValidator]string),
+ redeemMap: make(map[*HeaderValidator]string),
+ },
+ poolOfParamValidators: paramValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &ParamValidator{}
+
+ return s
+ },
+ },
+ debugMap: make(map[*ParamValidator]status),
+ allocMap: make(map[*ParamValidator]string),
+ redeemMap: make(map[*ParamValidator]string),
+ },
+ poolOfBasicSliceValidators: basicSliceValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &basicSliceValidator{}
+
+ return s
+ },
+ },
+ debugMap: make(map[*basicSliceValidator]status),
+ allocMap: make(map[*basicSliceValidator]string),
+ redeemMap: make(map[*basicSliceValidator]string),
+ },
+ poolOfNumberValidators: numberValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &numberValidator{}
+
+ return s
+ },
+ },
+ debugMap: make(map[*numberValidator]status),
+ allocMap: make(map[*numberValidator]string),
+ redeemMap: make(map[*numberValidator]string),
+ },
+ poolOfStringValidators: stringValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &stringValidator{}
+
+ return s
+ },
+ },
+ debugMap: make(map[*stringValidator]status),
+ allocMap: make(map[*stringValidator]string),
+ redeemMap: make(map[*stringValidator]string),
+ },
+ poolOfSchemaPropsValidators: schemaPropsValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &schemaPropsValidator{}
+
+ return s
+ },
+ },
+ debugMap: make(map[*schemaPropsValidator]status),
+ allocMap: make(map[*schemaPropsValidator]string),
+ redeemMap: make(map[*schemaPropsValidator]string),
+ },
+ poolOfFormatValidators: formatValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &formatValidator{}
+
+ return s
+ },
+ },
+ debugMap: make(map[*formatValidator]status),
+ allocMap: make(map[*formatValidator]string),
+ redeemMap: make(map[*formatValidator]string),
+ },
+ poolOfTypeValidators: typeValidatorsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &typeValidator{}
+
+ return s
+ },
+ },
+ debugMap: make(map[*typeValidator]status),
+ allocMap: make(map[*typeValidator]string),
+ redeemMap: make(map[*typeValidator]string),
+ },
+ poolOfSchemas: schemasPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &spec.Schema{}
+
+ return s
+ },
+ },
+ debugMap: make(map[*spec.Schema]status),
+ allocMap: make(map[*spec.Schema]string),
+ redeemMap: make(map[*spec.Schema]string),
+ },
+ poolOfResults: resultsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := &Result{}
+
+ return s
+ },
+ },
+ debugMap: make(map[*Result]status),
+ allocMap: make(map[*Result]string),
+ redeemMap: make(map[*Result]string),
+ },
+ }
+}
+
+const (
+ statusFresh status = iota + 1
+ statusRecycled
+ statusRedeemed
+)
+
+func (s status) String() string {
+ switch s {
+ case statusFresh:
+ return "fresh"
+ case statusRecycled:
+ return "recycled"
+ case statusRedeemed:
+ return "redeemed"
+ default:
+ panic(fmt.Errorf("invalid status: %d", s))
+ }
+}
+
+type (
+ // Debug
+ status uint8
+
+ allPools struct {
+ // memory pools for all validator objects.
+ //
+ // Each pool can be borrowed from and redeemed to.
+ poolOfSchemaValidators schemaValidatorsPool
+ poolOfObjectValidators objectValidatorsPool
+ poolOfSliceValidators sliceValidatorsPool
+ poolOfItemsValidators itemsValidatorsPool
+ poolOfBasicCommonValidators basicCommonValidatorsPool
+ poolOfHeaderValidators headerValidatorsPool
+ poolOfParamValidators paramValidatorsPool
+ poolOfBasicSliceValidators basicSliceValidatorsPool
+ poolOfNumberValidators numberValidatorsPool
+ poolOfStringValidators stringValidatorsPool
+ poolOfSchemaPropsValidators schemaPropsValidatorsPool
+ poolOfFormatValidators formatValidatorsPool
+ poolOfTypeValidators typeValidatorsPool
+ poolOfSchemas schemasPool
+ poolOfResults resultsPool
+ }
+
+ schemaValidatorsPool struct {
+ *sync.Pool
+ debugMap map[*SchemaValidator]status
+ allocMap map[*SchemaValidator]string
+ redeemMap map[*SchemaValidator]string
+ mx sync.Mutex
+ }
+
+ objectValidatorsPool struct {
+ *sync.Pool
+ debugMap map[*objectValidator]status
+ allocMap map[*objectValidator]string
+ redeemMap map[*objectValidator]string
+ mx sync.Mutex
+ }
+
+ sliceValidatorsPool struct {
+ *sync.Pool
+ debugMap map[*schemaSliceValidator]status
+ allocMap map[*schemaSliceValidator]string
+ redeemMap map[*schemaSliceValidator]string
+ mx sync.Mutex
+ }
+
+ itemsValidatorsPool struct {
+ *sync.Pool
+ debugMap map[*itemsValidator]status
+ allocMap map[*itemsValidator]string
+ redeemMap map[*itemsValidator]string
+ mx sync.Mutex
+ }
+
+ basicCommonValidatorsPool struct {
+ *sync.Pool
+ debugMap map[*basicCommonValidator]status
+ allocMap map[*basicCommonValidator]string
+ redeemMap map[*basicCommonValidator]string
+ mx sync.Mutex
+ }
+
+ headerValidatorsPool struct {
+ *sync.Pool
+ debugMap map[*HeaderValidator]status
+ allocMap map[*HeaderValidator]string
+ redeemMap map[*HeaderValidator]string
+ mx sync.Mutex
+ }
+
+ paramValidatorsPool struct {
+ *sync.Pool
+ debugMap map[*ParamValidator]status
+ allocMap map[*ParamValidator]string
+ redeemMap map[*ParamValidator]string
+ mx sync.Mutex
+ }
+
+ basicSliceValidatorsPool struct {
+ *sync.Pool
+ debugMap map[*basicSliceValidator]status
+ allocMap map[*basicSliceValidator]string
+ redeemMap map[*basicSliceValidator]string
+ mx sync.Mutex
+ }
+
+ numberValidatorsPool struct {
+ *sync.Pool
+ debugMap map[*numberValidator]status
+ allocMap map[*numberValidator]string
+ redeemMap map[*numberValidator]string
+ mx sync.Mutex
+ }
+
+ stringValidatorsPool struct {
+ *sync.Pool
+ debugMap map[*stringValidator]status
+ allocMap map[*stringValidator]string
+ redeemMap map[*stringValidator]string
+ mx sync.Mutex
+ }
+
+ schemaPropsValidatorsPool struct {
+ *sync.Pool
+ debugMap map[*schemaPropsValidator]status
+ allocMap map[*schemaPropsValidator]string
+ redeemMap map[*schemaPropsValidator]string
+ mx sync.Mutex
+ }
+
+ formatValidatorsPool struct {
+ *sync.Pool
+ debugMap map[*formatValidator]status
+ allocMap map[*formatValidator]string
+ redeemMap map[*formatValidator]string
+ mx sync.Mutex
+ }
+
+ typeValidatorsPool struct {
+ *sync.Pool
+ debugMap map[*typeValidator]status
+ allocMap map[*typeValidator]string
+ redeemMap map[*typeValidator]string
+ mx sync.Mutex
+ }
+
+ schemasPool struct {
+ *sync.Pool
+ debugMap map[*spec.Schema]status
+ allocMap map[*spec.Schema]string
+ redeemMap map[*spec.Schema]string
+ mx sync.Mutex
+ }
+
+ resultsPool struct {
+ *sync.Pool
+ debugMap map[*Result]status
+ allocMap map[*Result]string
+ redeemMap map[*Result]string
+ mx sync.Mutex
+ }
+)
+
+func (p *schemaValidatorsPool) BorrowValidator() *SchemaValidator {
+ s := p.Get().(*SchemaValidator)
+
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ p.debugMap[s] = statusFresh
+ } else {
+ if x != statusRedeemed {
+ panic("recycled schema should have been redeemed")
+ }
+ p.debugMap[s] = statusRecycled
+ }
+ p.allocMap[s] = caller()
+
+ return s
+}
+
+func (p *schemaValidatorsPool) RedeemValidator(s *SchemaValidator) {
+ // NOTE: s might be nil. In that case, Put is a noop.
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ panic("redeemed schema should have been allocated")
+ }
+ if x != statusRecycled && x != statusFresh {
+ panic("redeemed schema should have been allocated from a fresh or recycled pointer")
+ }
+ p.debugMap[s] = statusRedeemed
+ p.redeemMap[s] = caller()
+ p.Put(s)
+}
+
+func (p *objectValidatorsPool) BorrowValidator() *objectValidator {
+ s := p.Get().(*objectValidator)
+
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ p.debugMap[s] = statusFresh
+ } else {
+ if x != statusRedeemed {
+ panic("recycled object should have been redeemed")
+ }
+ p.debugMap[s] = statusRecycled
+ }
+ p.allocMap[s] = caller()
+
+ return s
+}
+
+func (p *objectValidatorsPool) RedeemValidator(s *objectValidator) {
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ panic("redeemed object should have been allocated")
+ }
+ if x != statusRecycled && x != statusFresh {
+ panic("redeemed object should have been allocated from a fresh or recycled pointer")
+ }
+ p.debugMap[s] = statusRedeemed
+ p.redeemMap[s] = caller()
+ p.Put(s)
+}
+
+func (p *sliceValidatorsPool) BorrowValidator() *schemaSliceValidator {
+ s := p.Get().(*schemaSliceValidator)
+
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ p.debugMap[s] = statusFresh
+ } else {
+ if x != statusRedeemed {
+ panic("recycled schemaSliceValidator should have been redeemed")
+ }
+ p.debugMap[s] = statusRecycled
+ }
+ p.allocMap[s] = caller()
+
+ return s
+}
+
+func (p *sliceValidatorsPool) RedeemValidator(s *schemaSliceValidator) {
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ panic("redeemed schemaSliceValidator should have been allocated")
+ }
+ if x != statusRecycled && x != statusFresh {
+ panic("redeemed schemaSliceValidator should have been allocated from a fresh or recycled pointer")
+ }
+ p.debugMap[s] = statusRedeemed
+ p.redeemMap[s] = caller()
+ p.Put(s)
+}
+
+func (p *itemsValidatorsPool) BorrowValidator() *itemsValidator {
+ s := p.Get().(*itemsValidator)
+
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ p.debugMap[s] = statusFresh
+ } else {
+ if x != statusRedeemed {
+ panic("recycled itemsValidator should have been redeemed")
+ }
+ p.debugMap[s] = statusRecycled
+ }
+ p.allocMap[s] = caller()
+
+ return s
+}
+
+func (p *itemsValidatorsPool) RedeemValidator(s *itemsValidator) {
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ panic("redeemed itemsValidator should have been allocated")
+ }
+ if x != statusRecycled && x != statusFresh {
+ panic("redeemed itemsValidator should have been allocated from a fresh or recycled pointer")
+ }
+ p.debugMap[s] = statusRedeemed
+ p.redeemMap[s] = caller()
+ p.Put(s)
+}
+
+func (p *basicCommonValidatorsPool) BorrowValidator() *basicCommonValidator {
+ s := p.Get().(*basicCommonValidator)
+
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ p.debugMap[s] = statusFresh
+ } else {
+ if x != statusRedeemed {
+ panic("recycled basicCommonValidator should have been redeemed")
+ }
+ p.debugMap[s] = statusRecycled
+ }
+ p.allocMap[s] = caller()
+
+ return s
+}
+
+func (p *basicCommonValidatorsPool) RedeemValidator(s *basicCommonValidator) {
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ panic("redeemed basicCommonValidator should have been allocated")
+ }
+ if x != statusRecycled && x != statusFresh {
+ panic("redeemed basicCommonValidator should have been allocated from a fresh or recycled pointer")
+ }
+ p.debugMap[s] = statusRedeemed
+ p.redeemMap[s] = caller()
+ p.Put(s)
+}
+
+func (p *headerValidatorsPool) BorrowValidator() *HeaderValidator {
+ s := p.Get().(*HeaderValidator)
+
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ p.debugMap[s] = statusFresh
+ } else {
+ if x != statusRedeemed {
+ panic("recycled HeaderValidator should have been redeemed")
+ }
+ p.debugMap[s] = statusRecycled
+ }
+ p.allocMap[s] = caller()
+
+ return s
+}
+
+func (p *headerValidatorsPool) RedeemValidator(s *HeaderValidator) {
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ panic("redeemed header should have been allocated")
+ }
+ if x != statusRecycled && x != statusFresh {
+ panic("redeemed header should have been allocated from a fresh or recycled pointer")
+ }
+ p.debugMap[s] = statusRedeemed
+ p.redeemMap[s] = caller()
+ p.Put(s)
+}
+
+func (p *paramValidatorsPool) BorrowValidator() *ParamValidator {
+ s := p.Get().(*ParamValidator)
+
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ p.debugMap[s] = statusFresh
+ } else {
+ if x != statusRedeemed {
+ panic("recycled param should have been redeemed")
+ }
+ p.debugMap[s] = statusRecycled
+ }
+ p.allocMap[s] = caller()
+
+ return s
+}
+
+func (p *paramValidatorsPool) RedeemValidator(s *ParamValidator) {
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ panic("redeemed param should have been allocated")
+ }
+ if x != statusRecycled && x != statusFresh {
+ panic("redeemed param should have been allocated from a fresh or recycled pointer")
+ }
+ p.debugMap[s] = statusRedeemed
+ p.redeemMap[s] = caller()
+ p.Put(s)
+}
+
+func (p *basicSliceValidatorsPool) BorrowValidator() *basicSliceValidator {
+ s := p.Get().(*basicSliceValidator)
+
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ p.debugMap[s] = statusFresh
+ } else {
+ if x != statusRedeemed {
+ panic("recycled basicSliceValidator should have been redeemed")
+ }
+ p.debugMap[s] = statusRecycled
+ }
+ p.allocMap[s] = caller()
+
+ return s
+}
+
+func (p *basicSliceValidatorsPool) RedeemValidator(s *basicSliceValidator) {
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ panic("redeemed basicSliceValidator should have been allocated")
+ }
+ if x != statusRecycled && x != statusFresh {
+ panic("redeemed basicSliceValidator should have been allocated from a fresh or recycled pointer")
+ }
+ p.debugMap[s] = statusRedeemed
+ p.redeemMap[s] = caller()
+ p.Put(s)
+}
+
+func (p *numberValidatorsPool) BorrowValidator() *numberValidator {
+ s := p.Get().(*numberValidator)
+
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ p.debugMap[s] = statusFresh
+ } else {
+ if x != statusRedeemed {
+ panic("recycled number should have been redeemed")
+ }
+ p.debugMap[s] = statusRecycled
+ }
+ p.allocMap[s] = caller()
+
+ return s
+}
+
+func (p *numberValidatorsPool) RedeemValidator(s *numberValidator) {
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ panic("redeemed number should have been allocated")
+ }
+ if x != statusRecycled && x != statusFresh {
+ panic("redeemed number should have been allocated from a fresh or recycled pointer")
+ }
+ p.debugMap[s] = statusRedeemed
+ p.redeemMap[s] = caller()
+ p.Put(s)
+}
+
+func (p *stringValidatorsPool) BorrowValidator() *stringValidator {
+ s := p.Get().(*stringValidator)
+
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ p.debugMap[s] = statusFresh
+ } else {
+ if x != statusRedeemed {
+ panic("recycled string should have been redeemed")
+ }
+ p.debugMap[s] = statusRecycled
+ }
+ p.allocMap[s] = caller()
+
+ return s
+}
+
+func (p *stringValidatorsPool) RedeemValidator(s *stringValidator) {
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ panic("redeemed string should have been allocated")
+ }
+ if x != statusRecycled && x != statusFresh {
+ panic("redeemed string should have been allocated from a fresh or recycled pointer")
+ }
+ p.debugMap[s] = statusRedeemed
+ p.redeemMap[s] = caller()
+ p.Put(s)
+}
+
+func (p *schemaPropsValidatorsPool) BorrowValidator() *schemaPropsValidator {
+ s := p.Get().(*schemaPropsValidator)
+
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ p.debugMap[s] = statusFresh
+ } else {
+ if x != statusRedeemed {
+ panic("recycled param should have been redeemed")
+ }
+ p.debugMap[s] = statusRecycled
+ }
+ p.allocMap[s] = caller()
+
+ return s
+}
+
+func (p *schemaPropsValidatorsPool) RedeemValidator(s *schemaPropsValidator) {
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ panic("redeemed schemaProps should have been allocated")
+ }
+ if x != statusRecycled && x != statusFresh {
+ panic("redeemed schemaProps should have been allocated from a fresh or recycled pointer")
+ }
+ p.debugMap[s] = statusRedeemed
+ p.redeemMap[s] = caller()
+ p.Put(s)
+}
+
+func (p *formatValidatorsPool) BorrowValidator() *formatValidator {
+ s := p.Get().(*formatValidator)
+
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ p.debugMap[s] = statusFresh
+ } else {
+ if x != statusRedeemed {
+ panic("recycled format should have been redeemed")
+ }
+ p.debugMap[s] = statusRecycled
+ }
+ p.allocMap[s] = caller()
+
+ return s
+}
+
+func (p *formatValidatorsPool) RedeemValidator(s *formatValidator) {
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ panic("redeemed format should have been allocated")
+ }
+ if x != statusRecycled && x != statusFresh {
+ panic("redeemed format should have been allocated from a fresh or recycled pointer")
+ }
+ p.debugMap[s] = statusRedeemed
+ p.redeemMap[s] = caller()
+ p.Put(s)
+}
+
+func (p *typeValidatorsPool) BorrowValidator() *typeValidator {
+ s := p.Get().(*typeValidator)
+
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ p.debugMap[s] = statusFresh
+ } else {
+ if x != statusRedeemed {
+ panic("recycled type should have been redeemed")
+ }
+ p.debugMap[s] = statusRecycled
+ }
+ p.allocMap[s] = caller()
+
+ return s
+}
+
+func (p *typeValidatorsPool) RedeemValidator(s *typeValidator) {
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ panic("redeemed type should have been allocated")
+ }
+ if x != statusRecycled && x != statusFresh {
+ panic(fmt.Errorf("redeemed type should have been allocated from a fresh or recycled pointer. Got status %s, already redeamed at: %s", x, p.redeemMap[s]))
+ }
+ p.debugMap[s] = statusRedeemed
+ p.redeemMap[s] = caller()
+ p.Put(s)
+}
+
+func (p *schemasPool) BorrowSchema() *spec.Schema {
+ s := p.Get().(*spec.Schema)
+
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ p.debugMap[s] = statusFresh
+ } else {
+ if x != statusRedeemed {
+ panic("recycled spec.Schema should have been redeemed")
+ }
+ p.debugMap[s] = statusRecycled
+ }
+ p.allocMap[s] = caller()
+
+ return s
+}
+
+func (p *schemasPool) RedeemSchema(s *spec.Schema) {
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ panic("redeemed spec.Schema should have been allocated")
+ }
+ if x != statusRecycled && x != statusFresh {
+ panic("redeemed spec.Schema should have been allocated from a fresh or recycled pointer")
+ }
+ p.debugMap[s] = statusRedeemed
+ p.redeemMap[s] = caller()
+ p.Put(s)
+}
+
+func (p *resultsPool) BorrowResult() *Result {
+ s := p.Get().(*Result).cleared()
+
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ p.debugMap[s] = statusFresh
+ } else {
+ if x != statusRedeemed {
+ panic("recycled result should have been redeemed")
+ }
+ p.debugMap[s] = statusRecycled
+ }
+ p.allocMap[s] = caller()
+
+ return s
+}
+
+func (p *resultsPool) RedeemResult(s *Result) {
+ if s == emptyResult {
+ if len(s.Errors) > 0 || len(s.Warnings) > 0 {
+ panic("empty result should not mutate")
+ }
+ return
+ }
+ p.mx.Lock()
+ defer p.mx.Unlock()
+ x, ok := p.debugMap[s]
+ if !ok {
+ panic("redeemed Result should have been allocated")
+ }
+ if x != statusRecycled && x != statusFresh {
+ panic("redeemed Result should have been allocated from a fresh or recycled pointer")
+ }
+ p.debugMap[s] = statusRedeemed
+ p.redeemMap[s] = caller()
+ p.Put(s)
+}
+
+func (p *allPools) allIsRedeemed(t testing.TB) bool {
+ outcome := true
+ for k, v := range p.poolOfSchemaValidators.debugMap {
+ if v == statusRedeemed {
+ continue
+ }
+ t.Logf("schemaValidator should be redeemed. Allocated by: %s", p.poolOfSchemaValidators.allocMap[k])
+ outcome = false
+ }
+ for k, v := range p.poolOfObjectValidators.debugMap {
+ if v == statusRedeemed {
+ continue
+ }
+ t.Logf("objectValidator should be redeemed. Allocated by: %s", p.poolOfObjectValidators.allocMap[k])
+ outcome = false
+ }
+ for k, v := range p.poolOfSliceValidators.debugMap {
+ if v == statusRedeemed {
+ continue
+ }
+ t.Logf("sliceValidator should be redeemed. Allocated by: %s", p.poolOfSliceValidators.allocMap[k])
+ outcome = false
+ }
+ for k, v := range p.poolOfItemsValidators.debugMap {
+ if v == statusRedeemed {
+ continue
+ }
+ t.Logf("itemsValidator should be redeemed. Allocated by: %s", p.poolOfItemsValidators.allocMap[k])
+ outcome = false
+ }
+ for k, v := range p.poolOfBasicCommonValidators.debugMap {
+ if v == statusRedeemed {
+ continue
+ }
+ t.Logf("basicCommonValidator should be redeemed. Allocated by: %s", p.poolOfBasicCommonValidators.allocMap[k])
+ outcome = false
+ }
+ for k, v := range p.poolOfHeaderValidators.debugMap {
+ if v == statusRedeemed {
+ continue
+ }
+ t.Logf("headerValidator should be redeemed. Allocated by: %s", p.poolOfHeaderValidators.allocMap[k])
+ outcome = false
+ }
+ for k, v := range p.poolOfParamValidators.debugMap {
+ if v == statusRedeemed {
+ continue
+ }
+ t.Logf("paramValidator should be redeemed. Allocated by: %s", p.poolOfParamValidators.allocMap[k])
+ outcome = false
+ }
+ for k, v := range p.poolOfBasicSliceValidators.debugMap {
+ if v == statusRedeemed {
+ continue
+ }
+ t.Logf("basicSliceValidator should be redeemed. Allocated by: %s", p.poolOfBasicSliceValidators.allocMap[k])
+ outcome = false
+ }
+ for k, v := range p.poolOfNumberValidators.debugMap {
+ if v == statusRedeemed {
+ continue
+ }
+ t.Logf("numberValidator should be redeemed. Allocated by: %s", p.poolOfNumberValidators.allocMap[k])
+ outcome = false
+ }
+ for k, v := range p.poolOfStringValidators.debugMap {
+ if v == statusRedeemed {
+ continue
+ }
+ t.Logf("stringValidator should be redeemed. Allocated by: %s", p.poolOfStringValidators.allocMap[k])
+ outcome = false
+ }
+ for k, v := range p.poolOfSchemaPropsValidators.debugMap {
+ if v == statusRedeemed {
+ continue
+ }
+ t.Logf("schemaPropsValidator should be redeemed. Allocated by: %s", p.poolOfSchemaPropsValidators.allocMap[k])
+ outcome = false
+ }
+ for k, v := range p.poolOfFormatValidators.debugMap {
+ if v == statusRedeemed {
+ continue
+ }
+ t.Logf("formatValidator should be redeemed. Allocated by: %s", p.poolOfFormatValidators.allocMap[k])
+ outcome = false
+ }
+ for k, v := range p.poolOfTypeValidators.debugMap {
+ if v == statusRedeemed {
+ continue
+ }
+ t.Logf("typeValidator should be redeemed. Allocated by: %s", p.poolOfTypeValidators.allocMap[k])
+ outcome = false
+ }
+ for k, v := range p.poolOfSchemas.debugMap {
+ if v == statusRedeemed {
+ continue
+ }
+ t.Logf("schemas should be redeemed. Allocated by: %s", p.poolOfSchemas.allocMap[k])
+ outcome = false
+ }
+ for k, v := range p.poolOfResults.debugMap {
+ if v == statusRedeemed {
+ continue
+ }
+ t.Logf("result should be redeemed. Allocated by: %s", p.poolOfResults.allocMap[k])
+ outcome = false
+ }
+
+ return outcome
+}
+
+func caller() string {
+ pc, _, _, _ := runtime.Caller(3) //nolint:dogsled
+ from, line := runtime.FuncForPC(pc).FileLine(pc)
+
+ return fmt.Sprintf("%s:%d", from, line)
+}
diff --git a/api/vendor/github.com/go-openapi/validate/result.go b/api/vendor/github.com/go-openapi/validate/result.go
index 8f5f935e5d14..c80804a93d0b 100644
--- a/api/vendor/github.com/go-openapi/validate/result.go
+++ b/api/vendor/github.com/go-openapi/validate/result.go
@@ -15,7 +15,7 @@
package validate
import (
- "fmt"
+ stderrors "errors"
"reflect"
"strings"
@@ -23,6 +23,8 @@ import (
"github.com/go-openapi/spec"
)
+var emptyResult = &Result{MatchCount: 1}
+
// Result represents a validation result set, composed of
// errors and warnings.
//
@@ -50,8 +52,10 @@ type Result struct {
// Schemata for slice items
itemSchemata []itemSchemata
- cachedFieldSchemta map[FieldKey][]*spec.Schema
- cachedItemSchemata map[ItemKey][]*spec.Schema
+ cachedFieldSchemata map[FieldKey][]*spec.Schema
+ cachedItemSchemata map[ItemKey][]*spec.Schema
+
+ wantsRedeemOnMerge bool
}
// FieldKey is a pair of an object and a field, usable as a key for a map.
@@ -116,6 +120,9 @@ func (r *Result) Merge(others ...*Result) *Result {
}
r.mergeWithoutRootSchemata(other)
r.rootObjectSchemata.Append(other.rootObjectSchemata)
+ if other.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(other)
+ }
}
return r
}
@@ -132,10 +139,9 @@ func (r *Result) RootObjectSchemata() []*spec.Schema {
}
// FieldSchemata returns the schemata which apply to fields in objects.
-// nolint: dupl
func (r *Result) FieldSchemata() map[FieldKey][]*spec.Schema {
- if r.cachedFieldSchemta != nil {
- return r.cachedFieldSchemta
+ if r.cachedFieldSchemata != nil {
+ return r.cachedFieldSchemata
}
ret := make(map[FieldKey][]*spec.Schema, len(r.fieldSchemata))
@@ -147,12 +153,12 @@ func (r *Result) FieldSchemata() map[FieldKey][]*spec.Schema {
ret[key] = append(ret[key], fs.schemata.multiple...)
}
}
- r.cachedFieldSchemta = ret
+ r.cachedFieldSchemata = ret
+
return ret
}
// ItemSchemata returns the schemata which apply to items in slices.
-// nolint: dupl
func (r *Result) ItemSchemata() map[ItemKey][]*spec.Schema {
if r.cachedItemSchemata != nil {
return r.cachedItemSchemata
@@ -172,12 +178,13 @@ func (r *Result) ItemSchemata() map[ItemKey][]*spec.Schema {
}
func (r *Result) resetCaches() {
- r.cachedFieldSchemta = nil
+ r.cachedFieldSchemata = nil
r.cachedItemSchemata = nil
}
// mergeForField merges other into r, assigning other's root schemata to the given Object and field name.
-// nolint: unparam
+//
+//nolint:unparam
func (r *Result) mergeForField(obj map[string]interface{}, field string, other *Result) *Result {
if other == nil {
return r
@@ -188,18 +195,23 @@ func (r *Result) mergeForField(obj map[string]interface{}, field string, other *
if r.fieldSchemata == nil {
r.fieldSchemata = make([]fieldSchemata, len(obj))
}
+ // clone other schemata, as other is about to be redeemed to the pool
r.fieldSchemata = append(r.fieldSchemata, fieldSchemata{
obj: obj,
field: field,
- schemata: other.rootObjectSchemata,
+ schemata: other.rootObjectSchemata.Clone(),
})
}
+ if other.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(other)
+ }
return r
}
// mergeForSlice merges other into r, assigning other's root schemata to the given slice and index.
-// nolint: unparam
+//
+//nolint:unparam
func (r *Result) mergeForSlice(slice reflect.Value, i int, other *Result) *Result {
if other == nil {
return r
@@ -210,29 +222,38 @@ func (r *Result) mergeForSlice(slice reflect.Value, i int, other *Result) *Resul
if r.itemSchemata == nil {
r.itemSchemata = make([]itemSchemata, slice.Len())
}
+ // clone other schemata, as other is about to be redeemed to the pool
r.itemSchemata = append(r.itemSchemata, itemSchemata{
slice: slice,
index: i,
- schemata: other.rootObjectSchemata,
+ schemata: other.rootObjectSchemata.Clone(),
})
}
+ if other.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(other)
+ }
+
return r
}
// addRootObjectSchemata adds the given schemata for the root object of the result.
-// The slice schemata might be reused. I.e. do not modify it after being added to a result.
+//
+// Since the slice schemata might be reused, it is shallow-cloned before saving it into the result.
func (r *Result) addRootObjectSchemata(s *spec.Schema) {
- r.rootObjectSchemata.Append(schemata{one: s})
+ clone := *s
+ r.rootObjectSchemata.Append(schemata{one: &clone})
}
// addPropertySchemata adds the given schemata for the object and field.
-// The slice schemata might be reused. I.e. do not modify it after being added to a result.
+//
+// Since the slice schemata might be reused, it is shallow-cloned before saving it into the result.
func (r *Result) addPropertySchemata(obj map[string]interface{}, fld string, schema *spec.Schema) {
if r.fieldSchemata == nil {
r.fieldSchemata = make([]fieldSchemata, 0, len(obj))
}
- r.fieldSchemata = append(r.fieldSchemata, fieldSchemata{obj: obj, field: fld, schemata: schemata{one: schema}})
+ clone := *schema
+ r.fieldSchemata = append(r.fieldSchemata, fieldSchemata{obj: obj, field: fld, schemata: schemata{one: &clone}})
}
/*
@@ -255,17 +276,21 @@ func (r *Result) mergeWithoutRootSchemata(other *Result) {
if other.fieldSchemata != nil {
if r.fieldSchemata == nil {
- r.fieldSchemata = other.fieldSchemata
- } else {
- r.fieldSchemata = append(r.fieldSchemata, other.fieldSchemata...)
+ r.fieldSchemata = make([]fieldSchemata, 0, len(other.fieldSchemata))
+ }
+ for _, field := range other.fieldSchemata {
+ field.schemata = field.schemata.Clone()
+ r.fieldSchemata = append(r.fieldSchemata, field)
}
}
if other.itemSchemata != nil {
if r.itemSchemata == nil {
- r.itemSchemata = other.itemSchemata
- } else {
- r.itemSchemata = append(r.itemSchemata, other.itemSchemata...)
+ r.itemSchemata = make([]itemSchemata, 0, len(other.itemSchemata))
+ }
+ for _, field := range other.itemSchemata {
+ field.schemata = field.schemata.Clone()
+ r.itemSchemata = append(r.itemSchemata, field)
}
}
}
@@ -280,6 +305,9 @@ func (r *Result) MergeAsErrors(others ...*Result) *Result {
r.AddErrors(other.Errors...)
r.AddErrors(other.Warnings...)
r.MatchCount += other.MatchCount
+ if other.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(other)
+ }
}
}
return r
@@ -295,6 +323,9 @@ func (r *Result) MergeAsWarnings(others ...*Result) *Result {
r.AddWarnings(other.Errors...)
r.AddWarnings(other.Warnings...)
r.MatchCount += other.MatchCount
+ if other.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(other)
+ }
}
}
return r
@@ -356,16 +387,21 @@ func (r *Result) keepRelevantErrors() *Result {
strippedErrors := []error{}
for _, e := range r.Errors {
if strings.HasPrefix(e.Error(), "IMPORTANT!") {
- strippedErrors = append(strippedErrors, fmt.Errorf(strings.TrimPrefix(e.Error(), "IMPORTANT!")))
+ strippedErrors = append(strippedErrors, stderrors.New(strings.TrimPrefix(e.Error(), "IMPORTANT!")))
}
}
strippedWarnings := []error{}
for _, e := range r.Warnings {
if strings.HasPrefix(e.Error(), "IMPORTANT!") {
- strippedWarnings = append(strippedWarnings, fmt.Errorf(strings.TrimPrefix(e.Error(), "IMPORTANT!")))
+ strippedWarnings = append(strippedWarnings, stderrors.New(strings.TrimPrefix(e.Error(), "IMPORTANT!")))
}
}
- strippedResult := new(Result)
+ var strippedResult *Result
+ if r.wantsRedeemOnMerge {
+ strippedResult = pools.poolOfResults.BorrowResult()
+ } else {
+ strippedResult = new(Result)
+ }
strippedResult.Errors = strippedErrors
strippedResult.Warnings = strippedWarnings
return strippedResult
@@ -427,6 +463,27 @@ func (r *Result) AsError() error {
return errors.CompositeValidationError(r.Errors...)
}
+func (r *Result) cleared() *Result {
+ // clear the Result to be reusable. Keep allocated capacity.
+ r.Errors = r.Errors[:0]
+ r.Warnings = r.Warnings[:0]
+ r.MatchCount = 0
+ r.data = nil
+ r.rootObjectSchemata.one = nil
+ r.rootObjectSchemata.multiple = r.rootObjectSchemata.multiple[:0]
+ r.fieldSchemata = r.fieldSchemata[:0]
+ r.itemSchemata = r.itemSchemata[:0]
+ for k := range r.cachedFieldSchemata {
+ delete(r.cachedFieldSchemata, k)
+ }
+ for k := range r.cachedItemSchemata {
+ delete(r.cachedItemSchemata, k)
+ }
+ r.wantsRedeemOnMerge = true // mark this result as eligible for redeem when merged into another
+
+ return r
+}
+
// schemata is an arbitrary number of schemata. It does a distinction between zero,
// one and many schemata to avoid slice allocations.
type schemata struct {
@@ -453,7 +510,7 @@ func (s *schemata) Slice() []*spec.Schema {
return s.multiple
}
-// appendSchemata appends the schemata in other to s. It mutated s in-place.
+// appendSchemata appends the schemata in other to s. It mutates s in-place.
func (s *schemata) Append(other schemata) {
if other.one == nil && len(other.multiple) == 0 {
return
@@ -484,3 +541,23 @@ func (s *schemata) Append(other schemata) {
}
}
}
+
+func (s schemata) Clone() schemata {
+ var clone schemata
+
+ if s.one != nil {
+ clone.one = new(spec.Schema)
+ *clone.one = *s.one
+ }
+
+ if len(s.multiple) > 0 {
+ clone.multiple = make([]*spec.Schema, len(s.multiple))
+ for idx := 0; idx < len(s.multiple); idx++ {
+ sp := new(spec.Schema)
+ *sp = *s.multiple[idx]
+ clone.multiple[idx] = sp
+ }
+ }
+
+ return clone
+}
diff --git a/api/vendor/github.com/go-openapi/validate/schema.go b/api/vendor/github.com/go-openapi/validate/schema.go
index 62b91dc5b0fd..db65264fd106 100644
--- a/api/vendor/github.com/go-openapi/validate/schema.go
+++ b/api/vendor/github.com/go-openapi/validate/schema.go
@@ -24,32 +24,32 @@ import (
"github.com/go-openapi/swag"
)
-var (
- specSchemaType = reflect.TypeOf(&spec.Schema{})
- specParameterType = reflect.TypeOf(&spec.Parameter{})
- specHeaderType = reflect.TypeOf(&spec.Header{})
- // specItemsType = reflect.TypeOf(&spec.Items{})
-)
-
// SchemaValidator validates data against a JSON schema
type SchemaValidator struct {
Path string
in string
Schema *spec.Schema
- validators []valueValidator
+ validators [8]valueValidator
Root interface{}
KnownFormats strfmt.Registry
- Options SchemaValidatorOptions
+ Options *SchemaValidatorOptions
}
// AgainstSchema validates the specified data against the provided schema, using a registry of supported formats.
//
// When no pre-parsed *spec.Schema structure is provided, it uses a JSON schema as default. See example.
func AgainstSchema(schema *spec.Schema, data interface{}, formats strfmt.Registry, options ...Option) error {
- res := NewSchemaValidator(schema, nil, "", formats, options...).Validate(data)
+ res := NewSchemaValidator(schema, nil, "", formats,
+ append(options, WithRecycleValidators(true), withRecycleResults(true))...,
+ ).Validate(data)
+ defer func() {
+ pools.poolOfResults.RedeemResult(res)
+ }()
+
if res.HasErrors() {
return errors.CompositeValidationError(res.Errors...)
}
+
return nil
}
@@ -57,6 +57,15 @@ func AgainstSchema(schema *spec.Schema, data interface{}, formats strfmt.Registr
//
// Panics if the provided schema is invalid.
func NewSchemaValidator(schema *spec.Schema, rootSchema interface{}, root string, formats strfmt.Registry, options ...Option) *SchemaValidator {
+ opts := new(SchemaValidatorOptions)
+ for _, o := range options {
+ o(opts)
+ }
+
+ return newSchemaValidator(schema, rootSchema, root, formats, opts)
+}
+
+func newSchemaValidator(schema *spec.Schema, rootSchema interface{}, root string, formats strfmt.Registry, opts *SchemaValidatorOptions) *SchemaValidator {
if schema == nil {
return nil
}
@@ -72,17 +81,26 @@ func NewSchemaValidator(schema *spec.Schema, rootSchema interface{}, root string
panic(msg)
}
}
- s := SchemaValidator{
- Path: root,
- in: "body",
- Schema: schema,
- Root: rootSchema,
- KnownFormats: formats,
- Options: SchemaValidatorOptions{}}
- for _, o := range options {
- o(&s.Options)
+
+ if opts == nil {
+ opts = new(SchemaValidatorOptions)
}
- s.validators = []valueValidator{
+
+ var s *SchemaValidator
+ if opts.recycleValidators {
+ s = pools.poolOfSchemaValidators.BorrowValidator()
+ } else {
+ s = new(SchemaValidator)
+ }
+
+ s.Path = root
+ s.in = "body"
+ s.Schema = schema
+ s.Root = rootSchema
+ s.Options = opts
+ s.KnownFormats = formats
+
+ s.validators = [8]valueValidator{
s.typeValidator(),
s.schemaPropsValidator(),
s.stringValidator(),
@@ -92,7 +110,8 @@ func NewSchemaValidator(schema *spec.Schema, rootSchema interface{}, root string
s.commonValidator(),
s.objectValidator(),
}
- return &s
+
+ return s
}
// SetPath sets the path for this schema valdiator
@@ -108,17 +127,39 @@ func (s *SchemaValidator) Applies(source interface{}, _ reflect.Kind) bool {
// Validate validates the data against the schema
func (s *SchemaValidator) Validate(data interface{}) *Result {
- result := &Result{data: data}
if s == nil {
- return result
+ return emptyResult
}
- if s.Schema != nil {
+
+ if s.Options.recycleValidators {
+ defer func() {
+ s.redeemChildren()
+ s.redeem() // one-time use validator
+ }()
+ }
+
+ var result *Result
+ if s.Options.recycleResult {
+ result = pools.poolOfResults.BorrowResult()
+ result.data = data
+ } else {
+ result = &Result{data: data}
+ }
+
+ if s.Schema != nil && !s.Options.skipSchemataResult {
result.addRootObjectSchemata(s.Schema)
}
if data == nil {
+ // early exit with minimal validation
result.Merge(s.validators[0].Validate(data)) // type validator
result.Merge(s.validators[6].Validate(data)) // common validator
+
+ if s.Options.recycleValidators {
+ s.validators[0] = nil
+ s.validators[6] = nil
+ }
+
return result
}
@@ -147,6 +188,7 @@ func (s *SchemaValidator) Validate(data interface{}) *Result {
if erri != nil {
result.AddErrors(invalidTypeConversionMsg(s.Path, erri))
result.Inc()
+
return result
}
d = in
@@ -155,6 +197,7 @@ func (s *SchemaValidator) Validate(data interface{}) *Result {
if errf != nil {
result.AddErrors(invalidTypeConversionMsg(s.Path, errf))
result.Inc()
+
return result
}
d = nf
@@ -164,14 +207,26 @@ func (s *SchemaValidator) Validate(data interface{}) *Result {
kind = tpe.Kind()
}
- for _, v := range s.validators {
+ for idx, v := range s.validators {
if !v.Applies(s.Schema, kind) {
- debugLog("%T does not apply for %v", v, kind)
+ if s.Options.recycleValidators {
+ // Validate won't be called, so relinquish this validator
+ if redeemableChildren, ok := v.(interface{ redeemChildren() }); ok {
+ redeemableChildren.redeemChildren()
+ }
+ if redeemable, ok := v.(interface{ redeem() }); ok {
+ redeemable.redeem()
+ }
+ s.validators[idx] = nil // prevents further (unsafe) usage
+ }
+
continue
}
- err := v.Validate(d)
- result.Merge(err)
+ result.Merge(v.Validate(d))
+ if s.Options.recycleValidators {
+ s.validators[idx] = nil // prevents further (unsafe) usage
+ }
result.Inc()
}
result.Inc()
@@ -180,81 +235,120 @@ func (s *SchemaValidator) Validate(data interface{}) *Result {
}
func (s *SchemaValidator) typeValidator() valueValidator {
- return &typeValidator{Type: s.Schema.Type, Nullable: s.Schema.Nullable, Format: s.Schema.Format, In: s.in, Path: s.Path}
+ return newTypeValidator(
+ s.Path,
+ s.in,
+ s.Schema.Type,
+ s.Schema.Nullable,
+ s.Schema.Format,
+ s.Options,
+ )
}
func (s *SchemaValidator) commonValidator() valueValidator {
- return &basicCommonValidator{
- Path: s.Path,
- In: s.in,
- Enum: s.Schema.Enum,
- }
+ return newBasicCommonValidator(
+ s.Path,
+ s.in,
+ s.Schema.Default,
+ s.Schema.Enum,
+ s.Options,
+ )
}
func (s *SchemaValidator) sliceValidator() valueValidator {
- return &schemaSliceValidator{
- Path: s.Path,
- In: s.in,
- MaxItems: s.Schema.MaxItems,
- MinItems: s.Schema.MinItems,
- UniqueItems: s.Schema.UniqueItems,
- AdditionalItems: s.Schema.AdditionalItems,
- Items: s.Schema.Items,
- Root: s.Root,
- KnownFormats: s.KnownFormats,
- Options: s.Options,
- }
+ return newSliceValidator(
+ s.Path,
+ s.in,
+ s.Schema.MaxItems,
+ s.Schema.MinItems,
+ s.Schema.UniqueItems,
+ s.Schema.AdditionalItems,
+ s.Schema.Items,
+ s.Root,
+ s.KnownFormats,
+ s.Options,
+ )
}
func (s *SchemaValidator) numberValidator() valueValidator {
- return &numberValidator{
- Path: s.Path,
- In: s.in,
- Default: s.Schema.Default,
- MultipleOf: s.Schema.MultipleOf,
- Maximum: s.Schema.Maximum,
- ExclusiveMaximum: s.Schema.ExclusiveMaximum,
- Minimum: s.Schema.Minimum,
- ExclusiveMinimum: s.Schema.ExclusiveMinimum,
- }
+ return newNumberValidator(
+ s.Path,
+ s.in,
+ s.Schema.Default,
+ s.Schema.MultipleOf,
+ s.Schema.Maximum,
+ s.Schema.ExclusiveMaximum,
+ s.Schema.Minimum,
+ s.Schema.ExclusiveMinimum,
+ "",
+ "",
+ s.Options,
+ )
}
func (s *SchemaValidator) stringValidator() valueValidator {
- return &stringValidator{
- Path: s.Path,
- In: s.in,
- MaxLength: s.Schema.MaxLength,
- MinLength: s.Schema.MinLength,
- Pattern: s.Schema.Pattern,
- }
+ return newStringValidator(
+ s.Path,
+ s.in,
+ nil,
+ false,
+ false,
+ s.Schema.MaxLength,
+ s.Schema.MinLength,
+ s.Schema.Pattern,
+ s.Options,
+ )
}
func (s *SchemaValidator) formatValidator() valueValidator {
- return &formatValidator{
- Path: s.Path,
- In: s.in,
- Format: s.Schema.Format,
- KnownFormats: s.KnownFormats,
- }
+ return newFormatValidator(
+ s.Path,
+ s.in,
+ s.Schema.Format,
+ s.KnownFormats,
+ s.Options,
+ )
}
func (s *SchemaValidator) schemaPropsValidator() valueValidator {
sch := s.Schema
- return newSchemaPropsValidator(s.Path, s.in, sch.AllOf, sch.OneOf, sch.AnyOf, sch.Not, sch.Dependencies, s.Root, s.KnownFormats, s.Options.Options()...)
+ return newSchemaPropsValidator(
+ s.Path, s.in, sch.AllOf, sch.OneOf, sch.AnyOf, sch.Not, sch.Dependencies, s.Root, s.KnownFormats,
+ s.Options,
+ )
}
func (s *SchemaValidator) objectValidator() valueValidator {
- return &objectValidator{
- Path: s.Path,
- In: s.in,
- MaxProperties: s.Schema.MaxProperties,
- MinProperties: s.Schema.MinProperties,
- Required: s.Schema.Required,
- Properties: s.Schema.Properties,
- AdditionalProperties: s.Schema.AdditionalProperties,
- PatternProperties: s.Schema.PatternProperties,
- Root: s.Root,
- KnownFormats: s.KnownFormats,
- Options: s.Options,
+ return newObjectValidator(
+ s.Path,
+ s.in,
+ s.Schema.MaxProperties,
+ s.Schema.MinProperties,
+ s.Schema.Required,
+ s.Schema.Properties,
+ s.Schema.AdditionalProperties,
+ s.Schema.PatternProperties,
+ s.Root,
+ s.KnownFormats,
+ s.Options,
+ )
+}
+
+func (s *SchemaValidator) redeem() {
+ pools.poolOfSchemaValidators.RedeemValidator(s)
+}
+
+func (s *SchemaValidator) redeemChildren() {
+ for i, validator := range s.validators {
+ if validator == nil {
+ continue
+ }
+ if redeemableChildren, ok := validator.(interface{ redeemChildren() }); ok {
+ redeemableChildren.redeemChildren()
+ }
+ if redeemable, ok := validator.(interface{ redeem() }); ok {
+ redeemable.redeem()
+ }
+ s.validators[i] = nil // free up allocated children if not in pool
}
}
diff --git a/api/vendor/github.com/go-openapi/validate/schema_option.go b/api/vendor/github.com/go-openapi/validate/schema_option.go
index 4b4879de8b1f..65eeebeaab31 100644
--- a/api/vendor/github.com/go-openapi/validate/schema_option.go
+++ b/api/vendor/github.com/go-openapi/validate/schema_option.go
@@ -18,6 +18,9 @@ package validate
type SchemaValidatorOptions struct {
EnableObjectArrayTypeCheck bool
EnableArrayMustHaveItemsCheck bool
+ recycleValidators bool
+ recycleResult bool
+ skipSchemataResult bool
}
// Option sets optional rules for schema validation
@@ -45,10 +48,36 @@ func SwaggerSchema(enable bool) Option {
}
}
-// Options returns current options
+// WithRecycleValidators saves memory allocations and makes validators
+// available for a single use of Validate() only.
+//
+// When a validator is recycled, called MUST not call the Validate() method twice.
+func WithRecycleValidators(enable bool) Option {
+ return func(svo *SchemaValidatorOptions) {
+ svo.recycleValidators = enable
+ }
+}
+
+func withRecycleResults(enable bool) Option {
+ return func(svo *SchemaValidatorOptions) {
+ svo.recycleResult = enable
+ }
+}
+
+// WithSkipSchemataResult skips the deep audit payload stored in validation Result
+func WithSkipSchemataResult(enable bool) Option {
+ return func(svo *SchemaValidatorOptions) {
+ svo.skipSchemataResult = enable
+ }
+}
+
+// Options returns the current set of options
func (svo SchemaValidatorOptions) Options() []Option {
return []Option{
EnableObjectArrayTypeCheck(svo.EnableObjectArrayTypeCheck),
EnableArrayMustHaveItemsCheck(svo.EnableArrayMustHaveItemsCheck),
+ WithRecycleValidators(svo.recycleValidators),
+ withRecycleResults(svo.recycleResult),
+ WithSkipSchemataResult(svo.skipSchemataResult),
}
}
diff --git a/api/vendor/github.com/go-openapi/validate/schema_props.go b/api/vendor/github.com/go-openapi/validate/schema_props.go
index 9bac3d29fb9d..1ca379244dc7 100644
--- a/api/vendor/github.com/go-openapi/validate/schema_props.go
+++ b/api/vendor/github.com/go-openapi/validate/schema_props.go
@@ -30,211 +30,327 @@ type schemaPropsValidator struct {
AnyOf []spec.Schema
Not *spec.Schema
Dependencies spec.Dependencies
- anyOfValidators []SchemaValidator
- allOfValidators []SchemaValidator
- oneOfValidators []SchemaValidator
+ anyOfValidators []*SchemaValidator
+ allOfValidators []*SchemaValidator
+ oneOfValidators []*SchemaValidator
notValidator *SchemaValidator
Root interface{}
KnownFormats strfmt.Registry
- Options SchemaValidatorOptions
+ Options *SchemaValidatorOptions
}
func (s *schemaPropsValidator) SetPath(path string) {
s.Path = path
}
-func newSchemaPropsValidator(path string, in string, allOf, oneOf, anyOf []spec.Schema, not *spec.Schema, deps spec.Dependencies, root interface{}, formats strfmt.Registry, options ...Option) *schemaPropsValidator {
- anyValidators := make([]SchemaValidator, 0, len(anyOf))
- for _, v := range anyOf {
- v := v
- anyValidators = append(anyValidators, *NewSchemaValidator(&v, root, path, formats, options...))
+func newSchemaPropsValidator(
+ path string, in string, allOf, oneOf, anyOf []spec.Schema, not *spec.Schema, deps spec.Dependencies, root interface{}, formats strfmt.Registry,
+ opts *SchemaValidatorOptions) *schemaPropsValidator {
+ if opts == nil {
+ opts = new(SchemaValidatorOptions)
}
- allValidators := make([]SchemaValidator, 0, len(allOf))
- for _, v := range allOf {
- v := v
- allValidators = append(allValidators, *NewSchemaValidator(&v, root, path, formats, options...))
+
+ anyValidators := make([]*SchemaValidator, 0, len(anyOf))
+ for i := range anyOf {
+ anyValidators = append(anyValidators, newSchemaValidator(&anyOf[i], root, path, formats, opts))
+ }
+ allValidators := make([]*SchemaValidator, 0, len(allOf))
+ for i := range allOf {
+ allValidators = append(allValidators, newSchemaValidator(&allOf[i], root, path, formats, opts))
}
- oneValidators := make([]SchemaValidator, 0, len(oneOf))
- for _, v := range oneOf {
- v := v
- oneValidators = append(oneValidators, *NewSchemaValidator(&v, root, path, formats, options...))
+ oneValidators := make([]*SchemaValidator, 0, len(oneOf))
+ for i := range oneOf {
+ oneValidators = append(oneValidators, newSchemaValidator(&oneOf[i], root, path, formats, opts))
}
var notValidator *SchemaValidator
if not != nil {
- notValidator = NewSchemaValidator(not, root, path, formats, options...)
- }
-
- schOptions := &SchemaValidatorOptions{}
- for _, o := range options {
- o(schOptions)
- }
- return &schemaPropsValidator{
- Path: path,
- In: in,
- AllOf: allOf,
- OneOf: oneOf,
- AnyOf: anyOf,
- Not: not,
- Dependencies: deps,
- anyOfValidators: anyValidators,
- allOfValidators: allValidators,
- oneOfValidators: oneValidators,
- notValidator: notValidator,
- Root: root,
- KnownFormats: formats,
- Options: *schOptions,
+ notValidator = newSchemaValidator(not, root, path, formats, opts)
+ }
+
+ var s *schemaPropsValidator
+ if opts.recycleValidators {
+ s = pools.poolOfSchemaPropsValidators.BorrowValidator()
+ } else {
+ s = new(schemaPropsValidator)
}
+
+ s.Path = path
+ s.In = in
+ s.AllOf = allOf
+ s.OneOf = oneOf
+ s.AnyOf = anyOf
+ s.Not = not
+ s.Dependencies = deps
+ s.anyOfValidators = anyValidators
+ s.allOfValidators = allValidators
+ s.oneOfValidators = oneValidators
+ s.notValidator = notValidator
+ s.Root = root
+ s.KnownFormats = formats
+ s.Options = opts
+
+ return s
}
-func (s *schemaPropsValidator) Applies(source interface{}, kind reflect.Kind) bool {
- r := reflect.TypeOf(source) == specSchemaType
- debugLog("schema props validator for %q applies %t for %T (kind: %v)\n", s.Path, r, source, kind)
- return r
+func (s *schemaPropsValidator) Applies(source interface{}, _ reflect.Kind) bool {
+ _, isSchema := source.(*spec.Schema)
+ return isSchema
}
func (s *schemaPropsValidator) Validate(data interface{}) *Result {
- mainResult := new(Result)
+ var mainResult *Result
+ if s.Options.recycleResult {
+ mainResult = pools.poolOfResults.BorrowResult()
+ } else {
+ mainResult = new(Result)
+ }
// Intermediary error results
// IMPORTANT! messages from underlying validators
- keepResultAnyOf := new(Result)
- keepResultOneOf := new(Result)
- keepResultAllOf := new(Result)
+ var keepResultAnyOf, keepResultOneOf, keepResultAllOf *Result
+
+ if s.Options.recycleValidators {
+ defer func() {
+ s.redeemChildren()
+ s.redeem()
+
+ // results are redeemed when merged
+ }()
+ }
- // Validates at least one in anyOf schemas
- var firstSuccess *Result
if len(s.anyOfValidators) > 0 {
- var bestFailures *Result
- succeededOnce := false
- for _, anyOfSchema := range s.anyOfValidators {
- result := anyOfSchema.Validate(data)
- // We keep inner IMPORTANT! errors no matter what MatchCount tells us
- keepResultAnyOf.Merge(result.keepRelevantErrors())
- if result.IsValid() {
- bestFailures = nil
- succeededOnce = true
- if firstSuccess == nil {
- firstSuccess = result
- }
- keepResultAnyOf = new(Result)
- break
- }
- // MatchCount is used to select errors from the schema with most positive checks
- if bestFailures == nil || result.MatchCount > bestFailures.MatchCount {
- bestFailures = result
+ keepResultAnyOf = pools.poolOfResults.BorrowResult()
+ s.validateAnyOf(data, mainResult, keepResultAnyOf)
+ }
+
+ if len(s.oneOfValidators) > 0 {
+ keepResultOneOf = pools.poolOfResults.BorrowResult()
+ s.validateOneOf(data, mainResult, keepResultOneOf)
+ }
+
+ if len(s.allOfValidators) > 0 {
+ keepResultAllOf = pools.poolOfResults.BorrowResult()
+ s.validateAllOf(data, mainResult, keepResultAllOf)
+ }
+
+ if s.notValidator != nil {
+ s.validateNot(data, mainResult)
+ }
+
+ if s.Dependencies != nil && len(s.Dependencies) > 0 && reflect.TypeOf(data).Kind() == reflect.Map {
+ s.validateDependencies(data, mainResult)
+ }
+
+ mainResult.Inc()
+
+ // In the end we retain best failures for schema validation
+ // plus, if any, composite errors which may explain special cases (tagged as IMPORTANT!).
+ return mainResult.Merge(keepResultAllOf, keepResultOneOf, keepResultAnyOf)
+}
+
+func (s *schemaPropsValidator) validateAnyOf(data interface{}, mainResult, keepResultAnyOf *Result) {
+ // Validates at least one in anyOf schemas
+ var bestFailures *Result
+
+ for i, anyOfSchema := range s.anyOfValidators {
+ result := anyOfSchema.Validate(data)
+ if s.Options.recycleValidators {
+ s.anyOfValidators[i] = nil
+ }
+ // We keep inner IMPORTANT! errors no matter what MatchCount tells us
+ keepResultAnyOf.Merge(result.keepRelevantErrors()) // merges (and redeems) a new instance of Result
+
+ if result.IsValid() {
+ if bestFailures != nil && bestFailures.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(bestFailures)
}
+
+ _ = keepResultAnyOf.cleared()
+ mainResult.Merge(result)
+
+ return
}
- if !succeededOnce {
- mainResult.AddErrors(mustValidateAtLeastOneSchemaMsg(s.Path))
+ // MatchCount is used to select errors from the schema with most positive checks
+ if bestFailures == nil || result.MatchCount > bestFailures.MatchCount {
+ if bestFailures != nil && bestFailures.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(bestFailures)
+ }
+ bestFailures = result
+
+ continue
}
- if bestFailures != nil {
- mainResult.Merge(bestFailures)
- } else if firstSuccess != nil {
- mainResult.Merge(firstSuccess)
+
+ if result.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(result) // this result is ditched
}
}
+ mainResult.AddErrors(mustValidateAtLeastOneSchemaMsg(s.Path))
+ mainResult.Merge(bestFailures)
+}
+
+func (s *schemaPropsValidator) validateOneOf(data interface{}, mainResult, keepResultOneOf *Result) {
// Validates exactly one in oneOf schemas
- if len(s.oneOfValidators) > 0 {
- var bestFailures *Result
- var firstSuccess *Result
- validated := 0
-
- for _, oneOfSchema := range s.oneOfValidators {
- result := oneOfSchema.Validate(data)
- // We keep inner IMPORTANT! errors no matter what MatchCount tells us
- keepResultOneOf.Merge(result.keepRelevantErrors())
- if result.IsValid() {
- validated++
- bestFailures = nil
- if firstSuccess == nil {
- firstSuccess = result
- }
- keepResultOneOf = new(Result)
- continue
- }
- // MatchCount is used to select errors from the schema with most positive checks
- if validated == 0 && (bestFailures == nil || result.MatchCount > bestFailures.MatchCount) {
- bestFailures = result
- }
+ var (
+ firstSuccess, bestFailures *Result
+ validated int
+ )
+
+ for i, oneOfSchema := range s.oneOfValidators {
+ result := oneOfSchema.Validate(data)
+ if s.Options.recycleValidators {
+ s.oneOfValidators[i] = nil
}
- if validated != 1 {
- var additionalMsg string
- if validated == 0 {
- additionalMsg = "Found none valid"
- } else {
- additionalMsg = fmt.Sprintf("Found %d valid alternatives", validated)
- }
+ // We keep inner IMPORTANT! errors no matter what MatchCount tells us
+ keepResultOneOf.Merge(result.keepRelevantErrors()) // merges (and redeems) a new instance of Result
- mainResult.AddErrors(mustValidateOnlyOneSchemaMsg(s.Path, additionalMsg))
- if bestFailures != nil {
- mainResult.Merge(bestFailures)
- }
- } else if firstSuccess != nil {
- mainResult.Merge(firstSuccess)
- }
- }
+ if result.IsValid() {
+ validated++
+ _ = keepResultOneOf.cleared()
- // Validates all of allOf schemas
- if len(s.allOfValidators) > 0 {
- validated := 0
-
- for _, allOfSchema := range s.allOfValidators {
- result := allOfSchema.Validate(data)
- // We keep inner IMPORTANT! errors no matter what MatchCount tells us
- keepResultAllOf.Merge(result.keepRelevantErrors())
- // keepResultAllOf.Merge(result)
- if result.IsValid() {
- validated++
+ if firstSuccess == nil {
+ firstSuccess = result
+ } else if result.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(result) // this result is ditched
}
- mainResult.Merge(result)
+
+ continue
}
- if validated != len(s.allOfValidators) {
- additionalMsg := ""
- if validated == 0 {
- additionalMsg = ". None validated"
+ // MatchCount is used to select errors from the schema with most positive checks
+ if validated == 0 && (bestFailures == nil || result.MatchCount > bestFailures.MatchCount) {
+ if bestFailures != nil && bestFailures.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(bestFailures)
}
+ bestFailures = result
+ } else if result.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(result) // this result is ditched
+ }
+ }
- mainResult.AddErrors(mustValidateAllSchemasMsg(s.Path, additionalMsg))
+ switch validated {
+ case 0:
+ mainResult.AddErrors(mustValidateOnlyOneSchemaMsg(s.Path, "Found none valid"))
+ mainResult.Merge(bestFailures)
+ // firstSucess necessarily nil
+ case 1:
+ mainResult.Merge(firstSuccess)
+ if bestFailures != nil && bestFailures.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(bestFailures)
+ }
+ default:
+ mainResult.AddErrors(mustValidateOnlyOneSchemaMsg(s.Path, fmt.Sprintf("Found %d valid alternatives", validated)))
+ mainResult.Merge(bestFailures)
+ if firstSuccess != nil && firstSuccess.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(firstSuccess)
}
}
+}
- if s.notValidator != nil {
- result := s.notValidator.Validate(data)
+func (s *schemaPropsValidator) validateAllOf(data interface{}, mainResult, keepResultAllOf *Result) {
+ // Validates all of allOf schemas
+ var validated int
+
+ for i, allOfSchema := range s.allOfValidators {
+ result := allOfSchema.Validate(data)
+ if s.Options.recycleValidators {
+ s.allOfValidators[i] = nil
+ }
// We keep inner IMPORTANT! errors no matter what MatchCount tells us
+ keepResultAllOf.Merge(result.keepRelevantErrors())
if result.IsValid() {
- mainResult.AddErrors(mustNotValidatechemaMsg(s.Path))
+ validated++
}
+ mainResult.Merge(result)
}
- if s.Dependencies != nil && len(s.Dependencies) > 0 && reflect.TypeOf(data).Kind() == reflect.Map {
- val := data.(map[string]interface{})
- for key := range val {
- if dep, ok := s.Dependencies[key]; ok {
+ switch validated {
+ case 0:
+ mainResult.AddErrors(mustValidateAllSchemasMsg(s.Path, ". None validated"))
+ case len(s.allOfValidators):
+ default:
+ mainResult.AddErrors(mustValidateAllSchemasMsg(s.Path, ""))
+ }
+}
- if dep.Schema != nil {
- mainResult.Merge(NewSchemaValidator(dep.Schema, s.Root, s.Path+"."+key, s.KnownFormats, s.Options.Options()...).Validate(data))
- continue
- }
+func (s *schemaPropsValidator) validateNot(data interface{}, mainResult *Result) {
+ result := s.notValidator.Validate(data)
+ if s.Options.recycleValidators {
+ s.notValidator = nil
+ }
+ // We keep inner IMPORTANT! errors no matter what MatchCount tells us
+ if result.IsValid() {
+ mainResult.AddErrors(mustNotValidatechemaMsg(s.Path))
+ }
+ if result.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(result) // this result is ditched
+ }
+}
+
+func (s *schemaPropsValidator) validateDependencies(data interface{}, mainResult *Result) {
+ val := data.(map[string]interface{})
+ for key := range val {
+ dep, ok := s.Dependencies[key]
+ if !ok {
+ continue
+ }
+
+ if dep.Schema != nil {
+ mainResult.Merge(
+ newSchemaValidator(dep.Schema, s.Root, s.Path+"."+key, s.KnownFormats, s.Options).Validate(data),
+ )
+ continue
+ }
- if len(dep.Property) > 0 {
- for _, depKey := range dep.Property {
- if _, ok := val[depKey]; !ok {
- mainResult.AddErrors(hasADependencyMsg(s.Path, depKey))
- }
- }
+ if len(dep.Property) > 0 {
+ for _, depKey := range dep.Property {
+ if _, ok := val[depKey]; !ok {
+ mainResult.AddErrors(hasADependencyMsg(s.Path, depKey))
}
}
}
}
+}
- mainResult.Inc()
- // In the end we retain best failures for schema validation
- // plus, if any, composite errors which may explain special cases (tagged as IMPORTANT!).
- return mainResult.Merge(keepResultAllOf, keepResultOneOf, keepResultAnyOf)
+func (s *schemaPropsValidator) redeem() {
+ pools.poolOfSchemaPropsValidators.RedeemValidator(s)
+}
+
+func (s *schemaPropsValidator) redeemChildren() {
+ for _, v := range s.anyOfValidators {
+ if v == nil {
+ continue
+ }
+ v.redeemChildren()
+ v.redeem()
+ }
+ s.anyOfValidators = nil
+
+ for _, v := range s.allOfValidators {
+ if v == nil {
+ continue
+ }
+ v.redeemChildren()
+ v.redeem()
+ }
+ s.allOfValidators = nil
+
+ for _, v := range s.oneOfValidators {
+ if v == nil {
+ continue
+ }
+ v.redeemChildren()
+ v.redeem()
+ }
+ s.oneOfValidators = nil
+
+ if s.notValidator != nil {
+ s.notValidator.redeemChildren()
+ s.notValidator.redeem()
+ s.notValidator = nil
+ }
}
diff --git a/api/vendor/github.com/go-openapi/validate/slice_validator.go b/api/vendor/github.com/go-openapi/validate/slice_validator.go
index aa429f5184e6..13bb02087d91 100644
--- a/api/vendor/github.com/go-openapi/validate/slice_validator.go
+++ b/api/vendor/github.com/go-openapi/validate/slice_validator.go
@@ -32,7 +32,36 @@ type schemaSliceValidator struct {
Items *spec.SchemaOrArray
Root interface{}
KnownFormats strfmt.Registry
- Options SchemaValidatorOptions
+ Options *SchemaValidatorOptions
+}
+
+func newSliceValidator(path, in string,
+ maxItems, minItems *int64, uniqueItems bool,
+ additionalItems *spec.SchemaOrBool, items *spec.SchemaOrArray,
+ root interface{}, formats strfmt.Registry, opts *SchemaValidatorOptions) *schemaSliceValidator {
+ if opts == nil {
+ opts = new(SchemaValidatorOptions)
+ }
+
+ var v *schemaSliceValidator
+ if opts.recycleValidators {
+ v = pools.poolOfSliceValidators.BorrowValidator()
+ } else {
+ v = new(schemaSliceValidator)
+ }
+
+ v.Path = path
+ v.In = in
+ v.MaxItems = maxItems
+ v.MinItems = minItems
+ v.UniqueItems = uniqueItems
+ v.AdditionalItems = additionalItems
+ v.Items = items
+ v.Root = root
+ v.KnownFormats = formats
+ v.Options = opts
+
+ return v
}
func (s *schemaSliceValidator) SetPath(path string) {
@@ -46,7 +75,18 @@ func (s *schemaSliceValidator) Applies(source interface{}, kind reflect.Kind) bo
}
func (s *schemaSliceValidator) Validate(data interface{}) *Result {
- result := new(Result)
+ if s.Options.recycleValidators {
+ defer func() {
+ s.redeem()
+ }()
+ }
+
+ var result *Result
+ if s.Options.recycleResult {
+ result = pools.poolOfResults.BorrowResult()
+ } else {
+ result = new(Result)
+ }
if data == nil {
return result
}
@@ -54,8 +94,8 @@ func (s *schemaSliceValidator) Validate(data interface{}) *Result {
size := val.Len()
if s.Items != nil && s.Items.Schema != nil {
- validator := NewSchemaValidator(s.Items.Schema, s.Root, s.Path, s.KnownFormats, s.Options.Options()...)
for i := 0; i < size; i++ {
+ validator := newSchemaValidator(s.Items.Schema, s.Root, s.Path, s.KnownFormats, s.Options)
validator.SetPath(fmt.Sprintf("%s.%d", s.Path, i))
value := val.Index(i)
result.mergeForSlice(val, i, validator.Validate(value.Interface()))
@@ -66,10 +106,11 @@ func (s *schemaSliceValidator) Validate(data interface{}) *Result {
if s.Items != nil && len(s.Items.Schemas) > 0 {
itemsSize = len(s.Items.Schemas)
for i := 0; i < itemsSize; i++ {
- validator := NewSchemaValidator(&s.Items.Schemas[i], s.Root, fmt.Sprintf("%s.%d", s.Path, i), s.KnownFormats, s.Options.Options()...)
- if val.Len() <= i {
+ if size <= i {
break
}
+
+ validator := newSchemaValidator(&s.Items.Schemas[i], s.Root, fmt.Sprintf("%s.%d", s.Path, i), s.KnownFormats, s.Options)
result.mergeForSlice(val, i, validator.Validate(val.Index(i).Interface()))
}
}
@@ -79,7 +120,7 @@ func (s *schemaSliceValidator) Validate(data interface{}) *Result {
}
if s.AdditionalItems.Schema != nil {
for i := itemsSize; i < size-itemsSize+1; i++ {
- validator := NewSchemaValidator(s.AdditionalItems.Schema, s.Root, fmt.Sprintf("%s.%d", s.Path, i), s.KnownFormats, s.Options.Options()...)
+ validator := newSchemaValidator(s.AdditionalItems.Schema, s.Root, fmt.Sprintf("%s.%d", s.Path, i), s.KnownFormats, s.Options)
result.mergeForSlice(val, i, validator.Validate(val.Index(i).Interface()))
}
}
@@ -103,3 +144,7 @@ func (s *schemaSliceValidator) Validate(data interface{}) *Result {
result.Inc()
return result
}
+
+func (s *schemaSliceValidator) redeem() {
+ pools.poolOfSliceValidators.RedeemValidator(s)
+}
diff --git a/api/vendor/github.com/go-openapi/validate/spec.go b/api/vendor/github.com/go-openapi/validate/spec.go
index 5b867dd59fc8..965452566e1e 100644
--- a/api/vendor/github.com/go-openapi/validate/spec.go
+++ b/api/vendor/github.com/go-openapi/validate/spec.go
@@ -15,6 +15,8 @@
package validate
import (
+ "bytes"
+ "encoding/gob"
"encoding/json"
"fmt"
"sort"
@@ -26,6 +28,7 @@ import (
"github.com/go-openapi/loads"
"github.com/go-openapi/spec"
"github.com/go-openapi/strfmt"
+ "github.com/go-openapi/swag"
)
// Spec validates an OpenAPI 2.0 specification document.
@@ -52,25 +55,38 @@ func Spec(doc *loads.Document, formats strfmt.Registry) error {
// SpecValidator validates a swagger 2.0 spec
type SpecValidator struct {
- schema *spec.Schema // swagger 2.0 schema
- spec *loads.Document
- analyzer *analysis.Spec
- expanded *loads.Document
- KnownFormats strfmt.Registry
- Options Opts // validation options
+ schema *spec.Schema // swagger 2.0 schema
+ spec *loads.Document
+ analyzer *analysis.Spec
+ expanded *loads.Document
+ KnownFormats strfmt.Registry
+ Options Opts // validation options
+ schemaOptions *SchemaValidatorOptions
}
// NewSpecValidator creates a new swagger spec validator instance
func NewSpecValidator(schema *spec.Schema, formats strfmt.Registry) *SpecValidator {
+ // schema options that apply to all called validators
+ schemaOptions := new(SchemaValidatorOptions)
+ for _, o := range []Option{
+ SwaggerSchema(true),
+ WithRecycleValidators(true),
+ // withRecycleResults(true),
+ } {
+ o(schemaOptions)
+ }
+
return &SpecValidator{
- schema: schema,
- KnownFormats: formats,
- Options: defaultOpts,
+ schema: schema,
+ KnownFormats: formats,
+ Options: defaultOpts,
+ schemaOptions: schemaOptions,
}
}
// Validate validates the swagger spec
func (s *SpecValidator) Validate(data interface{}) (*Result, *Result) {
+ s.schemaOptions.skipSchemataResult = s.Options.SkipSchemataResult
var sd *loads.Document
errs, warnings := new(Result), new(Result)
@@ -84,11 +100,8 @@ func (s *SpecValidator) Validate(data interface{}) (*Result, *Result) {
s.spec = sd
s.analyzer = analysis.New(sd.Spec())
- // Swagger schema validator
- schv := NewSchemaValidator(s.schema, nil, "", s.KnownFormats, SwaggerSchema(true))
- var obj interface{}
-
// Raw spec unmarshalling errors
+ var obj interface{}
if err := json.Unmarshal(sd.Raw(), &obj); err != nil {
// NOTE: under normal conditions, the *load.Document has been already unmarshalled
// So this one is just a paranoid check on the behavior of the spec package
@@ -102,6 +115,8 @@ func (s *SpecValidator) Validate(data interface{}) (*Result, *Result) {
warnings.AddErrors(errs.Warnings...)
}()
+ // Swagger schema validator
+ schv := newSchemaValidator(s.schema, nil, "", s.KnownFormats, s.schemaOptions)
errs.Merge(schv.Validate(obj)) // error -
// There may be a point in continuing to try and determine more accurate errors
if !s.Options.ContinueOnErrors && errs.HasErrors() {
@@ -129,13 +144,13 @@ func (s *SpecValidator) Validate(data interface{}) (*Result, *Result) {
}
// Values provided as default MUST validate their schema
- df := &defaultValidator{SpecValidator: s}
+ df := &defaultValidator{SpecValidator: s, schemaOptions: s.schemaOptions}
errs.Merge(df.Validate())
// Values provided as examples MUST validate their schema
// Value provided as examples in a response without schema generate a warning
// Known limitations: examples in responses for mime type not application/json are ignored (warning)
- ex := &exampleValidator{SpecValidator: s}
+ ex := &exampleValidator{SpecValidator: s, schemaOptions: s.schemaOptions}
errs.Merge(ex.Validate())
errs.Merge(s.validateNonEmptyPathParamNames())
@@ -147,22 +162,27 @@ func (s *SpecValidator) Validate(data interface{}) (*Result, *Result) {
}
func (s *SpecValidator) validateNonEmptyPathParamNames() *Result {
- res := new(Result)
+ res := pools.poolOfResults.BorrowResult()
if s.spec.Spec().Paths == nil {
// There is no Paths object: error
res.AddErrors(noValidPathMsg())
- } else {
- if s.spec.Spec().Paths.Paths == nil {
- // Paths may be empty: warning
- res.AddWarnings(noValidPathMsg())
- } else {
- for k := range s.spec.Spec().Paths.Paths {
- if strings.Contains(k, "{}") {
- res.AddErrors(emptyPathParameterMsg(k))
- }
- }
+
+ return res
+ }
+
+ if s.spec.Spec().Paths.Paths == nil {
+ // Paths may be empty: warning
+ res.AddWarnings(noValidPathMsg())
+
+ return res
+ }
+
+ for k := range s.spec.Spec().Paths.Paths {
+ if strings.Contains(k, "{}") {
+ res.AddErrors(emptyPathParameterMsg(k))
}
}
+
return res
}
@@ -176,7 +196,7 @@ func (s *SpecValidator) validateDuplicateOperationIDs() *Result {
// fallback on possible incomplete picture because of previous errors
analyzer = s.analyzer
}
- res := new(Result)
+ res := pools.poolOfResults.BorrowResult()
known := make(map[string]int)
for _, v := range analyzer.OperationIDs() {
if v != "" {
@@ -198,7 +218,7 @@ type dupProp struct {
func (s *SpecValidator) validateDuplicatePropertyNames() *Result {
// definition can't declare a property that's already defined by one of its ancestors
- res := new(Result)
+ res := pools.poolOfResults.BorrowResult()
for k, sch := range s.spec.Spec().Definitions {
if len(sch.AllOf) == 0 {
continue
@@ -247,7 +267,7 @@ func (s *SpecValidator) validateSchemaPropertyNames(nm string, sch spec.Schema,
schn := nm
schc := &sch
- res := new(Result)
+ res := pools.poolOfResults.BorrowResult()
for schc.Ref.String() != "" {
// gather property names
@@ -284,7 +304,7 @@ func (s *SpecValidator) validateSchemaPropertyNames(nm string, sch spec.Schema,
}
func (s *SpecValidator) validateCircularAncestry(nm string, sch spec.Schema, knowns map[string]struct{}) ([]string, *Result) {
- res := new(Result)
+ res := pools.poolOfResults.BorrowResult()
if sch.Ref.String() == "" && len(sch.AllOf) == 0 { // Safeguard. We should not be able to actually get there
return nil, res
@@ -334,7 +354,7 @@ func (s *SpecValidator) validateCircularAncestry(nm string, sch spec.Schema, kno
func (s *SpecValidator) validateItems() *Result {
// validate parameter, items, schema and response objects for presence of item if type is array
- res := new(Result)
+ res := pools.poolOfResults.BorrowResult()
for method, pi := range s.analyzer.Operations() {
for path, op := range pi {
@@ -393,7 +413,7 @@ func (s *SpecValidator) validateItems() *Result {
// Verifies constraints on array type
func (s *SpecValidator) validateSchemaItems(schema spec.Schema, prefix, opID string) *Result {
- res := new(Result)
+ res := pools.poolOfResults.BorrowResult()
if !schema.Type.Contains(arrayType) {
return res
}
@@ -417,7 +437,7 @@ func (s *SpecValidator) validateSchemaItems(schema spec.Schema, prefix, opID str
func (s *SpecValidator) validatePathParamPresence(path string, fromPath, fromOperation []string) *Result {
// Each defined operation path parameters must correspond to a named element in the API's path pattern.
// (For example, you cannot have a path parameter named id for the following path /pets/{petId} but you must have a path parameter named petId.)
- res := new(Result)
+ res := pools.poolOfResults.BorrowResult()
for _, l := range fromPath {
var matched bool
for _, r := range fromOperation {
@@ -455,7 +475,6 @@ func (s *SpecValidator) validateReferenced() *Result {
return &res
}
-// nolint: dupl
func (s *SpecValidator) validateReferencedParameters() *Result {
// Each referenceable definition should have references.
params := s.spec.Spec().Parameters
@@ -474,14 +493,13 @@ func (s *SpecValidator) validateReferencedParameters() *Result {
if len(expected) == 0 {
return nil
}
- result := new(Result)
+ result := pools.poolOfResults.BorrowResult()
for k := range expected {
result.AddWarnings(unusedParamMsg(k))
}
return result
}
-// nolint: dupl
func (s *SpecValidator) validateReferencedResponses() *Result {
// Each referenceable definition should have references.
responses := s.spec.Spec().Responses
@@ -500,14 +518,13 @@ func (s *SpecValidator) validateReferencedResponses() *Result {
if len(expected) == 0 {
return nil
}
- result := new(Result)
+ result := pools.poolOfResults.BorrowResult()
for k := range expected {
result.AddWarnings(unusedResponseMsg(k))
}
return result
}
-// nolint: dupl
func (s *SpecValidator) validateReferencedDefinitions() *Result {
// Each referenceable definition must have references.
defs := s.spec.Spec().Definitions
@@ -536,7 +553,7 @@ func (s *SpecValidator) validateReferencedDefinitions() *Result {
func (s *SpecValidator) validateRequiredDefinitions() *Result {
// Each property listed in the required array must be defined in the properties of the model
- res := new(Result)
+ res := pools.poolOfResults.BorrowResult()
DEFINITIONS:
for d, schema := range s.spec.Spec().Definitions {
@@ -555,7 +572,7 @@ DEFINITIONS:
func (s *SpecValidator) validateRequiredProperties(path, in string, v *spec.Schema) *Result {
// Takes care of recursive property definitions, which may be nested in additionalProperties schemas
- res := new(Result)
+ res := pools.poolOfResults.BorrowResult()
propertyMatch := false
patternMatch := false
additionalPropertiesMatch := false
@@ -621,7 +638,7 @@ func (s *SpecValidator) validateParameters() *Result {
// - parameters with pattern property must specify valid patterns
// - $ref in parameters must resolve
// - path param must be required
- res := new(Result)
+ res := pools.poolOfResults.BorrowResult()
rexGarbledPathSegment := mustCompileRegexp(`.*[{}\s]+.*`)
for method, pi := range s.expandedAnalyzer().Operations() {
methodPaths := make(map[string]map[string]string)
@@ -660,7 +677,23 @@ func (s *SpecValidator) validateParameters() *Result {
// TODO: should be done after param expansion
res.Merge(s.checkUniqueParams(path, method, op))
+ // pick the root schema from the swagger specification which describes a parameter
+ origSchema, ok := s.schema.Definitions["parameter"]
+ if !ok {
+ panic("unexpected swagger schema: missing #/definitions/parameter")
+ }
+ // clone it once to avoid expanding a global schema (e.g. swagger spec)
+ paramSchema, err := deepCloneSchema(origSchema)
+ if err != nil {
+ panic(fmt.Errorf("can't clone schema: %v", err))
+ }
+
for _, pr := range paramHelp.safeExpandedParamsFor(path, method, op.ID, res, s) {
+ // An expanded parameter must validate the Parameter schema (an unexpanded $ref always passes high-level schema validation)
+ schv := newSchemaValidator(¶mSchema, s.schema, fmt.Sprintf("%s.%s.parameters.%s", path, method, pr.Name), s.KnownFormats, s.schemaOptions)
+ obj := swag.ToDynamicJSON(pr)
+ res.Merge(schv.Validate(obj))
+
// Validate pattern regexp for parameters with a Pattern property
if _, err := compileRegexp(pr.Pattern); err != nil {
res.AddErrors(invalidPatternInParamMsg(op.ID, pr.Name, pr.Pattern))
@@ -742,7 +775,7 @@ func (s *SpecValidator) validateParameters() *Result {
func (s *SpecValidator) validateReferencesValid() *Result {
// each reference must point to a valid object
- res := new(Result)
+ res := pools.poolOfResults.BorrowResult()
for _, r := range s.analyzer.AllRefs() {
if !r.IsValidURI(s.spec.SpecFilePath()) { // Safeguard - spec should always yield a valid URI
res.AddErrors(invalidRefMsg(r.String()))
@@ -768,7 +801,7 @@ func (s *SpecValidator) checkUniqueParams(path, method string, op *spec.Operatio
// However, there are some issues with such a factorization:
// - analysis does not seem to fully expand params
// - param keys may be altered by x-go-name
- res := new(Result)
+ res := pools.poolOfResults.BorrowResult()
pnames := make(map[string]struct{})
if op.Parameters != nil { // Safeguard
@@ -803,3 +836,17 @@ func (s *SpecValidator) expandedAnalyzer() *analysis.Spec {
}
return s.analyzer
}
+
+func deepCloneSchema(src spec.Schema) (spec.Schema, error) {
+ var b bytes.Buffer
+ if err := gob.NewEncoder(&b).Encode(src); err != nil {
+ return spec.Schema{}, err
+ }
+
+ var dst spec.Schema
+ if err := gob.NewDecoder(&b).Decode(&dst); err != nil {
+ return spec.Schema{}, err
+ }
+
+ return dst, nil
+}
diff --git a/api/vendor/github.com/go-openapi/validate/spec_messages.go b/api/vendor/github.com/go-openapi/validate/spec_messages.go
index 5398679bffef..6d1f0f819cb4 100644
--- a/api/vendor/github.com/go-openapi/validate/spec_messages.go
+++ b/api/vendor/github.com/go-openapi/validate/spec_messages.go
@@ -187,6 +187,8 @@ const (
// UnusedResponseWarning ...
UnusedResponseWarning = "response %q is not used anywhere"
+
+ InvalidObject = "expected an object in %q.%s"
)
// Additional error codes
@@ -347,6 +349,9 @@ func invalidParameterDefinitionAsSchemaMsg(path, method, operationID string) err
func parameterValidationTypeMismatchMsg(param, path, typ string) errors.Error {
return errors.New(errors.CompositeErrorCode, ParamValidationTypeMismatch, param, path, typ)
}
+func invalidObjectMsg(path, in string) errors.Error {
+ return errors.New(errors.CompositeErrorCode, InvalidObject, path, in)
+}
// disabled
//
diff --git a/api/vendor/github.com/go-openapi/validate/type.go b/api/vendor/github.com/go-openapi/validate/type.go
index 876467588f55..f87abb3d5607 100644
--- a/api/vendor/github.com/go-openapi/validate/type.go
+++ b/api/vendor/github.com/go-openapi/validate/type.go
@@ -25,11 +25,34 @@ import (
)
type typeValidator struct {
+ Path string
+ In string
Type spec.StringOrArray
Nullable bool
Format string
- In string
- Path string
+ Options *SchemaValidatorOptions
+}
+
+func newTypeValidator(path, in string, typ spec.StringOrArray, nullable bool, format string, opts *SchemaValidatorOptions) *typeValidator {
+ if opts == nil {
+ opts = new(SchemaValidatorOptions)
+ }
+
+ var t *typeValidator
+ if opts.recycleValidators {
+ t = pools.poolOfTypeValidators.BorrowValidator()
+ } else {
+ t = new(typeValidator)
+ }
+
+ t.Path = path
+ t.In = in
+ t.Type = typ
+ t.Nullable = nullable
+ t.Format = format
+ t.Options = opts
+
+ return t
}
func (t *typeValidator) schemaInfoForType(data interface{}) (string, string) {
@@ -90,7 +113,7 @@ func (t *typeValidator) schemaInfoForType(data interface{}) (string, string) {
default:
val := reflect.ValueOf(data)
tpe := val.Type()
- switch tpe.Kind() {
+ switch tpe.Kind() { //nolint:exhaustive
case reflect.Bool:
return booleanType, ""
case reflect.String:
@@ -125,23 +148,33 @@ func (t *typeValidator) SetPath(path string) {
t.Path = path
}
-func (t *typeValidator) Applies(source interface{}, kind reflect.Kind) bool {
+func (t *typeValidator) Applies(source interface{}, _ reflect.Kind) bool {
// typeValidator applies to Schema, Parameter and Header objects
- stpe := reflect.TypeOf(source)
- r := (len(t.Type) > 0 || t.Format != "") && (stpe == specSchemaType || stpe == specParameterType || stpe == specHeaderType)
- debugLog("type validator for %q applies %t for %T (kind: %v)\n", t.Path, r, source, kind)
- return r
+ switch source.(type) {
+ case *spec.Schema:
+ case *spec.Parameter:
+ case *spec.Header:
+ default:
+ return false
+ }
+
+ return (len(t.Type) > 0 || t.Format != "")
}
func (t *typeValidator) Validate(data interface{}) *Result {
- result := new(Result)
- result.Inc()
+ if t.Options.recycleValidators {
+ defer func() {
+ t.redeem()
+ }()
+ }
+
if data == nil {
// nil or zero value for the passed structure require Type: null
if len(t.Type) > 0 && !t.Type.Contains(nullType) && !t.Nullable { // TODO: if a property is not required it also passes this
- return errorHelp.sErr(errors.InvalidType(t.Path, t.In, strings.Join(t.Type, ","), nullType))
+ return errorHelp.sErr(errors.InvalidType(t.Path, t.In, strings.Join(t.Type, ","), nullType), t.Options.recycleResult)
}
- return result
+
+ return emptyResult
}
// check if the type matches, should be used in every validator chain as first item
@@ -151,8 +184,6 @@ func (t *typeValidator) Validate(data interface{}) *Result {
// infer schema type (JSON) and format from passed data type
schType, format := t.schemaInfoForType(data)
- debugLog("path: %s, schType: %s, format: %s, expType: %s, expFmt: %s, kind: %s", t.Path, schType, format, t.Type, t.Format, val.Kind().String())
-
// check numerical types
// TODO: check unsigned ints
// TODO: check json.Number (see schema.go)
@@ -163,15 +194,20 @@ func (t *typeValidator) Validate(data interface{}) *Result {
if kind != reflect.String && kind != reflect.Slice && t.Format != "" && !(t.Type.Contains(schType) || format == t.Format || isFloatInt || isIntFloat || isLowerInt || isLowerFloat) {
// TODO: test case
- return errorHelp.sErr(errors.InvalidType(t.Path, t.In, t.Format, format))
+ return errorHelp.sErr(errors.InvalidType(t.Path, t.In, t.Format, format), t.Options.recycleResult)
}
if !(t.Type.Contains(numberType) || t.Type.Contains(integerType)) && t.Format != "" && (kind == reflect.String || kind == reflect.Slice) {
- return result
+ return emptyResult
}
if !(t.Type.Contains(schType) || isFloatInt || isIntFloat) {
- return errorHelp.sErr(errors.InvalidType(t.Path, t.In, strings.Join(t.Type, ","), schType))
+ return errorHelp.sErr(errors.InvalidType(t.Path, t.In, strings.Join(t.Type, ","), schType), t.Options.recycleResult)
}
- return result
+
+ return emptyResult
+}
+
+func (t *typeValidator) redeem() {
+ pools.poolOfTypeValidators.RedeemValidator(t)
}
diff --git a/api/vendor/github.com/go-openapi/validate/validator.go b/api/vendor/github.com/go-openapi/validate/validator.go
index ee01f2a7b758..c083aecc9da9 100644
--- a/api/vendor/github.com/go-openapi/validate/validator.go
+++ b/api/vendor/github.com/go-openapi/validate/validator.go
@@ -39,20 +39,31 @@ type itemsValidator struct {
root interface{}
path string
in string
- validators []valueValidator
+ validators [6]valueValidator
KnownFormats strfmt.Registry
+ Options *SchemaValidatorOptions
}
-func newItemsValidator(path, in string, items *spec.Items, root interface{}, formats strfmt.Registry) *itemsValidator {
- iv := &itemsValidator{path: path, in: in, items: items, root: root, KnownFormats: formats}
- iv.validators = []valueValidator{
- &typeValidator{
- Type: spec.StringOrArray([]string{items.Type}),
- Nullable: items.Nullable,
- Format: items.Format,
- In: in,
- Path: path,
- },
+func newItemsValidator(path, in string, items *spec.Items, root interface{}, formats strfmt.Registry, opts *SchemaValidatorOptions) *itemsValidator {
+ if opts == nil {
+ opts = new(SchemaValidatorOptions)
+ }
+
+ var iv *itemsValidator
+ if opts.recycleValidators {
+ iv = pools.poolOfItemsValidators.BorrowValidator()
+ } else {
+ iv = new(itemsValidator)
+ }
+
+ iv.path = path
+ iv.in = in
+ iv.items = items
+ iv.root = root
+ iv.KnownFormats = formats
+ iv.Options = opts
+ iv.validators = [6]valueValidator{
+ iv.typeValidator(),
iv.stringValidator(),
iv.formatValidator(),
iv.numberValidator(),
@@ -63,77 +74,152 @@ func newItemsValidator(path, in string, items *spec.Items, root interface{}, for
}
func (i *itemsValidator) Validate(index int, data interface{}) *Result {
+ if i.Options.recycleValidators {
+ defer func() {
+ i.redeemChildren()
+ i.redeem()
+ }()
+ }
+
tpe := reflect.TypeOf(data)
kind := tpe.Kind()
- mainResult := new(Result)
+ var result *Result
+ if i.Options.recycleResult {
+ result = pools.poolOfResults.BorrowResult()
+ } else {
+ result = new(Result)
+ }
+
path := fmt.Sprintf("%s.%d", i.path, index)
- for _, validator := range i.validators {
+ for idx, validator := range i.validators {
+ if !validator.Applies(i.root, kind) {
+ if i.Options.recycleValidators {
+ // Validate won't be called, so relinquish this validator
+ if redeemableChildren, ok := validator.(interface{ redeemChildren() }); ok {
+ redeemableChildren.redeemChildren()
+ }
+ if redeemable, ok := validator.(interface{ redeem() }); ok {
+ redeemable.redeem()
+ }
+ i.validators[idx] = nil // prevents further (unsafe) usage
+ }
+
+ continue
+ }
+
validator.SetPath(path)
- if validator.Applies(i.root, kind) {
- result := validator.Validate(data)
- mainResult.Merge(result)
- mainResult.Inc()
- if result != nil && result.HasErrors() {
- return mainResult
+ err := validator.Validate(data)
+ if i.Options.recycleValidators {
+ i.validators[idx] = nil // prevents further (unsafe) usage
+ }
+ if err != nil {
+ result.Inc()
+ if err.HasErrors() {
+ result.Merge(err)
+
+ break
}
+
+ result.Merge(err)
}
}
- return mainResult
+
+ return result
+}
+
+func (i *itemsValidator) typeValidator() valueValidator {
+ return newTypeValidator(
+ i.path,
+ i.in,
+ spec.StringOrArray([]string{i.items.Type}),
+ i.items.Nullable,
+ i.items.Format,
+ i.Options,
+ )
}
func (i *itemsValidator) commonValidator() valueValidator {
- return &basicCommonValidator{
- In: i.in,
- Default: i.items.Default,
- Enum: i.items.Enum,
- }
+ return newBasicCommonValidator(
+ "",
+ i.in,
+ i.items.Default,
+ i.items.Enum,
+ i.Options,
+ )
}
func (i *itemsValidator) sliceValidator() valueValidator {
- return &basicSliceValidator{
- In: i.in,
- Default: i.items.Default,
- MaxItems: i.items.MaxItems,
- MinItems: i.items.MinItems,
- UniqueItems: i.items.UniqueItems,
- Source: i.root,
- Items: i.items.Items,
- KnownFormats: i.KnownFormats,
- }
+ return newBasicSliceValidator(
+ "",
+ i.in,
+ i.items.Default,
+ i.items.MaxItems,
+ i.items.MinItems,
+ i.items.UniqueItems,
+ i.items.Items,
+ i.root,
+ i.KnownFormats,
+ i.Options,
+ )
}
func (i *itemsValidator) numberValidator() valueValidator {
- return &numberValidator{
- In: i.in,
- Default: i.items.Default,
- MultipleOf: i.items.MultipleOf,
- Maximum: i.items.Maximum,
- ExclusiveMaximum: i.items.ExclusiveMaximum,
- Minimum: i.items.Minimum,
- ExclusiveMinimum: i.items.ExclusiveMinimum,
- Type: i.items.Type,
- Format: i.items.Format,
- }
+ return newNumberValidator(
+ "",
+ i.in,
+ i.items.Default,
+ i.items.MultipleOf,
+ i.items.Maximum,
+ i.items.ExclusiveMaximum,
+ i.items.Minimum,
+ i.items.ExclusiveMinimum,
+ i.items.Type,
+ i.items.Format,
+ i.Options,
+ )
}
func (i *itemsValidator) stringValidator() valueValidator {
- return &stringValidator{
- In: i.in,
- Default: i.items.Default,
- MaxLength: i.items.MaxLength,
- MinLength: i.items.MinLength,
- Pattern: i.items.Pattern,
- AllowEmptyValue: false,
- }
+ return newStringValidator(
+ "",
+ i.in,
+ i.items.Default,
+ false, // Required
+ false, // AllowEmpty
+ i.items.MaxLength,
+ i.items.MinLength,
+ i.items.Pattern,
+ i.Options,
+ )
}
func (i *itemsValidator) formatValidator() valueValidator {
- return &formatValidator{
- In: i.in,
- //Default: i.items.Default,
- Format: i.items.Format,
- KnownFormats: i.KnownFormats,
+ return newFormatValidator(
+ "",
+ i.in,
+ i.items.Format,
+ i.KnownFormats,
+ i.Options,
+ )
+}
+
+func (i *itemsValidator) redeem() {
+ pools.poolOfItemsValidators.RedeemValidator(i)
+}
+
+func (i *itemsValidator) redeemChildren() {
+ for idx, validator := range i.validators {
+ if validator == nil {
+ continue
+ }
+ if redeemableChildren, ok := validator.(interface{ redeemChildren() }); ok {
+ redeemableChildren.redeemChildren()
+ }
+ if redeemable, ok := validator.(interface{ redeem() }); ok {
+ redeemable.redeem()
+ }
+ i.validators[idx] = nil // free up allocated children if not in pool
}
}
@@ -142,6 +228,28 @@ type basicCommonValidator struct {
In string
Default interface{}
Enum []interface{}
+ Options *SchemaValidatorOptions
+}
+
+func newBasicCommonValidator(path, in string, def interface{}, enum []interface{}, opts *SchemaValidatorOptions) *basicCommonValidator {
+ if opts == nil {
+ opts = new(SchemaValidatorOptions)
+ }
+
+ var b *basicCommonValidator
+ if opts.recycleValidators {
+ b = pools.poolOfBasicCommonValidators.BorrowValidator()
+ } else {
+ b = new(basicCommonValidator)
+ }
+
+ b.Path = path
+ b.In = in
+ b.Default = def
+ b.Enum = enum
+ b.Options = opts
+
+ return b
}
func (b *basicCommonValidator) SetPath(path string) {
@@ -152,255 +260,469 @@ func (b *basicCommonValidator) Applies(source interface{}, _ reflect.Kind) bool
switch source.(type) {
case *spec.Parameter, *spec.Schema, *spec.Header:
return true
+ default:
+ return false
}
- return false
}
func (b *basicCommonValidator) Validate(data interface{}) (res *Result) {
- if len(b.Enum) > 0 {
- for _, enumValue := range b.Enum {
- actualType := reflect.TypeOf(enumValue)
- if actualType != nil { // Safeguard
- expectedValue := reflect.ValueOf(data)
- if expectedValue.IsValid() && expectedValue.Type().ConvertibleTo(actualType) {
- if reflect.DeepEqual(expectedValue.Convert(actualType).Interface(), enumValue) {
- return nil
- }
- }
- }
+ if b.Options.recycleValidators {
+ defer func() {
+ b.redeem()
+ }()
+ }
+
+ if len(b.Enum) == 0 {
+ return nil
+ }
+
+ for _, enumValue := range b.Enum {
+ actualType := reflect.TypeOf(enumValue)
+ if actualType == nil { // Safeguard
+ continue
+ }
+
+ expectedValue := reflect.ValueOf(data)
+ if expectedValue.IsValid() &&
+ expectedValue.Type().ConvertibleTo(actualType) &&
+ reflect.DeepEqual(expectedValue.Convert(actualType).Interface(), enumValue) {
+ return nil
}
- return errorHelp.sErr(errors.EnumFail(b.Path, b.In, data, b.Enum))
}
- return nil
+
+ return errorHelp.sErr(errors.EnumFail(b.Path, b.In, data, b.Enum), b.Options.recycleResult)
+}
+
+func (b *basicCommonValidator) redeem() {
+ pools.poolOfBasicCommonValidators.RedeemValidator(b)
}
// A HeaderValidator has very limited subset of validations to apply
type HeaderValidator struct {
name string
header *spec.Header
- validators []valueValidator
+ validators [6]valueValidator
KnownFormats strfmt.Registry
+ Options *SchemaValidatorOptions
}
// NewHeaderValidator creates a new header validator object
-func NewHeaderValidator(name string, header *spec.Header, formats strfmt.Registry) *HeaderValidator {
- p := &HeaderValidator{name: name, header: header, KnownFormats: formats}
- p.validators = []valueValidator{
- &typeValidator{
- Type: spec.StringOrArray([]string{header.Type}),
- Nullable: header.Nullable,
- Format: header.Format,
- In: "header",
- Path: name,
- },
+func NewHeaderValidator(name string, header *spec.Header, formats strfmt.Registry, options ...Option) *HeaderValidator {
+ opts := new(SchemaValidatorOptions)
+ for _, o := range options {
+ o(opts)
+ }
+
+ return newHeaderValidator(name, header, formats, opts)
+}
+
+func newHeaderValidator(name string, header *spec.Header, formats strfmt.Registry, opts *SchemaValidatorOptions) *HeaderValidator {
+ if opts == nil {
+ opts = new(SchemaValidatorOptions)
+ }
+
+ var p *HeaderValidator
+ if opts.recycleValidators {
+ p = pools.poolOfHeaderValidators.BorrowValidator()
+ } else {
+ p = new(HeaderValidator)
+ }
+
+ p.name = name
+ p.header = header
+ p.KnownFormats = formats
+ p.Options = opts
+ p.validators = [6]valueValidator{
+ newTypeValidator(
+ name,
+ "header",
+ spec.StringOrArray([]string{header.Type}),
+ header.Nullable,
+ header.Format,
+ p.Options,
+ ),
p.stringValidator(),
p.formatValidator(),
p.numberValidator(),
p.sliceValidator(),
p.commonValidator(),
}
+
return p
}
// Validate the value of the header against its schema
func (p *HeaderValidator) Validate(data interface{}) *Result {
- result := new(Result)
+ if p.Options.recycleValidators {
+ defer func() {
+ p.redeemChildren()
+ p.redeem()
+ }()
+ }
+
+ if data == nil {
+ return nil
+ }
+
+ var result *Result
+ if p.Options.recycleResult {
+ result = pools.poolOfResults.BorrowResult()
+ } else {
+ result = new(Result)
+ }
+
tpe := reflect.TypeOf(data)
kind := tpe.Kind()
- for _, validator := range p.validators {
- if validator.Applies(p.header, kind) {
- if err := validator.Validate(data); err != nil {
- result.Merge(err)
- if err.HasErrors() {
- return result
+ for idx, validator := range p.validators {
+ if !validator.Applies(p.header, kind) {
+ if p.Options.recycleValidators {
+ // Validate won't be called, so relinquish this validator
+ if redeemableChildren, ok := validator.(interface{ redeemChildren() }); ok {
+ redeemableChildren.redeemChildren()
+ }
+ if redeemable, ok := validator.(interface{ redeem() }); ok {
+ redeemable.redeem()
}
+ p.validators[idx] = nil // prevents further (unsafe) usage
}
+
+ continue
+ }
+
+ err := validator.Validate(data)
+ if p.Options.recycleValidators {
+ p.validators[idx] = nil // prevents further (unsafe) usage
+ }
+ if err != nil {
+ if err.HasErrors() {
+ result.Merge(err)
+ break
+ }
+ result.Merge(err)
}
}
- return nil
+
+ return result
}
func (p *HeaderValidator) commonValidator() valueValidator {
- return &basicCommonValidator{
- Path: p.name,
- In: "response",
- Default: p.header.Default,
- Enum: p.header.Enum,
- }
+ return newBasicCommonValidator(
+ p.name,
+ "response",
+ p.header.Default,
+ p.header.Enum,
+ p.Options,
+ )
}
func (p *HeaderValidator) sliceValidator() valueValidator {
- return &basicSliceValidator{
- Path: p.name,
- In: "response",
- Default: p.header.Default,
- MaxItems: p.header.MaxItems,
- MinItems: p.header.MinItems,
- UniqueItems: p.header.UniqueItems,
- Items: p.header.Items,
- Source: p.header,
- KnownFormats: p.KnownFormats,
- }
+ return newBasicSliceValidator(
+ p.name,
+ "response",
+ p.header.Default,
+ p.header.MaxItems,
+ p.header.MinItems,
+ p.header.UniqueItems,
+ p.header.Items,
+ p.header,
+ p.KnownFormats,
+ p.Options,
+ )
}
func (p *HeaderValidator) numberValidator() valueValidator {
- return &numberValidator{
- Path: p.name,
- In: "response",
- Default: p.header.Default,
- MultipleOf: p.header.MultipleOf,
- Maximum: p.header.Maximum,
- ExclusiveMaximum: p.header.ExclusiveMaximum,
- Minimum: p.header.Minimum,
- ExclusiveMinimum: p.header.ExclusiveMinimum,
- Type: p.header.Type,
- Format: p.header.Format,
- }
+ return newNumberValidator(
+ p.name,
+ "response",
+ p.header.Default,
+ p.header.MultipleOf,
+ p.header.Maximum,
+ p.header.ExclusiveMaximum,
+ p.header.Minimum,
+ p.header.ExclusiveMinimum,
+ p.header.Type,
+ p.header.Format,
+ p.Options,
+ )
}
func (p *HeaderValidator) stringValidator() valueValidator {
- return &stringValidator{
- Path: p.name,
- In: "response",
- Default: p.header.Default,
- Required: true,
- MaxLength: p.header.MaxLength,
- MinLength: p.header.MinLength,
- Pattern: p.header.Pattern,
- AllowEmptyValue: false,
- }
+ return newStringValidator(
+ p.name,
+ "response",
+ p.header.Default,
+ true,
+ false,
+ p.header.MaxLength,
+ p.header.MinLength,
+ p.header.Pattern,
+ p.Options,
+ )
}
func (p *HeaderValidator) formatValidator() valueValidator {
- return &formatValidator{
- Path: p.name,
- In: "response",
- //Default: p.header.Default,
- Format: p.header.Format,
- KnownFormats: p.KnownFormats,
+ return newFormatValidator(
+ p.name,
+ "response",
+ p.header.Format,
+ p.KnownFormats,
+ p.Options,
+ )
+}
+
+func (p *HeaderValidator) redeem() {
+ pools.poolOfHeaderValidators.RedeemValidator(p)
+}
+
+func (p *HeaderValidator) redeemChildren() {
+ for idx, validator := range p.validators {
+ if validator == nil {
+ continue
+ }
+ if redeemableChildren, ok := validator.(interface{ redeemChildren() }); ok {
+ redeemableChildren.redeemChildren()
+ }
+ if redeemable, ok := validator.(interface{ redeem() }); ok {
+ redeemable.redeem()
+ }
+ p.validators[idx] = nil // free up allocated children if not in pool
}
}
// A ParamValidator has very limited subset of validations to apply
type ParamValidator struct {
param *spec.Parameter
- validators []valueValidator
+ validators [6]valueValidator
KnownFormats strfmt.Registry
+ Options *SchemaValidatorOptions
}
// NewParamValidator creates a new param validator object
-func NewParamValidator(param *spec.Parameter, formats strfmt.Registry) *ParamValidator {
- p := &ParamValidator{param: param, KnownFormats: formats}
- p.validators = []valueValidator{
- &typeValidator{
- Type: spec.StringOrArray([]string{param.Type}),
- Nullable: param.Nullable,
- Format: param.Format,
- In: param.In,
- Path: param.Name,
- },
+func NewParamValidator(param *spec.Parameter, formats strfmt.Registry, options ...Option) *ParamValidator {
+ opts := new(SchemaValidatorOptions)
+ for _, o := range options {
+ o(opts)
+ }
+
+ return newParamValidator(param, formats, opts)
+}
+
+func newParamValidator(param *spec.Parameter, formats strfmt.Registry, opts *SchemaValidatorOptions) *ParamValidator {
+ if opts == nil {
+ opts = new(SchemaValidatorOptions)
+ }
+
+ var p *ParamValidator
+ if opts.recycleValidators {
+ p = pools.poolOfParamValidators.BorrowValidator()
+ } else {
+ p = new(ParamValidator)
+ }
+
+ p.param = param
+ p.KnownFormats = formats
+ p.Options = opts
+ p.validators = [6]valueValidator{
+ newTypeValidator(
+ param.Name,
+ param.In,
+ spec.StringOrArray([]string{param.Type}),
+ param.Nullable,
+ param.Format,
+ p.Options,
+ ),
p.stringValidator(),
p.formatValidator(),
p.numberValidator(),
p.sliceValidator(),
p.commonValidator(),
}
+
return p
}
// Validate the data against the description of the parameter
func (p *ParamValidator) Validate(data interface{}) *Result {
- result := new(Result)
+ if data == nil {
+ return nil
+ }
+
+ var result *Result
+ if p.Options.recycleResult {
+ result = pools.poolOfResults.BorrowResult()
+ } else {
+ result = new(Result)
+ }
+
tpe := reflect.TypeOf(data)
kind := tpe.Kind()
+ if p.Options.recycleValidators {
+ defer func() {
+ p.redeemChildren()
+ p.redeem()
+ }()
+ }
+
// TODO: validate type
- for _, validator := range p.validators {
- if validator.Applies(p.param, kind) {
- if err := validator.Validate(data); err != nil {
- result.Merge(err)
- if err.HasErrors() {
- return result
+ for idx, validator := range p.validators {
+ if !validator.Applies(p.param, kind) {
+ if p.Options.recycleValidators {
+ // Validate won't be called, so relinquish this validator
+ if redeemableChildren, ok := validator.(interface{ redeemChildren() }); ok {
+ redeemableChildren.redeemChildren()
+ }
+ if redeemable, ok := validator.(interface{ redeem() }); ok {
+ redeemable.redeem()
}
+ p.validators[idx] = nil // prevents further (unsafe) usage
}
+
+ continue
+ }
+
+ err := validator.Validate(data)
+ if p.Options.recycleValidators {
+ p.validators[idx] = nil // prevents further (unsafe) usage
+ }
+ if err != nil {
+ if err.HasErrors() {
+ result.Merge(err)
+ break
+ }
+ result.Merge(err)
}
}
- return nil
+
+ return result
}
func (p *ParamValidator) commonValidator() valueValidator {
- return &basicCommonValidator{
- Path: p.param.Name,
- In: p.param.In,
- Default: p.param.Default,
- Enum: p.param.Enum,
- }
+ return newBasicCommonValidator(
+ p.param.Name,
+ p.param.In,
+ p.param.Default,
+ p.param.Enum,
+ p.Options,
+ )
}
func (p *ParamValidator) sliceValidator() valueValidator {
- return &basicSliceValidator{
- Path: p.param.Name,
- In: p.param.In,
- Default: p.param.Default,
- MaxItems: p.param.MaxItems,
- MinItems: p.param.MinItems,
- UniqueItems: p.param.UniqueItems,
- Items: p.param.Items,
- Source: p.param,
- KnownFormats: p.KnownFormats,
- }
+ return newBasicSliceValidator(
+ p.param.Name,
+ p.param.In,
+ p.param.Default,
+ p.param.MaxItems,
+ p.param.MinItems,
+ p.param.UniqueItems,
+ p.param.Items,
+ p.param,
+ p.KnownFormats,
+ p.Options,
+ )
}
func (p *ParamValidator) numberValidator() valueValidator {
- return &numberValidator{
- Path: p.param.Name,
- In: p.param.In,
- Default: p.param.Default,
- MultipleOf: p.param.MultipleOf,
- Maximum: p.param.Maximum,
- ExclusiveMaximum: p.param.ExclusiveMaximum,
- Minimum: p.param.Minimum,
- ExclusiveMinimum: p.param.ExclusiveMinimum,
- Type: p.param.Type,
- Format: p.param.Format,
- }
+ return newNumberValidator(
+ p.param.Name,
+ p.param.In,
+ p.param.Default,
+ p.param.MultipleOf,
+ p.param.Maximum,
+ p.param.ExclusiveMaximum,
+ p.param.Minimum,
+ p.param.ExclusiveMinimum,
+ p.param.Type,
+ p.param.Format,
+ p.Options,
+ )
}
func (p *ParamValidator) stringValidator() valueValidator {
- return &stringValidator{
- Path: p.param.Name,
- In: p.param.In,
- Default: p.param.Default,
- AllowEmptyValue: p.param.AllowEmptyValue,
- Required: p.param.Required,
- MaxLength: p.param.MaxLength,
- MinLength: p.param.MinLength,
- Pattern: p.param.Pattern,
- }
+ return newStringValidator(
+ p.param.Name,
+ p.param.In,
+ p.param.Default,
+ p.param.Required,
+ p.param.AllowEmptyValue,
+ p.param.MaxLength,
+ p.param.MinLength,
+ p.param.Pattern,
+ p.Options,
+ )
}
func (p *ParamValidator) formatValidator() valueValidator {
- return &formatValidator{
- Path: p.param.Name,
- In: p.param.In,
- //Default: p.param.Default,
- Format: p.param.Format,
- KnownFormats: p.KnownFormats,
+ return newFormatValidator(
+ p.param.Name,
+ p.param.In,
+ p.param.Format,
+ p.KnownFormats,
+ p.Options,
+ )
+}
+
+func (p *ParamValidator) redeem() {
+ pools.poolOfParamValidators.RedeemValidator(p)
+}
+
+func (p *ParamValidator) redeemChildren() {
+ for idx, validator := range p.validators {
+ if validator == nil {
+ continue
+ }
+ if redeemableChildren, ok := validator.(interface{ redeemChildren() }); ok {
+ redeemableChildren.redeemChildren()
+ }
+ if redeemable, ok := validator.(interface{ redeem() }); ok {
+ redeemable.redeem()
+ }
+ p.validators[idx] = nil // free up allocated children if not in pool
}
}
type basicSliceValidator struct {
- Path string
- In string
- Default interface{}
- MaxItems *int64
- MinItems *int64
- UniqueItems bool
- Items *spec.Items
- Source interface{}
- itemsValidator *itemsValidator
- KnownFormats strfmt.Registry
+ Path string
+ In string
+ Default interface{}
+ MaxItems *int64
+ MinItems *int64
+ UniqueItems bool
+ Items *spec.Items
+ Source interface{}
+ KnownFormats strfmt.Registry
+ Options *SchemaValidatorOptions
+}
+
+func newBasicSliceValidator(
+ path, in string,
+ def interface{}, maxItems, minItems *int64, uniqueItems bool, items *spec.Items,
+ source interface{}, formats strfmt.Registry,
+ opts *SchemaValidatorOptions) *basicSliceValidator {
+ if opts == nil {
+ opts = new(SchemaValidatorOptions)
+ }
+
+ var s *basicSliceValidator
+ if opts.recycleValidators {
+ s = pools.poolOfBasicSliceValidators.BorrowValidator()
+ } else {
+ s = new(basicSliceValidator)
+ }
+
+ s.Path = path
+ s.In = in
+ s.Default = def
+ s.MaxItems = maxItems
+ s.MinItems = minItems
+ s.UniqueItems = uniqueItems
+ s.Items = items
+ s.Source = source
+ s.KnownFormats = formats
+ s.Options = opts
+
+ return s
}
func (s *basicSliceValidator) SetPath(path string) {
@@ -411,60 +733,61 @@ func (s *basicSliceValidator) Applies(source interface{}, kind reflect.Kind) boo
switch source.(type) {
case *spec.Parameter, *spec.Items, *spec.Header:
return kind == reflect.Slice
+ default:
+ return false
}
- return false
}
func (s *basicSliceValidator) Validate(data interface{}) *Result {
+ if s.Options.recycleValidators {
+ defer func() {
+ s.redeem()
+ }()
+ }
val := reflect.ValueOf(data)
size := int64(val.Len())
if s.MinItems != nil {
if err := MinItems(s.Path, s.In, size, *s.MinItems); err != nil {
- return errorHelp.sErr(err)
+ return errorHelp.sErr(err, s.Options.recycleResult)
}
}
if s.MaxItems != nil {
if err := MaxItems(s.Path, s.In, size, *s.MaxItems); err != nil {
- return errorHelp.sErr(err)
+ return errorHelp.sErr(err, s.Options.recycleResult)
}
}
if s.UniqueItems {
if err := UniqueItems(s.Path, s.In, data); err != nil {
- return errorHelp.sErr(err)
+ return errorHelp.sErr(err, s.Options.recycleResult)
}
}
- if s.itemsValidator == nil && s.Items != nil {
- s.itemsValidator = newItemsValidator(s.Path, s.In, s.Items, s.Source, s.KnownFormats)
+ if s.Items == nil {
+ return nil
}
- if s.itemsValidator != nil {
- for i := 0; i < int(size); i++ {
- ele := val.Index(i)
- if err := s.itemsValidator.Validate(i, ele.Interface()); err != nil && err.HasErrors() {
+ for i := 0; i < int(size); i++ {
+ itemsValidator := newItemsValidator(s.Path, s.In, s.Items, s.Source, s.KnownFormats, s.Options)
+ ele := val.Index(i)
+ if err := itemsValidator.Validate(i, ele.Interface()); err != nil {
+ if err.HasErrors() {
return err
}
+ if err.wantsRedeemOnMerge {
+ pools.poolOfResults.RedeemResult(err)
+ }
}
}
+
return nil
}
-/* unused
-func (s *basicSliceValidator) hasDuplicates(value reflect.Value, size int) bool {
- dict := make(map[interface{}]struct{})
- for i := 0; i < size; i++ {
- ele := value.Index(i)
- if _, ok := dict[ele.Interface()]; ok {
- return true
- }
- dict[ele.Interface()] = struct{}{}
- }
- return false
+func (s *basicSliceValidator) redeem() {
+ pools.poolOfBasicSliceValidators.RedeemValidator(s)
}
-*/
type numberValidator struct {
Path string
@@ -476,8 +799,40 @@ type numberValidator struct {
Minimum *float64
ExclusiveMinimum bool
// Allows for more accurate behavior regarding integers
- Type string
- Format string
+ Type string
+ Format string
+ Options *SchemaValidatorOptions
+}
+
+func newNumberValidator(
+ path, in string, def interface{},
+ multipleOf, maximum *float64, exclusiveMaximum bool, minimum *float64, exclusiveMinimum bool,
+ typ, format string,
+ opts *SchemaValidatorOptions) *numberValidator {
+ if opts == nil {
+ opts = new(SchemaValidatorOptions)
+ }
+
+ var n *numberValidator
+ if opts.recycleValidators {
+ n = pools.poolOfNumberValidators.BorrowValidator()
+ } else {
+ n = new(numberValidator)
+ }
+
+ n.Path = path
+ n.In = in
+ n.Default = def
+ n.MultipleOf = multipleOf
+ n.Maximum = maximum
+ n.ExclusiveMaximum = exclusiveMaximum
+ n.Minimum = minimum
+ n.ExclusiveMinimum = exclusiveMinimum
+ n.Type = typ
+ n.Format = format
+ n.Options = opts
+
+ return n
}
func (n *numberValidator) SetPath(path string) {
@@ -489,12 +844,10 @@ func (n *numberValidator) Applies(source interface{}, kind reflect.Kind) bool {
case *spec.Parameter, *spec.Schema, *spec.Items, *spec.Header:
isInt := kind >= reflect.Int && kind <= reflect.Uint64
isFloat := kind == reflect.Float32 || kind == reflect.Float64
- r := isInt || isFloat
- debugLog("schema props validator for %q applies %t for %T (kind: %v) isInt=%t, isFloat=%t\n", n.Path, r, source, kind, isInt, isFloat)
- return r
+ return isInt || isFloat
+ default:
+ return false
}
- debugLog("schema props validator for %q applies %t for %T (kind: %v)\n", n.Path, false, source, kind)
- return false
}
// Validate provides a validator for generic JSON numbers,
@@ -519,11 +872,18 @@ func (n *numberValidator) Applies(source interface{}, kind reflect.Kind) bool {
//
// TODO: default boundaries with MAX_SAFE_INTEGER are not checked (specific to json.Number?)
func (n *numberValidator) Validate(val interface{}) *Result {
- res := new(Result)
+ if n.Options.recycleValidators {
+ defer func() {
+ n.redeem()
+ }()
+ }
- resMultiple := new(Result)
- resMinimum := new(Result)
- resMaximum := new(Result)
+ var res, resMultiple, resMinimum, resMaximum *Result
+ if n.Options.recycleResult {
+ res = pools.poolOfResults.BorrowResult()
+ } else {
+ res = new(Result)
+ }
// Used only to attempt to validate constraint on value,
// even though value or constraint specified do not match type and format
@@ -533,68 +893,106 @@ func (n *numberValidator) Validate(val interface{}) *Result {
res.AddErrors(IsValueValidAgainstRange(val, n.Type, n.Format, "Checked", n.Path))
if n.MultipleOf != nil {
+ resMultiple = pools.poolOfResults.BorrowResult()
+
// Is the constraint specifier within the range of the specific numeric type and format?
resMultiple.AddErrors(IsValueValidAgainstRange(*n.MultipleOf, n.Type, n.Format, "MultipleOf", n.Path))
if resMultiple.IsValid() {
// Constraint validated with compatible types
if err := MultipleOfNativeType(n.Path, n.In, val, *n.MultipleOf); err != nil {
- resMultiple.Merge(errorHelp.sErr(err))
+ resMultiple.Merge(errorHelp.sErr(err, n.Options.recycleResult))
}
} else {
// Constraint nevertheless validated, converted as general number
if err := MultipleOf(n.Path, n.In, data, *n.MultipleOf); err != nil {
- resMultiple.Merge(errorHelp.sErr(err))
+ resMultiple.Merge(errorHelp.sErr(err, n.Options.recycleResult))
}
}
}
- // nolint: dupl
if n.Maximum != nil {
+ resMaximum = pools.poolOfResults.BorrowResult()
+
// Is the constraint specifier within the range of the specific numeric type and format?
resMaximum.AddErrors(IsValueValidAgainstRange(*n.Maximum, n.Type, n.Format, "Maximum boundary", n.Path))
if resMaximum.IsValid() {
// Constraint validated with compatible types
if err := MaximumNativeType(n.Path, n.In, val, *n.Maximum, n.ExclusiveMaximum); err != nil {
- resMaximum.Merge(errorHelp.sErr(err))
+ resMaximum.Merge(errorHelp.sErr(err, n.Options.recycleResult))
}
} else {
// Constraint nevertheless validated, converted as general number
if err := Maximum(n.Path, n.In, data, *n.Maximum, n.ExclusiveMaximum); err != nil {
- resMaximum.Merge(errorHelp.sErr(err))
+ resMaximum.Merge(errorHelp.sErr(err, n.Options.recycleResult))
}
}
}
- // nolint: dupl
if n.Minimum != nil {
+ resMinimum = pools.poolOfResults.BorrowResult()
+
// Is the constraint specifier within the range of the specific numeric type and format?
resMinimum.AddErrors(IsValueValidAgainstRange(*n.Minimum, n.Type, n.Format, "Minimum boundary", n.Path))
if resMinimum.IsValid() {
// Constraint validated with compatible types
if err := MinimumNativeType(n.Path, n.In, val, *n.Minimum, n.ExclusiveMinimum); err != nil {
- resMinimum.Merge(errorHelp.sErr(err))
+ resMinimum.Merge(errorHelp.sErr(err, n.Options.recycleResult))
}
} else {
// Constraint nevertheless validated, converted as general number
if err := Minimum(n.Path, n.In, data, *n.Minimum, n.ExclusiveMinimum); err != nil {
- resMinimum.Merge(errorHelp.sErr(err))
+ resMinimum.Merge(errorHelp.sErr(err, n.Options.recycleResult))
}
}
}
res.Merge(resMultiple, resMinimum, resMaximum)
res.Inc()
+
return res
}
+func (n *numberValidator) redeem() {
+ pools.poolOfNumberValidators.RedeemValidator(n)
+}
+
type stringValidator struct {
+ Path string
+ In string
Default interface{}
Required bool
AllowEmptyValue bool
MaxLength *int64
MinLength *int64
Pattern string
- Path string
- In string
+ Options *SchemaValidatorOptions
+}
+
+func newStringValidator(
+ path, in string,
+ def interface{}, required, allowEmpty bool, maxLength, minLength *int64, pattern string,
+ opts *SchemaValidatorOptions) *stringValidator {
+ if opts == nil {
+ opts = new(SchemaValidatorOptions)
+ }
+
+ var s *stringValidator
+ if opts.recycleValidators {
+ s = pools.poolOfStringValidators.BorrowValidator()
+ } else {
+ s = new(stringValidator)
+ }
+
+ s.Path = path
+ s.In = in
+ s.Default = def
+ s.Required = required
+ s.AllowEmptyValue = allowEmpty
+ s.MaxLength = maxLength
+ s.MinLength = minLength
+ s.Pattern = pattern
+ s.Options = opts
+
+ return s
}
func (s *stringValidator) SetPath(path string) {
@@ -604,42 +1002,50 @@ func (s *stringValidator) SetPath(path string) {
func (s *stringValidator) Applies(source interface{}, kind reflect.Kind) bool {
switch source.(type) {
case *spec.Parameter, *spec.Schema, *spec.Items, *spec.Header:
- r := kind == reflect.String
- debugLog("string validator for %q applies %t for %T (kind: %v)\n", s.Path, r, source, kind)
- return r
+ return kind == reflect.String
+ default:
+ return false
}
- debugLog("string validator for %q applies %t for %T (kind: %v)\n", s.Path, false, source, kind)
- return false
}
func (s *stringValidator) Validate(val interface{}) *Result {
+ if s.Options.recycleValidators {
+ defer func() {
+ s.redeem()
+ }()
+ }
+
data, ok := val.(string)
if !ok {
- return errorHelp.sErr(errors.InvalidType(s.Path, s.In, stringType, val))
+ return errorHelp.sErr(errors.InvalidType(s.Path, s.In, stringType, val), s.Options.recycleResult)
}
if s.Required && !s.AllowEmptyValue && (s.Default == nil || s.Default == "") {
if err := RequiredString(s.Path, s.In, data); err != nil {
- return errorHelp.sErr(err)
+ return errorHelp.sErr(err, s.Options.recycleResult)
}
}
if s.MaxLength != nil {
if err := MaxLength(s.Path, s.In, data, *s.MaxLength); err != nil {
- return errorHelp.sErr(err)
+ return errorHelp.sErr(err, s.Options.recycleResult)
}
}
if s.MinLength != nil {
if err := MinLength(s.Path, s.In, data, *s.MinLength); err != nil {
- return errorHelp.sErr(err)
+ return errorHelp.sErr(err, s.Options.recycleResult)
}
}
if s.Pattern != "" {
if err := Pattern(s.Path, s.In, data, s.Pattern); err != nil {
- return errorHelp.sErr(err)
+ return errorHelp.sErr(err, s.Options.recycleResult)
}
}
return nil
}
+
+func (s *stringValidator) redeem() {
+ pools.poolOfStringValidators.RedeemValidator(s)
+}
diff --git a/api/vendor/github.com/go-openapi/validate/values.go b/api/vendor/github.com/go-openapi/validate/values.go
index 0f50d48da812..5f6f5ee61e57 100644
--- a/api/vendor/github.com/go-openapi/validate/values.go
+++ b/api/vendor/github.com/go-openapi/validate/values.go
@@ -161,22 +161,10 @@ func ReadOnly(ctx context.Context, path, in string, data interface{}) *errors.Va
func Required(path, in string, data interface{}) *errors.Validation {
val := reflect.ValueOf(data)
if val.IsValid() {
- typ := reflect.TypeOf(data)
- switch typ.Kind() {
- case reflect.Pointer:
- if val.IsNil() {
- return errors.Required(path, in, data)
- }
- if reflect.DeepEqual(reflect.Zero(val.Elem().Type()).Interface(), val.Elem().Interface()) {
- return errors.Required(path, in, data)
- }
- return nil
- default:
- if reflect.DeepEqual(reflect.Zero(val.Type()).Interface(), val.Interface()) {
- return errors.Required(path, in, data)
- }
- return nil
+ if reflect.DeepEqual(reflect.Zero(val.Type()).Interface(), val.Interface()) {
+ return errors.Required(path, in, data)
}
+ return nil
}
return errors.Required(path, in, data)
}
@@ -327,7 +315,7 @@ func FormatOf(path, in, format, data string, registry strfmt.Registry) *errors.V
// TODO: Normally, a JSON MAX_SAFE_INTEGER check would ensure conversion remains loss-free
func MaximumNativeType(path, in string, val interface{}, max float64, exclusive bool) *errors.Validation {
kind := reflect.ValueOf(val).Type().Kind()
- switch kind {
+ switch kind { //nolint:exhaustive
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
value := valueHelp.asInt64(val)
return MaximumInt(path, in, value, int64(max), exclusive)
@@ -357,7 +345,7 @@ func MaximumNativeType(path, in string, val interface{}, max float64, exclusive
// TODO: Normally, a JSON MAX_SAFE_INTEGER check would ensure conversion remains loss-free
func MinimumNativeType(path, in string, val interface{}, min float64, exclusive bool) *errors.Validation {
kind := reflect.ValueOf(val).Type().Kind()
- switch kind {
+ switch kind { //nolint:exhaustive
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
value := valueHelp.asInt64(val)
return MinimumInt(path, in, value, int64(min), exclusive)
@@ -387,7 +375,7 @@ func MinimumNativeType(path, in string, val interface{}, min float64, exclusive
// TODO: Normally, a JSON MAX_SAFE_INTEGER check would ensure conversion remains loss-free
func MultipleOfNativeType(path, in string, val interface{}, multipleOf float64) *errors.Validation {
kind := reflect.ValueOf(val).Type().Kind()
- switch kind {
+ switch kind { //nolint:exhaustive
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
value := valueHelp.asInt64(val)
return MultipleOfInt(path, in, value, int64(multipleOf))
@@ -411,7 +399,7 @@ func IsValueValidAgainstRange(val interface{}, typeName, format, prefix, path st
// What is the string representation of val
var stringRep string
- switch kind {
+ switch kind { //nolint:exhaustive
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
stringRep = swag.FormatUint64(valueHelp.asUint64(val))
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
diff --git a/api/vendor/github.com/gogo/protobuf/AUTHORS b/api/vendor/github.com/gogo/protobuf/AUTHORS
deleted file mode 100644
index 3d97fc7a29f8..000000000000
--- a/api/vendor/github.com/gogo/protobuf/AUTHORS
+++ /dev/null
@@ -1,15 +0,0 @@
-# This is the official list of GoGo authors for copyright purposes.
-# This file is distinct from the CONTRIBUTORS file, which
-# lists people. For example, employees are listed in CONTRIBUTORS,
-# but not in AUTHORS, because the employer holds the copyright.
-
-# Names should be added to this file as one of
-# Organization's name
-# Individual's name
-# Individual's name
-
-# Please keep the list sorted.
-
-Sendgrid, Inc
-Vastech SA (PTY) LTD
-Walter Schulze
diff --git a/api/vendor/github.com/gogo/protobuf/CONTRIBUTORS b/api/vendor/github.com/gogo/protobuf/CONTRIBUTORS
deleted file mode 100644
index 1b4f6c208a14..000000000000
--- a/api/vendor/github.com/gogo/protobuf/CONTRIBUTORS
+++ /dev/null
@@ -1,23 +0,0 @@
-Anton Povarov
-Brian Goff
-Clayton Coleman
-Denis Smirnov
-DongYun Kang
-Dwayne Schultz
-Georg Apitz
-Gustav Paul
-Johan Brandhorst
-John Shahid
-John Tuley
-Laurent
-Patrick Lee
-Peter Edge
-Roger Johansson
-Sam Nguyen
-Sergio Arbeo
-Stephen J Day
-Tamir Duberstein
-Todd Eisenberger
-Tormod Erevik Lea
-Vyacheslav Kim
-Walter Schulze
diff --git a/api/vendor/github.com/gogo/protobuf/LICENSE b/api/vendor/github.com/gogo/protobuf/LICENSE
deleted file mode 100644
index f57de90da8ac..000000000000
--- a/api/vendor/github.com/gogo/protobuf/LICENSE
+++ /dev/null
@@ -1,35 +0,0 @@
-Copyright (c) 2013, The GoGo Authors. All rights reserved.
-
-Protocol Buffers for Go with Gadgets
-
-Go support for Protocol Buffers - Google's data interchange format
-
-Copyright 2010 The Go Authors. All rights reserved.
-https://github.com/golang/protobuf
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * 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.
- * Neither the name of Google Inc. 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
-OWNER 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/api/vendor/github.com/gogo/protobuf/proto/Makefile b/api/vendor/github.com/gogo/protobuf/proto/Makefile
deleted file mode 100644
index 00d65f327732..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/Makefile
+++ /dev/null
@@ -1,43 +0,0 @@
-# Go support for Protocol Buffers - Google's data interchange format
-#
-# Copyright 2010 The Go Authors. All rights reserved.
-# https://github.com/golang/protobuf
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * 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.
-# * Neither the name of Google Inc. 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
-# OWNER 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.
-
-install:
- go install
-
-test: install generate-test-pbs
- go test
-
-
-generate-test-pbs:
- make install
- make -C test_proto
- make -C proto3_proto
- make
diff --git a/api/vendor/github.com/gogo/protobuf/proto/clone.go b/api/vendor/github.com/gogo/protobuf/proto/clone.go
deleted file mode 100644
index a26b046d94f1..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/clone.go
+++ /dev/null
@@ -1,258 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2011 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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
-// OWNER 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.
-
-// Protocol buffer deep copy and merge.
-// TODO: RawMessage.
-
-package proto
-
-import (
- "fmt"
- "log"
- "reflect"
- "strings"
-)
-
-// Clone returns a deep copy of a protocol buffer.
-func Clone(src Message) Message {
- in := reflect.ValueOf(src)
- if in.IsNil() {
- return src
- }
- out := reflect.New(in.Type().Elem())
- dst := out.Interface().(Message)
- Merge(dst, src)
- return dst
-}
-
-// Merger is the interface representing objects that can merge messages of the same type.
-type Merger interface {
- // Merge merges src into this message.
- // Required and optional fields that are set in src will be set to that value in dst.
- // Elements of repeated fields will be appended.
- //
- // Merge may panic if called with a different argument type than the receiver.
- Merge(src Message)
-}
-
-// generatedMerger is the custom merge method that generated protos will have.
-// We must add this method since a generate Merge method will conflict with
-// many existing protos that have a Merge data field already defined.
-type generatedMerger interface {
- XXX_Merge(src Message)
-}
-
-// Merge merges src into dst.
-// Required and optional fields that are set in src will be set to that value in dst.
-// Elements of repeated fields will be appended.
-// Merge panics if src and dst are not the same type, or if dst is nil.
-func Merge(dst, src Message) {
- if m, ok := dst.(Merger); ok {
- m.Merge(src)
- return
- }
-
- in := reflect.ValueOf(src)
- out := reflect.ValueOf(dst)
- if out.IsNil() {
- panic("proto: nil destination")
- }
- if in.Type() != out.Type() {
- panic(fmt.Sprintf("proto.Merge(%T, %T) type mismatch", dst, src))
- }
- if in.IsNil() {
- return // Merge from nil src is a noop
- }
- if m, ok := dst.(generatedMerger); ok {
- m.XXX_Merge(src)
- return
- }
- mergeStruct(out.Elem(), in.Elem())
-}
-
-func mergeStruct(out, in reflect.Value) {
- sprop := GetProperties(in.Type())
- for i := 0; i < in.NumField(); i++ {
- f := in.Type().Field(i)
- if strings.HasPrefix(f.Name, "XXX_") {
- continue
- }
- mergeAny(out.Field(i), in.Field(i), false, sprop.Prop[i])
- }
-
- if emIn, ok := in.Addr().Interface().(extensionsBytes); ok {
- emOut := out.Addr().Interface().(extensionsBytes)
- bIn := emIn.GetExtensions()
- bOut := emOut.GetExtensions()
- *bOut = append(*bOut, *bIn...)
- } else if emIn, err := extendable(in.Addr().Interface()); err == nil {
- emOut, _ := extendable(out.Addr().Interface())
- mIn, muIn := emIn.extensionsRead()
- if mIn != nil {
- mOut := emOut.extensionsWrite()
- muIn.Lock()
- mergeExtension(mOut, mIn)
- muIn.Unlock()
- }
- }
-
- uf := in.FieldByName("XXX_unrecognized")
- if !uf.IsValid() {
- return
- }
- uin := uf.Bytes()
- if len(uin) > 0 {
- out.FieldByName("XXX_unrecognized").SetBytes(append([]byte(nil), uin...))
- }
-}
-
-// mergeAny performs a merge between two values of the same type.
-// viaPtr indicates whether the values were indirected through a pointer (implying proto2).
-// prop is set if this is a struct field (it may be nil).
-func mergeAny(out, in reflect.Value, viaPtr bool, prop *Properties) {
- if in.Type() == protoMessageType {
- if !in.IsNil() {
- if out.IsNil() {
- out.Set(reflect.ValueOf(Clone(in.Interface().(Message))))
- } else {
- Merge(out.Interface().(Message), in.Interface().(Message))
- }
- }
- return
- }
- switch in.Kind() {
- case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int32, reflect.Int64,
- reflect.String, reflect.Uint32, reflect.Uint64:
- if !viaPtr && isProto3Zero(in) {
- return
- }
- out.Set(in)
- case reflect.Interface:
- // Probably a oneof field; copy non-nil values.
- if in.IsNil() {
- return
- }
- // Allocate destination if it is not set, or set to a different type.
- // Otherwise we will merge as normal.
- if out.IsNil() || out.Elem().Type() != in.Elem().Type() {
- out.Set(reflect.New(in.Elem().Elem().Type())) // interface -> *T -> T -> new(T)
- }
- mergeAny(out.Elem(), in.Elem(), false, nil)
- case reflect.Map:
- if in.Len() == 0 {
- return
- }
- if out.IsNil() {
- out.Set(reflect.MakeMap(in.Type()))
- }
- // For maps with value types of *T or []byte we need to deep copy each value.
- elemKind := in.Type().Elem().Kind()
- for _, key := range in.MapKeys() {
- var val reflect.Value
- switch elemKind {
- case reflect.Ptr:
- val = reflect.New(in.Type().Elem().Elem())
- mergeAny(val, in.MapIndex(key), false, nil)
- case reflect.Slice:
- val = in.MapIndex(key)
- val = reflect.ValueOf(append([]byte{}, val.Bytes()...))
- default:
- val = in.MapIndex(key)
- }
- out.SetMapIndex(key, val)
- }
- case reflect.Ptr:
- if in.IsNil() {
- return
- }
- if out.IsNil() {
- out.Set(reflect.New(in.Elem().Type()))
- }
- mergeAny(out.Elem(), in.Elem(), true, nil)
- case reflect.Slice:
- if in.IsNil() {
- return
- }
- if in.Type().Elem().Kind() == reflect.Uint8 {
- // []byte is a scalar bytes field, not a repeated field.
-
- // Edge case: if this is in a proto3 message, a zero length
- // bytes field is considered the zero value, and should not
- // be merged.
- if prop != nil && prop.proto3 && in.Len() == 0 {
- return
- }
-
- // Make a deep copy.
- // Append to []byte{} instead of []byte(nil) so that we never end up
- // with a nil result.
- out.SetBytes(append([]byte{}, in.Bytes()...))
- return
- }
- n := in.Len()
- if out.IsNil() {
- out.Set(reflect.MakeSlice(in.Type(), 0, n))
- }
- switch in.Type().Elem().Kind() {
- case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int32, reflect.Int64,
- reflect.String, reflect.Uint32, reflect.Uint64:
- out.Set(reflect.AppendSlice(out, in))
- default:
- for i := 0; i < n; i++ {
- x := reflect.Indirect(reflect.New(in.Type().Elem()))
- mergeAny(x, in.Index(i), false, nil)
- out.Set(reflect.Append(out, x))
- }
- }
- case reflect.Struct:
- mergeStruct(out, in)
- default:
- // unknown type, so not a protocol buffer
- log.Printf("proto: don't know how to copy %v", in)
- }
-}
-
-func mergeExtension(out, in map[int32]Extension) {
- for extNum, eIn := range in {
- eOut := Extension{desc: eIn.desc}
- if eIn.value != nil {
- v := reflect.New(reflect.TypeOf(eIn.value)).Elem()
- mergeAny(v, reflect.ValueOf(eIn.value), false, nil)
- eOut.value = v.Interface()
- }
- if eIn.enc != nil {
- eOut.enc = make([]byte, len(eIn.enc))
- copy(eOut.enc, eIn.enc)
- }
-
- out[extNum] = eOut
- }
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/custom_gogo.go b/api/vendor/github.com/gogo/protobuf/proto/custom_gogo.go
deleted file mode 100644
index 24552483c6ce..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/custom_gogo.go
+++ /dev/null
@@ -1,39 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2018, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-//
-// 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
-// OWNER 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.
-
-package proto
-
-import "reflect"
-
-type custom interface {
- Marshal() ([]byte, error)
- Unmarshal(data []byte) error
- Size() int
-}
-
-var customType = reflect.TypeOf((*custom)(nil)).Elem()
diff --git a/api/vendor/github.com/gogo/protobuf/proto/decode.go b/api/vendor/github.com/gogo/protobuf/proto/decode.go
deleted file mode 100644
index 63b0f08bef2a..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/decode.go
+++ /dev/null
@@ -1,427 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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
-// OWNER 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.
-
-package proto
-
-/*
- * Routines for decoding protocol buffer data to construct in-memory representations.
- */
-
-import (
- "errors"
- "fmt"
- "io"
-)
-
-// errOverflow is returned when an integer is too large to be represented.
-var errOverflow = errors.New("proto: integer overflow")
-
-// ErrInternalBadWireType is returned by generated code when an incorrect
-// wire type is encountered. It does not get returned to user code.
-var ErrInternalBadWireType = errors.New("proto: internal error: bad wiretype for oneof")
-
-// DecodeVarint reads a varint-encoded integer from the slice.
-// It returns the integer and the number of bytes consumed, or
-// zero if there is not enough.
-// This is the format for the
-// int32, int64, uint32, uint64, bool, and enum
-// protocol buffer types.
-func DecodeVarint(buf []byte) (x uint64, n int) {
- for shift := uint(0); shift < 64; shift += 7 {
- if n >= len(buf) {
- return 0, 0
- }
- b := uint64(buf[n])
- n++
- x |= (b & 0x7F) << shift
- if (b & 0x80) == 0 {
- return x, n
- }
- }
-
- // The number is too large to represent in a 64-bit value.
- return 0, 0
-}
-
-func (p *Buffer) decodeVarintSlow() (x uint64, err error) {
- i := p.index
- l := len(p.buf)
-
- for shift := uint(0); shift < 64; shift += 7 {
- if i >= l {
- err = io.ErrUnexpectedEOF
- return
- }
- b := p.buf[i]
- i++
- x |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- p.index = i
- return
- }
- }
-
- // The number is too large to represent in a 64-bit value.
- err = errOverflow
- return
-}
-
-// DecodeVarint reads a varint-encoded integer from the Buffer.
-// This is the format for the
-// int32, int64, uint32, uint64, bool, and enum
-// protocol buffer types.
-func (p *Buffer) DecodeVarint() (x uint64, err error) {
- i := p.index
- buf := p.buf
-
- if i >= len(buf) {
- return 0, io.ErrUnexpectedEOF
- } else if buf[i] < 0x80 {
- p.index++
- return uint64(buf[i]), nil
- } else if len(buf)-i < 10 {
- return p.decodeVarintSlow()
- }
-
- var b uint64
- // we already checked the first byte
- x = uint64(buf[i]) - 0x80
- i++
-
- b = uint64(buf[i])
- i++
- x += b << 7
- if b&0x80 == 0 {
- goto done
- }
- x -= 0x80 << 7
-
- b = uint64(buf[i])
- i++
- x += b << 14
- if b&0x80 == 0 {
- goto done
- }
- x -= 0x80 << 14
-
- b = uint64(buf[i])
- i++
- x += b << 21
- if b&0x80 == 0 {
- goto done
- }
- x -= 0x80 << 21
-
- b = uint64(buf[i])
- i++
- x += b << 28
- if b&0x80 == 0 {
- goto done
- }
- x -= 0x80 << 28
-
- b = uint64(buf[i])
- i++
- x += b << 35
- if b&0x80 == 0 {
- goto done
- }
- x -= 0x80 << 35
-
- b = uint64(buf[i])
- i++
- x += b << 42
- if b&0x80 == 0 {
- goto done
- }
- x -= 0x80 << 42
-
- b = uint64(buf[i])
- i++
- x += b << 49
- if b&0x80 == 0 {
- goto done
- }
- x -= 0x80 << 49
-
- b = uint64(buf[i])
- i++
- x += b << 56
- if b&0x80 == 0 {
- goto done
- }
- x -= 0x80 << 56
-
- b = uint64(buf[i])
- i++
- x += b << 63
- if b&0x80 == 0 {
- goto done
- }
-
- return 0, errOverflow
-
-done:
- p.index = i
- return x, nil
-}
-
-// DecodeFixed64 reads a 64-bit integer from the Buffer.
-// This is the format for the
-// fixed64, sfixed64, and double protocol buffer types.
-func (p *Buffer) DecodeFixed64() (x uint64, err error) {
- // x, err already 0
- i := p.index + 8
- if i < 0 || i > len(p.buf) {
- err = io.ErrUnexpectedEOF
- return
- }
- p.index = i
-
- x = uint64(p.buf[i-8])
- x |= uint64(p.buf[i-7]) << 8
- x |= uint64(p.buf[i-6]) << 16
- x |= uint64(p.buf[i-5]) << 24
- x |= uint64(p.buf[i-4]) << 32
- x |= uint64(p.buf[i-3]) << 40
- x |= uint64(p.buf[i-2]) << 48
- x |= uint64(p.buf[i-1]) << 56
- return
-}
-
-// DecodeFixed32 reads a 32-bit integer from the Buffer.
-// This is the format for the
-// fixed32, sfixed32, and float protocol buffer types.
-func (p *Buffer) DecodeFixed32() (x uint64, err error) {
- // x, err already 0
- i := p.index + 4
- if i < 0 || i > len(p.buf) {
- err = io.ErrUnexpectedEOF
- return
- }
- p.index = i
-
- x = uint64(p.buf[i-4])
- x |= uint64(p.buf[i-3]) << 8
- x |= uint64(p.buf[i-2]) << 16
- x |= uint64(p.buf[i-1]) << 24
- return
-}
-
-// DecodeZigzag64 reads a zigzag-encoded 64-bit integer
-// from the Buffer.
-// This is the format used for the sint64 protocol buffer type.
-func (p *Buffer) DecodeZigzag64() (x uint64, err error) {
- x, err = p.DecodeVarint()
- if err != nil {
- return
- }
- x = (x >> 1) ^ uint64((int64(x&1)<<63)>>63)
- return
-}
-
-// DecodeZigzag32 reads a zigzag-encoded 32-bit integer
-// from the Buffer.
-// This is the format used for the sint32 protocol buffer type.
-func (p *Buffer) DecodeZigzag32() (x uint64, err error) {
- x, err = p.DecodeVarint()
- if err != nil {
- return
- }
- x = uint64((uint32(x) >> 1) ^ uint32((int32(x&1)<<31)>>31))
- return
-}
-
-// DecodeRawBytes reads a count-delimited byte buffer from the Buffer.
-// This is the format used for the bytes protocol buffer
-// type and for embedded messages.
-func (p *Buffer) DecodeRawBytes(alloc bool) (buf []byte, err error) {
- n, err := p.DecodeVarint()
- if err != nil {
- return nil, err
- }
-
- nb := int(n)
- if nb < 0 {
- return nil, fmt.Errorf("proto: bad byte length %d", nb)
- }
- end := p.index + nb
- if end < p.index || end > len(p.buf) {
- return nil, io.ErrUnexpectedEOF
- }
-
- if !alloc {
- // todo: check if can get more uses of alloc=false
- buf = p.buf[p.index:end]
- p.index += nb
- return
- }
-
- buf = make([]byte, nb)
- copy(buf, p.buf[p.index:])
- p.index += nb
- return
-}
-
-// DecodeStringBytes reads an encoded string from the Buffer.
-// This is the format used for the proto2 string type.
-func (p *Buffer) DecodeStringBytes() (s string, err error) {
- buf, err := p.DecodeRawBytes(false)
- if err != nil {
- return
- }
- return string(buf), nil
-}
-
-// Unmarshaler is the interface representing objects that can
-// unmarshal themselves. The argument points to data that may be
-// overwritten, so implementations should not keep references to the
-// buffer.
-// Unmarshal implementations should not clear the receiver.
-// Any unmarshaled data should be merged into the receiver.
-// Callers of Unmarshal that do not want to retain existing data
-// should Reset the receiver before calling Unmarshal.
-type Unmarshaler interface {
- Unmarshal([]byte) error
-}
-
-// newUnmarshaler is the interface representing objects that can
-// unmarshal themselves. The semantics are identical to Unmarshaler.
-//
-// This exists to support protoc-gen-go generated messages.
-// The proto package will stop type-asserting to this interface in the future.
-//
-// DO NOT DEPEND ON THIS.
-type newUnmarshaler interface {
- XXX_Unmarshal([]byte) error
-}
-
-// Unmarshal parses the protocol buffer representation in buf and places the
-// decoded result in pb. If the struct underlying pb does not match
-// the data in buf, the results can be unpredictable.
-//
-// Unmarshal resets pb before starting to unmarshal, so any
-// existing data in pb is always removed. Use UnmarshalMerge
-// to preserve and append to existing data.
-func Unmarshal(buf []byte, pb Message) error {
- pb.Reset()
- if u, ok := pb.(newUnmarshaler); ok {
- return u.XXX_Unmarshal(buf)
- }
- if u, ok := pb.(Unmarshaler); ok {
- return u.Unmarshal(buf)
- }
- return NewBuffer(buf).Unmarshal(pb)
-}
-
-// UnmarshalMerge parses the protocol buffer representation in buf and
-// writes the decoded result to pb. If the struct underlying pb does not match
-// the data in buf, the results can be unpredictable.
-//
-// UnmarshalMerge merges into existing data in pb.
-// Most code should use Unmarshal instead.
-func UnmarshalMerge(buf []byte, pb Message) error {
- if u, ok := pb.(newUnmarshaler); ok {
- return u.XXX_Unmarshal(buf)
- }
- if u, ok := pb.(Unmarshaler); ok {
- // NOTE: The history of proto have unfortunately been inconsistent
- // whether Unmarshaler should or should not implicitly clear itself.
- // Some implementations do, most do not.
- // Thus, calling this here may or may not do what people want.
- //
- // See https://github.com/golang/protobuf/issues/424
- return u.Unmarshal(buf)
- }
- return NewBuffer(buf).Unmarshal(pb)
-}
-
-// DecodeMessage reads a count-delimited message from the Buffer.
-func (p *Buffer) DecodeMessage(pb Message) error {
- enc, err := p.DecodeRawBytes(false)
- if err != nil {
- return err
- }
- return NewBuffer(enc).Unmarshal(pb)
-}
-
-// DecodeGroup reads a tag-delimited group from the Buffer.
-// StartGroup tag is already consumed. This function consumes
-// EndGroup tag.
-func (p *Buffer) DecodeGroup(pb Message) error {
- b := p.buf[p.index:]
- x, y := findEndGroup(b)
- if x < 0 {
- return io.ErrUnexpectedEOF
- }
- err := Unmarshal(b[:x], pb)
- p.index += y
- return err
-}
-
-// Unmarshal parses the protocol buffer representation in the
-// Buffer and places the decoded result in pb. If the struct
-// underlying pb does not match the data in the buffer, the results can be
-// unpredictable.
-//
-// Unlike proto.Unmarshal, this does not reset pb before starting to unmarshal.
-func (p *Buffer) Unmarshal(pb Message) error {
- // If the object can unmarshal itself, let it.
- if u, ok := pb.(newUnmarshaler); ok {
- err := u.XXX_Unmarshal(p.buf[p.index:])
- p.index = len(p.buf)
- return err
- }
- if u, ok := pb.(Unmarshaler); ok {
- // NOTE: The history of proto have unfortunately been inconsistent
- // whether Unmarshaler should or should not implicitly clear itself.
- // Some implementations do, most do not.
- // Thus, calling this here may or may not do what people want.
- //
- // See https://github.com/golang/protobuf/issues/424
- err := u.Unmarshal(p.buf[p.index:])
- p.index = len(p.buf)
- return err
- }
-
- // Slow workaround for messages that aren't Unmarshalers.
- // This includes some hand-coded .pb.go files and
- // bootstrap protos.
- // TODO: fix all of those and then add Unmarshal to
- // the Message interface. Then:
- // The cast above and code below can be deleted.
- // The old unmarshaler can be deleted.
- // Clients can call Unmarshal directly (can already do that, actually).
- var info InternalMessageInfo
- err := info.Unmarshal(pb, p.buf[p.index:])
- p.index = len(p.buf)
- return err
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/deprecated.go b/api/vendor/github.com/gogo/protobuf/proto/deprecated.go
deleted file mode 100644
index 35b882c09aaf..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/deprecated.go
+++ /dev/null
@@ -1,63 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2018 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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
-// OWNER 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.
-
-package proto
-
-import "errors"
-
-// Deprecated: do not use.
-type Stats struct{ Emalloc, Dmalloc, Encode, Decode, Chit, Cmiss, Size uint64 }
-
-// Deprecated: do not use.
-func GetStats() Stats { return Stats{} }
-
-// Deprecated: do not use.
-func MarshalMessageSet(interface{}) ([]byte, error) {
- return nil, errors.New("proto: not implemented")
-}
-
-// Deprecated: do not use.
-func UnmarshalMessageSet([]byte, interface{}) error {
- return errors.New("proto: not implemented")
-}
-
-// Deprecated: do not use.
-func MarshalMessageSetJSON(interface{}) ([]byte, error) {
- return nil, errors.New("proto: not implemented")
-}
-
-// Deprecated: do not use.
-func UnmarshalMessageSetJSON([]byte, interface{}) error {
- return errors.New("proto: not implemented")
-}
-
-// Deprecated: do not use.
-func RegisterMessageSetType(Message, int32, string) {}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/discard.go b/api/vendor/github.com/gogo/protobuf/proto/discard.go
deleted file mode 100644
index fe1bd7d904e2..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/discard.go
+++ /dev/null
@@ -1,350 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2017 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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
-// OWNER 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.
-
-package proto
-
-import (
- "fmt"
- "reflect"
- "strings"
- "sync"
- "sync/atomic"
-)
-
-type generatedDiscarder interface {
- XXX_DiscardUnknown()
-}
-
-// DiscardUnknown recursively discards all unknown fields from this message
-// and all embedded messages.
-//
-// When unmarshaling a message with unrecognized fields, the tags and values
-// of such fields are preserved in the Message. This allows a later call to
-// marshal to be able to produce a message that continues to have those
-// unrecognized fields. To avoid this, DiscardUnknown is used to
-// explicitly clear the unknown fields after unmarshaling.
-//
-// For proto2 messages, the unknown fields of message extensions are only
-// discarded from messages that have been accessed via GetExtension.
-func DiscardUnknown(m Message) {
- if m, ok := m.(generatedDiscarder); ok {
- m.XXX_DiscardUnknown()
- return
- }
- // TODO: Dynamically populate a InternalMessageInfo for legacy messages,
- // but the master branch has no implementation for InternalMessageInfo,
- // so it would be more work to replicate that approach.
- discardLegacy(m)
-}
-
-// DiscardUnknown recursively discards all unknown fields.
-func (a *InternalMessageInfo) DiscardUnknown(m Message) {
- di := atomicLoadDiscardInfo(&a.discard)
- if di == nil {
- di = getDiscardInfo(reflect.TypeOf(m).Elem())
- atomicStoreDiscardInfo(&a.discard, di)
- }
- di.discard(toPointer(&m))
-}
-
-type discardInfo struct {
- typ reflect.Type
-
- initialized int32 // 0: only typ is valid, 1: everything is valid
- lock sync.Mutex
-
- fields []discardFieldInfo
- unrecognized field
-}
-
-type discardFieldInfo struct {
- field field // Offset of field, guaranteed to be valid
- discard func(src pointer)
-}
-
-var (
- discardInfoMap = map[reflect.Type]*discardInfo{}
- discardInfoLock sync.Mutex
-)
-
-func getDiscardInfo(t reflect.Type) *discardInfo {
- discardInfoLock.Lock()
- defer discardInfoLock.Unlock()
- di := discardInfoMap[t]
- if di == nil {
- di = &discardInfo{typ: t}
- discardInfoMap[t] = di
- }
- return di
-}
-
-func (di *discardInfo) discard(src pointer) {
- if src.isNil() {
- return // Nothing to do.
- }
-
- if atomic.LoadInt32(&di.initialized) == 0 {
- di.computeDiscardInfo()
- }
-
- for _, fi := range di.fields {
- sfp := src.offset(fi.field)
- fi.discard(sfp)
- }
-
- // For proto2 messages, only discard unknown fields in message extensions
- // that have been accessed via GetExtension.
- if em, err := extendable(src.asPointerTo(di.typ).Interface()); err == nil {
- // Ignore lock since DiscardUnknown is not concurrency safe.
- emm, _ := em.extensionsRead()
- for _, mx := range emm {
- if m, ok := mx.value.(Message); ok {
- DiscardUnknown(m)
- }
- }
- }
-
- if di.unrecognized.IsValid() {
- *src.offset(di.unrecognized).toBytes() = nil
- }
-}
-
-func (di *discardInfo) computeDiscardInfo() {
- di.lock.Lock()
- defer di.lock.Unlock()
- if di.initialized != 0 {
- return
- }
- t := di.typ
- n := t.NumField()
-
- for i := 0; i < n; i++ {
- f := t.Field(i)
- if strings.HasPrefix(f.Name, "XXX_") {
- continue
- }
-
- dfi := discardFieldInfo{field: toField(&f)}
- tf := f.Type
-
- // Unwrap tf to get its most basic type.
- var isPointer, isSlice bool
- if tf.Kind() == reflect.Slice && tf.Elem().Kind() != reflect.Uint8 {
- isSlice = true
- tf = tf.Elem()
- }
- if tf.Kind() == reflect.Ptr {
- isPointer = true
- tf = tf.Elem()
- }
- if isPointer && isSlice && tf.Kind() != reflect.Struct {
- panic(fmt.Sprintf("%v.%s cannot be a slice of pointers to primitive types", t, f.Name))
- }
-
- switch tf.Kind() {
- case reflect.Struct:
- switch {
- case !isPointer:
- panic(fmt.Sprintf("%v.%s cannot be a direct struct value", t, f.Name))
- case isSlice: // E.g., []*pb.T
- discardInfo := getDiscardInfo(tf)
- dfi.discard = func(src pointer) {
- sps := src.getPointerSlice()
- for _, sp := range sps {
- if !sp.isNil() {
- discardInfo.discard(sp)
- }
- }
- }
- default: // E.g., *pb.T
- discardInfo := getDiscardInfo(tf)
- dfi.discard = func(src pointer) {
- sp := src.getPointer()
- if !sp.isNil() {
- discardInfo.discard(sp)
- }
- }
- }
- case reflect.Map:
- switch {
- case isPointer || isSlice:
- panic(fmt.Sprintf("%v.%s cannot be a pointer to a map or a slice of map values", t, f.Name))
- default: // E.g., map[K]V
- if tf.Elem().Kind() == reflect.Ptr { // Proto struct (e.g., *T)
- dfi.discard = func(src pointer) {
- sm := src.asPointerTo(tf).Elem()
- if sm.Len() == 0 {
- return
- }
- for _, key := range sm.MapKeys() {
- val := sm.MapIndex(key)
- DiscardUnknown(val.Interface().(Message))
- }
- }
- } else {
- dfi.discard = func(pointer) {} // Noop
- }
- }
- case reflect.Interface:
- // Must be oneof field.
- switch {
- case isPointer || isSlice:
- panic(fmt.Sprintf("%v.%s cannot be a pointer to a interface or a slice of interface values", t, f.Name))
- default: // E.g., interface{}
- // TODO: Make this faster?
- dfi.discard = func(src pointer) {
- su := src.asPointerTo(tf).Elem()
- if !su.IsNil() {
- sv := su.Elem().Elem().Field(0)
- if sv.Kind() == reflect.Ptr && sv.IsNil() {
- return
- }
- switch sv.Type().Kind() {
- case reflect.Ptr: // Proto struct (e.g., *T)
- DiscardUnknown(sv.Interface().(Message))
- }
- }
- }
- }
- default:
- continue
- }
- di.fields = append(di.fields, dfi)
- }
-
- di.unrecognized = invalidField
- if f, ok := t.FieldByName("XXX_unrecognized"); ok {
- if f.Type != reflect.TypeOf([]byte{}) {
- panic("expected XXX_unrecognized to be of type []byte")
- }
- di.unrecognized = toField(&f)
- }
-
- atomic.StoreInt32(&di.initialized, 1)
-}
-
-func discardLegacy(m Message) {
- v := reflect.ValueOf(m)
- if v.Kind() != reflect.Ptr || v.IsNil() {
- return
- }
- v = v.Elem()
- if v.Kind() != reflect.Struct {
- return
- }
- t := v.Type()
-
- for i := 0; i < v.NumField(); i++ {
- f := t.Field(i)
- if strings.HasPrefix(f.Name, "XXX_") {
- continue
- }
- vf := v.Field(i)
- tf := f.Type
-
- // Unwrap tf to get its most basic type.
- var isPointer, isSlice bool
- if tf.Kind() == reflect.Slice && tf.Elem().Kind() != reflect.Uint8 {
- isSlice = true
- tf = tf.Elem()
- }
- if tf.Kind() == reflect.Ptr {
- isPointer = true
- tf = tf.Elem()
- }
- if isPointer && isSlice && tf.Kind() != reflect.Struct {
- panic(fmt.Sprintf("%T.%s cannot be a slice of pointers to primitive types", m, f.Name))
- }
-
- switch tf.Kind() {
- case reflect.Struct:
- switch {
- case !isPointer:
- panic(fmt.Sprintf("%T.%s cannot be a direct struct value", m, f.Name))
- case isSlice: // E.g., []*pb.T
- for j := 0; j < vf.Len(); j++ {
- discardLegacy(vf.Index(j).Interface().(Message))
- }
- default: // E.g., *pb.T
- discardLegacy(vf.Interface().(Message))
- }
- case reflect.Map:
- switch {
- case isPointer || isSlice:
- panic(fmt.Sprintf("%T.%s cannot be a pointer to a map or a slice of map values", m, f.Name))
- default: // E.g., map[K]V
- tv := vf.Type().Elem()
- if tv.Kind() == reflect.Ptr && tv.Implements(protoMessageType) { // Proto struct (e.g., *T)
- for _, key := range vf.MapKeys() {
- val := vf.MapIndex(key)
- discardLegacy(val.Interface().(Message))
- }
- }
- }
- case reflect.Interface:
- // Must be oneof field.
- switch {
- case isPointer || isSlice:
- panic(fmt.Sprintf("%T.%s cannot be a pointer to a interface or a slice of interface values", m, f.Name))
- default: // E.g., test_proto.isCommunique_Union interface
- if !vf.IsNil() && f.Tag.Get("protobuf_oneof") != "" {
- vf = vf.Elem() // E.g., *test_proto.Communique_Msg
- if !vf.IsNil() {
- vf = vf.Elem() // E.g., test_proto.Communique_Msg
- vf = vf.Field(0) // E.g., Proto struct (e.g., *T) or primitive value
- if vf.Kind() == reflect.Ptr {
- discardLegacy(vf.Interface().(Message))
- }
- }
- }
- }
- }
- }
-
- if vf := v.FieldByName("XXX_unrecognized"); vf.IsValid() {
- if vf.Type() != reflect.TypeOf([]byte{}) {
- panic("expected XXX_unrecognized to be of type []byte")
- }
- vf.Set(reflect.ValueOf([]byte(nil)))
- }
-
- // For proto2 messages, only discard unknown fields in message extensions
- // that have been accessed via GetExtension.
- if em, err := extendable(m); err == nil {
- // Ignore lock since discardLegacy is not concurrency safe.
- emm, _ := em.extensionsRead()
- for _, mx := range emm {
- if m, ok := mx.value.(Message); ok {
- discardLegacy(m)
- }
- }
- }
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/duration.go b/api/vendor/github.com/gogo/protobuf/proto/duration.go
deleted file mode 100644
index 93464c91cffb..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/duration.go
+++ /dev/null
@@ -1,100 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2016 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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
-// OWNER 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.
-
-package proto
-
-// This file implements conversions between google.protobuf.Duration
-// and time.Duration.
-
-import (
- "errors"
- "fmt"
- "time"
-)
-
-const (
- // Range of a Duration in seconds, as specified in
- // google/protobuf/duration.proto. This is about 10,000 years in seconds.
- maxSeconds = int64(10000 * 365.25 * 24 * 60 * 60)
- minSeconds = -maxSeconds
-)
-
-// validateDuration determines whether the Duration is valid according to the
-// definition in google/protobuf/duration.proto. A valid Duration
-// may still be too large to fit into a time.Duration (the range of Duration
-// is about 10,000 years, and the range of time.Duration is about 290).
-func validateDuration(d *duration) error {
- if d == nil {
- return errors.New("duration: nil Duration")
- }
- if d.Seconds < minSeconds || d.Seconds > maxSeconds {
- return fmt.Errorf("duration: %#v: seconds out of range", d)
- }
- if d.Nanos <= -1e9 || d.Nanos >= 1e9 {
- return fmt.Errorf("duration: %#v: nanos out of range", d)
- }
- // Seconds and Nanos must have the same sign, unless d.Nanos is zero.
- if (d.Seconds < 0 && d.Nanos > 0) || (d.Seconds > 0 && d.Nanos < 0) {
- return fmt.Errorf("duration: %#v: seconds and nanos have different signs", d)
- }
- return nil
-}
-
-// DurationFromProto converts a Duration to a time.Duration. DurationFromProto
-// returns an error if the Duration is invalid or is too large to be
-// represented in a time.Duration.
-func durationFromProto(p *duration) (time.Duration, error) {
- if err := validateDuration(p); err != nil {
- return 0, err
- }
- d := time.Duration(p.Seconds) * time.Second
- if int64(d/time.Second) != p.Seconds {
- return 0, fmt.Errorf("duration: %#v is out of range for time.Duration", p)
- }
- if p.Nanos != 0 {
- d += time.Duration(p.Nanos)
- if (d < 0) != (p.Nanos < 0) {
- return 0, fmt.Errorf("duration: %#v is out of range for time.Duration", p)
- }
- }
- return d, nil
-}
-
-// DurationProto converts a time.Duration to a Duration.
-func durationProto(d time.Duration) *duration {
- nanos := d.Nanoseconds()
- secs := nanos / 1e9
- nanos -= secs * 1e9
- return &duration{
- Seconds: secs,
- Nanos: int32(nanos),
- }
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/duration_gogo.go b/api/vendor/github.com/gogo/protobuf/proto/duration_gogo.go
deleted file mode 100644
index e748e1730e1c..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/duration_gogo.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2016, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-//
-// 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
-// OWNER 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.
-
-package proto
-
-import (
- "reflect"
- "time"
-)
-
-var durationType = reflect.TypeOf((*time.Duration)(nil)).Elem()
-
-type duration struct {
- Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"`
- Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"`
-}
-
-func (m *duration) Reset() { *m = duration{} }
-func (*duration) ProtoMessage() {}
-func (*duration) String() string { return "duration" }
-
-func init() {
- RegisterType((*duration)(nil), "gogo.protobuf.proto.duration")
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/encode.go b/api/vendor/github.com/gogo/protobuf/proto/encode.go
deleted file mode 100644
index 9581ccd3042f..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/encode.go
+++ /dev/null
@@ -1,205 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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
-// OWNER 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.
-
-package proto
-
-/*
- * Routines for encoding data into the wire format for protocol buffers.
- */
-
-import (
- "errors"
- "reflect"
-)
-
-var (
- // errRepeatedHasNil is the error returned if Marshal is called with
- // a struct with a repeated field containing a nil element.
- errRepeatedHasNil = errors.New("proto: repeated field has nil element")
-
- // errOneofHasNil is the error returned if Marshal is called with
- // a struct with a oneof field containing a nil element.
- errOneofHasNil = errors.New("proto: oneof field has nil value")
-
- // ErrNil is the error returned if Marshal is called with nil.
- ErrNil = errors.New("proto: Marshal called with nil")
-
- // ErrTooLarge is the error returned if Marshal is called with a
- // message that encodes to >2GB.
- ErrTooLarge = errors.New("proto: message encodes to over 2 GB")
-)
-
-// The fundamental encoders that put bytes on the wire.
-// Those that take integer types all accept uint64 and are
-// therefore of type valueEncoder.
-
-const maxVarintBytes = 10 // maximum length of a varint
-
-// EncodeVarint returns the varint encoding of x.
-// This is the format for the
-// int32, int64, uint32, uint64, bool, and enum
-// protocol buffer types.
-// Not used by the package itself, but helpful to clients
-// wishing to use the same encoding.
-func EncodeVarint(x uint64) []byte {
- var buf [maxVarintBytes]byte
- var n int
- for n = 0; x > 127; n++ {
- buf[n] = 0x80 | uint8(x&0x7F)
- x >>= 7
- }
- buf[n] = uint8(x)
- n++
- return buf[0:n]
-}
-
-// EncodeVarint writes a varint-encoded integer to the Buffer.
-// This is the format for the
-// int32, int64, uint32, uint64, bool, and enum
-// protocol buffer types.
-func (p *Buffer) EncodeVarint(x uint64) error {
- for x >= 1<<7 {
- p.buf = append(p.buf, uint8(x&0x7f|0x80))
- x >>= 7
- }
- p.buf = append(p.buf, uint8(x))
- return nil
-}
-
-// SizeVarint returns the varint encoding size of an integer.
-func SizeVarint(x uint64) int {
- switch {
- case x < 1<<7:
- return 1
- case x < 1<<14:
- return 2
- case x < 1<<21:
- return 3
- case x < 1<<28:
- return 4
- case x < 1<<35:
- return 5
- case x < 1<<42:
- return 6
- case x < 1<<49:
- return 7
- case x < 1<<56:
- return 8
- case x < 1<<63:
- return 9
- }
- return 10
-}
-
-// EncodeFixed64 writes a 64-bit integer to the Buffer.
-// This is the format for the
-// fixed64, sfixed64, and double protocol buffer types.
-func (p *Buffer) EncodeFixed64(x uint64) error {
- p.buf = append(p.buf,
- uint8(x),
- uint8(x>>8),
- uint8(x>>16),
- uint8(x>>24),
- uint8(x>>32),
- uint8(x>>40),
- uint8(x>>48),
- uint8(x>>56))
- return nil
-}
-
-// EncodeFixed32 writes a 32-bit integer to the Buffer.
-// This is the format for the
-// fixed32, sfixed32, and float protocol buffer types.
-func (p *Buffer) EncodeFixed32(x uint64) error {
- p.buf = append(p.buf,
- uint8(x),
- uint8(x>>8),
- uint8(x>>16),
- uint8(x>>24))
- return nil
-}
-
-// EncodeZigzag64 writes a zigzag-encoded 64-bit integer
-// to the Buffer.
-// This is the format used for the sint64 protocol buffer type.
-func (p *Buffer) EncodeZigzag64(x uint64) error {
- // use signed number to get arithmetic right shift.
- return p.EncodeVarint(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-
-// EncodeZigzag32 writes a zigzag-encoded 32-bit integer
-// to the Buffer.
-// This is the format used for the sint32 protocol buffer type.
-func (p *Buffer) EncodeZigzag32(x uint64) error {
- // use signed number to get arithmetic right shift.
- return p.EncodeVarint(uint64((uint32(x) << 1) ^ uint32((int32(x) >> 31))))
-}
-
-// EncodeRawBytes writes a count-delimited byte buffer to the Buffer.
-// This is the format used for the bytes protocol buffer
-// type and for embedded messages.
-func (p *Buffer) EncodeRawBytes(b []byte) error {
- p.EncodeVarint(uint64(len(b)))
- p.buf = append(p.buf, b...)
- return nil
-}
-
-// EncodeStringBytes writes an encoded string to the Buffer.
-// This is the format used for the proto2 string type.
-func (p *Buffer) EncodeStringBytes(s string) error {
- p.EncodeVarint(uint64(len(s)))
- p.buf = append(p.buf, s...)
- return nil
-}
-
-// Marshaler is the interface representing objects that can marshal themselves.
-type Marshaler interface {
- Marshal() ([]byte, error)
-}
-
-// EncodeMessage writes the protocol buffer to the Buffer,
-// prefixed by a varint-encoded length.
-func (p *Buffer) EncodeMessage(pb Message) error {
- siz := Size(pb)
- sizVar := SizeVarint(uint64(siz))
- p.grow(siz + sizVar)
- p.EncodeVarint(uint64(siz))
- return p.Marshal(pb)
-}
-
-// All protocol buffer fields are nillable, but be careful.
-func isNil(v reflect.Value) bool {
- switch v.Kind() {
- case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
- return v.IsNil()
- }
- return false
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/encode_gogo.go b/api/vendor/github.com/gogo/protobuf/proto/encode_gogo.go
deleted file mode 100644
index 0f5fb173e9fd..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/encode_gogo.go
+++ /dev/null
@@ -1,33 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2013, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-//
-// 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
-// OWNER 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.
-
-package proto
-
-func NewRequiredNotSetError(field string) *RequiredNotSetError {
- return &RequiredNotSetError{field}
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/equal.go b/api/vendor/github.com/gogo/protobuf/proto/equal.go
deleted file mode 100644
index d4db5a1c1457..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/equal.go
+++ /dev/null
@@ -1,300 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2011 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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
-// OWNER 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.
-
-// Protocol buffer comparison.
-
-package proto
-
-import (
- "bytes"
- "log"
- "reflect"
- "strings"
-)
-
-/*
-Equal returns true iff protocol buffers a and b are equal.
-The arguments must both be pointers to protocol buffer structs.
-
-Equality is defined in this way:
- - Two messages are equal iff they are the same type,
- corresponding fields are equal, unknown field sets
- are equal, and extensions sets are equal.
- - Two set scalar fields are equal iff their values are equal.
- If the fields are of a floating-point type, remember that
- NaN != x for all x, including NaN. If the message is defined
- in a proto3 .proto file, fields are not "set"; specifically,
- zero length proto3 "bytes" fields are equal (nil == {}).
- - Two repeated fields are equal iff their lengths are the same,
- and their corresponding elements are equal. Note a "bytes" field,
- although represented by []byte, is not a repeated field and the
- rule for the scalar fields described above applies.
- - Two unset fields are equal.
- - Two unknown field sets are equal if their current
- encoded state is equal.
- - Two extension sets are equal iff they have corresponding
- elements that are pairwise equal.
- - Two map fields are equal iff their lengths are the same,
- and they contain the same set of elements. Zero-length map
- fields are equal.
- - Every other combination of things are not equal.
-
-The return value is undefined if a and b are not protocol buffers.
-*/
-func Equal(a, b Message) bool {
- if a == nil || b == nil {
- return a == b
- }
- v1, v2 := reflect.ValueOf(a), reflect.ValueOf(b)
- if v1.Type() != v2.Type() {
- return false
- }
- if v1.Kind() == reflect.Ptr {
- if v1.IsNil() {
- return v2.IsNil()
- }
- if v2.IsNil() {
- return false
- }
- v1, v2 = v1.Elem(), v2.Elem()
- }
- if v1.Kind() != reflect.Struct {
- return false
- }
- return equalStruct(v1, v2)
-}
-
-// v1 and v2 are known to have the same type.
-func equalStruct(v1, v2 reflect.Value) bool {
- sprop := GetProperties(v1.Type())
- for i := 0; i < v1.NumField(); i++ {
- f := v1.Type().Field(i)
- if strings.HasPrefix(f.Name, "XXX_") {
- continue
- }
- f1, f2 := v1.Field(i), v2.Field(i)
- if f.Type.Kind() == reflect.Ptr {
- if n1, n2 := f1.IsNil(), f2.IsNil(); n1 && n2 {
- // both unset
- continue
- } else if n1 != n2 {
- // set/unset mismatch
- return false
- }
- f1, f2 = f1.Elem(), f2.Elem()
- }
- if !equalAny(f1, f2, sprop.Prop[i]) {
- return false
- }
- }
-
- if em1 := v1.FieldByName("XXX_InternalExtensions"); em1.IsValid() {
- em2 := v2.FieldByName("XXX_InternalExtensions")
- if !equalExtensions(v1.Type(), em1.Interface().(XXX_InternalExtensions), em2.Interface().(XXX_InternalExtensions)) {
- return false
- }
- }
-
- if em1 := v1.FieldByName("XXX_extensions"); em1.IsValid() {
- em2 := v2.FieldByName("XXX_extensions")
- if !equalExtMap(v1.Type(), em1.Interface().(map[int32]Extension), em2.Interface().(map[int32]Extension)) {
- return false
- }
- }
-
- uf := v1.FieldByName("XXX_unrecognized")
- if !uf.IsValid() {
- return true
- }
-
- u1 := uf.Bytes()
- u2 := v2.FieldByName("XXX_unrecognized").Bytes()
- return bytes.Equal(u1, u2)
-}
-
-// v1 and v2 are known to have the same type.
-// prop may be nil.
-func equalAny(v1, v2 reflect.Value, prop *Properties) bool {
- if v1.Type() == protoMessageType {
- m1, _ := v1.Interface().(Message)
- m2, _ := v2.Interface().(Message)
- return Equal(m1, m2)
- }
- switch v1.Kind() {
- case reflect.Bool:
- return v1.Bool() == v2.Bool()
- case reflect.Float32, reflect.Float64:
- return v1.Float() == v2.Float()
- case reflect.Int32, reflect.Int64:
- return v1.Int() == v2.Int()
- case reflect.Interface:
- // Probably a oneof field; compare the inner values.
- n1, n2 := v1.IsNil(), v2.IsNil()
- if n1 || n2 {
- return n1 == n2
- }
- e1, e2 := v1.Elem(), v2.Elem()
- if e1.Type() != e2.Type() {
- return false
- }
- return equalAny(e1, e2, nil)
- case reflect.Map:
- if v1.Len() != v2.Len() {
- return false
- }
- for _, key := range v1.MapKeys() {
- val2 := v2.MapIndex(key)
- if !val2.IsValid() {
- // This key was not found in the second map.
- return false
- }
- if !equalAny(v1.MapIndex(key), val2, nil) {
- return false
- }
- }
- return true
- case reflect.Ptr:
- // Maps may have nil values in them, so check for nil.
- if v1.IsNil() && v2.IsNil() {
- return true
- }
- if v1.IsNil() != v2.IsNil() {
- return false
- }
- return equalAny(v1.Elem(), v2.Elem(), prop)
- case reflect.Slice:
- if v1.Type().Elem().Kind() == reflect.Uint8 {
- // short circuit: []byte
-
- // Edge case: if this is in a proto3 message, a zero length
- // bytes field is considered the zero value.
- if prop != nil && prop.proto3 && v1.Len() == 0 && v2.Len() == 0 {
- return true
- }
- if v1.IsNil() != v2.IsNil() {
- return false
- }
- return bytes.Equal(v1.Interface().([]byte), v2.Interface().([]byte))
- }
-
- if v1.Len() != v2.Len() {
- return false
- }
- for i := 0; i < v1.Len(); i++ {
- if !equalAny(v1.Index(i), v2.Index(i), prop) {
- return false
- }
- }
- return true
- case reflect.String:
- return v1.Interface().(string) == v2.Interface().(string)
- case reflect.Struct:
- return equalStruct(v1, v2)
- case reflect.Uint32, reflect.Uint64:
- return v1.Uint() == v2.Uint()
- }
-
- // unknown type, so not a protocol buffer
- log.Printf("proto: don't know how to compare %v", v1)
- return false
-}
-
-// base is the struct type that the extensions are based on.
-// x1 and x2 are InternalExtensions.
-func equalExtensions(base reflect.Type, x1, x2 XXX_InternalExtensions) bool {
- em1, _ := x1.extensionsRead()
- em2, _ := x2.extensionsRead()
- return equalExtMap(base, em1, em2)
-}
-
-func equalExtMap(base reflect.Type, em1, em2 map[int32]Extension) bool {
- if len(em1) != len(em2) {
- return false
- }
-
- for extNum, e1 := range em1 {
- e2, ok := em2[extNum]
- if !ok {
- return false
- }
-
- m1, m2 := e1.value, e2.value
-
- if m1 == nil && m2 == nil {
- // Both have only encoded form.
- if bytes.Equal(e1.enc, e2.enc) {
- continue
- }
- // The bytes are different, but the extensions might still be
- // equal. We need to decode them to compare.
- }
-
- if m1 != nil && m2 != nil {
- // Both are unencoded.
- if !equalAny(reflect.ValueOf(m1), reflect.ValueOf(m2), nil) {
- return false
- }
- continue
- }
-
- // At least one is encoded. To do a semantically correct comparison
- // we need to unmarshal them first.
- var desc *ExtensionDesc
- if m := extensionMaps[base]; m != nil {
- desc = m[extNum]
- }
- if desc == nil {
- // If both have only encoded form and the bytes are the same,
- // it is handled above. We get here when the bytes are different.
- // We don't know how to decode it, so just compare them as byte
- // slices.
- log.Printf("proto: don't know how to compare extension %d of %v", extNum, base)
- return false
- }
- var err error
- if m1 == nil {
- m1, err = decodeExtension(e1.enc, desc)
- }
- if m2 == nil && err == nil {
- m2, err = decodeExtension(e2.enc, desc)
- }
- if err != nil {
- // The encoded form is invalid.
- log.Printf("proto: badly encoded extension %d of %v: %v", extNum, base, err)
- return false
- }
- if !equalAny(reflect.ValueOf(m1), reflect.ValueOf(m2), nil) {
- return false
- }
- }
-
- return true
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/extensions.go b/api/vendor/github.com/gogo/protobuf/proto/extensions.go
deleted file mode 100644
index 341c6f57f521..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/extensions.go
+++ /dev/null
@@ -1,605 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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
-// OWNER 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.
-
-package proto
-
-/*
- * Types and routines for supporting protocol buffer extensions.
- */
-
-import (
- "errors"
- "fmt"
- "io"
- "reflect"
- "strconv"
- "sync"
-)
-
-// ErrMissingExtension is the error returned by GetExtension if the named extension is not in the message.
-var ErrMissingExtension = errors.New("proto: missing extension")
-
-// ExtensionRange represents a range of message extensions for a protocol buffer.
-// Used in code generated by the protocol compiler.
-type ExtensionRange struct {
- Start, End int32 // both inclusive
-}
-
-// extendableProto is an interface implemented by any protocol buffer generated by the current
-// proto compiler that may be extended.
-type extendableProto interface {
- Message
- ExtensionRangeArray() []ExtensionRange
- extensionsWrite() map[int32]Extension
- extensionsRead() (map[int32]Extension, sync.Locker)
-}
-
-// extendableProtoV1 is an interface implemented by a protocol buffer generated by the previous
-// version of the proto compiler that may be extended.
-type extendableProtoV1 interface {
- Message
- ExtensionRangeArray() []ExtensionRange
- ExtensionMap() map[int32]Extension
-}
-
-// extensionAdapter is a wrapper around extendableProtoV1 that implements extendableProto.
-type extensionAdapter struct {
- extendableProtoV1
-}
-
-func (e extensionAdapter) extensionsWrite() map[int32]Extension {
- return e.ExtensionMap()
-}
-
-func (e extensionAdapter) extensionsRead() (map[int32]Extension, sync.Locker) {
- return e.ExtensionMap(), notLocker{}
-}
-
-// notLocker is a sync.Locker whose Lock and Unlock methods are nops.
-type notLocker struct{}
-
-func (n notLocker) Lock() {}
-func (n notLocker) Unlock() {}
-
-// extendable returns the extendableProto interface for the given generated proto message.
-// If the proto message has the old extension format, it returns a wrapper that implements
-// the extendableProto interface.
-func extendable(p interface{}) (extendableProto, error) {
- switch p := p.(type) {
- case extendableProto:
- if isNilPtr(p) {
- return nil, fmt.Errorf("proto: nil %T is not extendable", p)
- }
- return p, nil
- case extendableProtoV1:
- if isNilPtr(p) {
- return nil, fmt.Errorf("proto: nil %T is not extendable", p)
- }
- return extensionAdapter{p}, nil
- case extensionsBytes:
- return slowExtensionAdapter{p}, nil
- }
- // Don't allocate a specific error containing %T:
- // this is the hot path for Clone and MarshalText.
- return nil, errNotExtendable
-}
-
-var errNotExtendable = errors.New("proto: not an extendable proto.Message")
-
-func isNilPtr(x interface{}) bool {
- v := reflect.ValueOf(x)
- return v.Kind() == reflect.Ptr && v.IsNil()
-}
-
-// XXX_InternalExtensions is an internal representation of proto extensions.
-//
-// Each generated message struct type embeds an anonymous XXX_InternalExtensions field,
-// thus gaining the unexported 'extensions' method, which can be called only from the proto package.
-//
-// The methods of XXX_InternalExtensions are not concurrency safe in general,
-// but calls to logically read-only methods such as has and get may be executed concurrently.
-type XXX_InternalExtensions struct {
- // The struct must be indirect so that if a user inadvertently copies a
- // generated message and its embedded XXX_InternalExtensions, they
- // avoid the mayhem of a copied mutex.
- //
- // The mutex serializes all logically read-only operations to p.extensionMap.
- // It is up to the client to ensure that write operations to p.extensionMap are
- // mutually exclusive with other accesses.
- p *struct {
- mu sync.Mutex
- extensionMap map[int32]Extension
- }
-}
-
-// extensionsWrite returns the extension map, creating it on first use.
-func (e *XXX_InternalExtensions) extensionsWrite() map[int32]Extension {
- if e.p == nil {
- e.p = new(struct {
- mu sync.Mutex
- extensionMap map[int32]Extension
- })
- e.p.extensionMap = make(map[int32]Extension)
- }
- return e.p.extensionMap
-}
-
-// extensionsRead returns the extensions map for read-only use. It may be nil.
-// The caller must hold the returned mutex's lock when accessing Elements within the map.
-func (e *XXX_InternalExtensions) extensionsRead() (map[int32]Extension, sync.Locker) {
- if e.p == nil {
- return nil, nil
- }
- return e.p.extensionMap, &e.p.mu
-}
-
-// ExtensionDesc represents an extension specification.
-// Used in generated code from the protocol compiler.
-type ExtensionDesc struct {
- ExtendedType Message // nil pointer to the type that is being extended
- ExtensionType interface{} // nil pointer to the extension type
- Field int32 // field number
- Name string // fully-qualified name of extension, for text formatting
- Tag string // protobuf tag style
- Filename string // name of the file in which the extension is defined
-}
-
-func (ed *ExtensionDesc) repeated() bool {
- t := reflect.TypeOf(ed.ExtensionType)
- return t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8
-}
-
-// Extension represents an extension in a message.
-type Extension struct {
- // When an extension is stored in a message using SetExtension
- // only desc and value are set. When the message is marshaled
- // enc will be set to the encoded form of the message.
- //
- // When a message is unmarshaled and contains extensions, each
- // extension will have only enc set. When such an extension is
- // accessed using GetExtension (or GetExtensions) desc and value
- // will be set.
- desc *ExtensionDesc
- value interface{}
- enc []byte
-}
-
-// SetRawExtension is for testing only.
-func SetRawExtension(base Message, id int32, b []byte) {
- if ebase, ok := base.(extensionsBytes); ok {
- clearExtension(base, id)
- ext := ebase.GetExtensions()
- *ext = append(*ext, b...)
- return
- }
- epb, err := extendable(base)
- if err != nil {
- return
- }
- extmap := epb.extensionsWrite()
- extmap[id] = Extension{enc: b}
-}
-
-// isExtensionField returns true iff the given field number is in an extension range.
-func isExtensionField(pb extendableProto, field int32) bool {
- for _, er := range pb.ExtensionRangeArray() {
- if er.Start <= field && field <= er.End {
- return true
- }
- }
- return false
-}
-
-// checkExtensionTypes checks that the given extension is valid for pb.
-func checkExtensionTypes(pb extendableProto, extension *ExtensionDesc) error {
- var pbi interface{} = pb
- // Check the extended type.
- if ea, ok := pbi.(extensionAdapter); ok {
- pbi = ea.extendableProtoV1
- }
- if ea, ok := pbi.(slowExtensionAdapter); ok {
- pbi = ea.extensionsBytes
- }
- if a, b := reflect.TypeOf(pbi), reflect.TypeOf(extension.ExtendedType); a != b {
- return fmt.Errorf("proto: bad extended type; %v does not extend %v", b, a)
- }
- // Check the range.
- if !isExtensionField(pb, extension.Field) {
- return errors.New("proto: bad extension number; not in declared ranges")
- }
- return nil
-}
-
-// extPropKey is sufficient to uniquely identify an extension.
-type extPropKey struct {
- base reflect.Type
- field int32
-}
-
-var extProp = struct {
- sync.RWMutex
- m map[extPropKey]*Properties
-}{
- m: make(map[extPropKey]*Properties),
-}
-
-func extensionProperties(ed *ExtensionDesc) *Properties {
- key := extPropKey{base: reflect.TypeOf(ed.ExtendedType), field: ed.Field}
-
- extProp.RLock()
- if prop, ok := extProp.m[key]; ok {
- extProp.RUnlock()
- return prop
- }
- extProp.RUnlock()
-
- extProp.Lock()
- defer extProp.Unlock()
- // Check again.
- if prop, ok := extProp.m[key]; ok {
- return prop
- }
-
- prop := new(Properties)
- prop.Init(reflect.TypeOf(ed.ExtensionType), "unknown_name", ed.Tag, nil)
- extProp.m[key] = prop
- return prop
-}
-
-// HasExtension returns whether the given extension is present in pb.
-func HasExtension(pb Message, extension *ExtensionDesc) bool {
- if epb, doki := pb.(extensionsBytes); doki {
- ext := epb.GetExtensions()
- buf := *ext
- o := 0
- for o < len(buf) {
- tag, n := DecodeVarint(buf[o:])
- fieldNum := int32(tag >> 3)
- if int32(fieldNum) == extension.Field {
- return true
- }
- wireType := int(tag & 0x7)
- o += n
- l, err := size(buf[o:], wireType)
- if err != nil {
- return false
- }
- o += l
- }
- return false
- }
- // TODO: Check types, field numbers, etc.?
- epb, err := extendable(pb)
- if err != nil {
- return false
- }
- extmap, mu := epb.extensionsRead()
- if extmap == nil {
- return false
- }
- mu.Lock()
- _, ok := extmap[extension.Field]
- mu.Unlock()
- return ok
-}
-
-// ClearExtension removes the given extension from pb.
-func ClearExtension(pb Message, extension *ExtensionDesc) {
- clearExtension(pb, extension.Field)
-}
-
-func clearExtension(pb Message, fieldNum int32) {
- if epb, ok := pb.(extensionsBytes); ok {
- offset := 0
- for offset != -1 {
- offset = deleteExtension(epb, fieldNum, offset)
- }
- return
- }
- epb, err := extendable(pb)
- if err != nil {
- return
- }
- // TODO: Check types, field numbers, etc.?
- extmap := epb.extensionsWrite()
- delete(extmap, fieldNum)
-}
-
-// GetExtension retrieves a proto2 extended field from pb.
-//
-// If the descriptor is type complete (i.e., ExtensionDesc.ExtensionType is non-nil),
-// then GetExtension parses the encoded field and returns a Go value of the specified type.
-// If the field is not present, then the default value is returned (if one is specified),
-// otherwise ErrMissingExtension is reported.
-//
-// If the descriptor is not type complete (i.e., ExtensionDesc.ExtensionType is nil),
-// then GetExtension returns the raw encoded bytes of the field extension.
-func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) {
- if epb, doki := pb.(extensionsBytes); doki {
- ext := epb.GetExtensions()
- return decodeExtensionFromBytes(extension, *ext)
- }
-
- epb, err := extendable(pb)
- if err != nil {
- return nil, err
- }
-
- if extension.ExtendedType != nil {
- // can only check type if this is a complete descriptor
- if cerr := checkExtensionTypes(epb, extension); cerr != nil {
- return nil, cerr
- }
- }
-
- emap, mu := epb.extensionsRead()
- if emap == nil {
- return defaultExtensionValue(extension)
- }
- mu.Lock()
- defer mu.Unlock()
- e, ok := emap[extension.Field]
- if !ok {
- // defaultExtensionValue returns the default value or
- // ErrMissingExtension if there is no default.
- return defaultExtensionValue(extension)
- }
-
- if e.value != nil {
- // Already decoded. Check the descriptor, though.
- if e.desc != extension {
- // This shouldn't happen. If it does, it means that
- // GetExtension was called twice with two different
- // descriptors with the same field number.
- return nil, errors.New("proto: descriptor conflict")
- }
- return e.value, nil
- }
-
- if extension.ExtensionType == nil {
- // incomplete descriptor
- return e.enc, nil
- }
-
- v, err := decodeExtension(e.enc, extension)
- if err != nil {
- return nil, err
- }
-
- // Remember the decoded version and drop the encoded version.
- // That way it is safe to mutate what we return.
- e.value = v
- e.desc = extension
- e.enc = nil
- emap[extension.Field] = e
- return e.value, nil
-}
-
-// defaultExtensionValue returns the default value for extension.
-// If no default for an extension is defined ErrMissingExtension is returned.
-func defaultExtensionValue(extension *ExtensionDesc) (interface{}, error) {
- if extension.ExtensionType == nil {
- // incomplete descriptor, so no default
- return nil, ErrMissingExtension
- }
-
- t := reflect.TypeOf(extension.ExtensionType)
- props := extensionProperties(extension)
-
- sf, _, err := fieldDefault(t, props)
- if err != nil {
- return nil, err
- }
-
- if sf == nil || sf.value == nil {
- // There is no default value.
- return nil, ErrMissingExtension
- }
-
- if t.Kind() != reflect.Ptr {
- // We do not need to return a Ptr, we can directly return sf.value.
- return sf.value, nil
- }
-
- // We need to return an interface{} that is a pointer to sf.value.
- value := reflect.New(t).Elem()
- value.Set(reflect.New(value.Type().Elem()))
- if sf.kind == reflect.Int32 {
- // We may have an int32 or an enum, but the underlying data is int32.
- // Since we can't set an int32 into a non int32 reflect.value directly
- // set it as a int32.
- value.Elem().SetInt(int64(sf.value.(int32)))
- } else {
- value.Elem().Set(reflect.ValueOf(sf.value))
- }
- return value.Interface(), nil
-}
-
-// decodeExtension decodes an extension encoded in b.
-func decodeExtension(b []byte, extension *ExtensionDesc) (interface{}, error) {
- t := reflect.TypeOf(extension.ExtensionType)
- unmarshal := typeUnmarshaler(t, extension.Tag)
-
- // t is a pointer to a struct, pointer to basic type or a slice.
- // Allocate space to store the pointer/slice.
- value := reflect.New(t).Elem()
-
- var err error
- for {
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- wire := int(x) & 7
-
- b, err = unmarshal(b, valToPointer(value.Addr()), wire)
- if err != nil {
- return nil, err
- }
-
- if len(b) == 0 {
- break
- }
- }
- return value.Interface(), nil
-}
-
-// GetExtensions returns a slice of the extensions present in pb that are also listed in es.
-// The returned slice has the same length as es; missing extensions will appear as nil elements.
-func GetExtensions(pb Message, es []*ExtensionDesc) (extensions []interface{}, err error) {
- epb, err := extendable(pb)
- if err != nil {
- return nil, err
- }
- extensions = make([]interface{}, len(es))
- for i, e := range es {
- extensions[i], err = GetExtension(epb, e)
- if err == ErrMissingExtension {
- err = nil
- }
- if err != nil {
- return
- }
- }
- return
-}
-
-// ExtensionDescs returns a new slice containing pb's extension descriptors, in undefined order.
-// For non-registered extensions, ExtensionDescs returns an incomplete descriptor containing
-// just the Field field, which defines the extension's field number.
-func ExtensionDescs(pb Message) ([]*ExtensionDesc, error) {
- epb, err := extendable(pb)
- if err != nil {
- return nil, err
- }
- registeredExtensions := RegisteredExtensions(pb)
-
- emap, mu := epb.extensionsRead()
- if emap == nil {
- return nil, nil
- }
- mu.Lock()
- defer mu.Unlock()
- extensions := make([]*ExtensionDesc, 0, len(emap))
- for extid, e := range emap {
- desc := e.desc
- if desc == nil {
- desc = registeredExtensions[extid]
- if desc == nil {
- desc = &ExtensionDesc{Field: extid}
- }
- }
-
- extensions = append(extensions, desc)
- }
- return extensions, nil
-}
-
-// SetExtension sets the specified extension of pb to the specified value.
-func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error {
- if epb, ok := pb.(extensionsBytes); ok {
- ClearExtension(pb, extension)
- newb, err := encodeExtension(extension, value)
- if err != nil {
- return err
- }
- bb := epb.GetExtensions()
- *bb = append(*bb, newb...)
- return nil
- }
- epb, err := extendable(pb)
- if err != nil {
- return err
- }
- if err := checkExtensionTypes(epb, extension); err != nil {
- return err
- }
- typ := reflect.TypeOf(extension.ExtensionType)
- if typ != reflect.TypeOf(value) {
- return fmt.Errorf("proto: bad extension value type. got: %T, want: %T", value, extension.ExtensionType)
- }
- // nil extension values need to be caught early, because the
- // encoder can't distinguish an ErrNil due to a nil extension
- // from an ErrNil due to a missing field. Extensions are
- // always optional, so the encoder would just swallow the error
- // and drop all the extensions from the encoded message.
- if reflect.ValueOf(value).IsNil() {
- return fmt.Errorf("proto: SetExtension called with nil value of type %T", value)
- }
-
- extmap := epb.extensionsWrite()
- extmap[extension.Field] = Extension{desc: extension, value: value}
- return nil
-}
-
-// ClearAllExtensions clears all extensions from pb.
-func ClearAllExtensions(pb Message) {
- if epb, doki := pb.(extensionsBytes); doki {
- ext := epb.GetExtensions()
- *ext = []byte{}
- return
- }
- epb, err := extendable(pb)
- if err != nil {
- return
- }
- m := epb.extensionsWrite()
- for k := range m {
- delete(m, k)
- }
-}
-
-// A global registry of extensions.
-// The generated code will register the generated descriptors by calling RegisterExtension.
-
-var extensionMaps = make(map[reflect.Type]map[int32]*ExtensionDesc)
-
-// RegisterExtension is called from the generated code.
-func RegisterExtension(desc *ExtensionDesc) {
- st := reflect.TypeOf(desc.ExtendedType).Elem()
- m := extensionMaps[st]
- if m == nil {
- m = make(map[int32]*ExtensionDesc)
- extensionMaps[st] = m
- }
- if _, ok := m[desc.Field]; ok {
- panic("proto: duplicate extension registered: " + st.String() + " " + strconv.Itoa(int(desc.Field)))
- }
- m[desc.Field] = desc
-}
-
-// RegisteredExtensions returns a map of the registered extensions of a
-// protocol buffer struct, indexed by the extension number.
-// The argument pb should be a nil pointer to the struct type.
-func RegisteredExtensions(pb Message) map[int32]*ExtensionDesc {
- return extensionMaps[reflect.TypeOf(pb).Elem()]
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/extensions_gogo.go b/api/vendor/github.com/gogo/protobuf/proto/extensions_gogo.go
deleted file mode 100644
index 6f1ae120ece5..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/extensions_gogo.go
+++ /dev/null
@@ -1,389 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2013, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-//
-// 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
-// OWNER 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.
-
-package proto
-
-import (
- "bytes"
- "errors"
- "fmt"
- "io"
- "reflect"
- "sort"
- "strings"
- "sync"
-)
-
-type extensionsBytes interface {
- Message
- ExtensionRangeArray() []ExtensionRange
- GetExtensions() *[]byte
-}
-
-type slowExtensionAdapter struct {
- extensionsBytes
-}
-
-func (s slowExtensionAdapter) extensionsWrite() map[int32]Extension {
- panic("Please report a bug to github.com/gogo/protobuf if you see this message: Writing extensions is not supported for extensions stored in a byte slice field.")
-}
-
-func (s slowExtensionAdapter) extensionsRead() (map[int32]Extension, sync.Locker) {
- b := s.GetExtensions()
- m, err := BytesToExtensionsMap(*b)
- if err != nil {
- panic(err)
- }
- return m, notLocker{}
-}
-
-func GetBoolExtension(pb Message, extension *ExtensionDesc, ifnotset bool) bool {
- if reflect.ValueOf(pb).IsNil() {
- return ifnotset
- }
- value, err := GetExtension(pb, extension)
- if err != nil {
- return ifnotset
- }
- if value == nil {
- return ifnotset
- }
- if value.(*bool) == nil {
- return ifnotset
- }
- return *(value.(*bool))
-}
-
-func (this *Extension) Equal(that *Extension) bool {
- if err := this.Encode(); err != nil {
- return false
- }
- if err := that.Encode(); err != nil {
- return false
- }
- return bytes.Equal(this.enc, that.enc)
-}
-
-func (this *Extension) Compare(that *Extension) int {
- if err := this.Encode(); err != nil {
- return 1
- }
- if err := that.Encode(); err != nil {
- return -1
- }
- return bytes.Compare(this.enc, that.enc)
-}
-
-func SizeOfInternalExtension(m extendableProto) (n int) {
- info := getMarshalInfo(reflect.TypeOf(m))
- return info.sizeV1Extensions(m.extensionsWrite())
-}
-
-type sortableMapElem struct {
- field int32
- ext Extension
-}
-
-func newSortableExtensionsFromMap(m map[int32]Extension) sortableExtensions {
- s := make(sortableExtensions, 0, len(m))
- for k, v := range m {
- s = append(s, &sortableMapElem{field: k, ext: v})
- }
- return s
-}
-
-type sortableExtensions []*sortableMapElem
-
-func (this sortableExtensions) Len() int { return len(this) }
-
-func (this sortableExtensions) Swap(i, j int) { this[i], this[j] = this[j], this[i] }
-
-func (this sortableExtensions) Less(i, j int) bool { return this[i].field < this[j].field }
-
-func (this sortableExtensions) String() string {
- sort.Sort(this)
- ss := make([]string, len(this))
- for i := range this {
- ss[i] = fmt.Sprintf("%d: %v", this[i].field, this[i].ext)
- }
- return "map[" + strings.Join(ss, ",") + "]"
-}
-
-func StringFromInternalExtension(m extendableProto) string {
- return StringFromExtensionsMap(m.extensionsWrite())
-}
-
-func StringFromExtensionsMap(m map[int32]Extension) string {
- return newSortableExtensionsFromMap(m).String()
-}
-
-func StringFromExtensionsBytes(ext []byte) string {
- m, err := BytesToExtensionsMap(ext)
- if err != nil {
- panic(err)
- }
- return StringFromExtensionsMap(m)
-}
-
-func EncodeInternalExtension(m extendableProto, data []byte) (n int, err error) {
- return EncodeExtensionMap(m.extensionsWrite(), data)
-}
-
-func EncodeInternalExtensionBackwards(m extendableProto, data []byte) (n int, err error) {
- return EncodeExtensionMapBackwards(m.extensionsWrite(), data)
-}
-
-func EncodeExtensionMap(m map[int32]Extension, data []byte) (n int, err error) {
- o := 0
- for _, e := range m {
- if err := e.Encode(); err != nil {
- return 0, err
- }
- n := copy(data[o:], e.enc)
- if n != len(e.enc) {
- return 0, io.ErrShortBuffer
- }
- o += n
- }
- return o, nil
-}
-
-func EncodeExtensionMapBackwards(m map[int32]Extension, data []byte) (n int, err error) {
- o := 0
- end := len(data)
- for _, e := range m {
- if err := e.Encode(); err != nil {
- return 0, err
- }
- n := copy(data[end-len(e.enc):], e.enc)
- if n != len(e.enc) {
- return 0, io.ErrShortBuffer
- }
- end -= n
- o += n
- }
- return o, nil
-}
-
-func GetRawExtension(m map[int32]Extension, id int32) ([]byte, error) {
- e := m[id]
- if err := e.Encode(); err != nil {
- return nil, err
- }
- return e.enc, nil
-}
-
-func size(buf []byte, wire int) (int, error) {
- switch wire {
- case WireVarint:
- _, n := DecodeVarint(buf)
- return n, nil
- case WireFixed64:
- return 8, nil
- case WireBytes:
- v, n := DecodeVarint(buf)
- return int(v) + n, nil
- case WireFixed32:
- return 4, nil
- case WireStartGroup:
- offset := 0
- for {
- u, n := DecodeVarint(buf[offset:])
- fwire := int(u & 0x7)
- offset += n
- if fwire == WireEndGroup {
- return offset, nil
- }
- s, err := size(buf[offset:], wire)
- if err != nil {
- return 0, err
- }
- offset += s
- }
- }
- return 0, fmt.Errorf("proto: can't get size for unknown wire type %d", wire)
-}
-
-func BytesToExtensionsMap(buf []byte) (map[int32]Extension, error) {
- m := make(map[int32]Extension)
- i := 0
- for i < len(buf) {
- tag, n := DecodeVarint(buf[i:])
- if n <= 0 {
- return nil, fmt.Errorf("unable to decode varint")
- }
- fieldNum := int32(tag >> 3)
- wireType := int(tag & 0x7)
- l, err := size(buf[i+n:], wireType)
- if err != nil {
- return nil, err
- }
- end := i + int(l) + n
- m[int32(fieldNum)] = Extension{enc: buf[i:end]}
- i = end
- }
- return m, nil
-}
-
-func NewExtension(e []byte) Extension {
- ee := Extension{enc: make([]byte, len(e))}
- copy(ee.enc, e)
- return ee
-}
-
-func AppendExtension(e Message, tag int32, buf []byte) {
- if ee, eok := e.(extensionsBytes); eok {
- ext := ee.GetExtensions()
- *ext = append(*ext, buf...)
- return
- }
- if ee, eok := e.(extendableProto); eok {
- m := ee.extensionsWrite()
- ext := m[int32(tag)] // may be missing
- ext.enc = append(ext.enc, buf...)
- m[int32(tag)] = ext
- }
-}
-
-func encodeExtension(extension *ExtensionDesc, value interface{}) ([]byte, error) {
- u := getMarshalInfo(reflect.TypeOf(extension.ExtendedType))
- ei := u.getExtElemInfo(extension)
- v := value
- p := toAddrPointer(&v, ei.isptr)
- siz := ei.sizer(p, SizeVarint(ei.wiretag))
- buf := make([]byte, 0, siz)
- return ei.marshaler(buf, p, ei.wiretag, false)
-}
-
-func decodeExtensionFromBytes(extension *ExtensionDesc, buf []byte) (interface{}, error) {
- o := 0
- for o < len(buf) {
- tag, n := DecodeVarint((buf)[o:])
- fieldNum := int32(tag >> 3)
- wireType := int(tag & 0x7)
- if o+n > len(buf) {
- return nil, fmt.Errorf("unable to decode extension")
- }
- l, err := size((buf)[o+n:], wireType)
- if err != nil {
- return nil, err
- }
- if int32(fieldNum) == extension.Field {
- if o+n+l > len(buf) {
- return nil, fmt.Errorf("unable to decode extension")
- }
- v, err := decodeExtension((buf)[o:o+n+l], extension)
- if err != nil {
- return nil, err
- }
- return v, nil
- }
- o += n + l
- }
- return defaultExtensionValue(extension)
-}
-
-func (this *Extension) Encode() error {
- if this.enc == nil {
- var err error
- this.enc, err = encodeExtension(this.desc, this.value)
- if err != nil {
- return err
- }
- }
- return nil
-}
-
-func (this Extension) GoString() string {
- if err := this.Encode(); err != nil {
- return fmt.Sprintf("error encoding extension: %v", err)
- }
- return fmt.Sprintf("proto.NewExtension(%#v)", this.enc)
-}
-
-func SetUnsafeExtension(pb Message, fieldNum int32, value interface{}) error {
- typ := reflect.TypeOf(pb).Elem()
- ext, ok := extensionMaps[typ]
- if !ok {
- return fmt.Errorf("proto: bad extended type; %s is not extendable", typ.String())
- }
- desc, ok := ext[fieldNum]
- if !ok {
- return errors.New("proto: bad extension number; not in declared ranges")
- }
- return SetExtension(pb, desc, value)
-}
-
-func GetUnsafeExtension(pb Message, fieldNum int32) (interface{}, error) {
- typ := reflect.TypeOf(pb).Elem()
- ext, ok := extensionMaps[typ]
- if !ok {
- return nil, fmt.Errorf("proto: bad extended type; %s is not extendable", typ.String())
- }
- desc, ok := ext[fieldNum]
- if !ok {
- return nil, fmt.Errorf("unregistered field number %d", fieldNum)
- }
- return GetExtension(pb, desc)
-}
-
-func NewUnsafeXXX_InternalExtensions(m map[int32]Extension) XXX_InternalExtensions {
- x := &XXX_InternalExtensions{
- p: new(struct {
- mu sync.Mutex
- extensionMap map[int32]Extension
- }),
- }
- x.p.extensionMap = m
- return *x
-}
-
-func GetUnsafeExtensionsMap(extendable Message) map[int32]Extension {
- pb := extendable.(extendableProto)
- return pb.extensionsWrite()
-}
-
-func deleteExtension(pb extensionsBytes, theFieldNum int32, offset int) int {
- ext := pb.GetExtensions()
- for offset < len(*ext) {
- tag, n1 := DecodeVarint((*ext)[offset:])
- fieldNum := int32(tag >> 3)
- wireType := int(tag & 0x7)
- n2, err := size((*ext)[offset+n1:], wireType)
- if err != nil {
- panic(err)
- }
- newOffset := offset + n1 + n2
- if fieldNum == theFieldNum {
- *ext = append((*ext)[:offset], (*ext)[newOffset:]...)
- return offset
- }
- offset = newOffset
- }
- return -1
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/lib.go b/api/vendor/github.com/gogo/protobuf/proto/lib.go
deleted file mode 100644
index 80db1c155b59..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/lib.go
+++ /dev/null
@@ -1,973 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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
-// OWNER 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.
-
-/*
-Package proto converts data structures to and from the wire format of
-protocol buffers. It works in concert with the Go source code generated
-for .proto files by the protocol compiler.
-
-A summary of the properties of the protocol buffer interface
-for a protocol buffer variable v:
-
- - Names are turned from camel_case to CamelCase for export.
- - There are no methods on v to set fields; just treat
- them as structure fields.
- - There are getters that return a field's value if set,
- and return the field's default value if unset.
- The getters work even if the receiver is a nil message.
- - The zero value for a struct is its correct initialization state.
- All desired fields must be set before marshaling.
- - A Reset() method will restore a protobuf struct to its zero state.
- - Non-repeated fields are pointers to the values; nil means unset.
- That is, optional or required field int32 f becomes F *int32.
- - Repeated fields are slices.
- - Helper functions are available to aid the setting of fields.
- msg.Foo = proto.String("hello") // set field
- - Constants are defined to hold the default values of all fields that
- have them. They have the form Default_StructName_FieldName.
- Because the getter methods handle defaulted values,
- direct use of these constants should be rare.
- - Enums are given type names and maps from names to values.
- Enum values are prefixed by the enclosing message's name, or by the
- enum's type name if it is a top-level enum. Enum types have a String
- method, and a Enum method to assist in message construction.
- - Nested messages, groups and enums have type names prefixed with the name of
- the surrounding message type.
- - Extensions are given descriptor names that start with E_,
- followed by an underscore-delimited list of the nested messages
- that contain it (if any) followed by the CamelCased name of the
- extension field itself. HasExtension, ClearExtension, GetExtension
- and SetExtension are functions for manipulating extensions.
- - Oneof field sets are given a single field in their message,
- with distinguished wrapper types for each possible field value.
- - Marshal and Unmarshal are functions to encode and decode the wire format.
-
-When the .proto file specifies `syntax="proto3"`, there are some differences:
-
- - Non-repeated fields of non-message type are values instead of pointers.
- - Enum types do not get an Enum method.
-
-The simplest way to describe this is to see an example.
-Given file test.proto, containing
-
- package example;
-
- enum FOO { X = 17; }
-
- message Test {
- required string label = 1;
- optional int32 type = 2 [default=77];
- repeated int64 reps = 3;
- optional group OptionalGroup = 4 {
- required string RequiredField = 5;
- }
- oneof union {
- int32 number = 6;
- string name = 7;
- }
- }
-
-The resulting file, test.pb.go, is:
-
- package example
-
- import proto "github.com/gogo/protobuf/proto"
- import math "math"
-
- type FOO int32
- const (
- FOO_X FOO = 17
- )
- var FOO_name = map[int32]string{
- 17: "X",
- }
- var FOO_value = map[string]int32{
- "X": 17,
- }
-
- func (x FOO) Enum() *FOO {
- p := new(FOO)
- *p = x
- return p
- }
- func (x FOO) String() string {
- return proto.EnumName(FOO_name, int32(x))
- }
- func (x *FOO) UnmarshalJSON(data []byte) error {
- value, err := proto.UnmarshalJSONEnum(FOO_value, data)
- if err != nil {
- return err
- }
- *x = FOO(value)
- return nil
- }
-
- type Test struct {
- Label *string `protobuf:"bytes,1,req,name=label" json:"label,omitempty"`
- Type *int32 `protobuf:"varint,2,opt,name=type,def=77" json:"type,omitempty"`
- Reps []int64 `protobuf:"varint,3,rep,name=reps" json:"reps,omitempty"`
- Optionalgroup *Test_OptionalGroup `protobuf:"group,4,opt,name=OptionalGroup" json:"optionalgroup,omitempty"`
- // Types that are valid to be assigned to Union:
- // *Test_Number
- // *Test_Name
- Union isTest_Union `protobuf_oneof:"union"`
- XXX_unrecognized []byte `json:"-"`
- }
- func (m *Test) Reset() { *m = Test{} }
- func (m *Test) String() string { return proto.CompactTextString(m) }
- func (*Test) ProtoMessage() {}
-
- type isTest_Union interface {
- isTest_Union()
- }
-
- type Test_Number struct {
- Number int32 `protobuf:"varint,6,opt,name=number"`
- }
- type Test_Name struct {
- Name string `protobuf:"bytes,7,opt,name=name"`
- }
-
- func (*Test_Number) isTest_Union() {}
- func (*Test_Name) isTest_Union() {}
-
- func (m *Test) GetUnion() isTest_Union {
- if m != nil {
- return m.Union
- }
- return nil
- }
- const Default_Test_Type int32 = 77
-
- func (m *Test) GetLabel() string {
- if m != nil && m.Label != nil {
- return *m.Label
- }
- return ""
- }
-
- func (m *Test) GetType() int32 {
- if m != nil && m.Type != nil {
- return *m.Type
- }
- return Default_Test_Type
- }
-
- func (m *Test) GetOptionalgroup() *Test_OptionalGroup {
- if m != nil {
- return m.Optionalgroup
- }
- return nil
- }
-
- type Test_OptionalGroup struct {
- RequiredField *string `protobuf:"bytes,5,req" json:"RequiredField,omitempty"`
- }
- func (m *Test_OptionalGroup) Reset() { *m = Test_OptionalGroup{} }
- func (m *Test_OptionalGroup) String() string { return proto.CompactTextString(m) }
-
- func (m *Test_OptionalGroup) GetRequiredField() string {
- if m != nil && m.RequiredField != nil {
- return *m.RequiredField
- }
- return ""
- }
-
- func (m *Test) GetNumber() int32 {
- if x, ok := m.GetUnion().(*Test_Number); ok {
- return x.Number
- }
- return 0
- }
-
- func (m *Test) GetName() string {
- if x, ok := m.GetUnion().(*Test_Name); ok {
- return x.Name
- }
- return ""
- }
-
- func init() {
- proto.RegisterEnum("example.FOO", FOO_name, FOO_value)
- }
-
-To create and play with a Test object:
-
- package main
-
- import (
- "log"
-
- "github.com/gogo/protobuf/proto"
- pb "./example.pb"
- )
-
- func main() {
- test := &pb.Test{
- Label: proto.String("hello"),
- Type: proto.Int32(17),
- Reps: []int64{1, 2, 3},
- Optionalgroup: &pb.Test_OptionalGroup{
- RequiredField: proto.String("good bye"),
- },
- Union: &pb.Test_Name{"fred"},
- }
- data, err := proto.Marshal(test)
- if err != nil {
- log.Fatal("marshaling error: ", err)
- }
- newTest := &pb.Test{}
- err = proto.Unmarshal(data, newTest)
- if err != nil {
- log.Fatal("unmarshaling error: ", err)
- }
- // Now test and newTest contain the same data.
- if test.GetLabel() != newTest.GetLabel() {
- log.Fatalf("data mismatch %q != %q", test.GetLabel(), newTest.GetLabel())
- }
- // Use a type switch to determine which oneof was set.
- switch u := test.Union.(type) {
- case *pb.Test_Number: // u.Number contains the number.
- case *pb.Test_Name: // u.Name contains the string.
- }
- // etc.
- }
-*/
-package proto
-
-import (
- "encoding/json"
- "fmt"
- "log"
- "reflect"
- "sort"
- "strconv"
- "sync"
-)
-
-// RequiredNotSetError is an error type returned by either Marshal or Unmarshal.
-// Marshal reports this when a required field is not initialized.
-// Unmarshal reports this when a required field is missing from the wire data.
-type RequiredNotSetError struct{ field string }
-
-func (e *RequiredNotSetError) Error() string {
- if e.field == "" {
- return fmt.Sprintf("proto: required field not set")
- }
- return fmt.Sprintf("proto: required field %q not set", e.field)
-}
-func (e *RequiredNotSetError) RequiredNotSet() bool {
- return true
-}
-
-type invalidUTF8Error struct{ field string }
-
-func (e *invalidUTF8Error) Error() string {
- if e.field == "" {
- return "proto: invalid UTF-8 detected"
- }
- return fmt.Sprintf("proto: field %q contains invalid UTF-8", e.field)
-}
-func (e *invalidUTF8Error) InvalidUTF8() bool {
- return true
-}
-
-// errInvalidUTF8 is a sentinel error to identify fields with invalid UTF-8.
-// This error should not be exposed to the external API as such errors should
-// be recreated with the field information.
-var errInvalidUTF8 = &invalidUTF8Error{}
-
-// isNonFatal reports whether the error is either a RequiredNotSet error
-// or a InvalidUTF8 error.
-func isNonFatal(err error) bool {
- if re, ok := err.(interface{ RequiredNotSet() bool }); ok && re.RequiredNotSet() {
- return true
- }
- if re, ok := err.(interface{ InvalidUTF8() bool }); ok && re.InvalidUTF8() {
- return true
- }
- return false
-}
-
-type nonFatal struct{ E error }
-
-// Merge merges err into nf and reports whether it was successful.
-// Otherwise it returns false for any fatal non-nil errors.
-func (nf *nonFatal) Merge(err error) (ok bool) {
- if err == nil {
- return true // not an error
- }
- if !isNonFatal(err) {
- return false // fatal error
- }
- if nf.E == nil {
- nf.E = err // store first instance of non-fatal error
- }
- return true
-}
-
-// Message is implemented by generated protocol buffer messages.
-type Message interface {
- Reset()
- String() string
- ProtoMessage()
-}
-
-// A Buffer is a buffer manager for marshaling and unmarshaling
-// protocol buffers. It may be reused between invocations to
-// reduce memory usage. It is not necessary to use a Buffer;
-// the global functions Marshal and Unmarshal create a
-// temporary Buffer and are fine for most applications.
-type Buffer struct {
- buf []byte // encode/decode byte stream
- index int // read point
-
- deterministic bool
-}
-
-// NewBuffer allocates a new Buffer and initializes its internal data to
-// the contents of the argument slice.
-func NewBuffer(e []byte) *Buffer {
- return &Buffer{buf: e}
-}
-
-// Reset resets the Buffer, ready for marshaling a new protocol buffer.
-func (p *Buffer) Reset() {
- p.buf = p.buf[0:0] // for reading/writing
- p.index = 0 // for reading
-}
-
-// SetBuf replaces the internal buffer with the slice,
-// ready for unmarshaling the contents of the slice.
-func (p *Buffer) SetBuf(s []byte) {
- p.buf = s
- p.index = 0
-}
-
-// Bytes returns the contents of the Buffer.
-func (p *Buffer) Bytes() []byte { return p.buf }
-
-// SetDeterministic sets whether to use deterministic serialization.
-//
-// Deterministic serialization guarantees that for a given binary, equal
-// messages will always be serialized to the same bytes. This implies:
-//
-// - Repeated serialization of a message will return the same bytes.
-// - Different processes of the same binary (which may be executing on
-// different machines) will serialize equal messages to the same bytes.
-//
-// Note that the deterministic serialization is NOT canonical across
-// languages. It is not guaranteed to remain stable over time. It is unstable
-// across different builds with schema changes due to unknown fields.
-// Users who need canonical serialization (e.g., persistent storage in a
-// canonical form, fingerprinting, etc.) should define their own
-// canonicalization specification and implement their own serializer rather
-// than relying on this API.
-//
-// If deterministic serialization is requested, map entries will be sorted
-// by keys in lexographical order. This is an implementation detail and
-// subject to change.
-func (p *Buffer) SetDeterministic(deterministic bool) {
- p.deterministic = deterministic
-}
-
-/*
- * Helper routines for simplifying the creation of optional fields of basic type.
- */
-
-// Bool is a helper routine that allocates a new bool value
-// to store v and returns a pointer to it.
-func Bool(v bool) *bool {
- return &v
-}
-
-// Int32 is a helper routine that allocates a new int32 value
-// to store v and returns a pointer to it.
-func Int32(v int32) *int32 {
- return &v
-}
-
-// Int is a helper routine that allocates a new int32 value
-// to store v and returns a pointer to it, but unlike Int32
-// its argument value is an int.
-func Int(v int) *int32 {
- p := new(int32)
- *p = int32(v)
- return p
-}
-
-// Int64 is a helper routine that allocates a new int64 value
-// to store v and returns a pointer to it.
-func Int64(v int64) *int64 {
- return &v
-}
-
-// Float32 is a helper routine that allocates a new float32 value
-// to store v and returns a pointer to it.
-func Float32(v float32) *float32 {
- return &v
-}
-
-// Float64 is a helper routine that allocates a new float64 value
-// to store v and returns a pointer to it.
-func Float64(v float64) *float64 {
- return &v
-}
-
-// Uint32 is a helper routine that allocates a new uint32 value
-// to store v and returns a pointer to it.
-func Uint32(v uint32) *uint32 {
- return &v
-}
-
-// Uint64 is a helper routine that allocates a new uint64 value
-// to store v and returns a pointer to it.
-func Uint64(v uint64) *uint64 {
- return &v
-}
-
-// String is a helper routine that allocates a new string value
-// to store v and returns a pointer to it.
-func String(v string) *string {
- return &v
-}
-
-// EnumName is a helper function to simplify printing protocol buffer enums
-// by name. Given an enum map and a value, it returns a useful string.
-func EnumName(m map[int32]string, v int32) string {
- s, ok := m[v]
- if ok {
- return s
- }
- return strconv.Itoa(int(v))
-}
-
-// UnmarshalJSONEnum is a helper function to simplify recovering enum int values
-// from their JSON-encoded representation. Given a map from the enum's symbolic
-// names to its int values, and a byte buffer containing the JSON-encoded
-// value, it returns an int32 that can be cast to the enum type by the caller.
-//
-// The function can deal with both JSON representations, numeric and symbolic.
-func UnmarshalJSONEnum(m map[string]int32, data []byte, enumName string) (int32, error) {
- if data[0] == '"' {
- // New style: enums are strings.
- var repr string
- if err := json.Unmarshal(data, &repr); err != nil {
- return -1, err
- }
- val, ok := m[repr]
- if !ok {
- return 0, fmt.Errorf("unrecognized enum %s value %q", enumName, repr)
- }
- return val, nil
- }
- // Old style: enums are ints.
- var val int32
- if err := json.Unmarshal(data, &val); err != nil {
- return 0, fmt.Errorf("cannot unmarshal %#q into enum %s", data, enumName)
- }
- return val, nil
-}
-
-// DebugPrint dumps the encoded data in b in a debugging format with a header
-// including the string s. Used in testing but made available for general debugging.
-func (p *Buffer) DebugPrint(s string, b []byte) {
- var u uint64
-
- obuf := p.buf
- sindex := p.index
- p.buf = b
- p.index = 0
- depth := 0
-
- fmt.Printf("\n--- %s ---\n", s)
-
-out:
- for {
- for i := 0; i < depth; i++ {
- fmt.Print(" ")
- }
-
- index := p.index
- if index == len(p.buf) {
- break
- }
-
- op, err := p.DecodeVarint()
- if err != nil {
- fmt.Printf("%3d: fetching op err %v\n", index, err)
- break out
- }
- tag := op >> 3
- wire := op & 7
-
- switch wire {
- default:
- fmt.Printf("%3d: t=%3d unknown wire=%d\n",
- index, tag, wire)
- break out
-
- case WireBytes:
- var r []byte
-
- r, err = p.DecodeRawBytes(false)
- if err != nil {
- break out
- }
- fmt.Printf("%3d: t=%3d bytes [%d]", index, tag, len(r))
- if len(r) <= 6 {
- for i := 0; i < len(r); i++ {
- fmt.Printf(" %.2x", r[i])
- }
- } else {
- for i := 0; i < 3; i++ {
- fmt.Printf(" %.2x", r[i])
- }
- fmt.Printf(" ..")
- for i := len(r) - 3; i < len(r); i++ {
- fmt.Printf(" %.2x", r[i])
- }
- }
- fmt.Printf("\n")
-
- case WireFixed32:
- u, err = p.DecodeFixed32()
- if err != nil {
- fmt.Printf("%3d: t=%3d fix32 err %v\n", index, tag, err)
- break out
- }
- fmt.Printf("%3d: t=%3d fix32 %d\n", index, tag, u)
-
- case WireFixed64:
- u, err = p.DecodeFixed64()
- if err != nil {
- fmt.Printf("%3d: t=%3d fix64 err %v\n", index, tag, err)
- break out
- }
- fmt.Printf("%3d: t=%3d fix64 %d\n", index, tag, u)
-
- case WireVarint:
- u, err = p.DecodeVarint()
- if err != nil {
- fmt.Printf("%3d: t=%3d varint err %v\n", index, tag, err)
- break out
- }
- fmt.Printf("%3d: t=%3d varint %d\n", index, tag, u)
-
- case WireStartGroup:
- fmt.Printf("%3d: t=%3d start\n", index, tag)
- depth++
-
- case WireEndGroup:
- depth--
- fmt.Printf("%3d: t=%3d end\n", index, tag)
- }
- }
-
- if depth != 0 {
- fmt.Printf("%3d: start-end not balanced %d\n", p.index, depth)
- }
- fmt.Printf("\n")
-
- p.buf = obuf
- p.index = sindex
-}
-
-// SetDefaults sets unset protocol buffer fields to their default values.
-// It only modifies fields that are both unset and have defined defaults.
-// It recursively sets default values in any non-nil sub-messages.
-func SetDefaults(pb Message) {
- setDefaults(reflect.ValueOf(pb), true, false)
-}
-
-// v is a struct.
-func setDefaults(v reflect.Value, recur, zeros bool) {
- if v.Kind() == reflect.Ptr {
- v = v.Elem()
- }
-
- defaultMu.RLock()
- dm, ok := defaults[v.Type()]
- defaultMu.RUnlock()
- if !ok {
- dm = buildDefaultMessage(v.Type())
- defaultMu.Lock()
- defaults[v.Type()] = dm
- defaultMu.Unlock()
- }
-
- for _, sf := range dm.scalars {
- f := v.Field(sf.index)
- if !f.IsNil() {
- // field already set
- continue
- }
- dv := sf.value
- if dv == nil && !zeros {
- // no explicit default, and don't want to set zeros
- continue
- }
- fptr := f.Addr().Interface() // **T
- // TODO: Consider batching the allocations we do here.
- switch sf.kind {
- case reflect.Bool:
- b := new(bool)
- if dv != nil {
- *b = dv.(bool)
- }
- *(fptr.(**bool)) = b
- case reflect.Float32:
- f := new(float32)
- if dv != nil {
- *f = dv.(float32)
- }
- *(fptr.(**float32)) = f
- case reflect.Float64:
- f := new(float64)
- if dv != nil {
- *f = dv.(float64)
- }
- *(fptr.(**float64)) = f
- case reflect.Int32:
- // might be an enum
- if ft := f.Type(); ft != int32PtrType {
- // enum
- f.Set(reflect.New(ft.Elem()))
- if dv != nil {
- f.Elem().SetInt(int64(dv.(int32)))
- }
- } else {
- // int32 field
- i := new(int32)
- if dv != nil {
- *i = dv.(int32)
- }
- *(fptr.(**int32)) = i
- }
- case reflect.Int64:
- i := new(int64)
- if dv != nil {
- *i = dv.(int64)
- }
- *(fptr.(**int64)) = i
- case reflect.String:
- s := new(string)
- if dv != nil {
- *s = dv.(string)
- }
- *(fptr.(**string)) = s
- case reflect.Uint8:
- // exceptional case: []byte
- var b []byte
- if dv != nil {
- db := dv.([]byte)
- b = make([]byte, len(db))
- copy(b, db)
- } else {
- b = []byte{}
- }
- *(fptr.(*[]byte)) = b
- case reflect.Uint32:
- u := new(uint32)
- if dv != nil {
- *u = dv.(uint32)
- }
- *(fptr.(**uint32)) = u
- case reflect.Uint64:
- u := new(uint64)
- if dv != nil {
- *u = dv.(uint64)
- }
- *(fptr.(**uint64)) = u
- default:
- log.Printf("proto: can't set default for field %v (sf.kind=%v)", f, sf.kind)
- }
- }
-
- for _, ni := range dm.nested {
- f := v.Field(ni)
- // f is *T or T or []*T or []T
- switch f.Kind() {
- case reflect.Struct:
- setDefaults(f, recur, zeros)
-
- case reflect.Ptr:
- if f.IsNil() {
- continue
- }
- setDefaults(f, recur, zeros)
-
- case reflect.Slice:
- for i := 0; i < f.Len(); i++ {
- e := f.Index(i)
- if e.Kind() == reflect.Ptr && e.IsNil() {
- continue
- }
- setDefaults(e, recur, zeros)
- }
-
- case reflect.Map:
- for _, k := range f.MapKeys() {
- e := f.MapIndex(k)
- if e.IsNil() {
- continue
- }
- setDefaults(e, recur, zeros)
- }
- }
- }
-}
-
-var (
- // defaults maps a protocol buffer struct type to a slice of the fields,
- // with its scalar fields set to their proto-declared non-zero default values.
- defaultMu sync.RWMutex
- defaults = make(map[reflect.Type]defaultMessage)
-
- int32PtrType = reflect.TypeOf((*int32)(nil))
-)
-
-// defaultMessage represents information about the default values of a message.
-type defaultMessage struct {
- scalars []scalarField
- nested []int // struct field index of nested messages
-}
-
-type scalarField struct {
- index int // struct field index
- kind reflect.Kind // element type (the T in *T or []T)
- value interface{} // the proto-declared default value, or nil
-}
-
-// t is a struct type.
-func buildDefaultMessage(t reflect.Type) (dm defaultMessage) {
- sprop := GetProperties(t)
- for _, prop := range sprop.Prop {
- fi, ok := sprop.decoderTags.get(prop.Tag)
- if !ok {
- // XXX_unrecognized
- continue
- }
- ft := t.Field(fi).Type
-
- sf, nested, err := fieldDefault(ft, prop)
- switch {
- case err != nil:
- log.Print(err)
- case nested:
- dm.nested = append(dm.nested, fi)
- case sf != nil:
- sf.index = fi
- dm.scalars = append(dm.scalars, *sf)
- }
- }
-
- return dm
-}
-
-// fieldDefault returns the scalarField for field type ft.
-// sf will be nil if the field can not have a default.
-// nestedMessage will be true if this is a nested message.
-// Note that sf.index is not set on return.
-func fieldDefault(ft reflect.Type, prop *Properties) (sf *scalarField, nestedMessage bool, err error) {
- var canHaveDefault bool
- switch ft.Kind() {
- case reflect.Struct:
- nestedMessage = true // non-nullable
-
- case reflect.Ptr:
- if ft.Elem().Kind() == reflect.Struct {
- nestedMessage = true
- } else {
- canHaveDefault = true // proto2 scalar field
- }
-
- case reflect.Slice:
- switch ft.Elem().Kind() {
- case reflect.Ptr, reflect.Struct:
- nestedMessage = true // repeated message
- case reflect.Uint8:
- canHaveDefault = true // bytes field
- }
-
- case reflect.Map:
- if ft.Elem().Kind() == reflect.Ptr {
- nestedMessage = true // map with message values
- }
- }
-
- if !canHaveDefault {
- if nestedMessage {
- return nil, true, nil
- }
- return nil, false, nil
- }
-
- // We now know that ft is a pointer or slice.
- sf = &scalarField{kind: ft.Elem().Kind()}
-
- // scalar fields without defaults
- if !prop.HasDefault {
- return sf, false, nil
- }
-
- // a scalar field: either *T or []byte
- switch ft.Elem().Kind() {
- case reflect.Bool:
- x, err := strconv.ParseBool(prop.Default)
- if err != nil {
- return nil, false, fmt.Errorf("proto: bad default bool %q: %v", prop.Default, err)
- }
- sf.value = x
- case reflect.Float32:
- x, err := strconv.ParseFloat(prop.Default, 32)
- if err != nil {
- return nil, false, fmt.Errorf("proto: bad default float32 %q: %v", prop.Default, err)
- }
- sf.value = float32(x)
- case reflect.Float64:
- x, err := strconv.ParseFloat(prop.Default, 64)
- if err != nil {
- return nil, false, fmt.Errorf("proto: bad default float64 %q: %v", prop.Default, err)
- }
- sf.value = x
- case reflect.Int32:
- x, err := strconv.ParseInt(prop.Default, 10, 32)
- if err != nil {
- return nil, false, fmt.Errorf("proto: bad default int32 %q: %v", prop.Default, err)
- }
- sf.value = int32(x)
- case reflect.Int64:
- x, err := strconv.ParseInt(prop.Default, 10, 64)
- if err != nil {
- return nil, false, fmt.Errorf("proto: bad default int64 %q: %v", prop.Default, err)
- }
- sf.value = x
- case reflect.String:
- sf.value = prop.Default
- case reflect.Uint8:
- // []byte (not *uint8)
- sf.value = []byte(prop.Default)
- case reflect.Uint32:
- x, err := strconv.ParseUint(prop.Default, 10, 32)
- if err != nil {
- return nil, false, fmt.Errorf("proto: bad default uint32 %q: %v", prop.Default, err)
- }
- sf.value = uint32(x)
- case reflect.Uint64:
- x, err := strconv.ParseUint(prop.Default, 10, 64)
- if err != nil {
- return nil, false, fmt.Errorf("proto: bad default uint64 %q: %v", prop.Default, err)
- }
- sf.value = x
- default:
- return nil, false, fmt.Errorf("proto: unhandled def kind %v", ft.Elem().Kind())
- }
-
- return sf, false, nil
-}
-
-// mapKeys returns a sort.Interface to be used for sorting the map keys.
-// Map fields may have key types of non-float scalars, strings and enums.
-func mapKeys(vs []reflect.Value) sort.Interface {
- s := mapKeySorter{vs: vs}
-
- // Type specialization per https://developers.google.com/protocol-buffers/docs/proto#maps.
- if len(vs) == 0 {
- return s
- }
- switch vs[0].Kind() {
- case reflect.Int32, reflect.Int64:
- s.less = func(a, b reflect.Value) bool { return a.Int() < b.Int() }
- case reflect.Uint32, reflect.Uint64:
- s.less = func(a, b reflect.Value) bool { return a.Uint() < b.Uint() }
- case reflect.Bool:
- s.less = func(a, b reflect.Value) bool { return !a.Bool() && b.Bool() } // false < true
- case reflect.String:
- s.less = func(a, b reflect.Value) bool { return a.String() < b.String() }
- default:
- panic(fmt.Sprintf("unsupported map key type: %v", vs[0].Kind()))
- }
-
- return s
-}
-
-type mapKeySorter struct {
- vs []reflect.Value
- less func(a, b reflect.Value) bool
-}
-
-func (s mapKeySorter) Len() int { return len(s.vs) }
-func (s mapKeySorter) Swap(i, j int) { s.vs[i], s.vs[j] = s.vs[j], s.vs[i] }
-func (s mapKeySorter) Less(i, j int) bool {
- return s.less(s.vs[i], s.vs[j])
-}
-
-// isProto3Zero reports whether v is a zero proto3 value.
-func isProto3Zero(v reflect.Value) bool {
- switch v.Kind() {
- case reflect.Bool:
- return !v.Bool()
- case reflect.Int32, reflect.Int64:
- return v.Int() == 0
- case reflect.Uint32, reflect.Uint64:
- return v.Uint() == 0
- case reflect.Float32, reflect.Float64:
- return v.Float() == 0
- case reflect.String:
- return v.String() == ""
- }
- return false
-}
-
-const (
- // ProtoPackageIsVersion3 is referenced from generated protocol buffer files
- // to assert that that code is compatible with this version of the proto package.
- GoGoProtoPackageIsVersion3 = true
-
- // ProtoPackageIsVersion2 is referenced from generated protocol buffer files
- // to assert that that code is compatible with this version of the proto package.
- GoGoProtoPackageIsVersion2 = true
-
- // ProtoPackageIsVersion1 is referenced from generated protocol buffer files
- // to assert that that code is compatible with this version of the proto package.
- GoGoProtoPackageIsVersion1 = true
-)
-
-// InternalMessageInfo is a type used internally by generated .pb.go files.
-// This type is not intended to be used by non-generated code.
-// This type is not subject to any compatibility guarantee.
-type InternalMessageInfo struct {
- marshal *marshalInfo
- unmarshal *unmarshalInfo
- merge *mergeInfo
- discard *discardInfo
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/lib_gogo.go b/api/vendor/github.com/gogo/protobuf/proto/lib_gogo.go
deleted file mode 100644
index b3aa39190a13..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/lib_gogo.go
+++ /dev/null
@@ -1,50 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2013, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-//
-// 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
-// OWNER 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.
-
-package proto
-
-import (
- "encoding/json"
- "strconv"
-)
-
-type Sizer interface {
- Size() int
-}
-
-type ProtoSizer interface {
- ProtoSize() int
-}
-
-func MarshalJSONEnum(m map[int32]string, value int32) ([]byte, error) {
- s, ok := m[value]
- if !ok {
- s = strconv.Itoa(int(value))
- }
- return json.Marshal(s)
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/message_set.go b/api/vendor/github.com/gogo/protobuf/proto/message_set.go
deleted file mode 100644
index f48a756761ea..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/message_set.go
+++ /dev/null
@@ -1,181 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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
-// OWNER 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.
-
-package proto
-
-/*
- * Support for message sets.
- */
-
-import (
- "errors"
-)
-
-// errNoMessageTypeID occurs when a protocol buffer does not have a message type ID.
-// A message type ID is required for storing a protocol buffer in a message set.
-var errNoMessageTypeID = errors.New("proto does not have a message type ID")
-
-// The first two types (_MessageSet_Item and messageSet)
-// model what the protocol compiler produces for the following protocol message:
-// message MessageSet {
-// repeated group Item = 1 {
-// required int32 type_id = 2;
-// required string message = 3;
-// };
-// }
-// That is the MessageSet wire format. We can't use a proto to generate these
-// because that would introduce a circular dependency between it and this package.
-
-type _MessageSet_Item struct {
- TypeId *int32 `protobuf:"varint,2,req,name=type_id"`
- Message []byte `protobuf:"bytes,3,req,name=message"`
-}
-
-type messageSet struct {
- Item []*_MessageSet_Item `protobuf:"group,1,rep"`
- XXX_unrecognized []byte
- // TODO: caching?
-}
-
-// Make sure messageSet is a Message.
-var _ Message = (*messageSet)(nil)
-
-// messageTypeIder is an interface satisfied by a protocol buffer type
-// that may be stored in a MessageSet.
-type messageTypeIder interface {
- MessageTypeId() int32
-}
-
-func (ms *messageSet) find(pb Message) *_MessageSet_Item {
- mti, ok := pb.(messageTypeIder)
- if !ok {
- return nil
- }
- id := mti.MessageTypeId()
- for _, item := range ms.Item {
- if *item.TypeId == id {
- return item
- }
- }
- return nil
-}
-
-func (ms *messageSet) Has(pb Message) bool {
- return ms.find(pb) != nil
-}
-
-func (ms *messageSet) Unmarshal(pb Message) error {
- if item := ms.find(pb); item != nil {
- return Unmarshal(item.Message, pb)
- }
- if _, ok := pb.(messageTypeIder); !ok {
- return errNoMessageTypeID
- }
- return nil // TODO: return error instead?
-}
-
-func (ms *messageSet) Marshal(pb Message) error {
- msg, err := Marshal(pb)
- if err != nil {
- return err
- }
- if item := ms.find(pb); item != nil {
- // reuse existing item
- item.Message = msg
- return nil
- }
-
- mti, ok := pb.(messageTypeIder)
- if !ok {
- return errNoMessageTypeID
- }
-
- mtid := mti.MessageTypeId()
- ms.Item = append(ms.Item, &_MessageSet_Item{
- TypeId: &mtid,
- Message: msg,
- })
- return nil
-}
-
-func (ms *messageSet) Reset() { *ms = messageSet{} }
-func (ms *messageSet) String() string { return CompactTextString(ms) }
-func (*messageSet) ProtoMessage() {}
-
-// Support for the message_set_wire_format message option.
-
-func skipVarint(buf []byte) []byte {
- i := 0
- for ; buf[i]&0x80 != 0; i++ {
- }
- return buf[i+1:]
-}
-
-// unmarshalMessageSet decodes the extension map encoded in buf in the message set wire format.
-// It is called by Unmarshal methods on protocol buffer messages with the message_set_wire_format option.
-func unmarshalMessageSet(buf []byte, exts interface{}) error {
- var m map[int32]Extension
- switch exts := exts.(type) {
- case *XXX_InternalExtensions:
- m = exts.extensionsWrite()
- case map[int32]Extension:
- m = exts
- default:
- return errors.New("proto: not an extension map")
- }
-
- ms := new(messageSet)
- if err := Unmarshal(buf, ms); err != nil {
- return err
- }
- for _, item := range ms.Item {
- id := *item.TypeId
- msg := item.Message
-
- // Restore wire type and field number varint, plus length varint.
- // Be careful to preserve duplicate items.
- b := EncodeVarint(uint64(id)<<3 | WireBytes)
- if ext, ok := m[id]; ok {
- // Existing data; rip off the tag and length varint
- // so we join the new data correctly.
- // We can assume that ext.enc is set because we are unmarshaling.
- o := ext.enc[len(b):] // skip wire type and field number
- _, n := DecodeVarint(o) // calculate length of length varint
- o = o[n:] // skip length varint
- msg = append(o, msg...) // join old data and new data
- }
- b = append(b, EncodeVarint(uint64(len(msg)))...)
- b = append(b, msg...)
-
- m[id] = Extension{enc: b}
- }
- return nil
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/pointer_reflect.go b/api/vendor/github.com/gogo/protobuf/proto/pointer_reflect.go
deleted file mode 100644
index b6cad90834b3..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/pointer_reflect.go
+++ /dev/null
@@ -1,357 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2012 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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
-// OWNER 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.
-
-// +build purego appengine js
-
-// This file contains an implementation of proto field accesses using package reflect.
-// It is slower than the code in pointer_unsafe.go but it avoids package unsafe and can
-// be used on App Engine.
-
-package proto
-
-import (
- "reflect"
- "sync"
-)
-
-const unsafeAllowed = false
-
-// A field identifies a field in a struct, accessible from a pointer.
-// In this implementation, a field is identified by the sequence of field indices
-// passed to reflect's FieldByIndex.
-type field []int
-
-// toField returns a field equivalent to the given reflect field.
-func toField(f *reflect.StructField) field {
- return f.Index
-}
-
-// invalidField is an invalid field identifier.
-var invalidField = field(nil)
-
-// zeroField is a noop when calling pointer.offset.
-var zeroField = field([]int{})
-
-// IsValid reports whether the field identifier is valid.
-func (f field) IsValid() bool { return f != nil }
-
-// The pointer type is for the table-driven decoder.
-// The implementation here uses a reflect.Value of pointer type to
-// create a generic pointer. In pointer_unsafe.go we use unsafe
-// instead of reflect to implement the same (but faster) interface.
-type pointer struct {
- v reflect.Value
-}
-
-// toPointer converts an interface of pointer type to a pointer
-// that points to the same target.
-func toPointer(i *Message) pointer {
- return pointer{v: reflect.ValueOf(*i)}
-}
-
-// toAddrPointer converts an interface to a pointer that points to
-// the interface data.
-func toAddrPointer(i *interface{}, isptr bool) pointer {
- v := reflect.ValueOf(*i)
- u := reflect.New(v.Type())
- u.Elem().Set(v)
- return pointer{v: u}
-}
-
-// valToPointer converts v to a pointer. v must be of pointer type.
-func valToPointer(v reflect.Value) pointer {
- return pointer{v: v}
-}
-
-// offset converts from a pointer to a structure to a pointer to
-// one of its fields.
-func (p pointer) offset(f field) pointer {
- return pointer{v: p.v.Elem().FieldByIndex(f).Addr()}
-}
-
-func (p pointer) isNil() bool {
- return p.v.IsNil()
-}
-
-// grow updates the slice s in place to make it one element longer.
-// s must be addressable.
-// Returns the (addressable) new element.
-func grow(s reflect.Value) reflect.Value {
- n, m := s.Len(), s.Cap()
- if n < m {
- s.SetLen(n + 1)
- } else {
- s.Set(reflect.Append(s, reflect.Zero(s.Type().Elem())))
- }
- return s.Index(n)
-}
-
-func (p pointer) toInt64() *int64 {
- return p.v.Interface().(*int64)
-}
-func (p pointer) toInt64Ptr() **int64 {
- return p.v.Interface().(**int64)
-}
-func (p pointer) toInt64Slice() *[]int64 {
- return p.v.Interface().(*[]int64)
-}
-
-var int32ptr = reflect.TypeOf((*int32)(nil))
-
-func (p pointer) toInt32() *int32 {
- return p.v.Convert(int32ptr).Interface().(*int32)
-}
-
-// The toInt32Ptr/Slice methods don't work because of enums.
-// Instead, we must use set/get methods for the int32ptr/slice case.
-/*
- func (p pointer) toInt32Ptr() **int32 {
- return p.v.Interface().(**int32)
-}
- func (p pointer) toInt32Slice() *[]int32 {
- return p.v.Interface().(*[]int32)
-}
-*/
-func (p pointer) getInt32Ptr() *int32 {
- if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) {
- // raw int32 type
- return p.v.Elem().Interface().(*int32)
- }
- // an enum
- return p.v.Elem().Convert(int32PtrType).Interface().(*int32)
-}
-func (p pointer) setInt32Ptr(v int32) {
- // Allocate value in a *int32. Possibly convert that to a *enum.
- // Then assign it to a **int32 or **enum.
- // Note: we can convert *int32 to *enum, but we can't convert
- // **int32 to **enum!
- p.v.Elem().Set(reflect.ValueOf(&v).Convert(p.v.Type().Elem()))
-}
-
-// getInt32Slice copies []int32 from p as a new slice.
-// This behavior differs from the implementation in pointer_unsafe.go.
-func (p pointer) getInt32Slice() []int32 {
- if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) {
- // raw int32 type
- return p.v.Elem().Interface().([]int32)
- }
- // an enum
- // Allocate a []int32, then assign []enum's values into it.
- // Note: we can't convert []enum to []int32.
- slice := p.v.Elem()
- s := make([]int32, slice.Len())
- for i := 0; i < slice.Len(); i++ {
- s[i] = int32(slice.Index(i).Int())
- }
- return s
-}
-
-// setInt32Slice copies []int32 into p as a new slice.
-// This behavior differs from the implementation in pointer_unsafe.go.
-func (p pointer) setInt32Slice(v []int32) {
- if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) {
- // raw int32 type
- p.v.Elem().Set(reflect.ValueOf(v))
- return
- }
- // an enum
- // Allocate a []enum, then assign []int32's values into it.
- // Note: we can't convert []enum to []int32.
- slice := reflect.MakeSlice(p.v.Type().Elem(), len(v), cap(v))
- for i, x := range v {
- slice.Index(i).SetInt(int64(x))
- }
- p.v.Elem().Set(slice)
-}
-func (p pointer) appendInt32Slice(v int32) {
- grow(p.v.Elem()).SetInt(int64(v))
-}
-
-func (p pointer) toUint64() *uint64 {
- return p.v.Interface().(*uint64)
-}
-func (p pointer) toUint64Ptr() **uint64 {
- return p.v.Interface().(**uint64)
-}
-func (p pointer) toUint64Slice() *[]uint64 {
- return p.v.Interface().(*[]uint64)
-}
-func (p pointer) toUint32() *uint32 {
- return p.v.Interface().(*uint32)
-}
-func (p pointer) toUint32Ptr() **uint32 {
- return p.v.Interface().(**uint32)
-}
-func (p pointer) toUint32Slice() *[]uint32 {
- return p.v.Interface().(*[]uint32)
-}
-func (p pointer) toBool() *bool {
- return p.v.Interface().(*bool)
-}
-func (p pointer) toBoolPtr() **bool {
- return p.v.Interface().(**bool)
-}
-func (p pointer) toBoolSlice() *[]bool {
- return p.v.Interface().(*[]bool)
-}
-func (p pointer) toFloat64() *float64 {
- return p.v.Interface().(*float64)
-}
-func (p pointer) toFloat64Ptr() **float64 {
- return p.v.Interface().(**float64)
-}
-func (p pointer) toFloat64Slice() *[]float64 {
- return p.v.Interface().(*[]float64)
-}
-func (p pointer) toFloat32() *float32 {
- return p.v.Interface().(*float32)
-}
-func (p pointer) toFloat32Ptr() **float32 {
- return p.v.Interface().(**float32)
-}
-func (p pointer) toFloat32Slice() *[]float32 {
- return p.v.Interface().(*[]float32)
-}
-func (p pointer) toString() *string {
- return p.v.Interface().(*string)
-}
-func (p pointer) toStringPtr() **string {
- return p.v.Interface().(**string)
-}
-func (p pointer) toStringSlice() *[]string {
- return p.v.Interface().(*[]string)
-}
-func (p pointer) toBytes() *[]byte {
- return p.v.Interface().(*[]byte)
-}
-func (p pointer) toBytesSlice() *[][]byte {
- return p.v.Interface().(*[][]byte)
-}
-func (p pointer) toExtensions() *XXX_InternalExtensions {
- return p.v.Interface().(*XXX_InternalExtensions)
-}
-func (p pointer) toOldExtensions() *map[int32]Extension {
- return p.v.Interface().(*map[int32]Extension)
-}
-func (p pointer) getPointer() pointer {
- return pointer{v: p.v.Elem()}
-}
-func (p pointer) setPointer(q pointer) {
- p.v.Elem().Set(q.v)
-}
-func (p pointer) appendPointer(q pointer) {
- grow(p.v.Elem()).Set(q.v)
-}
-
-// getPointerSlice copies []*T from p as a new []pointer.
-// This behavior differs from the implementation in pointer_unsafe.go.
-func (p pointer) getPointerSlice() []pointer {
- if p.v.IsNil() {
- return nil
- }
- n := p.v.Elem().Len()
- s := make([]pointer, n)
- for i := 0; i < n; i++ {
- s[i] = pointer{v: p.v.Elem().Index(i)}
- }
- return s
-}
-
-// setPointerSlice copies []pointer into p as a new []*T.
-// This behavior differs from the implementation in pointer_unsafe.go.
-func (p pointer) setPointerSlice(v []pointer) {
- if v == nil {
- p.v.Elem().Set(reflect.New(p.v.Elem().Type()).Elem())
- return
- }
- s := reflect.MakeSlice(p.v.Elem().Type(), 0, len(v))
- for _, p := range v {
- s = reflect.Append(s, p.v)
- }
- p.v.Elem().Set(s)
-}
-
-// getInterfacePointer returns a pointer that points to the
-// interface data of the interface pointed by p.
-func (p pointer) getInterfacePointer() pointer {
- if p.v.Elem().IsNil() {
- return pointer{v: p.v.Elem()}
- }
- return pointer{v: p.v.Elem().Elem().Elem().Field(0).Addr()} // *interface -> interface -> *struct -> struct
-}
-
-func (p pointer) asPointerTo(t reflect.Type) reflect.Value {
- // TODO: check that p.v.Type().Elem() == t?
- return p.v
-}
-
-func atomicLoadUnmarshalInfo(p **unmarshalInfo) *unmarshalInfo {
- atomicLock.Lock()
- defer atomicLock.Unlock()
- return *p
-}
-func atomicStoreUnmarshalInfo(p **unmarshalInfo, v *unmarshalInfo) {
- atomicLock.Lock()
- defer atomicLock.Unlock()
- *p = v
-}
-func atomicLoadMarshalInfo(p **marshalInfo) *marshalInfo {
- atomicLock.Lock()
- defer atomicLock.Unlock()
- return *p
-}
-func atomicStoreMarshalInfo(p **marshalInfo, v *marshalInfo) {
- atomicLock.Lock()
- defer atomicLock.Unlock()
- *p = v
-}
-func atomicLoadMergeInfo(p **mergeInfo) *mergeInfo {
- atomicLock.Lock()
- defer atomicLock.Unlock()
- return *p
-}
-func atomicStoreMergeInfo(p **mergeInfo, v *mergeInfo) {
- atomicLock.Lock()
- defer atomicLock.Unlock()
- *p = v
-}
-func atomicLoadDiscardInfo(p **discardInfo) *discardInfo {
- atomicLock.Lock()
- defer atomicLock.Unlock()
- return *p
-}
-func atomicStoreDiscardInfo(p **discardInfo, v *discardInfo) {
- atomicLock.Lock()
- defer atomicLock.Unlock()
- *p = v
-}
-
-var atomicLock sync.Mutex
diff --git a/api/vendor/github.com/gogo/protobuf/proto/pointer_reflect_gogo.go b/api/vendor/github.com/gogo/protobuf/proto/pointer_reflect_gogo.go
deleted file mode 100644
index 7ffd3c29d90c..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/pointer_reflect_gogo.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2018, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-//
-// 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
-// OWNER 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.
-
-// +build purego appengine js
-
-// This file contains an implementation of proto field accesses using package reflect.
-// It is slower than the code in pointer_unsafe.go but it avoids package unsafe and can
-// be used on App Engine.
-
-package proto
-
-import (
- "reflect"
-)
-
-// TODO: untested, so probably incorrect.
-
-func (p pointer) getRef() pointer {
- return pointer{v: p.v.Addr()}
-}
-
-func (p pointer) appendRef(v pointer, typ reflect.Type) {
- slice := p.getSlice(typ)
- elem := v.asPointerTo(typ).Elem()
- newSlice := reflect.Append(slice, elem)
- slice.Set(newSlice)
-}
-
-func (p pointer) getSlice(typ reflect.Type) reflect.Value {
- sliceTyp := reflect.SliceOf(typ)
- slice := p.asPointerTo(sliceTyp)
- slice = slice.Elem()
- return slice
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/pointer_unsafe.go b/api/vendor/github.com/gogo/protobuf/proto/pointer_unsafe.go
deleted file mode 100644
index d55a335d9453..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/pointer_unsafe.go
+++ /dev/null
@@ -1,308 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2012 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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
-// OWNER 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.
-
-// +build !purego,!appengine,!js
-
-// This file contains the implementation of the proto field accesses using package unsafe.
-
-package proto
-
-import (
- "reflect"
- "sync/atomic"
- "unsafe"
-)
-
-const unsafeAllowed = true
-
-// A field identifies a field in a struct, accessible from a pointer.
-// In this implementation, a field is identified by its byte offset from the start of the struct.
-type field uintptr
-
-// toField returns a field equivalent to the given reflect field.
-func toField(f *reflect.StructField) field {
- return field(f.Offset)
-}
-
-// invalidField is an invalid field identifier.
-const invalidField = ^field(0)
-
-// zeroField is a noop when calling pointer.offset.
-const zeroField = field(0)
-
-// IsValid reports whether the field identifier is valid.
-func (f field) IsValid() bool {
- return f != invalidField
-}
-
-// The pointer type below is for the new table-driven encoder/decoder.
-// The implementation here uses unsafe.Pointer to create a generic pointer.
-// In pointer_reflect.go we use reflect instead of unsafe to implement
-// the same (but slower) interface.
-type pointer struct {
- p unsafe.Pointer
-}
-
-// size of pointer
-var ptrSize = unsafe.Sizeof(uintptr(0))
-
-// toPointer converts an interface of pointer type to a pointer
-// that points to the same target.
-func toPointer(i *Message) pointer {
- // Super-tricky - read pointer out of data word of interface value.
- // Saves ~25ns over the equivalent:
- // return valToPointer(reflect.ValueOf(*i))
- return pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]}
-}
-
-// toAddrPointer converts an interface to a pointer that points to
-// the interface data.
-func toAddrPointer(i *interface{}, isptr bool) pointer {
- // Super-tricky - read or get the address of data word of interface value.
- if isptr {
- // The interface is of pointer type, thus it is a direct interface.
- // The data word is the pointer data itself. We take its address.
- return pointer{p: unsafe.Pointer(uintptr(unsafe.Pointer(i)) + ptrSize)}
- }
- // The interface is not of pointer type. The data word is the pointer
- // to the data.
- return pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]}
-}
-
-// valToPointer converts v to a pointer. v must be of pointer type.
-func valToPointer(v reflect.Value) pointer {
- return pointer{p: unsafe.Pointer(v.Pointer())}
-}
-
-// offset converts from a pointer to a structure to a pointer to
-// one of its fields.
-func (p pointer) offset(f field) pointer {
- // For safety, we should panic if !f.IsValid, however calling panic causes
- // this to no longer be inlineable, which is a serious performance cost.
- /*
- if !f.IsValid() {
- panic("invalid field")
- }
- */
- return pointer{p: unsafe.Pointer(uintptr(p.p) + uintptr(f))}
-}
-
-func (p pointer) isNil() bool {
- return p.p == nil
-}
-
-func (p pointer) toInt64() *int64 {
- return (*int64)(p.p)
-}
-func (p pointer) toInt64Ptr() **int64 {
- return (**int64)(p.p)
-}
-func (p pointer) toInt64Slice() *[]int64 {
- return (*[]int64)(p.p)
-}
-func (p pointer) toInt32() *int32 {
- return (*int32)(p.p)
-}
-
-// See pointer_reflect.go for why toInt32Ptr/Slice doesn't exist.
-/*
- func (p pointer) toInt32Ptr() **int32 {
- return (**int32)(p.p)
- }
- func (p pointer) toInt32Slice() *[]int32 {
- return (*[]int32)(p.p)
- }
-*/
-func (p pointer) getInt32Ptr() *int32 {
- return *(**int32)(p.p)
-}
-func (p pointer) setInt32Ptr(v int32) {
- *(**int32)(p.p) = &v
-}
-
-// getInt32Slice loads a []int32 from p.
-// The value returned is aliased with the original slice.
-// This behavior differs from the implementation in pointer_reflect.go.
-func (p pointer) getInt32Slice() []int32 {
- return *(*[]int32)(p.p)
-}
-
-// setInt32Slice stores a []int32 to p.
-// The value set is aliased with the input slice.
-// This behavior differs from the implementation in pointer_reflect.go.
-func (p pointer) setInt32Slice(v []int32) {
- *(*[]int32)(p.p) = v
-}
-
-// TODO: Can we get rid of appendInt32Slice and use setInt32Slice instead?
-func (p pointer) appendInt32Slice(v int32) {
- s := (*[]int32)(p.p)
- *s = append(*s, v)
-}
-
-func (p pointer) toUint64() *uint64 {
- return (*uint64)(p.p)
-}
-func (p pointer) toUint64Ptr() **uint64 {
- return (**uint64)(p.p)
-}
-func (p pointer) toUint64Slice() *[]uint64 {
- return (*[]uint64)(p.p)
-}
-func (p pointer) toUint32() *uint32 {
- return (*uint32)(p.p)
-}
-func (p pointer) toUint32Ptr() **uint32 {
- return (**uint32)(p.p)
-}
-func (p pointer) toUint32Slice() *[]uint32 {
- return (*[]uint32)(p.p)
-}
-func (p pointer) toBool() *bool {
- return (*bool)(p.p)
-}
-func (p pointer) toBoolPtr() **bool {
- return (**bool)(p.p)
-}
-func (p pointer) toBoolSlice() *[]bool {
- return (*[]bool)(p.p)
-}
-func (p pointer) toFloat64() *float64 {
- return (*float64)(p.p)
-}
-func (p pointer) toFloat64Ptr() **float64 {
- return (**float64)(p.p)
-}
-func (p pointer) toFloat64Slice() *[]float64 {
- return (*[]float64)(p.p)
-}
-func (p pointer) toFloat32() *float32 {
- return (*float32)(p.p)
-}
-func (p pointer) toFloat32Ptr() **float32 {
- return (**float32)(p.p)
-}
-func (p pointer) toFloat32Slice() *[]float32 {
- return (*[]float32)(p.p)
-}
-func (p pointer) toString() *string {
- return (*string)(p.p)
-}
-func (p pointer) toStringPtr() **string {
- return (**string)(p.p)
-}
-func (p pointer) toStringSlice() *[]string {
- return (*[]string)(p.p)
-}
-func (p pointer) toBytes() *[]byte {
- return (*[]byte)(p.p)
-}
-func (p pointer) toBytesSlice() *[][]byte {
- return (*[][]byte)(p.p)
-}
-func (p pointer) toExtensions() *XXX_InternalExtensions {
- return (*XXX_InternalExtensions)(p.p)
-}
-func (p pointer) toOldExtensions() *map[int32]Extension {
- return (*map[int32]Extension)(p.p)
-}
-
-// getPointerSlice loads []*T from p as a []pointer.
-// The value returned is aliased with the original slice.
-// This behavior differs from the implementation in pointer_reflect.go.
-func (p pointer) getPointerSlice() []pointer {
- // Super-tricky - p should point to a []*T where T is a
- // message type. We load it as []pointer.
- return *(*[]pointer)(p.p)
-}
-
-// setPointerSlice stores []pointer into p as a []*T.
-// The value set is aliased with the input slice.
-// This behavior differs from the implementation in pointer_reflect.go.
-func (p pointer) setPointerSlice(v []pointer) {
- // Super-tricky - p should point to a []*T where T is a
- // message type. We store it as []pointer.
- *(*[]pointer)(p.p) = v
-}
-
-// getPointer loads the pointer at p and returns it.
-func (p pointer) getPointer() pointer {
- return pointer{p: *(*unsafe.Pointer)(p.p)}
-}
-
-// setPointer stores the pointer q at p.
-func (p pointer) setPointer(q pointer) {
- *(*unsafe.Pointer)(p.p) = q.p
-}
-
-// append q to the slice pointed to by p.
-func (p pointer) appendPointer(q pointer) {
- s := (*[]unsafe.Pointer)(p.p)
- *s = append(*s, q.p)
-}
-
-// getInterfacePointer returns a pointer that points to the
-// interface data of the interface pointed by p.
-func (p pointer) getInterfacePointer() pointer {
- // Super-tricky - read pointer out of data word of interface value.
- return pointer{p: (*(*[2]unsafe.Pointer)(p.p))[1]}
-}
-
-// asPointerTo returns a reflect.Value that is a pointer to an
-// object of type t stored at p.
-func (p pointer) asPointerTo(t reflect.Type) reflect.Value {
- return reflect.NewAt(t, p.p)
-}
-
-func atomicLoadUnmarshalInfo(p **unmarshalInfo) *unmarshalInfo {
- return (*unmarshalInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p))))
-}
-func atomicStoreUnmarshalInfo(p **unmarshalInfo, v *unmarshalInfo) {
- atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v))
-}
-func atomicLoadMarshalInfo(p **marshalInfo) *marshalInfo {
- return (*marshalInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p))))
-}
-func atomicStoreMarshalInfo(p **marshalInfo, v *marshalInfo) {
- atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v))
-}
-func atomicLoadMergeInfo(p **mergeInfo) *mergeInfo {
- return (*mergeInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p))))
-}
-func atomicStoreMergeInfo(p **mergeInfo, v *mergeInfo) {
- atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v))
-}
-func atomicLoadDiscardInfo(p **discardInfo) *discardInfo {
- return (*discardInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p))))
-}
-func atomicStoreDiscardInfo(p **discardInfo, v *discardInfo) {
- atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v))
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/pointer_unsafe_gogo.go b/api/vendor/github.com/gogo/protobuf/proto/pointer_unsafe_gogo.go
deleted file mode 100644
index aca8eed02a11..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/pointer_unsafe_gogo.go
+++ /dev/null
@@ -1,56 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2018, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-//
-// 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
-// OWNER 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.
-
-// +build !purego,!appengine,!js
-
-// This file contains the implementation of the proto field accesses using package unsafe.
-
-package proto
-
-import (
- "reflect"
- "unsafe"
-)
-
-func (p pointer) getRef() pointer {
- return pointer{p: (unsafe.Pointer)(&p.p)}
-}
-
-func (p pointer) appendRef(v pointer, typ reflect.Type) {
- slice := p.getSlice(typ)
- elem := v.asPointerTo(typ).Elem()
- newSlice := reflect.Append(slice, elem)
- slice.Set(newSlice)
-}
-
-func (p pointer) getSlice(typ reflect.Type) reflect.Value {
- sliceTyp := reflect.SliceOf(typ)
- slice := p.asPointerTo(sliceTyp)
- slice = slice.Elem()
- return slice
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/properties.go b/api/vendor/github.com/gogo/protobuf/proto/properties.go
deleted file mode 100644
index 28da1475fb39..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/properties.go
+++ /dev/null
@@ -1,610 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2013, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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
-// OWNER 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.
-
-package proto
-
-/*
- * Routines for encoding data into the wire format for protocol buffers.
- */
-
-import (
- "fmt"
- "log"
- "reflect"
- "sort"
- "strconv"
- "strings"
- "sync"
-)
-
-const debug bool = false
-
-// Constants that identify the encoding of a value on the wire.
-const (
- WireVarint = 0
- WireFixed64 = 1
- WireBytes = 2
- WireStartGroup = 3
- WireEndGroup = 4
- WireFixed32 = 5
-)
-
-// tagMap is an optimization over map[int]int for typical protocol buffer
-// use-cases. Encoded protocol buffers are often in tag order with small tag
-// numbers.
-type tagMap struct {
- fastTags []int
- slowTags map[int]int
-}
-
-// tagMapFastLimit is the upper bound on the tag number that will be stored in
-// the tagMap slice rather than its map.
-const tagMapFastLimit = 1024
-
-func (p *tagMap) get(t int) (int, bool) {
- if t > 0 && t < tagMapFastLimit {
- if t >= len(p.fastTags) {
- return 0, false
- }
- fi := p.fastTags[t]
- return fi, fi >= 0
- }
- fi, ok := p.slowTags[t]
- return fi, ok
-}
-
-func (p *tagMap) put(t int, fi int) {
- if t > 0 && t < tagMapFastLimit {
- for len(p.fastTags) < t+1 {
- p.fastTags = append(p.fastTags, -1)
- }
- p.fastTags[t] = fi
- return
- }
- if p.slowTags == nil {
- p.slowTags = make(map[int]int)
- }
- p.slowTags[t] = fi
-}
-
-// StructProperties represents properties for all the fields of a struct.
-// decoderTags and decoderOrigNames should only be used by the decoder.
-type StructProperties struct {
- Prop []*Properties // properties for each field
- reqCount int // required count
- decoderTags tagMap // map from proto tag to struct field number
- decoderOrigNames map[string]int // map from original name to struct field number
- order []int // list of struct field numbers in tag order
-
- // OneofTypes contains information about the oneof fields in this message.
- // It is keyed by the original name of a field.
- OneofTypes map[string]*OneofProperties
-}
-
-// OneofProperties represents information about a specific field in a oneof.
-type OneofProperties struct {
- Type reflect.Type // pointer to generated struct type for this oneof field
- Field int // struct field number of the containing oneof in the message
- Prop *Properties
-}
-
-// Implement the sorting interface so we can sort the fields in tag order, as recommended by the spec.
-// See encode.go, (*Buffer).enc_struct.
-
-func (sp *StructProperties) Len() int { return len(sp.order) }
-func (sp *StructProperties) Less(i, j int) bool {
- return sp.Prop[sp.order[i]].Tag < sp.Prop[sp.order[j]].Tag
-}
-func (sp *StructProperties) Swap(i, j int) { sp.order[i], sp.order[j] = sp.order[j], sp.order[i] }
-
-// Properties represents the protocol-specific behavior of a single struct field.
-type Properties struct {
- Name string // name of the field, for error messages
- OrigName string // original name before protocol compiler (always set)
- JSONName string // name to use for JSON; determined by protoc
- Wire string
- WireType int
- Tag int
- Required bool
- Optional bool
- Repeated bool
- Packed bool // relevant for repeated primitives only
- Enum string // set for enum types only
- proto3 bool // whether this is known to be a proto3 field
- oneof bool // whether this is a oneof field
-
- Default string // default value
- HasDefault bool // whether an explicit default was provided
- CustomType string
- CastType string
- StdTime bool
- StdDuration bool
- WktPointer bool
-
- stype reflect.Type // set for struct types only
- ctype reflect.Type // set for custom types only
- sprop *StructProperties // set for struct types only
-
- mtype reflect.Type // set for map types only
- MapKeyProp *Properties // set for map types only
- MapValProp *Properties // set for map types only
-}
-
-// String formats the properties in the protobuf struct field tag style.
-func (p *Properties) String() string {
- s := p.Wire
- s += ","
- s += strconv.Itoa(p.Tag)
- if p.Required {
- s += ",req"
- }
- if p.Optional {
- s += ",opt"
- }
- if p.Repeated {
- s += ",rep"
- }
- if p.Packed {
- s += ",packed"
- }
- s += ",name=" + p.OrigName
- if p.JSONName != p.OrigName {
- s += ",json=" + p.JSONName
- }
- if p.proto3 {
- s += ",proto3"
- }
- if p.oneof {
- s += ",oneof"
- }
- if len(p.Enum) > 0 {
- s += ",enum=" + p.Enum
- }
- if p.HasDefault {
- s += ",def=" + p.Default
- }
- return s
-}
-
-// Parse populates p by parsing a string in the protobuf struct field tag style.
-func (p *Properties) Parse(s string) {
- // "bytes,49,opt,name=foo,def=hello!"
- fields := strings.Split(s, ",") // breaks def=, but handled below.
- if len(fields) < 2 {
- log.Printf("proto: tag has too few fields: %q", s)
- return
- }
-
- p.Wire = fields[0]
- switch p.Wire {
- case "varint":
- p.WireType = WireVarint
- case "fixed32":
- p.WireType = WireFixed32
- case "fixed64":
- p.WireType = WireFixed64
- case "zigzag32":
- p.WireType = WireVarint
- case "zigzag64":
- p.WireType = WireVarint
- case "bytes", "group":
- p.WireType = WireBytes
- // no numeric converter for non-numeric types
- default:
- log.Printf("proto: tag has unknown wire type: %q", s)
- return
- }
-
- var err error
- p.Tag, err = strconv.Atoi(fields[1])
- if err != nil {
- return
- }
-
-outer:
- for i := 2; i < len(fields); i++ {
- f := fields[i]
- switch {
- case f == "req":
- p.Required = true
- case f == "opt":
- p.Optional = true
- case f == "rep":
- p.Repeated = true
- case f == "packed":
- p.Packed = true
- case strings.HasPrefix(f, "name="):
- p.OrigName = f[5:]
- case strings.HasPrefix(f, "json="):
- p.JSONName = f[5:]
- case strings.HasPrefix(f, "enum="):
- p.Enum = f[5:]
- case f == "proto3":
- p.proto3 = true
- case f == "oneof":
- p.oneof = true
- case strings.HasPrefix(f, "def="):
- p.HasDefault = true
- p.Default = f[4:] // rest of string
- if i+1 < len(fields) {
- // Commas aren't escaped, and def is always last.
- p.Default += "," + strings.Join(fields[i+1:], ",")
- break outer
- }
- case strings.HasPrefix(f, "embedded="):
- p.OrigName = strings.Split(f, "=")[1]
- case strings.HasPrefix(f, "customtype="):
- p.CustomType = strings.Split(f, "=")[1]
- case strings.HasPrefix(f, "casttype="):
- p.CastType = strings.Split(f, "=")[1]
- case f == "stdtime":
- p.StdTime = true
- case f == "stdduration":
- p.StdDuration = true
- case f == "wktptr":
- p.WktPointer = true
- }
- }
-}
-
-var protoMessageType = reflect.TypeOf((*Message)(nil)).Elem()
-
-// setFieldProps initializes the field properties for submessages and maps.
-func (p *Properties) setFieldProps(typ reflect.Type, f *reflect.StructField, lockGetProp bool) {
- isMap := typ.Kind() == reflect.Map
- if len(p.CustomType) > 0 && !isMap {
- p.ctype = typ
- p.setTag(lockGetProp)
- return
- }
- if p.StdTime && !isMap {
- p.setTag(lockGetProp)
- return
- }
- if p.StdDuration && !isMap {
- p.setTag(lockGetProp)
- return
- }
- if p.WktPointer && !isMap {
- p.setTag(lockGetProp)
- return
- }
- switch t1 := typ; t1.Kind() {
- case reflect.Struct:
- p.stype = typ
- case reflect.Ptr:
- if t1.Elem().Kind() == reflect.Struct {
- p.stype = t1.Elem()
- }
- case reflect.Slice:
- switch t2 := t1.Elem(); t2.Kind() {
- case reflect.Ptr:
- switch t3 := t2.Elem(); t3.Kind() {
- case reflect.Struct:
- p.stype = t3
- }
- case reflect.Struct:
- p.stype = t2
- }
-
- case reflect.Map:
-
- p.mtype = t1
- p.MapKeyProp = &Properties{}
- p.MapKeyProp.init(reflect.PtrTo(p.mtype.Key()), "Key", f.Tag.Get("protobuf_key"), nil, lockGetProp)
- p.MapValProp = &Properties{}
- vtype := p.mtype.Elem()
- if vtype.Kind() != reflect.Ptr && vtype.Kind() != reflect.Slice {
- // The value type is not a message (*T) or bytes ([]byte),
- // so we need encoders for the pointer to this type.
- vtype = reflect.PtrTo(vtype)
- }
-
- p.MapValProp.CustomType = p.CustomType
- p.MapValProp.StdDuration = p.StdDuration
- p.MapValProp.StdTime = p.StdTime
- p.MapValProp.WktPointer = p.WktPointer
- p.MapValProp.init(vtype, "Value", f.Tag.Get("protobuf_val"), nil, lockGetProp)
- }
- p.setTag(lockGetProp)
-}
-
-func (p *Properties) setTag(lockGetProp bool) {
- if p.stype != nil {
- if lockGetProp {
- p.sprop = GetProperties(p.stype)
- } else {
- p.sprop = getPropertiesLocked(p.stype)
- }
- }
-}
-
-var (
- marshalerType = reflect.TypeOf((*Marshaler)(nil)).Elem()
-)
-
-// Init populates the properties from a protocol buffer struct tag.
-func (p *Properties) Init(typ reflect.Type, name, tag string, f *reflect.StructField) {
- p.init(typ, name, tag, f, true)
-}
-
-func (p *Properties) init(typ reflect.Type, name, tag string, f *reflect.StructField, lockGetProp bool) {
- // "bytes,49,opt,def=hello!"
- p.Name = name
- p.OrigName = name
- if tag == "" {
- return
- }
- p.Parse(tag)
- p.setFieldProps(typ, f, lockGetProp)
-}
-
-var (
- propertiesMu sync.RWMutex
- propertiesMap = make(map[reflect.Type]*StructProperties)
-)
-
-// GetProperties returns the list of properties for the type represented by t.
-// t must represent a generated struct type of a protocol message.
-func GetProperties(t reflect.Type) *StructProperties {
- if t.Kind() != reflect.Struct {
- panic("proto: type must have kind struct")
- }
-
- // Most calls to GetProperties in a long-running program will be
- // retrieving details for types we have seen before.
- propertiesMu.RLock()
- sprop, ok := propertiesMap[t]
- propertiesMu.RUnlock()
- if ok {
- return sprop
- }
-
- propertiesMu.Lock()
- sprop = getPropertiesLocked(t)
- propertiesMu.Unlock()
- return sprop
-}
-
-type (
- oneofFuncsIface interface {
- XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{})
- }
- oneofWrappersIface interface {
- XXX_OneofWrappers() []interface{}
- }
-)
-
-// getPropertiesLocked requires that propertiesMu is held.
-func getPropertiesLocked(t reflect.Type) *StructProperties {
- if prop, ok := propertiesMap[t]; ok {
- return prop
- }
-
- prop := new(StructProperties)
- // in case of recursive protos, fill this in now.
- propertiesMap[t] = prop
-
- // build properties
- prop.Prop = make([]*Properties, t.NumField())
- prop.order = make([]int, t.NumField())
-
- isOneofMessage := false
- for i := 0; i < t.NumField(); i++ {
- f := t.Field(i)
- p := new(Properties)
- name := f.Name
- p.init(f.Type, name, f.Tag.Get("protobuf"), &f, false)
-
- oneof := f.Tag.Get("protobuf_oneof") // special case
- if oneof != "" {
- isOneofMessage = true
- // Oneof fields don't use the traditional protobuf tag.
- p.OrigName = oneof
- }
- prop.Prop[i] = p
- prop.order[i] = i
- if debug {
- print(i, " ", f.Name, " ", t.String(), " ")
- if p.Tag > 0 {
- print(p.String())
- }
- print("\n")
- }
- }
-
- // Re-order prop.order.
- sort.Sort(prop)
-
- if isOneofMessage {
- var oots []interface{}
- switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) {
- case oneofFuncsIface:
- _, _, _, oots = m.XXX_OneofFuncs()
- case oneofWrappersIface:
- oots = m.XXX_OneofWrappers()
- }
- if len(oots) > 0 {
- // Interpret oneof metadata.
- prop.OneofTypes = make(map[string]*OneofProperties)
- for _, oot := range oots {
- oop := &OneofProperties{
- Type: reflect.ValueOf(oot).Type(), // *T
- Prop: new(Properties),
- }
- sft := oop.Type.Elem().Field(0)
- oop.Prop.Name = sft.Name
- oop.Prop.Parse(sft.Tag.Get("protobuf"))
- // There will be exactly one interface field that
- // this new value is assignable to.
- for i := 0; i < t.NumField(); i++ {
- f := t.Field(i)
- if f.Type.Kind() != reflect.Interface {
- continue
- }
- if !oop.Type.AssignableTo(f.Type) {
- continue
- }
- oop.Field = i
- break
- }
- prop.OneofTypes[oop.Prop.OrigName] = oop
- }
- }
- }
-
- // build required counts
- // build tags
- reqCount := 0
- prop.decoderOrigNames = make(map[string]int)
- for i, p := range prop.Prop {
- if strings.HasPrefix(p.Name, "XXX_") {
- // Internal fields should not appear in tags/origNames maps.
- // They are handled specially when encoding and decoding.
- continue
- }
- if p.Required {
- reqCount++
- }
- prop.decoderTags.put(p.Tag, i)
- prop.decoderOrigNames[p.OrigName] = i
- }
- prop.reqCount = reqCount
-
- return prop
-}
-
-// A global registry of enum types.
-// The generated code will register the generated maps by calling RegisterEnum.
-
-var enumValueMaps = make(map[string]map[string]int32)
-var enumStringMaps = make(map[string]map[int32]string)
-
-// RegisterEnum is called from the generated code to install the enum descriptor
-// maps into the global table to aid parsing text format protocol buffers.
-func RegisterEnum(typeName string, unusedNameMap map[int32]string, valueMap map[string]int32) {
- if _, ok := enumValueMaps[typeName]; ok {
- panic("proto: duplicate enum registered: " + typeName)
- }
- enumValueMaps[typeName] = valueMap
- if _, ok := enumStringMaps[typeName]; ok {
- panic("proto: duplicate enum registered: " + typeName)
- }
- enumStringMaps[typeName] = unusedNameMap
-}
-
-// EnumValueMap returns the mapping from names to integers of the
-// enum type enumType, or a nil if not found.
-func EnumValueMap(enumType string) map[string]int32 {
- return enumValueMaps[enumType]
-}
-
-// A registry of all linked message types.
-// The string is a fully-qualified proto name ("pkg.Message").
-var (
- protoTypedNils = make(map[string]Message) // a map from proto names to typed nil pointers
- protoMapTypes = make(map[string]reflect.Type) // a map from proto names to map types
- revProtoTypes = make(map[reflect.Type]string)
-)
-
-// RegisterType is called from generated code and maps from the fully qualified
-// proto name to the type (pointer to struct) of the protocol buffer.
-func RegisterType(x Message, name string) {
- if _, ok := protoTypedNils[name]; ok {
- // TODO: Some day, make this a panic.
- log.Printf("proto: duplicate proto type registered: %s", name)
- return
- }
- t := reflect.TypeOf(x)
- if v := reflect.ValueOf(x); v.Kind() == reflect.Ptr && v.Pointer() == 0 {
- // Generated code always calls RegisterType with nil x.
- // This check is just for extra safety.
- protoTypedNils[name] = x
- } else {
- protoTypedNils[name] = reflect.Zero(t).Interface().(Message)
- }
- revProtoTypes[t] = name
-}
-
-// RegisterMapType is called from generated code and maps from the fully qualified
-// proto name to the native map type of the proto map definition.
-func RegisterMapType(x interface{}, name string) {
- if reflect.TypeOf(x).Kind() != reflect.Map {
- panic(fmt.Sprintf("RegisterMapType(%T, %q); want map", x, name))
- }
- if _, ok := protoMapTypes[name]; ok {
- log.Printf("proto: duplicate proto type registered: %s", name)
- return
- }
- t := reflect.TypeOf(x)
- protoMapTypes[name] = t
- revProtoTypes[t] = name
-}
-
-// MessageName returns the fully-qualified proto name for the given message type.
-func MessageName(x Message) string {
- type xname interface {
- XXX_MessageName() string
- }
- if m, ok := x.(xname); ok {
- return m.XXX_MessageName()
- }
- return revProtoTypes[reflect.TypeOf(x)]
-}
-
-// MessageType returns the message type (pointer to struct) for a named message.
-// The type is not guaranteed to implement proto.Message if the name refers to a
-// map entry.
-func MessageType(name string) reflect.Type {
- if t, ok := protoTypedNils[name]; ok {
- return reflect.TypeOf(t)
- }
- return protoMapTypes[name]
-}
-
-// A registry of all linked proto files.
-var (
- protoFiles = make(map[string][]byte) // file name => fileDescriptor
-)
-
-// RegisterFile is called from generated code and maps from the
-// full file name of a .proto file to its compressed FileDescriptorProto.
-func RegisterFile(filename string, fileDescriptor []byte) {
- protoFiles[filename] = fileDescriptor
-}
-
-// FileDescriptor returns the compressed FileDescriptorProto for a .proto file.
-func FileDescriptor(filename string) []byte { return protoFiles[filename] }
diff --git a/api/vendor/github.com/gogo/protobuf/proto/properties_gogo.go b/api/vendor/github.com/gogo/protobuf/proto/properties_gogo.go
deleted file mode 100644
index 40ea3dd935c2..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/properties_gogo.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2018, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-//
-// 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
-// OWNER 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.
-
-package proto
-
-import (
- "reflect"
-)
-
-var sizerType = reflect.TypeOf((*Sizer)(nil)).Elem()
-var protosizerType = reflect.TypeOf((*ProtoSizer)(nil)).Elem()
diff --git a/api/vendor/github.com/gogo/protobuf/proto/skip_gogo.go b/api/vendor/github.com/gogo/protobuf/proto/skip_gogo.go
deleted file mode 100644
index 5a5fd93f7c19..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/skip_gogo.go
+++ /dev/null
@@ -1,119 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2013, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-//
-// 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
-// OWNER 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.
-
-package proto
-
-import (
- "fmt"
- "io"
-)
-
-func Skip(data []byte) (n int, err error) {
- l := len(data)
- index := 0
- for index < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- 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 {
- if index >= l {
- return 0, io.ErrUnexpectedEOF
- }
- index++
- if data[index-1] < 0x80 {
- break
- }
- }
- return index, nil
- case 1:
- index += 8
- return index, nil
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if index >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := data[index]
- index++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- index += length
- return index, nil
- case 3:
- for {
- var innerWire uint64
- var start int = index
- for shift := uint(0); ; shift += 7 {
- if index >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := data[index]
- index++
- innerWire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- innerWireType := int(innerWire & 0x7)
- if innerWireType == 4 {
- break
- }
- next, err := Skip(data[start:])
- if err != nil {
- return 0, err
- }
- index = start + next
- }
- return index, nil
- case 4:
- return index, nil
- case 5:
- index += 4
- return index, nil
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- }
- panic("unreachable")
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/table_marshal.go b/api/vendor/github.com/gogo/protobuf/proto/table_marshal.go
deleted file mode 100644
index f8babdefab94..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/table_marshal.go
+++ /dev/null
@@ -1,3009 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2016 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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
-// OWNER 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.
-
-package proto
-
-import (
- "errors"
- "fmt"
- "math"
- "reflect"
- "sort"
- "strconv"
- "strings"
- "sync"
- "sync/atomic"
- "unicode/utf8"
-)
-
-// a sizer takes a pointer to a field and the size of its tag, computes the size of
-// the encoded data.
-type sizer func(pointer, int) int
-
-// a marshaler takes a byte slice, a pointer to a field, and its tag (in wire format),
-// marshals the field to the end of the slice, returns the slice and error (if any).
-type marshaler func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error)
-
-// marshalInfo is the information used for marshaling a message.
-type marshalInfo struct {
- typ reflect.Type
- fields []*marshalFieldInfo
- unrecognized field // offset of XXX_unrecognized
- extensions field // offset of XXX_InternalExtensions
- v1extensions field // offset of XXX_extensions
- sizecache field // offset of XXX_sizecache
- initialized int32 // 0 -- only typ is set, 1 -- fully initialized
- messageset bool // uses message set wire format
- hasmarshaler bool // has custom marshaler
- sync.RWMutex // protect extElems map, also for initialization
- extElems map[int32]*marshalElemInfo // info of extension elements
-
- hassizer bool // has custom sizer
- hasprotosizer bool // has custom protosizer
-
- bytesExtensions field // offset of XXX_extensions where the field type is []byte
-}
-
-// marshalFieldInfo is the information used for marshaling a field of a message.
-type marshalFieldInfo struct {
- field field
- wiretag uint64 // tag in wire format
- tagsize int // size of tag in wire format
- sizer sizer
- marshaler marshaler
- isPointer bool
- required bool // field is required
- name string // name of the field, for error reporting
- oneofElems map[reflect.Type]*marshalElemInfo // info of oneof elements
-}
-
-// marshalElemInfo is the information used for marshaling an extension or oneof element.
-type marshalElemInfo struct {
- wiretag uint64 // tag in wire format
- tagsize int // size of tag in wire format
- sizer sizer
- marshaler marshaler
- isptr bool // elem is pointer typed, thus interface of this type is a direct interface (extension only)
-}
-
-var (
- marshalInfoMap = map[reflect.Type]*marshalInfo{}
- marshalInfoLock sync.Mutex
-
- uint8SliceType = reflect.TypeOf(([]uint8)(nil)).Kind()
-)
-
-// getMarshalInfo returns the information to marshal a given type of message.
-// The info it returns may not necessarily initialized.
-// t is the type of the message (NOT the pointer to it).
-func getMarshalInfo(t reflect.Type) *marshalInfo {
- marshalInfoLock.Lock()
- u, ok := marshalInfoMap[t]
- if !ok {
- u = &marshalInfo{typ: t}
- marshalInfoMap[t] = u
- }
- marshalInfoLock.Unlock()
- return u
-}
-
-// Size is the entry point from generated code,
-// and should be ONLY called by generated code.
-// It computes the size of encoded data of msg.
-// a is a pointer to a place to store cached marshal info.
-func (a *InternalMessageInfo) Size(msg Message) int {
- u := getMessageMarshalInfo(msg, a)
- ptr := toPointer(&msg)
- if ptr.isNil() {
- // We get here if msg is a typed nil ((*SomeMessage)(nil)),
- // so it satisfies the interface, and msg == nil wouldn't
- // catch it. We don't want crash in this case.
- return 0
- }
- return u.size(ptr)
-}
-
-// Marshal is the entry point from generated code,
-// and should be ONLY called by generated code.
-// It marshals msg to the end of b.
-// a is a pointer to a place to store cached marshal info.
-func (a *InternalMessageInfo) Marshal(b []byte, msg Message, deterministic bool) ([]byte, error) {
- u := getMessageMarshalInfo(msg, a)
- ptr := toPointer(&msg)
- if ptr.isNil() {
- // We get here if msg is a typed nil ((*SomeMessage)(nil)),
- // so it satisfies the interface, and msg == nil wouldn't
- // catch it. We don't want crash in this case.
- return b, ErrNil
- }
- return u.marshal(b, ptr, deterministic)
-}
-
-func getMessageMarshalInfo(msg interface{}, a *InternalMessageInfo) *marshalInfo {
- // u := a.marshal, but atomically.
- // We use an atomic here to ensure memory consistency.
- u := atomicLoadMarshalInfo(&a.marshal)
- if u == nil {
- // Get marshal information from type of message.
- t := reflect.ValueOf(msg).Type()
- if t.Kind() != reflect.Ptr {
- panic(fmt.Sprintf("cannot handle non-pointer message type %v", t))
- }
- u = getMarshalInfo(t.Elem())
- // Store it in the cache for later users.
- // a.marshal = u, but atomically.
- atomicStoreMarshalInfo(&a.marshal, u)
- }
- return u
-}
-
-// size is the main function to compute the size of the encoded data of a message.
-// ptr is the pointer to the message.
-func (u *marshalInfo) size(ptr pointer) int {
- if atomic.LoadInt32(&u.initialized) == 0 {
- u.computeMarshalInfo()
- }
-
- // If the message can marshal itself, let it do it, for compatibility.
- // NOTE: This is not efficient.
- if u.hasmarshaler {
- // Uses the message's Size method if available
- if u.hassizer {
- s := ptr.asPointerTo(u.typ).Interface().(Sizer)
- return s.Size()
- }
- // Uses the message's ProtoSize method if available
- if u.hasprotosizer {
- s := ptr.asPointerTo(u.typ).Interface().(ProtoSizer)
- return s.ProtoSize()
- }
-
- m := ptr.asPointerTo(u.typ).Interface().(Marshaler)
- b, _ := m.Marshal()
- return len(b)
- }
-
- n := 0
- for _, f := range u.fields {
- if f.isPointer && ptr.offset(f.field).getPointer().isNil() {
- // nil pointer always marshals to nothing
- continue
- }
- n += f.sizer(ptr.offset(f.field), f.tagsize)
- }
- if u.extensions.IsValid() {
- e := ptr.offset(u.extensions).toExtensions()
- if u.messageset {
- n += u.sizeMessageSet(e)
- } else {
- n += u.sizeExtensions(e)
- }
- }
- if u.v1extensions.IsValid() {
- m := *ptr.offset(u.v1extensions).toOldExtensions()
- n += u.sizeV1Extensions(m)
- }
- if u.bytesExtensions.IsValid() {
- s := *ptr.offset(u.bytesExtensions).toBytes()
- n += len(s)
- }
- if u.unrecognized.IsValid() {
- s := *ptr.offset(u.unrecognized).toBytes()
- n += len(s)
- }
-
- // cache the result for use in marshal
- if u.sizecache.IsValid() {
- atomic.StoreInt32(ptr.offset(u.sizecache).toInt32(), int32(n))
- }
- return n
-}
-
-// cachedsize gets the size from cache. If there is no cache (i.e. message is not generated),
-// fall back to compute the size.
-func (u *marshalInfo) cachedsize(ptr pointer) int {
- if u.sizecache.IsValid() {
- return int(atomic.LoadInt32(ptr.offset(u.sizecache).toInt32()))
- }
- return u.size(ptr)
-}
-
-// marshal is the main function to marshal a message. It takes a byte slice and appends
-// the encoded data to the end of the slice, returns the slice and error (if any).
-// ptr is the pointer to the message.
-// If deterministic is true, map is marshaled in deterministic order.
-func (u *marshalInfo) marshal(b []byte, ptr pointer, deterministic bool) ([]byte, error) {
- if atomic.LoadInt32(&u.initialized) == 0 {
- u.computeMarshalInfo()
- }
-
- // If the message can marshal itself, let it do it, for compatibility.
- // NOTE: This is not efficient.
- if u.hasmarshaler {
- m := ptr.asPointerTo(u.typ).Interface().(Marshaler)
- b1, err := m.Marshal()
- b = append(b, b1...)
- return b, err
- }
-
- var err, errLater error
- // The old marshaler encodes extensions at beginning.
- if u.extensions.IsValid() {
- e := ptr.offset(u.extensions).toExtensions()
- if u.messageset {
- b, err = u.appendMessageSet(b, e, deterministic)
- } else {
- b, err = u.appendExtensions(b, e, deterministic)
- }
- if err != nil {
- return b, err
- }
- }
- if u.v1extensions.IsValid() {
- m := *ptr.offset(u.v1extensions).toOldExtensions()
- b, err = u.appendV1Extensions(b, m, deterministic)
- if err != nil {
- return b, err
- }
- }
- if u.bytesExtensions.IsValid() {
- s := *ptr.offset(u.bytesExtensions).toBytes()
- b = append(b, s...)
- }
- for _, f := range u.fields {
- if f.required {
- if f.isPointer && ptr.offset(f.field).getPointer().isNil() {
- // Required field is not set.
- // We record the error but keep going, to give a complete marshaling.
- if errLater == nil {
- errLater = &RequiredNotSetError{f.name}
- }
- continue
- }
- }
- if f.isPointer && ptr.offset(f.field).getPointer().isNil() {
- // nil pointer always marshals to nothing
- continue
- }
- b, err = f.marshaler(b, ptr.offset(f.field), f.wiretag, deterministic)
- if err != nil {
- if err1, ok := err.(*RequiredNotSetError); ok {
- // Required field in submessage is not set.
- // We record the error but keep going, to give a complete marshaling.
- if errLater == nil {
- errLater = &RequiredNotSetError{f.name + "." + err1.field}
- }
- continue
- }
- if err == errRepeatedHasNil {
- err = errors.New("proto: repeated field " + f.name + " has nil element")
- }
- if err == errInvalidUTF8 {
- if errLater == nil {
- fullName := revProtoTypes[reflect.PtrTo(u.typ)] + "." + f.name
- errLater = &invalidUTF8Error{fullName}
- }
- continue
- }
- return b, err
- }
- }
- if u.unrecognized.IsValid() {
- s := *ptr.offset(u.unrecognized).toBytes()
- b = append(b, s...)
- }
- return b, errLater
-}
-
-// computeMarshalInfo initializes the marshal info.
-func (u *marshalInfo) computeMarshalInfo() {
- u.Lock()
- defer u.Unlock()
- if u.initialized != 0 { // non-atomic read is ok as it is protected by the lock
- return
- }
-
- t := u.typ
- u.unrecognized = invalidField
- u.extensions = invalidField
- u.v1extensions = invalidField
- u.bytesExtensions = invalidField
- u.sizecache = invalidField
- isOneofMessage := false
-
- if reflect.PtrTo(t).Implements(sizerType) {
- u.hassizer = true
- }
- if reflect.PtrTo(t).Implements(protosizerType) {
- u.hasprotosizer = true
- }
- // If the message can marshal itself, let it do it, for compatibility.
- // NOTE: This is not efficient.
- if reflect.PtrTo(t).Implements(marshalerType) {
- u.hasmarshaler = true
- atomic.StoreInt32(&u.initialized, 1)
- return
- }
-
- n := t.NumField()
-
- // deal with XXX fields first
- for i := 0; i < t.NumField(); i++ {
- f := t.Field(i)
- if f.Tag.Get("protobuf_oneof") != "" {
- isOneofMessage = true
- }
- if !strings.HasPrefix(f.Name, "XXX_") {
- continue
- }
- switch f.Name {
- case "XXX_sizecache":
- u.sizecache = toField(&f)
- case "XXX_unrecognized":
- u.unrecognized = toField(&f)
- case "XXX_InternalExtensions":
- u.extensions = toField(&f)
- u.messageset = f.Tag.Get("protobuf_messageset") == "1"
- case "XXX_extensions":
- if f.Type.Kind() == reflect.Map {
- u.v1extensions = toField(&f)
- } else {
- u.bytesExtensions = toField(&f)
- }
- case "XXX_NoUnkeyedLiteral":
- // nothing to do
- default:
- panic("unknown XXX field: " + f.Name)
- }
- n--
- }
-
- // get oneof implementers
- var oneofImplementers []interface{}
- // gogo: isOneofMessage is needed for embedded oneof messages, without a marshaler and unmarshaler
- if isOneofMessage {
- switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) {
- case oneofFuncsIface:
- _, _, _, oneofImplementers = m.XXX_OneofFuncs()
- case oneofWrappersIface:
- oneofImplementers = m.XXX_OneofWrappers()
- }
- }
-
- // normal fields
- fields := make([]marshalFieldInfo, n) // batch allocation
- u.fields = make([]*marshalFieldInfo, 0, n)
- for i, j := 0, 0; i < t.NumField(); i++ {
- f := t.Field(i)
-
- if strings.HasPrefix(f.Name, "XXX_") {
- continue
- }
- field := &fields[j]
- j++
- field.name = f.Name
- u.fields = append(u.fields, field)
- if f.Tag.Get("protobuf_oneof") != "" {
- field.computeOneofFieldInfo(&f, oneofImplementers)
- continue
- }
- if f.Tag.Get("protobuf") == "" {
- // field has no tag (not in generated message), ignore it
- u.fields = u.fields[:len(u.fields)-1]
- j--
- continue
- }
- field.computeMarshalFieldInfo(&f)
- }
-
- // fields are marshaled in tag order on the wire.
- sort.Sort(byTag(u.fields))
-
- atomic.StoreInt32(&u.initialized, 1)
-}
-
-// helper for sorting fields by tag
-type byTag []*marshalFieldInfo
-
-func (a byTag) Len() int { return len(a) }
-func (a byTag) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
-func (a byTag) Less(i, j int) bool { return a[i].wiretag < a[j].wiretag }
-
-// getExtElemInfo returns the information to marshal an extension element.
-// The info it returns is initialized.
-func (u *marshalInfo) getExtElemInfo(desc *ExtensionDesc) *marshalElemInfo {
- // get from cache first
- u.RLock()
- e, ok := u.extElems[desc.Field]
- u.RUnlock()
- if ok {
- return e
- }
-
- t := reflect.TypeOf(desc.ExtensionType) // pointer or slice to basic type or struct
- tags := strings.Split(desc.Tag, ",")
- tag, err := strconv.Atoi(tags[1])
- if err != nil {
- panic("tag is not an integer")
- }
- wt := wiretype(tags[0])
- sizr, marshalr := typeMarshaler(t, tags, false, false)
- e = &marshalElemInfo{
- wiretag: uint64(tag)<<3 | wt,
- tagsize: SizeVarint(uint64(tag) << 3),
- sizer: sizr,
- marshaler: marshalr,
- isptr: t.Kind() == reflect.Ptr,
- }
-
- // update cache
- u.Lock()
- if u.extElems == nil {
- u.extElems = make(map[int32]*marshalElemInfo)
- }
- u.extElems[desc.Field] = e
- u.Unlock()
- return e
-}
-
-// computeMarshalFieldInfo fills up the information to marshal a field.
-func (fi *marshalFieldInfo) computeMarshalFieldInfo(f *reflect.StructField) {
- // parse protobuf tag of the field.
- // tag has format of "bytes,49,opt,name=foo,def=hello!"
- tags := strings.Split(f.Tag.Get("protobuf"), ",")
- if tags[0] == "" {
- return
- }
- tag, err := strconv.Atoi(tags[1])
- if err != nil {
- panic("tag is not an integer")
- }
- wt := wiretype(tags[0])
- if tags[2] == "req" {
- fi.required = true
- }
- fi.setTag(f, tag, wt)
- fi.setMarshaler(f, tags)
-}
-
-func (fi *marshalFieldInfo) computeOneofFieldInfo(f *reflect.StructField, oneofImplementers []interface{}) {
- fi.field = toField(f)
- fi.wiretag = math.MaxInt32 // Use a large tag number, make oneofs sorted at the end. This tag will not appear on the wire.
- fi.isPointer = true
- fi.sizer, fi.marshaler = makeOneOfMarshaler(fi, f)
- fi.oneofElems = make(map[reflect.Type]*marshalElemInfo)
-
- ityp := f.Type // interface type
- for _, o := range oneofImplementers {
- t := reflect.TypeOf(o)
- if !t.Implements(ityp) {
- continue
- }
- sf := t.Elem().Field(0) // oneof implementer is a struct with a single field
- tags := strings.Split(sf.Tag.Get("protobuf"), ",")
- tag, err := strconv.Atoi(tags[1])
- if err != nil {
- panic("tag is not an integer")
- }
- wt := wiretype(tags[0])
- sizr, marshalr := typeMarshaler(sf.Type, tags, false, true) // oneof should not omit any zero value
- fi.oneofElems[t.Elem()] = &marshalElemInfo{
- wiretag: uint64(tag)<<3 | wt,
- tagsize: SizeVarint(uint64(tag) << 3),
- sizer: sizr,
- marshaler: marshalr,
- }
- }
-}
-
-// wiretype returns the wire encoding of the type.
-func wiretype(encoding string) uint64 {
- switch encoding {
- case "fixed32":
- return WireFixed32
- case "fixed64":
- return WireFixed64
- case "varint", "zigzag32", "zigzag64":
- return WireVarint
- case "bytes":
- return WireBytes
- case "group":
- return WireStartGroup
- }
- panic("unknown wire type " + encoding)
-}
-
-// setTag fills up the tag (in wire format) and its size in the info of a field.
-func (fi *marshalFieldInfo) setTag(f *reflect.StructField, tag int, wt uint64) {
- fi.field = toField(f)
- fi.wiretag = uint64(tag)<<3 | wt
- fi.tagsize = SizeVarint(uint64(tag) << 3)
-}
-
-// setMarshaler fills up the sizer and marshaler in the info of a field.
-func (fi *marshalFieldInfo) setMarshaler(f *reflect.StructField, tags []string) {
- switch f.Type.Kind() {
- case reflect.Map:
- // map field
- fi.isPointer = true
- fi.sizer, fi.marshaler = makeMapMarshaler(f)
- return
- case reflect.Ptr, reflect.Slice:
- fi.isPointer = true
- }
- fi.sizer, fi.marshaler = typeMarshaler(f.Type, tags, true, false)
-}
-
-// typeMarshaler returns the sizer and marshaler of a given field.
-// t is the type of the field.
-// tags is the generated "protobuf" tag of the field.
-// If nozero is true, zero value is not marshaled to the wire.
-// If oneof is true, it is a oneof field.
-func typeMarshaler(t reflect.Type, tags []string, nozero, oneof bool) (sizer, marshaler) {
- encoding := tags[0]
-
- pointer := false
- slice := false
- if t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8 {
- slice = true
- t = t.Elem()
- }
- if t.Kind() == reflect.Ptr {
- pointer = true
- t = t.Elem()
- }
-
- packed := false
- proto3 := false
- ctype := false
- isTime := false
- isDuration := false
- isWktPointer := false
- validateUTF8 := true
- for i := 2; i < len(tags); i++ {
- if tags[i] == "packed" {
- packed = true
- }
- if tags[i] == "proto3" {
- proto3 = true
- }
- if strings.HasPrefix(tags[i], "customtype=") {
- ctype = true
- }
- if tags[i] == "stdtime" {
- isTime = true
- }
- if tags[i] == "stdduration" {
- isDuration = true
- }
- if tags[i] == "wktptr" {
- isWktPointer = true
- }
- }
- validateUTF8 = validateUTF8 && proto3
- if !proto3 && !pointer && !slice {
- nozero = false
- }
-
- if ctype {
- if reflect.PtrTo(t).Implements(customType) {
- if slice {
- return makeMessageRefSliceMarshaler(getMarshalInfo(t))
- }
- if pointer {
- return makeCustomPtrMarshaler(getMarshalInfo(t))
- }
- return makeCustomMarshaler(getMarshalInfo(t))
- } else {
- panic(fmt.Sprintf("custom type: type: %v, does not implement the proto.custom interface", t))
- }
- }
-
- if isTime {
- if pointer {
- if slice {
- return makeTimePtrSliceMarshaler(getMarshalInfo(t))
- }
- return makeTimePtrMarshaler(getMarshalInfo(t))
- }
- if slice {
- return makeTimeSliceMarshaler(getMarshalInfo(t))
- }
- return makeTimeMarshaler(getMarshalInfo(t))
- }
-
- if isDuration {
- if pointer {
- if slice {
- return makeDurationPtrSliceMarshaler(getMarshalInfo(t))
- }
- return makeDurationPtrMarshaler(getMarshalInfo(t))
- }
- if slice {
- return makeDurationSliceMarshaler(getMarshalInfo(t))
- }
- return makeDurationMarshaler(getMarshalInfo(t))
- }
-
- if isWktPointer {
- switch t.Kind() {
- case reflect.Float64:
- if pointer {
- if slice {
- return makeStdDoubleValuePtrSliceMarshaler(getMarshalInfo(t))
- }
- return makeStdDoubleValuePtrMarshaler(getMarshalInfo(t))
- }
- if slice {
- return makeStdDoubleValueSliceMarshaler(getMarshalInfo(t))
- }
- return makeStdDoubleValueMarshaler(getMarshalInfo(t))
- case reflect.Float32:
- if pointer {
- if slice {
- return makeStdFloatValuePtrSliceMarshaler(getMarshalInfo(t))
- }
- return makeStdFloatValuePtrMarshaler(getMarshalInfo(t))
- }
- if slice {
- return makeStdFloatValueSliceMarshaler(getMarshalInfo(t))
- }
- return makeStdFloatValueMarshaler(getMarshalInfo(t))
- case reflect.Int64:
- if pointer {
- if slice {
- return makeStdInt64ValuePtrSliceMarshaler(getMarshalInfo(t))
- }
- return makeStdInt64ValuePtrMarshaler(getMarshalInfo(t))
- }
- if slice {
- return makeStdInt64ValueSliceMarshaler(getMarshalInfo(t))
- }
- return makeStdInt64ValueMarshaler(getMarshalInfo(t))
- case reflect.Uint64:
- if pointer {
- if slice {
- return makeStdUInt64ValuePtrSliceMarshaler(getMarshalInfo(t))
- }
- return makeStdUInt64ValuePtrMarshaler(getMarshalInfo(t))
- }
- if slice {
- return makeStdUInt64ValueSliceMarshaler(getMarshalInfo(t))
- }
- return makeStdUInt64ValueMarshaler(getMarshalInfo(t))
- case reflect.Int32:
- if pointer {
- if slice {
- return makeStdInt32ValuePtrSliceMarshaler(getMarshalInfo(t))
- }
- return makeStdInt32ValuePtrMarshaler(getMarshalInfo(t))
- }
- if slice {
- return makeStdInt32ValueSliceMarshaler(getMarshalInfo(t))
- }
- return makeStdInt32ValueMarshaler(getMarshalInfo(t))
- case reflect.Uint32:
- if pointer {
- if slice {
- return makeStdUInt32ValuePtrSliceMarshaler(getMarshalInfo(t))
- }
- return makeStdUInt32ValuePtrMarshaler(getMarshalInfo(t))
- }
- if slice {
- return makeStdUInt32ValueSliceMarshaler(getMarshalInfo(t))
- }
- return makeStdUInt32ValueMarshaler(getMarshalInfo(t))
- case reflect.Bool:
- if pointer {
- if slice {
- return makeStdBoolValuePtrSliceMarshaler(getMarshalInfo(t))
- }
- return makeStdBoolValuePtrMarshaler(getMarshalInfo(t))
- }
- if slice {
- return makeStdBoolValueSliceMarshaler(getMarshalInfo(t))
- }
- return makeStdBoolValueMarshaler(getMarshalInfo(t))
- case reflect.String:
- if pointer {
- if slice {
- return makeStdStringValuePtrSliceMarshaler(getMarshalInfo(t))
- }
- return makeStdStringValuePtrMarshaler(getMarshalInfo(t))
- }
- if slice {
- return makeStdStringValueSliceMarshaler(getMarshalInfo(t))
- }
- return makeStdStringValueMarshaler(getMarshalInfo(t))
- case uint8SliceType:
- if pointer {
- if slice {
- return makeStdBytesValuePtrSliceMarshaler(getMarshalInfo(t))
- }
- return makeStdBytesValuePtrMarshaler(getMarshalInfo(t))
- }
- if slice {
- return makeStdBytesValueSliceMarshaler(getMarshalInfo(t))
- }
- return makeStdBytesValueMarshaler(getMarshalInfo(t))
- default:
- panic(fmt.Sprintf("unknown wktpointer type %#v", t))
- }
- }
-
- switch t.Kind() {
- case reflect.Bool:
- if pointer {
- return sizeBoolPtr, appendBoolPtr
- }
- if slice {
- if packed {
- return sizeBoolPackedSlice, appendBoolPackedSlice
- }
- return sizeBoolSlice, appendBoolSlice
- }
- if nozero {
- return sizeBoolValueNoZero, appendBoolValueNoZero
- }
- return sizeBoolValue, appendBoolValue
- case reflect.Uint32:
- switch encoding {
- case "fixed32":
- if pointer {
- return sizeFixed32Ptr, appendFixed32Ptr
- }
- if slice {
- if packed {
- return sizeFixed32PackedSlice, appendFixed32PackedSlice
- }
- return sizeFixed32Slice, appendFixed32Slice
- }
- if nozero {
- return sizeFixed32ValueNoZero, appendFixed32ValueNoZero
- }
- return sizeFixed32Value, appendFixed32Value
- case "varint":
- if pointer {
- return sizeVarint32Ptr, appendVarint32Ptr
- }
- if slice {
- if packed {
- return sizeVarint32PackedSlice, appendVarint32PackedSlice
- }
- return sizeVarint32Slice, appendVarint32Slice
- }
- if nozero {
- return sizeVarint32ValueNoZero, appendVarint32ValueNoZero
- }
- return sizeVarint32Value, appendVarint32Value
- }
- case reflect.Int32:
- switch encoding {
- case "fixed32":
- if pointer {
- return sizeFixedS32Ptr, appendFixedS32Ptr
- }
- if slice {
- if packed {
- return sizeFixedS32PackedSlice, appendFixedS32PackedSlice
- }
- return sizeFixedS32Slice, appendFixedS32Slice
- }
- if nozero {
- return sizeFixedS32ValueNoZero, appendFixedS32ValueNoZero
- }
- return sizeFixedS32Value, appendFixedS32Value
- case "varint":
- if pointer {
- return sizeVarintS32Ptr, appendVarintS32Ptr
- }
- if slice {
- if packed {
- return sizeVarintS32PackedSlice, appendVarintS32PackedSlice
- }
- return sizeVarintS32Slice, appendVarintS32Slice
- }
- if nozero {
- return sizeVarintS32ValueNoZero, appendVarintS32ValueNoZero
- }
- return sizeVarintS32Value, appendVarintS32Value
- case "zigzag32":
- if pointer {
- return sizeZigzag32Ptr, appendZigzag32Ptr
- }
- if slice {
- if packed {
- return sizeZigzag32PackedSlice, appendZigzag32PackedSlice
- }
- return sizeZigzag32Slice, appendZigzag32Slice
- }
- if nozero {
- return sizeZigzag32ValueNoZero, appendZigzag32ValueNoZero
- }
- return sizeZigzag32Value, appendZigzag32Value
- }
- case reflect.Uint64:
- switch encoding {
- case "fixed64":
- if pointer {
- return sizeFixed64Ptr, appendFixed64Ptr
- }
- if slice {
- if packed {
- return sizeFixed64PackedSlice, appendFixed64PackedSlice
- }
- return sizeFixed64Slice, appendFixed64Slice
- }
- if nozero {
- return sizeFixed64ValueNoZero, appendFixed64ValueNoZero
- }
- return sizeFixed64Value, appendFixed64Value
- case "varint":
- if pointer {
- return sizeVarint64Ptr, appendVarint64Ptr
- }
- if slice {
- if packed {
- return sizeVarint64PackedSlice, appendVarint64PackedSlice
- }
- return sizeVarint64Slice, appendVarint64Slice
- }
- if nozero {
- return sizeVarint64ValueNoZero, appendVarint64ValueNoZero
- }
- return sizeVarint64Value, appendVarint64Value
- }
- case reflect.Int64:
- switch encoding {
- case "fixed64":
- if pointer {
- return sizeFixedS64Ptr, appendFixedS64Ptr
- }
- if slice {
- if packed {
- return sizeFixedS64PackedSlice, appendFixedS64PackedSlice
- }
- return sizeFixedS64Slice, appendFixedS64Slice
- }
- if nozero {
- return sizeFixedS64ValueNoZero, appendFixedS64ValueNoZero
- }
- return sizeFixedS64Value, appendFixedS64Value
- case "varint":
- if pointer {
- return sizeVarintS64Ptr, appendVarintS64Ptr
- }
- if slice {
- if packed {
- return sizeVarintS64PackedSlice, appendVarintS64PackedSlice
- }
- return sizeVarintS64Slice, appendVarintS64Slice
- }
- if nozero {
- return sizeVarintS64ValueNoZero, appendVarintS64ValueNoZero
- }
- return sizeVarintS64Value, appendVarintS64Value
- case "zigzag64":
- if pointer {
- return sizeZigzag64Ptr, appendZigzag64Ptr
- }
- if slice {
- if packed {
- return sizeZigzag64PackedSlice, appendZigzag64PackedSlice
- }
- return sizeZigzag64Slice, appendZigzag64Slice
- }
- if nozero {
- return sizeZigzag64ValueNoZero, appendZigzag64ValueNoZero
- }
- return sizeZigzag64Value, appendZigzag64Value
- }
- case reflect.Float32:
- if pointer {
- return sizeFloat32Ptr, appendFloat32Ptr
- }
- if slice {
- if packed {
- return sizeFloat32PackedSlice, appendFloat32PackedSlice
- }
- return sizeFloat32Slice, appendFloat32Slice
- }
- if nozero {
- return sizeFloat32ValueNoZero, appendFloat32ValueNoZero
- }
- return sizeFloat32Value, appendFloat32Value
- case reflect.Float64:
- if pointer {
- return sizeFloat64Ptr, appendFloat64Ptr
- }
- if slice {
- if packed {
- return sizeFloat64PackedSlice, appendFloat64PackedSlice
- }
- return sizeFloat64Slice, appendFloat64Slice
- }
- if nozero {
- return sizeFloat64ValueNoZero, appendFloat64ValueNoZero
- }
- return sizeFloat64Value, appendFloat64Value
- case reflect.String:
- if validateUTF8 {
- if pointer {
- return sizeStringPtr, appendUTF8StringPtr
- }
- if slice {
- return sizeStringSlice, appendUTF8StringSlice
- }
- if nozero {
- return sizeStringValueNoZero, appendUTF8StringValueNoZero
- }
- return sizeStringValue, appendUTF8StringValue
- }
- if pointer {
- return sizeStringPtr, appendStringPtr
- }
- if slice {
- return sizeStringSlice, appendStringSlice
- }
- if nozero {
- return sizeStringValueNoZero, appendStringValueNoZero
- }
- return sizeStringValue, appendStringValue
- case reflect.Slice:
- if slice {
- return sizeBytesSlice, appendBytesSlice
- }
- if oneof {
- // Oneof bytes field may also have "proto3" tag.
- // We want to marshal it as a oneof field. Do this
- // check before the proto3 check.
- return sizeBytesOneof, appendBytesOneof
- }
- if proto3 {
- return sizeBytes3, appendBytes3
- }
- return sizeBytes, appendBytes
- case reflect.Struct:
- switch encoding {
- case "group":
- if slice {
- return makeGroupSliceMarshaler(getMarshalInfo(t))
- }
- return makeGroupMarshaler(getMarshalInfo(t))
- case "bytes":
- if pointer {
- if slice {
- return makeMessageSliceMarshaler(getMarshalInfo(t))
- }
- return makeMessageMarshaler(getMarshalInfo(t))
- } else {
- if slice {
- return makeMessageRefSliceMarshaler(getMarshalInfo(t))
- }
- return makeMessageRefMarshaler(getMarshalInfo(t))
- }
- }
- }
- panic(fmt.Sprintf("unknown or mismatched type: type: %v, wire type: %v", t, encoding))
-}
-
-// Below are functions to size/marshal a specific type of a field.
-// They are stored in the field's info, and called by function pointers.
-// They have type sizer or marshaler.
-
-func sizeFixed32Value(_ pointer, tagsize int) int {
- return 4 + tagsize
-}
-func sizeFixed32ValueNoZero(ptr pointer, tagsize int) int {
- v := *ptr.toUint32()
- if v == 0 {
- return 0
- }
- return 4 + tagsize
-}
-func sizeFixed32Ptr(ptr pointer, tagsize int) int {
- p := *ptr.toUint32Ptr()
- if p == nil {
- return 0
- }
- return 4 + tagsize
-}
-func sizeFixed32Slice(ptr pointer, tagsize int) int {
- s := *ptr.toUint32Slice()
- return (4 + tagsize) * len(s)
-}
-func sizeFixed32PackedSlice(ptr pointer, tagsize int) int {
- s := *ptr.toUint32Slice()
- if len(s) == 0 {
- return 0
- }
- return 4*len(s) + SizeVarint(uint64(4*len(s))) + tagsize
-}
-func sizeFixedS32Value(_ pointer, tagsize int) int {
- return 4 + tagsize
-}
-func sizeFixedS32ValueNoZero(ptr pointer, tagsize int) int {
- v := *ptr.toInt32()
- if v == 0 {
- return 0
- }
- return 4 + tagsize
-}
-func sizeFixedS32Ptr(ptr pointer, tagsize int) int {
- p := ptr.getInt32Ptr()
- if p == nil {
- return 0
- }
- return 4 + tagsize
-}
-func sizeFixedS32Slice(ptr pointer, tagsize int) int {
- s := ptr.getInt32Slice()
- return (4 + tagsize) * len(s)
-}
-func sizeFixedS32PackedSlice(ptr pointer, tagsize int) int {
- s := ptr.getInt32Slice()
- if len(s) == 0 {
- return 0
- }
- return 4*len(s) + SizeVarint(uint64(4*len(s))) + tagsize
-}
-func sizeFloat32Value(_ pointer, tagsize int) int {
- return 4 + tagsize
-}
-func sizeFloat32ValueNoZero(ptr pointer, tagsize int) int {
- v := math.Float32bits(*ptr.toFloat32())
- if v == 0 {
- return 0
- }
- return 4 + tagsize
-}
-func sizeFloat32Ptr(ptr pointer, tagsize int) int {
- p := *ptr.toFloat32Ptr()
- if p == nil {
- return 0
- }
- return 4 + tagsize
-}
-func sizeFloat32Slice(ptr pointer, tagsize int) int {
- s := *ptr.toFloat32Slice()
- return (4 + tagsize) * len(s)
-}
-func sizeFloat32PackedSlice(ptr pointer, tagsize int) int {
- s := *ptr.toFloat32Slice()
- if len(s) == 0 {
- return 0
- }
- return 4*len(s) + SizeVarint(uint64(4*len(s))) + tagsize
-}
-func sizeFixed64Value(_ pointer, tagsize int) int {
- return 8 + tagsize
-}
-func sizeFixed64ValueNoZero(ptr pointer, tagsize int) int {
- v := *ptr.toUint64()
- if v == 0 {
- return 0
- }
- return 8 + tagsize
-}
-func sizeFixed64Ptr(ptr pointer, tagsize int) int {
- p := *ptr.toUint64Ptr()
- if p == nil {
- return 0
- }
- return 8 + tagsize
-}
-func sizeFixed64Slice(ptr pointer, tagsize int) int {
- s := *ptr.toUint64Slice()
- return (8 + tagsize) * len(s)
-}
-func sizeFixed64PackedSlice(ptr pointer, tagsize int) int {
- s := *ptr.toUint64Slice()
- if len(s) == 0 {
- return 0
- }
- return 8*len(s) + SizeVarint(uint64(8*len(s))) + tagsize
-}
-func sizeFixedS64Value(_ pointer, tagsize int) int {
- return 8 + tagsize
-}
-func sizeFixedS64ValueNoZero(ptr pointer, tagsize int) int {
- v := *ptr.toInt64()
- if v == 0 {
- return 0
- }
- return 8 + tagsize
-}
-func sizeFixedS64Ptr(ptr pointer, tagsize int) int {
- p := *ptr.toInt64Ptr()
- if p == nil {
- return 0
- }
- return 8 + tagsize
-}
-func sizeFixedS64Slice(ptr pointer, tagsize int) int {
- s := *ptr.toInt64Slice()
- return (8 + tagsize) * len(s)
-}
-func sizeFixedS64PackedSlice(ptr pointer, tagsize int) int {
- s := *ptr.toInt64Slice()
- if len(s) == 0 {
- return 0
- }
- return 8*len(s) + SizeVarint(uint64(8*len(s))) + tagsize
-}
-func sizeFloat64Value(_ pointer, tagsize int) int {
- return 8 + tagsize
-}
-func sizeFloat64ValueNoZero(ptr pointer, tagsize int) int {
- v := math.Float64bits(*ptr.toFloat64())
- if v == 0 {
- return 0
- }
- return 8 + tagsize
-}
-func sizeFloat64Ptr(ptr pointer, tagsize int) int {
- p := *ptr.toFloat64Ptr()
- if p == nil {
- return 0
- }
- return 8 + tagsize
-}
-func sizeFloat64Slice(ptr pointer, tagsize int) int {
- s := *ptr.toFloat64Slice()
- return (8 + tagsize) * len(s)
-}
-func sizeFloat64PackedSlice(ptr pointer, tagsize int) int {
- s := *ptr.toFloat64Slice()
- if len(s) == 0 {
- return 0
- }
- return 8*len(s) + SizeVarint(uint64(8*len(s))) + tagsize
-}
-func sizeVarint32Value(ptr pointer, tagsize int) int {
- v := *ptr.toUint32()
- return SizeVarint(uint64(v)) + tagsize
-}
-func sizeVarint32ValueNoZero(ptr pointer, tagsize int) int {
- v := *ptr.toUint32()
- if v == 0 {
- return 0
- }
- return SizeVarint(uint64(v)) + tagsize
-}
-func sizeVarint32Ptr(ptr pointer, tagsize int) int {
- p := *ptr.toUint32Ptr()
- if p == nil {
- return 0
- }
- return SizeVarint(uint64(*p)) + tagsize
-}
-func sizeVarint32Slice(ptr pointer, tagsize int) int {
- s := *ptr.toUint32Slice()
- n := 0
- for _, v := range s {
- n += SizeVarint(uint64(v)) + tagsize
- }
- return n
-}
-func sizeVarint32PackedSlice(ptr pointer, tagsize int) int {
- s := *ptr.toUint32Slice()
- if len(s) == 0 {
- return 0
- }
- n := 0
- for _, v := range s {
- n += SizeVarint(uint64(v))
- }
- return n + SizeVarint(uint64(n)) + tagsize
-}
-func sizeVarintS32Value(ptr pointer, tagsize int) int {
- v := *ptr.toInt32()
- return SizeVarint(uint64(v)) + tagsize
-}
-func sizeVarintS32ValueNoZero(ptr pointer, tagsize int) int {
- v := *ptr.toInt32()
- if v == 0 {
- return 0
- }
- return SizeVarint(uint64(v)) + tagsize
-}
-func sizeVarintS32Ptr(ptr pointer, tagsize int) int {
- p := ptr.getInt32Ptr()
- if p == nil {
- return 0
- }
- return SizeVarint(uint64(*p)) + tagsize
-}
-func sizeVarintS32Slice(ptr pointer, tagsize int) int {
- s := ptr.getInt32Slice()
- n := 0
- for _, v := range s {
- n += SizeVarint(uint64(v)) + tagsize
- }
- return n
-}
-func sizeVarintS32PackedSlice(ptr pointer, tagsize int) int {
- s := ptr.getInt32Slice()
- if len(s) == 0 {
- return 0
- }
- n := 0
- for _, v := range s {
- n += SizeVarint(uint64(v))
- }
- return n + SizeVarint(uint64(n)) + tagsize
-}
-func sizeVarint64Value(ptr pointer, tagsize int) int {
- v := *ptr.toUint64()
- return SizeVarint(v) + tagsize
-}
-func sizeVarint64ValueNoZero(ptr pointer, tagsize int) int {
- v := *ptr.toUint64()
- if v == 0 {
- return 0
- }
- return SizeVarint(v) + tagsize
-}
-func sizeVarint64Ptr(ptr pointer, tagsize int) int {
- p := *ptr.toUint64Ptr()
- if p == nil {
- return 0
- }
- return SizeVarint(*p) + tagsize
-}
-func sizeVarint64Slice(ptr pointer, tagsize int) int {
- s := *ptr.toUint64Slice()
- n := 0
- for _, v := range s {
- n += SizeVarint(v) + tagsize
- }
- return n
-}
-func sizeVarint64PackedSlice(ptr pointer, tagsize int) int {
- s := *ptr.toUint64Slice()
- if len(s) == 0 {
- return 0
- }
- n := 0
- for _, v := range s {
- n += SizeVarint(v)
- }
- return n + SizeVarint(uint64(n)) + tagsize
-}
-func sizeVarintS64Value(ptr pointer, tagsize int) int {
- v := *ptr.toInt64()
- return SizeVarint(uint64(v)) + tagsize
-}
-func sizeVarintS64ValueNoZero(ptr pointer, tagsize int) int {
- v := *ptr.toInt64()
- if v == 0 {
- return 0
- }
- return SizeVarint(uint64(v)) + tagsize
-}
-func sizeVarintS64Ptr(ptr pointer, tagsize int) int {
- p := *ptr.toInt64Ptr()
- if p == nil {
- return 0
- }
- return SizeVarint(uint64(*p)) + tagsize
-}
-func sizeVarintS64Slice(ptr pointer, tagsize int) int {
- s := *ptr.toInt64Slice()
- n := 0
- for _, v := range s {
- n += SizeVarint(uint64(v)) + tagsize
- }
- return n
-}
-func sizeVarintS64PackedSlice(ptr pointer, tagsize int) int {
- s := *ptr.toInt64Slice()
- if len(s) == 0 {
- return 0
- }
- n := 0
- for _, v := range s {
- n += SizeVarint(uint64(v))
- }
- return n + SizeVarint(uint64(n)) + tagsize
-}
-func sizeZigzag32Value(ptr pointer, tagsize int) int {
- v := *ptr.toInt32()
- return SizeVarint(uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) + tagsize
-}
-func sizeZigzag32ValueNoZero(ptr pointer, tagsize int) int {
- v := *ptr.toInt32()
- if v == 0 {
- return 0
- }
- return SizeVarint(uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) + tagsize
-}
-func sizeZigzag32Ptr(ptr pointer, tagsize int) int {
- p := ptr.getInt32Ptr()
- if p == nil {
- return 0
- }
- v := *p
- return SizeVarint(uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) + tagsize
-}
-func sizeZigzag32Slice(ptr pointer, tagsize int) int {
- s := ptr.getInt32Slice()
- n := 0
- for _, v := range s {
- n += SizeVarint(uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) + tagsize
- }
- return n
-}
-func sizeZigzag32PackedSlice(ptr pointer, tagsize int) int {
- s := ptr.getInt32Slice()
- if len(s) == 0 {
- return 0
- }
- n := 0
- for _, v := range s {
- n += SizeVarint(uint64((uint32(v) << 1) ^ uint32((int32(v) >> 31))))
- }
- return n + SizeVarint(uint64(n)) + tagsize
-}
-func sizeZigzag64Value(ptr pointer, tagsize int) int {
- v := *ptr.toInt64()
- return SizeVarint(uint64(v<<1)^uint64((int64(v)>>63))) + tagsize
-}
-func sizeZigzag64ValueNoZero(ptr pointer, tagsize int) int {
- v := *ptr.toInt64()
- if v == 0 {
- return 0
- }
- return SizeVarint(uint64(v<<1)^uint64((int64(v)>>63))) + tagsize
-}
-func sizeZigzag64Ptr(ptr pointer, tagsize int) int {
- p := *ptr.toInt64Ptr()
- if p == nil {
- return 0
- }
- v := *p
- return SizeVarint(uint64(v<<1)^uint64((int64(v)>>63))) + tagsize
-}
-func sizeZigzag64Slice(ptr pointer, tagsize int) int {
- s := *ptr.toInt64Slice()
- n := 0
- for _, v := range s {
- n += SizeVarint(uint64(v<<1)^uint64((int64(v)>>63))) + tagsize
- }
- return n
-}
-func sizeZigzag64PackedSlice(ptr pointer, tagsize int) int {
- s := *ptr.toInt64Slice()
- if len(s) == 0 {
- return 0
- }
- n := 0
- for _, v := range s {
- n += SizeVarint(uint64(v<<1) ^ uint64((int64(v) >> 63)))
- }
- return n + SizeVarint(uint64(n)) + tagsize
-}
-func sizeBoolValue(_ pointer, tagsize int) int {
- return 1 + tagsize
-}
-func sizeBoolValueNoZero(ptr pointer, tagsize int) int {
- v := *ptr.toBool()
- if !v {
- return 0
- }
- return 1 + tagsize
-}
-func sizeBoolPtr(ptr pointer, tagsize int) int {
- p := *ptr.toBoolPtr()
- if p == nil {
- return 0
- }
- return 1 + tagsize
-}
-func sizeBoolSlice(ptr pointer, tagsize int) int {
- s := *ptr.toBoolSlice()
- return (1 + tagsize) * len(s)
-}
-func sizeBoolPackedSlice(ptr pointer, tagsize int) int {
- s := *ptr.toBoolSlice()
- if len(s) == 0 {
- return 0
- }
- return len(s) + SizeVarint(uint64(len(s))) + tagsize
-}
-func sizeStringValue(ptr pointer, tagsize int) int {
- v := *ptr.toString()
- return len(v) + SizeVarint(uint64(len(v))) + tagsize
-}
-func sizeStringValueNoZero(ptr pointer, tagsize int) int {
- v := *ptr.toString()
- if v == "" {
- return 0
- }
- return len(v) + SizeVarint(uint64(len(v))) + tagsize
-}
-func sizeStringPtr(ptr pointer, tagsize int) int {
- p := *ptr.toStringPtr()
- if p == nil {
- return 0
- }
- v := *p
- return len(v) + SizeVarint(uint64(len(v))) + tagsize
-}
-func sizeStringSlice(ptr pointer, tagsize int) int {
- s := *ptr.toStringSlice()
- n := 0
- for _, v := range s {
- n += len(v) + SizeVarint(uint64(len(v))) + tagsize
- }
- return n
-}
-func sizeBytes(ptr pointer, tagsize int) int {
- v := *ptr.toBytes()
- if v == nil {
- return 0
- }
- return len(v) + SizeVarint(uint64(len(v))) + tagsize
-}
-func sizeBytes3(ptr pointer, tagsize int) int {
- v := *ptr.toBytes()
- if len(v) == 0 {
- return 0
- }
- return len(v) + SizeVarint(uint64(len(v))) + tagsize
-}
-func sizeBytesOneof(ptr pointer, tagsize int) int {
- v := *ptr.toBytes()
- return len(v) + SizeVarint(uint64(len(v))) + tagsize
-}
-func sizeBytesSlice(ptr pointer, tagsize int) int {
- s := *ptr.toBytesSlice()
- n := 0
- for _, v := range s {
- n += len(v) + SizeVarint(uint64(len(v))) + tagsize
- }
- return n
-}
-
-// appendFixed32 appends an encoded fixed32 to b.
-func appendFixed32(b []byte, v uint32) []byte {
- b = append(b,
- byte(v),
- byte(v>>8),
- byte(v>>16),
- byte(v>>24))
- return b
-}
-
-// appendFixed64 appends an encoded fixed64 to b.
-func appendFixed64(b []byte, v uint64) []byte {
- b = append(b,
- byte(v),
- byte(v>>8),
- byte(v>>16),
- byte(v>>24),
- byte(v>>32),
- byte(v>>40),
- byte(v>>48),
- byte(v>>56))
- return b
-}
-
-// appendVarint appends an encoded varint to b.
-func appendVarint(b []byte, v uint64) []byte {
- // TODO: make 1-byte (maybe 2-byte) case inline-able, once we
- // have non-leaf inliner.
- switch {
- case v < 1<<7:
- b = append(b, byte(v))
- case v < 1<<14:
- b = append(b,
- byte(v&0x7f|0x80),
- byte(v>>7))
- case v < 1<<21:
- b = append(b,
- byte(v&0x7f|0x80),
- byte((v>>7)&0x7f|0x80),
- byte(v>>14))
- case v < 1<<28:
- b = append(b,
- byte(v&0x7f|0x80),
- byte((v>>7)&0x7f|0x80),
- byte((v>>14)&0x7f|0x80),
- byte(v>>21))
- case v < 1<<35:
- b = append(b,
- byte(v&0x7f|0x80),
- byte((v>>7)&0x7f|0x80),
- byte((v>>14)&0x7f|0x80),
- byte((v>>21)&0x7f|0x80),
- byte(v>>28))
- case v < 1<<42:
- b = append(b,
- byte(v&0x7f|0x80),
- byte((v>>7)&0x7f|0x80),
- byte((v>>14)&0x7f|0x80),
- byte((v>>21)&0x7f|0x80),
- byte((v>>28)&0x7f|0x80),
- byte(v>>35))
- case v < 1<<49:
- b = append(b,
- byte(v&0x7f|0x80),
- byte((v>>7)&0x7f|0x80),
- byte((v>>14)&0x7f|0x80),
- byte((v>>21)&0x7f|0x80),
- byte((v>>28)&0x7f|0x80),
- byte((v>>35)&0x7f|0x80),
- byte(v>>42))
- case v < 1<<56:
- b = append(b,
- byte(v&0x7f|0x80),
- byte((v>>7)&0x7f|0x80),
- byte((v>>14)&0x7f|0x80),
- byte((v>>21)&0x7f|0x80),
- byte((v>>28)&0x7f|0x80),
- byte((v>>35)&0x7f|0x80),
- byte((v>>42)&0x7f|0x80),
- byte(v>>49))
- case v < 1<<63:
- b = append(b,
- byte(v&0x7f|0x80),
- byte((v>>7)&0x7f|0x80),
- byte((v>>14)&0x7f|0x80),
- byte((v>>21)&0x7f|0x80),
- byte((v>>28)&0x7f|0x80),
- byte((v>>35)&0x7f|0x80),
- byte((v>>42)&0x7f|0x80),
- byte((v>>49)&0x7f|0x80),
- byte(v>>56))
- default:
- b = append(b,
- byte(v&0x7f|0x80),
- byte((v>>7)&0x7f|0x80),
- byte((v>>14)&0x7f|0x80),
- byte((v>>21)&0x7f|0x80),
- byte((v>>28)&0x7f|0x80),
- byte((v>>35)&0x7f|0x80),
- byte((v>>42)&0x7f|0x80),
- byte((v>>49)&0x7f|0x80),
- byte((v>>56)&0x7f|0x80),
- 1)
- }
- return b
-}
-
-func appendFixed32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toUint32()
- b = appendVarint(b, wiretag)
- b = appendFixed32(b, v)
- return b, nil
-}
-func appendFixed32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toUint32()
- if v == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendFixed32(b, v)
- return b, nil
-}
-func appendFixed32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- p := *ptr.toUint32Ptr()
- if p == nil {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendFixed32(b, *p)
- return b, nil
-}
-func appendFixed32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toUint32Slice()
- for _, v := range s {
- b = appendVarint(b, wiretag)
- b = appendFixed32(b, v)
- }
- return b, nil
-}
-func appendFixed32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toUint32Slice()
- if len(s) == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag&^7|WireBytes)
- b = appendVarint(b, uint64(4*len(s)))
- for _, v := range s {
- b = appendFixed32(b, v)
- }
- return b, nil
-}
-func appendFixedS32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toInt32()
- b = appendVarint(b, wiretag)
- b = appendFixed32(b, uint32(v))
- return b, nil
-}
-func appendFixedS32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toInt32()
- if v == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendFixed32(b, uint32(v))
- return b, nil
-}
-func appendFixedS32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- p := ptr.getInt32Ptr()
- if p == nil {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendFixed32(b, uint32(*p))
- return b, nil
-}
-func appendFixedS32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := ptr.getInt32Slice()
- for _, v := range s {
- b = appendVarint(b, wiretag)
- b = appendFixed32(b, uint32(v))
- }
- return b, nil
-}
-func appendFixedS32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := ptr.getInt32Slice()
- if len(s) == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag&^7|WireBytes)
- b = appendVarint(b, uint64(4*len(s)))
- for _, v := range s {
- b = appendFixed32(b, uint32(v))
- }
- return b, nil
-}
-func appendFloat32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := math.Float32bits(*ptr.toFloat32())
- b = appendVarint(b, wiretag)
- b = appendFixed32(b, v)
- return b, nil
-}
-func appendFloat32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := math.Float32bits(*ptr.toFloat32())
- if v == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendFixed32(b, v)
- return b, nil
-}
-func appendFloat32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- p := *ptr.toFloat32Ptr()
- if p == nil {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendFixed32(b, math.Float32bits(*p))
- return b, nil
-}
-func appendFloat32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toFloat32Slice()
- for _, v := range s {
- b = appendVarint(b, wiretag)
- b = appendFixed32(b, math.Float32bits(v))
- }
- return b, nil
-}
-func appendFloat32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toFloat32Slice()
- if len(s) == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag&^7|WireBytes)
- b = appendVarint(b, uint64(4*len(s)))
- for _, v := range s {
- b = appendFixed32(b, math.Float32bits(v))
- }
- return b, nil
-}
-func appendFixed64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toUint64()
- b = appendVarint(b, wiretag)
- b = appendFixed64(b, v)
- return b, nil
-}
-func appendFixed64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toUint64()
- if v == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendFixed64(b, v)
- return b, nil
-}
-func appendFixed64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- p := *ptr.toUint64Ptr()
- if p == nil {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendFixed64(b, *p)
- return b, nil
-}
-func appendFixed64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toUint64Slice()
- for _, v := range s {
- b = appendVarint(b, wiretag)
- b = appendFixed64(b, v)
- }
- return b, nil
-}
-func appendFixed64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toUint64Slice()
- if len(s) == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag&^7|WireBytes)
- b = appendVarint(b, uint64(8*len(s)))
- for _, v := range s {
- b = appendFixed64(b, v)
- }
- return b, nil
-}
-func appendFixedS64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toInt64()
- b = appendVarint(b, wiretag)
- b = appendFixed64(b, uint64(v))
- return b, nil
-}
-func appendFixedS64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toInt64()
- if v == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendFixed64(b, uint64(v))
- return b, nil
-}
-func appendFixedS64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- p := *ptr.toInt64Ptr()
- if p == nil {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendFixed64(b, uint64(*p))
- return b, nil
-}
-func appendFixedS64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toInt64Slice()
- for _, v := range s {
- b = appendVarint(b, wiretag)
- b = appendFixed64(b, uint64(v))
- }
- return b, nil
-}
-func appendFixedS64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toInt64Slice()
- if len(s) == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag&^7|WireBytes)
- b = appendVarint(b, uint64(8*len(s)))
- for _, v := range s {
- b = appendFixed64(b, uint64(v))
- }
- return b, nil
-}
-func appendFloat64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := math.Float64bits(*ptr.toFloat64())
- b = appendVarint(b, wiretag)
- b = appendFixed64(b, v)
- return b, nil
-}
-func appendFloat64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := math.Float64bits(*ptr.toFloat64())
- if v == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendFixed64(b, v)
- return b, nil
-}
-func appendFloat64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- p := *ptr.toFloat64Ptr()
- if p == nil {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendFixed64(b, math.Float64bits(*p))
- return b, nil
-}
-func appendFloat64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toFloat64Slice()
- for _, v := range s {
- b = appendVarint(b, wiretag)
- b = appendFixed64(b, math.Float64bits(v))
- }
- return b, nil
-}
-func appendFloat64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toFloat64Slice()
- if len(s) == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag&^7|WireBytes)
- b = appendVarint(b, uint64(8*len(s)))
- for _, v := range s {
- b = appendFixed64(b, math.Float64bits(v))
- }
- return b, nil
-}
-func appendVarint32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toUint32()
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(v))
- return b, nil
-}
-func appendVarint32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toUint32()
- if v == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(v))
- return b, nil
-}
-func appendVarint32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- p := *ptr.toUint32Ptr()
- if p == nil {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(*p))
- return b, nil
-}
-func appendVarint32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toUint32Slice()
- for _, v := range s {
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(v))
- }
- return b, nil
-}
-func appendVarint32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toUint32Slice()
- if len(s) == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag&^7|WireBytes)
- // compute size
- n := 0
- for _, v := range s {
- n += SizeVarint(uint64(v))
- }
- b = appendVarint(b, uint64(n))
- for _, v := range s {
- b = appendVarint(b, uint64(v))
- }
- return b, nil
-}
-func appendVarintS32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toInt32()
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(v))
- return b, nil
-}
-func appendVarintS32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toInt32()
- if v == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(v))
- return b, nil
-}
-func appendVarintS32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- p := ptr.getInt32Ptr()
- if p == nil {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(*p))
- return b, nil
-}
-func appendVarintS32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := ptr.getInt32Slice()
- for _, v := range s {
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(v))
- }
- return b, nil
-}
-func appendVarintS32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := ptr.getInt32Slice()
- if len(s) == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag&^7|WireBytes)
- // compute size
- n := 0
- for _, v := range s {
- n += SizeVarint(uint64(v))
- }
- b = appendVarint(b, uint64(n))
- for _, v := range s {
- b = appendVarint(b, uint64(v))
- }
- return b, nil
-}
-func appendVarint64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toUint64()
- b = appendVarint(b, wiretag)
- b = appendVarint(b, v)
- return b, nil
-}
-func appendVarint64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toUint64()
- if v == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, v)
- return b, nil
-}
-func appendVarint64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- p := *ptr.toUint64Ptr()
- if p == nil {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, *p)
- return b, nil
-}
-func appendVarint64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toUint64Slice()
- for _, v := range s {
- b = appendVarint(b, wiretag)
- b = appendVarint(b, v)
- }
- return b, nil
-}
-func appendVarint64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toUint64Slice()
- if len(s) == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag&^7|WireBytes)
- // compute size
- n := 0
- for _, v := range s {
- n += SizeVarint(v)
- }
- b = appendVarint(b, uint64(n))
- for _, v := range s {
- b = appendVarint(b, v)
- }
- return b, nil
-}
-func appendVarintS64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toInt64()
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(v))
- return b, nil
-}
-func appendVarintS64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toInt64()
- if v == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(v))
- return b, nil
-}
-func appendVarintS64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- p := *ptr.toInt64Ptr()
- if p == nil {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(*p))
- return b, nil
-}
-func appendVarintS64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toInt64Slice()
- for _, v := range s {
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(v))
- }
- return b, nil
-}
-func appendVarintS64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toInt64Slice()
- if len(s) == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag&^7|WireBytes)
- // compute size
- n := 0
- for _, v := range s {
- n += SizeVarint(uint64(v))
- }
- b = appendVarint(b, uint64(n))
- for _, v := range s {
- b = appendVarint(b, uint64(v))
- }
- return b, nil
-}
-func appendZigzag32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toInt32()
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31))))
- return b, nil
-}
-func appendZigzag32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toInt32()
- if v == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31))))
- return b, nil
-}
-func appendZigzag32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- p := ptr.getInt32Ptr()
- if p == nil {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- v := *p
- b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31))))
- return b, nil
-}
-func appendZigzag32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := ptr.getInt32Slice()
- for _, v := range s {
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31))))
- }
- return b, nil
-}
-func appendZigzag32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := ptr.getInt32Slice()
- if len(s) == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag&^7|WireBytes)
- // compute size
- n := 0
- for _, v := range s {
- n += SizeVarint(uint64((uint32(v) << 1) ^ uint32((int32(v) >> 31))))
- }
- b = appendVarint(b, uint64(n))
- for _, v := range s {
- b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31))))
- }
- return b, nil
-}
-func appendZigzag64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toInt64()
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63)))
- return b, nil
-}
-func appendZigzag64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toInt64()
- if v == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63)))
- return b, nil
-}
-func appendZigzag64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- p := *ptr.toInt64Ptr()
- if p == nil {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- v := *p
- b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63)))
- return b, nil
-}
-func appendZigzag64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toInt64Slice()
- for _, v := range s {
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63)))
- }
- return b, nil
-}
-func appendZigzag64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toInt64Slice()
- if len(s) == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag&^7|WireBytes)
- // compute size
- n := 0
- for _, v := range s {
- n += SizeVarint(uint64(v<<1) ^ uint64((int64(v) >> 63)))
- }
- b = appendVarint(b, uint64(n))
- for _, v := range s {
- b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63)))
- }
- return b, nil
-}
-func appendBoolValue(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toBool()
- b = appendVarint(b, wiretag)
- if v {
- b = append(b, 1)
- } else {
- b = append(b, 0)
- }
- return b, nil
-}
-func appendBoolValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toBool()
- if !v {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = append(b, 1)
- return b, nil
-}
-
-func appendBoolPtr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- p := *ptr.toBoolPtr()
- if p == nil {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- if *p {
- b = append(b, 1)
- } else {
- b = append(b, 0)
- }
- return b, nil
-}
-func appendBoolSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toBoolSlice()
- for _, v := range s {
- b = appendVarint(b, wiretag)
- if v {
- b = append(b, 1)
- } else {
- b = append(b, 0)
- }
- }
- return b, nil
-}
-func appendBoolPackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toBoolSlice()
- if len(s) == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag&^7|WireBytes)
- b = appendVarint(b, uint64(len(s)))
- for _, v := range s {
- if v {
- b = append(b, 1)
- } else {
- b = append(b, 0)
- }
- }
- return b, nil
-}
-func appendStringValue(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toString()
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(v)))
- b = append(b, v...)
- return b, nil
-}
-func appendStringValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toString()
- if v == "" {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(v)))
- b = append(b, v...)
- return b, nil
-}
-func appendStringPtr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- p := *ptr.toStringPtr()
- if p == nil {
- return b, nil
- }
- v := *p
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(v)))
- b = append(b, v...)
- return b, nil
-}
-func appendStringSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toStringSlice()
- for _, v := range s {
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(v)))
- b = append(b, v...)
- }
- return b, nil
-}
-func appendUTF8StringValue(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- var invalidUTF8 bool
- v := *ptr.toString()
- if !utf8.ValidString(v) {
- invalidUTF8 = true
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(v)))
- b = append(b, v...)
- if invalidUTF8 {
- return b, errInvalidUTF8
- }
- return b, nil
-}
-func appendUTF8StringValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- var invalidUTF8 bool
- v := *ptr.toString()
- if v == "" {
- return b, nil
- }
- if !utf8.ValidString(v) {
- invalidUTF8 = true
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(v)))
- b = append(b, v...)
- if invalidUTF8 {
- return b, errInvalidUTF8
- }
- return b, nil
-}
-func appendUTF8StringPtr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- var invalidUTF8 bool
- p := *ptr.toStringPtr()
- if p == nil {
- return b, nil
- }
- v := *p
- if !utf8.ValidString(v) {
- invalidUTF8 = true
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(v)))
- b = append(b, v...)
- if invalidUTF8 {
- return b, errInvalidUTF8
- }
- return b, nil
-}
-func appendUTF8StringSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- var invalidUTF8 bool
- s := *ptr.toStringSlice()
- for _, v := range s {
- if !utf8.ValidString(v) {
- invalidUTF8 = true
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(v)))
- b = append(b, v...)
- }
- if invalidUTF8 {
- return b, errInvalidUTF8
- }
- return b, nil
-}
-func appendBytes(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toBytes()
- if v == nil {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(v)))
- b = append(b, v...)
- return b, nil
-}
-func appendBytes3(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toBytes()
- if len(v) == 0 {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(v)))
- b = append(b, v...)
- return b, nil
-}
-func appendBytesOneof(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- v := *ptr.toBytes()
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(v)))
- b = append(b, v...)
- return b, nil
-}
-func appendBytesSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
- s := *ptr.toBytesSlice()
- for _, v := range s {
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(v)))
- b = append(b, v...)
- }
- return b, nil
-}
-
-// makeGroupMarshaler returns the sizer and marshaler for a group.
-// u is the marshal info of the underlying message.
-func makeGroupMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- p := ptr.getPointer()
- if p.isNil() {
- return 0
- }
- return u.size(p) + 2*tagsize
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- p := ptr.getPointer()
- if p.isNil() {
- return b, nil
- }
- var err error
- b = appendVarint(b, wiretag) // start group
- b, err = u.marshal(b, p, deterministic)
- b = appendVarint(b, wiretag+(WireEndGroup-WireStartGroup)) // end group
- return b, err
- }
-}
-
-// makeGroupSliceMarshaler returns the sizer and marshaler for a group slice.
-// u is the marshal info of the underlying message.
-func makeGroupSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getPointerSlice()
- n := 0
- for _, v := range s {
- if v.isNil() {
- continue
- }
- n += u.size(v) + 2*tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getPointerSlice()
- var err error
- var nerr nonFatal
- for _, v := range s {
- if v.isNil() {
- return b, errRepeatedHasNil
- }
- b = appendVarint(b, wiretag) // start group
- b, err = u.marshal(b, v, deterministic)
- b = appendVarint(b, wiretag+(WireEndGroup-WireStartGroup)) // end group
- if !nerr.Merge(err) {
- if err == ErrNil {
- err = errRepeatedHasNil
- }
- return b, err
- }
- }
- return b, nerr.E
- }
-}
-
-// makeMessageMarshaler returns the sizer and marshaler for a message field.
-// u is the marshal info of the message.
-func makeMessageMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- p := ptr.getPointer()
- if p.isNil() {
- return 0
- }
- siz := u.size(p)
- return siz + SizeVarint(uint64(siz)) + tagsize
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- p := ptr.getPointer()
- if p.isNil() {
- return b, nil
- }
- b = appendVarint(b, wiretag)
- siz := u.cachedsize(p)
- b = appendVarint(b, uint64(siz))
- return u.marshal(b, p, deterministic)
- }
-}
-
-// makeMessageSliceMarshaler returns the sizer and marshaler for a message slice.
-// u is the marshal info of the message.
-func makeMessageSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getPointerSlice()
- n := 0
- for _, v := range s {
- if v.isNil() {
- continue
- }
- siz := u.size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getPointerSlice()
- var err error
- var nerr nonFatal
- for _, v := range s {
- if v.isNil() {
- return b, errRepeatedHasNil
- }
- b = appendVarint(b, wiretag)
- siz := u.cachedsize(v)
- b = appendVarint(b, uint64(siz))
- b, err = u.marshal(b, v, deterministic)
-
- if !nerr.Merge(err) {
- if err == ErrNil {
- err = errRepeatedHasNil
- }
- return b, err
- }
- }
- return b, nerr.E
- }
-}
-
-// makeMapMarshaler returns the sizer and marshaler for a map field.
-// f is the pointer to the reflect data structure of the field.
-func makeMapMarshaler(f *reflect.StructField) (sizer, marshaler) {
- // figure out key and value type
- t := f.Type
- keyType := t.Key()
- valType := t.Elem()
- tags := strings.Split(f.Tag.Get("protobuf"), ",")
- keyTags := strings.Split(f.Tag.Get("protobuf_key"), ",")
- valTags := strings.Split(f.Tag.Get("protobuf_val"), ",")
- stdOptions := false
- for _, t := range tags {
- if strings.HasPrefix(t, "customtype=") {
- valTags = append(valTags, t)
- }
- if t == "stdtime" {
- valTags = append(valTags, t)
- stdOptions = true
- }
- if t == "stdduration" {
- valTags = append(valTags, t)
- stdOptions = true
- }
- if t == "wktptr" {
- valTags = append(valTags, t)
- }
- }
- keySizer, keyMarshaler := typeMarshaler(keyType, keyTags, false, false) // don't omit zero value in map
- valSizer, valMarshaler := typeMarshaler(valType, valTags, false, false) // don't omit zero value in map
- keyWireTag := 1<<3 | wiretype(keyTags[0])
- valWireTag := 2<<3 | wiretype(valTags[0])
-
- // We create an interface to get the addresses of the map key and value.
- // If value is pointer-typed, the interface is a direct interface, the
- // idata itself is the value. Otherwise, the idata is the pointer to the
- // value.
- // Key cannot be pointer-typed.
- valIsPtr := valType.Kind() == reflect.Ptr
-
- // If value is a message with nested maps, calling
- // valSizer in marshal may be quadratic. We should use
- // cached version in marshal (but not in size).
- // If value is not message type, we don't have size cache,
- // but it cannot be nested either. Just use valSizer.
- valCachedSizer := valSizer
- if valIsPtr && !stdOptions && valType.Elem().Kind() == reflect.Struct {
- u := getMarshalInfo(valType.Elem())
- valCachedSizer = func(ptr pointer, tagsize int) int {
- // Same as message sizer, but use cache.
- p := ptr.getPointer()
- if p.isNil() {
- return 0
- }
- siz := u.cachedsize(p)
- return siz + SizeVarint(uint64(siz)) + tagsize
- }
- }
- return func(ptr pointer, tagsize int) int {
- m := ptr.asPointerTo(t).Elem() // the map
- n := 0
- for _, k := range m.MapKeys() {
- ki := k.Interface()
- vi := m.MapIndex(k).Interface()
- kaddr := toAddrPointer(&ki, false) // pointer to key
- vaddr := toAddrPointer(&vi, valIsPtr) // pointer to value
- siz := keySizer(kaddr, 1) + valSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, tag uint64, deterministic bool) ([]byte, error) {
- m := ptr.asPointerTo(t).Elem() // the map
- var err error
- keys := m.MapKeys()
- if len(keys) > 1 && deterministic {
- sort.Sort(mapKeys(keys))
- }
-
- var nerr nonFatal
- for _, k := range keys {
- ki := k.Interface()
- vi := m.MapIndex(k).Interface()
- kaddr := toAddrPointer(&ki, false) // pointer to key
- vaddr := toAddrPointer(&vi, valIsPtr) // pointer to value
- b = appendVarint(b, tag)
- siz := keySizer(kaddr, 1) + valCachedSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1)
- b = appendVarint(b, uint64(siz))
- b, err = keyMarshaler(b, kaddr, keyWireTag, deterministic)
- if !nerr.Merge(err) {
- return b, err
- }
- b, err = valMarshaler(b, vaddr, valWireTag, deterministic)
- if err != ErrNil && !nerr.Merge(err) { // allow nil value in map
- return b, err
- }
- }
- return b, nerr.E
- }
-}
-
-// makeOneOfMarshaler returns the sizer and marshaler for a oneof field.
-// fi is the marshal info of the field.
-// f is the pointer to the reflect data structure of the field.
-func makeOneOfMarshaler(fi *marshalFieldInfo, f *reflect.StructField) (sizer, marshaler) {
- // Oneof field is an interface. We need to get the actual data type on the fly.
- t := f.Type
- return func(ptr pointer, _ int) int {
- p := ptr.getInterfacePointer()
- if p.isNil() {
- return 0
- }
- v := ptr.asPointerTo(t).Elem().Elem().Elem() // *interface -> interface -> *struct -> struct
- telem := v.Type()
- e := fi.oneofElems[telem]
- return e.sizer(p, e.tagsize)
- },
- func(b []byte, ptr pointer, _ uint64, deterministic bool) ([]byte, error) {
- p := ptr.getInterfacePointer()
- if p.isNil() {
- return b, nil
- }
- v := ptr.asPointerTo(t).Elem().Elem().Elem() // *interface -> interface -> *struct -> struct
- telem := v.Type()
- if telem.Field(0).Type.Kind() == reflect.Ptr && p.getPointer().isNil() {
- return b, errOneofHasNil
- }
- e := fi.oneofElems[telem]
- return e.marshaler(b, p, e.wiretag, deterministic)
- }
-}
-
-// sizeExtensions computes the size of encoded data for a XXX_InternalExtensions field.
-func (u *marshalInfo) sizeExtensions(ext *XXX_InternalExtensions) int {
- m, mu := ext.extensionsRead()
- if m == nil {
- return 0
- }
- mu.Lock()
-
- n := 0
- for _, e := range m {
- if e.value == nil || e.desc == nil {
- // Extension is only in its encoded form.
- n += len(e.enc)
- continue
- }
-
- // We don't skip extensions that have an encoded form set,
- // because the extension value may have been mutated after
- // the last time this function was called.
- ei := u.getExtElemInfo(e.desc)
- v := e.value
- p := toAddrPointer(&v, ei.isptr)
- n += ei.sizer(p, ei.tagsize)
- }
- mu.Unlock()
- return n
-}
-
-// appendExtensions marshals a XXX_InternalExtensions field to the end of byte slice b.
-func (u *marshalInfo) appendExtensions(b []byte, ext *XXX_InternalExtensions, deterministic bool) ([]byte, error) {
- m, mu := ext.extensionsRead()
- if m == nil {
- return b, nil
- }
- mu.Lock()
- defer mu.Unlock()
-
- var err error
- var nerr nonFatal
-
- // Fast-path for common cases: zero or one extensions.
- // Don't bother sorting the keys.
- if len(m) <= 1 {
- for _, e := range m {
- if e.value == nil || e.desc == nil {
- // Extension is only in its encoded form.
- b = append(b, e.enc...)
- continue
- }
-
- // We don't skip extensions that have an encoded form set,
- // because the extension value may have been mutated after
- // the last time this function was called.
-
- ei := u.getExtElemInfo(e.desc)
- v := e.value
- p := toAddrPointer(&v, ei.isptr)
- b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
- if !nerr.Merge(err) {
- return b, err
- }
- }
- return b, nerr.E
- }
-
- // Sort the keys to provide a deterministic encoding.
- // Not sure this is required, but the old code does it.
- keys := make([]int, 0, len(m))
- for k := range m {
- keys = append(keys, int(k))
- }
- sort.Ints(keys)
-
- for _, k := range keys {
- e := m[int32(k)]
- if e.value == nil || e.desc == nil {
- // Extension is only in its encoded form.
- b = append(b, e.enc...)
- continue
- }
-
- // We don't skip extensions that have an encoded form set,
- // because the extension value may have been mutated after
- // the last time this function was called.
-
- ei := u.getExtElemInfo(e.desc)
- v := e.value
- p := toAddrPointer(&v, ei.isptr)
- b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
- if !nerr.Merge(err) {
- return b, err
- }
- }
- return b, nerr.E
-}
-
-// message set format is:
-// message MessageSet {
-// repeated group Item = 1 {
-// required int32 type_id = 2;
-// required string message = 3;
-// };
-// }
-
-// sizeMessageSet computes the size of encoded data for a XXX_InternalExtensions field
-// in message set format (above).
-func (u *marshalInfo) sizeMessageSet(ext *XXX_InternalExtensions) int {
- m, mu := ext.extensionsRead()
- if m == nil {
- return 0
- }
- mu.Lock()
-
- n := 0
- for id, e := range m {
- n += 2 // start group, end group. tag = 1 (size=1)
- n += SizeVarint(uint64(id)) + 1 // type_id, tag = 2 (size=1)
-
- if e.value == nil || e.desc == nil {
- // Extension is only in its encoded form.
- msgWithLen := skipVarint(e.enc) // skip old tag, but leave the length varint
- siz := len(msgWithLen)
- n += siz + 1 // message, tag = 3 (size=1)
- continue
- }
-
- // We don't skip extensions that have an encoded form set,
- // because the extension value may have been mutated after
- // the last time this function was called.
-
- ei := u.getExtElemInfo(e.desc)
- v := e.value
- p := toAddrPointer(&v, ei.isptr)
- n += ei.sizer(p, 1) // message, tag = 3 (size=1)
- }
- mu.Unlock()
- return n
-}
-
-// appendMessageSet marshals a XXX_InternalExtensions field in message set format (above)
-// to the end of byte slice b.
-func (u *marshalInfo) appendMessageSet(b []byte, ext *XXX_InternalExtensions, deterministic bool) ([]byte, error) {
- m, mu := ext.extensionsRead()
- if m == nil {
- return b, nil
- }
- mu.Lock()
- defer mu.Unlock()
-
- var err error
- var nerr nonFatal
-
- // Fast-path for common cases: zero or one extensions.
- // Don't bother sorting the keys.
- if len(m) <= 1 {
- for id, e := range m {
- b = append(b, 1<<3|WireStartGroup)
- b = append(b, 2<<3|WireVarint)
- b = appendVarint(b, uint64(id))
-
- if e.value == nil || e.desc == nil {
- // Extension is only in its encoded form.
- msgWithLen := skipVarint(e.enc) // skip old tag, but leave the length varint
- b = append(b, 3<<3|WireBytes)
- b = append(b, msgWithLen...)
- b = append(b, 1<<3|WireEndGroup)
- continue
- }
-
- // We don't skip extensions that have an encoded form set,
- // because the extension value may have been mutated after
- // the last time this function was called.
-
- ei := u.getExtElemInfo(e.desc)
- v := e.value
- p := toAddrPointer(&v, ei.isptr)
- b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic)
- if !nerr.Merge(err) {
- return b, err
- }
- b = append(b, 1<<3|WireEndGroup)
- }
- return b, nerr.E
- }
-
- // Sort the keys to provide a deterministic encoding.
- keys := make([]int, 0, len(m))
- for k := range m {
- keys = append(keys, int(k))
- }
- sort.Ints(keys)
-
- for _, id := range keys {
- e := m[int32(id)]
- b = append(b, 1<<3|WireStartGroup)
- b = append(b, 2<<3|WireVarint)
- b = appendVarint(b, uint64(id))
-
- if e.value == nil || e.desc == nil {
- // Extension is only in its encoded form.
- msgWithLen := skipVarint(e.enc) // skip old tag, but leave the length varint
- b = append(b, 3<<3|WireBytes)
- b = append(b, msgWithLen...)
- b = append(b, 1<<3|WireEndGroup)
- continue
- }
-
- // We don't skip extensions that have an encoded form set,
- // because the extension value may have been mutated after
- // the last time this function was called.
-
- ei := u.getExtElemInfo(e.desc)
- v := e.value
- p := toAddrPointer(&v, ei.isptr)
- b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic)
- b = append(b, 1<<3|WireEndGroup)
- if !nerr.Merge(err) {
- return b, err
- }
- }
- return b, nerr.E
-}
-
-// sizeV1Extensions computes the size of encoded data for a V1-API extension field.
-func (u *marshalInfo) sizeV1Extensions(m map[int32]Extension) int {
- if m == nil {
- return 0
- }
-
- n := 0
- for _, e := range m {
- if e.value == nil || e.desc == nil {
- // Extension is only in its encoded form.
- n += len(e.enc)
- continue
- }
-
- // We don't skip extensions that have an encoded form set,
- // because the extension value may have been mutated after
- // the last time this function was called.
-
- ei := u.getExtElemInfo(e.desc)
- v := e.value
- p := toAddrPointer(&v, ei.isptr)
- n += ei.sizer(p, ei.tagsize)
- }
- return n
-}
-
-// appendV1Extensions marshals a V1-API extension field to the end of byte slice b.
-func (u *marshalInfo) appendV1Extensions(b []byte, m map[int32]Extension, deterministic bool) ([]byte, error) {
- if m == nil {
- return b, nil
- }
-
- // Sort the keys to provide a deterministic encoding.
- keys := make([]int, 0, len(m))
- for k := range m {
- keys = append(keys, int(k))
- }
- sort.Ints(keys)
-
- var err error
- var nerr nonFatal
- for _, k := range keys {
- e := m[int32(k)]
- if e.value == nil || e.desc == nil {
- // Extension is only in its encoded form.
- b = append(b, e.enc...)
- continue
- }
-
- // We don't skip extensions that have an encoded form set,
- // because the extension value may have been mutated after
- // the last time this function was called.
-
- ei := u.getExtElemInfo(e.desc)
- v := e.value
- p := toAddrPointer(&v, ei.isptr)
- b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
- if !nerr.Merge(err) {
- return b, err
- }
- }
- return b, nerr.E
-}
-
-// newMarshaler is the interface representing objects that can marshal themselves.
-//
-// This exists to support protoc-gen-go generated messages.
-// The proto package will stop type-asserting to this interface in the future.
-//
-// DO NOT DEPEND ON THIS.
-type newMarshaler interface {
- XXX_Size() int
- XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
-}
-
-// Size returns the encoded size of a protocol buffer message.
-// This is the main entry point.
-func Size(pb Message) int {
- if m, ok := pb.(newMarshaler); ok {
- return m.XXX_Size()
- }
- if m, ok := pb.(Marshaler); ok {
- // If the message can marshal itself, let it do it, for compatibility.
- // NOTE: This is not efficient.
- b, _ := m.Marshal()
- return len(b)
- }
- // in case somehow we didn't generate the wrapper
- if pb == nil {
- return 0
- }
- var info InternalMessageInfo
- return info.Size(pb)
-}
-
-// Marshal takes a protocol buffer message
-// and encodes it into the wire format, returning the data.
-// This is the main entry point.
-func Marshal(pb Message) ([]byte, error) {
- if m, ok := pb.(newMarshaler); ok {
- siz := m.XXX_Size()
- b := make([]byte, 0, siz)
- return m.XXX_Marshal(b, false)
- }
- if m, ok := pb.(Marshaler); ok {
- // If the message can marshal itself, let it do it, for compatibility.
- // NOTE: This is not efficient.
- return m.Marshal()
- }
- // in case somehow we didn't generate the wrapper
- if pb == nil {
- return nil, ErrNil
- }
- var info InternalMessageInfo
- siz := info.Size(pb)
- b := make([]byte, 0, siz)
- return info.Marshal(b, pb, false)
-}
-
-// Marshal takes a protocol buffer message
-// and encodes it into the wire format, writing the result to the
-// Buffer.
-// This is an alternative entry point. It is not necessary to use
-// a Buffer for most applications.
-func (p *Buffer) Marshal(pb Message) error {
- var err error
- if p.deterministic {
- if _, ok := pb.(Marshaler); ok {
- return fmt.Errorf("proto: deterministic not supported by the Marshal method of %T", pb)
- }
- }
- if m, ok := pb.(newMarshaler); ok {
- siz := m.XXX_Size()
- p.grow(siz) // make sure buf has enough capacity
- pp := p.buf[len(p.buf) : len(p.buf) : len(p.buf)+siz]
- pp, err = m.XXX_Marshal(pp, p.deterministic)
- p.buf = append(p.buf, pp...)
- return err
- }
- if m, ok := pb.(Marshaler); ok {
- // If the message can marshal itself, let it do it, for compatibility.
- // NOTE: This is not efficient.
- var b []byte
- b, err = m.Marshal()
- p.buf = append(p.buf, b...)
- return err
- }
- // in case somehow we didn't generate the wrapper
- if pb == nil {
- return ErrNil
- }
- var info InternalMessageInfo
- siz := info.Size(pb)
- p.grow(siz) // make sure buf has enough capacity
- p.buf, err = info.Marshal(p.buf, pb, p.deterministic)
- return err
-}
-
-// grow grows the buffer's capacity, if necessary, to guarantee space for
-// another n bytes. After grow(n), at least n bytes can be written to the
-// buffer without another allocation.
-func (p *Buffer) grow(n int) {
- need := len(p.buf) + n
- if need <= cap(p.buf) {
- return
- }
- newCap := len(p.buf) * 2
- if newCap < need {
- newCap = need
- }
- p.buf = append(make([]byte, 0, newCap), p.buf...)
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/table_marshal_gogo.go b/api/vendor/github.com/gogo/protobuf/proto/table_marshal_gogo.go
deleted file mode 100644
index 997f57c1e102..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/table_marshal_gogo.go
+++ /dev/null
@@ -1,388 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2018, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-//
-// 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
-// OWNER 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.
-
-package proto
-
-import (
- "reflect"
- "time"
-)
-
-// makeMessageRefMarshaler differs a bit from makeMessageMarshaler
-// It marshal a message T instead of a *T
-func makeMessageRefMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- siz := u.size(ptr)
- return siz + SizeVarint(uint64(siz)) + tagsize
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- b = appendVarint(b, wiretag)
- siz := u.cachedsize(ptr)
- b = appendVarint(b, uint64(siz))
- return u.marshal(b, ptr, deterministic)
- }
-}
-
-// makeMessageRefSliceMarshaler differs quite a lot from makeMessageSliceMarshaler
-// It marshals a slice of messages []T instead of []*T
-func makeMessageRefSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(u.typ)
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- e := elem.Interface()
- v := toAddrPointer(&e, false)
- siz := u.size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(u.typ)
- var err, errreq error
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- e := elem.Interface()
- v := toAddrPointer(&e, false)
- b = appendVarint(b, wiretag)
- siz := u.size(v)
- b = appendVarint(b, uint64(siz))
- b, err = u.marshal(b, v, deterministic)
-
- if err != nil {
- if _, ok := err.(*RequiredNotSetError); ok {
- // Required field in submessage is not set.
- // We record the error but keep going, to give a complete marshaling.
- if errreq == nil {
- errreq = err
- }
- continue
- }
- if err == ErrNil {
- err = errRepeatedHasNil
- }
- return b, err
- }
- }
-
- return b, errreq
- }
-}
-
-func makeCustomPtrMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- if ptr.isNil() {
- return 0
- }
- m := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(custom)
- siz := m.Size()
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- if ptr.isNil() {
- return b, nil
- }
- m := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(custom)
- siz := m.Size()
- buf, err := m.Marshal()
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeCustomMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- m := ptr.asPointerTo(u.typ).Interface().(custom)
- siz := m.Size()
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- m := ptr.asPointerTo(u.typ).Interface().(custom)
- siz := m.Size()
- buf, err := m.Marshal()
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeTimeMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- t := ptr.asPointerTo(u.typ).Interface().(*time.Time)
- ts, err := timestampProto(*t)
- if err != nil {
- return 0
- }
- siz := Size(ts)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- t := ptr.asPointerTo(u.typ).Interface().(*time.Time)
- ts, err := timestampProto(*t)
- if err != nil {
- return nil, err
- }
- buf, err := Marshal(ts)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeTimePtrMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- if ptr.isNil() {
- return 0
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*time.Time)
- ts, err := timestampProto(*t)
- if err != nil {
- return 0
- }
- siz := Size(ts)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- if ptr.isNil() {
- return b, nil
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*time.Time)
- ts, err := timestampProto(*t)
- if err != nil {
- return nil, err
- }
- buf, err := Marshal(ts)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeTimeSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(u.typ)
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(time.Time)
- ts, err := timestampProto(t)
- if err != nil {
- return 0
- }
- siz := Size(ts)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(u.typ)
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(time.Time)
- ts, err := timestampProto(t)
- if err != nil {
- return nil, err
- }
- siz := Size(ts)
- buf, err := Marshal(ts)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeTimePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*time.Time)
- ts, err := timestampProto(*t)
- if err != nil {
- return 0
- }
- siz := Size(ts)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*time.Time)
- ts, err := timestampProto(*t)
- if err != nil {
- return nil, err
- }
- siz := Size(ts)
- buf, err := Marshal(ts)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeDurationMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- d := ptr.asPointerTo(u.typ).Interface().(*time.Duration)
- dur := durationProto(*d)
- siz := Size(dur)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- d := ptr.asPointerTo(u.typ).Interface().(*time.Duration)
- dur := durationProto(*d)
- buf, err := Marshal(dur)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeDurationPtrMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- if ptr.isNil() {
- return 0
- }
- d := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*time.Duration)
- dur := durationProto(*d)
- siz := Size(dur)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- if ptr.isNil() {
- return b, nil
- }
- d := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*time.Duration)
- dur := durationProto(*d)
- buf, err := Marshal(dur)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeDurationSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(u.typ)
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- d := elem.Interface().(time.Duration)
- dur := durationProto(d)
- siz := Size(dur)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(u.typ)
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- d := elem.Interface().(time.Duration)
- dur := durationProto(d)
- siz := Size(dur)
- buf, err := Marshal(dur)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeDurationPtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- d := elem.Interface().(*time.Duration)
- dur := durationProto(*d)
- siz := Size(dur)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- d := elem.Interface().(*time.Duration)
- dur := durationProto(*d)
- siz := Size(dur)
- buf, err := Marshal(dur)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/table_merge.go b/api/vendor/github.com/gogo/protobuf/proto/table_merge.go
deleted file mode 100644
index 60dcf70d1e6c..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/table_merge.go
+++ /dev/null
@@ -1,676 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2016 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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
-// OWNER 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.
-
-package proto
-
-import (
- "fmt"
- "reflect"
- "strings"
- "sync"
- "sync/atomic"
-)
-
-// Merge merges the src message into dst.
-// This assumes that dst and src of the same type and are non-nil.
-func (a *InternalMessageInfo) Merge(dst, src Message) {
- mi := atomicLoadMergeInfo(&a.merge)
- if mi == nil {
- mi = getMergeInfo(reflect.TypeOf(dst).Elem())
- atomicStoreMergeInfo(&a.merge, mi)
- }
- mi.merge(toPointer(&dst), toPointer(&src))
-}
-
-type mergeInfo struct {
- typ reflect.Type
-
- initialized int32 // 0: only typ is valid, 1: everything is valid
- lock sync.Mutex
-
- fields []mergeFieldInfo
- unrecognized field // Offset of XXX_unrecognized
-}
-
-type mergeFieldInfo struct {
- field field // Offset of field, guaranteed to be valid
-
- // isPointer reports whether the value in the field is a pointer.
- // This is true for the following situations:
- // * Pointer to struct
- // * Pointer to basic type (proto2 only)
- // * Slice (first value in slice header is a pointer)
- // * String (first value in string header is a pointer)
- isPointer bool
-
- // basicWidth reports the width of the field assuming that it is directly
- // embedded in the struct (as is the case for basic types in proto3).
- // The possible values are:
- // 0: invalid
- // 1: bool
- // 4: int32, uint32, float32
- // 8: int64, uint64, float64
- basicWidth int
-
- // Where dst and src are pointers to the types being merged.
- merge func(dst, src pointer)
-}
-
-var (
- mergeInfoMap = map[reflect.Type]*mergeInfo{}
- mergeInfoLock sync.Mutex
-)
-
-func getMergeInfo(t reflect.Type) *mergeInfo {
- mergeInfoLock.Lock()
- defer mergeInfoLock.Unlock()
- mi := mergeInfoMap[t]
- if mi == nil {
- mi = &mergeInfo{typ: t}
- mergeInfoMap[t] = mi
- }
- return mi
-}
-
-// merge merges src into dst assuming they are both of type *mi.typ.
-func (mi *mergeInfo) merge(dst, src pointer) {
- if dst.isNil() {
- panic("proto: nil destination")
- }
- if src.isNil() {
- return // Nothing to do.
- }
-
- if atomic.LoadInt32(&mi.initialized) == 0 {
- mi.computeMergeInfo()
- }
-
- for _, fi := range mi.fields {
- sfp := src.offset(fi.field)
-
- // As an optimization, we can avoid the merge function call cost
- // if we know for sure that the source will have no effect
- // by checking if it is the zero value.
- if unsafeAllowed {
- if fi.isPointer && sfp.getPointer().isNil() { // Could be slice or string
- continue
- }
- if fi.basicWidth > 0 {
- switch {
- case fi.basicWidth == 1 && !*sfp.toBool():
- continue
- case fi.basicWidth == 4 && *sfp.toUint32() == 0:
- continue
- case fi.basicWidth == 8 && *sfp.toUint64() == 0:
- continue
- }
- }
- }
-
- dfp := dst.offset(fi.field)
- fi.merge(dfp, sfp)
- }
-
- // TODO: Make this faster?
- out := dst.asPointerTo(mi.typ).Elem()
- in := src.asPointerTo(mi.typ).Elem()
- if emIn, err := extendable(in.Addr().Interface()); err == nil {
- emOut, _ := extendable(out.Addr().Interface())
- mIn, muIn := emIn.extensionsRead()
- if mIn != nil {
- mOut := emOut.extensionsWrite()
- muIn.Lock()
- mergeExtension(mOut, mIn)
- muIn.Unlock()
- }
- }
-
- if mi.unrecognized.IsValid() {
- if b := *src.offset(mi.unrecognized).toBytes(); len(b) > 0 {
- *dst.offset(mi.unrecognized).toBytes() = append([]byte(nil), b...)
- }
- }
-}
-
-func (mi *mergeInfo) computeMergeInfo() {
- mi.lock.Lock()
- defer mi.lock.Unlock()
- if mi.initialized != 0 {
- return
- }
- t := mi.typ
- n := t.NumField()
-
- props := GetProperties(t)
- for i := 0; i < n; i++ {
- f := t.Field(i)
- if strings.HasPrefix(f.Name, "XXX_") {
- continue
- }
-
- mfi := mergeFieldInfo{field: toField(&f)}
- tf := f.Type
-
- // As an optimization, we can avoid the merge function call cost
- // if we know for sure that the source will have no effect
- // by checking if it is the zero value.
- if unsafeAllowed {
- switch tf.Kind() {
- case reflect.Ptr, reflect.Slice, reflect.String:
- // As a special case, we assume slices and strings are pointers
- // since we know that the first field in the SliceSlice or
- // StringHeader is a data pointer.
- mfi.isPointer = true
- case reflect.Bool:
- mfi.basicWidth = 1
- case reflect.Int32, reflect.Uint32, reflect.Float32:
- mfi.basicWidth = 4
- case reflect.Int64, reflect.Uint64, reflect.Float64:
- mfi.basicWidth = 8
- }
- }
-
- // Unwrap tf to get at its most basic type.
- var isPointer, isSlice bool
- if tf.Kind() == reflect.Slice && tf.Elem().Kind() != reflect.Uint8 {
- isSlice = true
- tf = tf.Elem()
- }
- if tf.Kind() == reflect.Ptr {
- isPointer = true
- tf = tf.Elem()
- }
- if isPointer && isSlice && tf.Kind() != reflect.Struct {
- panic("both pointer and slice for basic type in " + tf.Name())
- }
-
- switch tf.Kind() {
- case reflect.Int32:
- switch {
- case isSlice: // E.g., []int32
- mfi.merge = func(dst, src pointer) {
- // NOTE: toInt32Slice is not defined (see pointer_reflect.go).
- /*
- sfsp := src.toInt32Slice()
- if *sfsp != nil {
- dfsp := dst.toInt32Slice()
- *dfsp = append(*dfsp, *sfsp...)
- if *dfsp == nil {
- *dfsp = []int64{}
- }
- }
- */
- sfs := src.getInt32Slice()
- if sfs != nil {
- dfs := dst.getInt32Slice()
- dfs = append(dfs, sfs...)
- if dfs == nil {
- dfs = []int32{}
- }
- dst.setInt32Slice(dfs)
- }
- }
- case isPointer: // E.g., *int32
- mfi.merge = func(dst, src pointer) {
- // NOTE: toInt32Ptr is not defined (see pointer_reflect.go).
- /*
- sfpp := src.toInt32Ptr()
- if *sfpp != nil {
- dfpp := dst.toInt32Ptr()
- if *dfpp == nil {
- *dfpp = Int32(**sfpp)
- } else {
- **dfpp = **sfpp
- }
- }
- */
- sfp := src.getInt32Ptr()
- if sfp != nil {
- dfp := dst.getInt32Ptr()
- if dfp == nil {
- dst.setInt32Ptr(*sfp)
- } else {
- *dfp = *sfp
- }
- }
- }
- default: // E.g., int32
- mfi.merge = func(dst, src pointer) {
- if v := *src.toInt32(); v != 0 {
- *dst.toInt32() = v
- }
- }
- }
- case reflect.Int64:
- switch {
- case isSlice: // E.g., []int64
- mfi.merge = func(dst, src pointer) {
- sfsp := src.toInt64Slice()
- if *sfsp != nil {
- dfsp := dst.toInt64Slice()
- *dfsp = append(*dfsp, *sfsp...)
- if *dfsp == nil {
- *dfsp = []int64{}
- }
- }
- }
- case isPointer: // E.g., *int64
- mfi.merge = func(dst, src pointer) {
- sfpp := src.toInt64Ptr()
- if *sfpp != nil {
- dfpp := dst.toInt64Ptr()
- if *dfpp == nil {
- *dfpp = Int64(**sfpp)
- } else {
- **dfpp = **sfpp
- }
- }
- }
- default: // E.g., int64
- mfi.merge = func(dst, src pointer) {
- if v := *src.toInt64(); v != 0 {
- *dst.toInt64() = v
- }
- }
- }
- case reflect.Uint32:
- switch {
- case isSlice: // E.g., []uint32
- mfi.merge = func(dst, src pointer) {
- sfsp := src.toUint32Slice()
- if *sfsp != nil {
- dfsp := dst.toUint32Slice()
- *dfsp = append(*dfsp, *sfsp...)
- if *dfsp == nil {
- *dfsp = []uint32{}
- }
- }
- }
- case isPointer: // E.g., *uint32
- mfi.merge = func(dst, src pointer) {
- sfpp := src.toUint32Ptr()
- if *sfpp != nil {
- dfpp := dst.toUint32Ptr()
- if *dfpp == nil {
- *dfpp = Uint32(**sfpp)
- } else {
- **dfpp = **sfpp
- }
- }
- }
- default: // E.g., uint32
- mfi.merge = func(dst, src pointer) {
- if v := *src.toUint32(); v != 0 {
- *dst.toUint32() = v
- }
- }
- }
- case reflect.Uint64:
- switch {
- case isSlice: // E.g., []uint64
- mfi.merge = func(dst, src pointer) {
- sfsp := src.toUint64Slice()
- if *sfsp != nil {
- dfsp := dst.toUint64Slice()
- *dfsp = append(*dfsp, *sfsp...)
- if *dfsp == nil {
- *dfsp = []uint64{}
- }
- }
- }
- case isPointer: // E.g., *uint64
- mfi.merge = func(dst, src pointer) {
- sfpp := src.toUint64Ptr()
- if *sfpp != nil {
- dfpp := dst.toUint64Ptr()
- if *dfpp == nil {
- *dfpp = Uint64(**sfpp)
- } else {
- **dfpp = **sfpp
- }
- }
- }
- default: // E.g., uint64
- mfi.merge = func(dst, src pointer) {
- if v := *src.toUint64(); v != 0 {
- *dst.toUint64() = v
- }
- }
- }
- case reflect.Float32:
- switch {
- case isSlice: // E.g., []float32
- mfi.merge = func(dst, src pointer) {
- sfsp := src.toFloat32Slice()
- if *sfsp != nil {
- dfsp := dst.toFloat32Slice()
- *dfsp = append(*dfsp, *sfsp...)
- if *dfsp == nil {
- *dfsp = []float32{}
- }
- }
- }
- case isPointer: // E.g., *float32
- mfi.merge = func(dst, src pointer) {
- sfpp := src.toFloat32Ptr()
- if *sfpp != nil {
- dfpp := dst.toFloat32Ptr()
- if *dfpp == nil {
- *dfpp = Float32(**sfpp)
- } else {
- **dfpp = **sfpp
- }
- }
- }
- default: // E.g., float32
- mfi.merge = func(dst, src pointer) {
- if v := *src.toFloat32(); v != 0 {
- *dst.toFloat32() = v
- }
- }
- }
- case reflect.Float64:
- switch {
- case isSlice: // E.g., []float64
- mfi.merge = func(dst, src pointer) {
- sfsp := src.toFloat64Slice()
- if *sfsp != nil {
- dfsp := dst.toFloat64Slice()
- *dfsp = append(*dfsp, *sfsp...)
- if *dfsp == nil {
- *dfsp = []float64{}
- }
- }
- }
- case isPointer: // E.g., *float64
- mfi.merge = func(dst, src pointer) {
- sfpp := src.toFloat64Ptr()
- if *sfpp != nil {
- dfpp := dst.toFloat64Ptr()
- if *dfpp == nil {
- *dfpp = Float64(**sfpp)
- } else {
- **dfpp = **sfpp
- }
- }
- }
- default: // E.g., float64
- mfi.merge = func(dst, src pointer) {
- if v := *src.toFloat64(); v != 0 {
- *dst.toFloat64() = v
- }
- }
- }
- case reflect.Bool:
- switch {
- case isSlice: // E.g., []bool
- mfi.merge = func(dst, src pointer) {
- sfsp := src.toBoolSlice()
- if *sfsp != nil {
- dfsp := dst.toBoolSlice()
- *dfsp = append(*dfsp, *sfsp...)
- if *dfsp == nil {
- *dfsp = []bool{}
- }
- }
- }
- case isPointer: // E.g., *bool
- mfi.merge = func(dst, src pointer) {
- sfpp := src.toBoolPtr()
- if *sfpp != nil {
- dfpp := dst.toBoolPtr()
- if *dfpp == nil {
- *dfpp = Bool(**sfpp)
- } else {
- **dfpp = **sfpp
- }
- }
- }
- default: // E.g., bool
- mfi.merge = func(dst, src pointer) {
- if v := *src.toBool(); v {
- *dst.toBool() = v
- }
- }
- }
- case reflect.String:
- switch {
- case isSlice: // E.g., []string
- mfi.merge = func(dst, src pointer) {
- sfsp := src.toStringSlice()
- if *sfsp != nil {
- dfsp := dst.toStringSlice()
- *dfsp = append(*dfsp, *sfsp...)
- if *dfsp == nil {
- *dfsp = []string{}
- }
- }
- }
- case isPointer: // E.g., *string
- mfi.merge = func(dst, src pointer) {
- sfpp := src.toStringPtr()
- if *sfpp != nil {
- dfpp := dst.toStringPtr()
- if *dfpp == nil {
- *dfpp = String(**sfpp)
- } else {
- **dfpp = **sfpp
- }
- }
- }
- default: // E.g., string
- mfi.merge = func(dst, src pointer) {
- if v := *src.toString(); v != "" {
- *dst.toString() = v
- }
- }
- }
- case reflect.Slice:
- isProto3 := props.Prop[i].proto3
- switch {
- case isPointer:
- panic("bad pointer in byte slice case in " + tf.Name())
- case tf.Elem().Kind() != reflect.Uint8:
- panic("bad element kind in byte slice case in " + tf.Name())
- case isSlice: // E.g., [][]byte
- mfi.merge = func(dst, src pointer) {
- sbsp := src.toBytesSlice()
- if *sbsp != nil {
- dbsp := dst.toBytesSlice()
- for _, sb := range *sbsp {
- if sb == nil {
- *dbsp = append(*dbsp, nil)
- } else {
- *dbsp = append(*dbsp, append([]byte{}, sb...))
- }
- }
- if *dbsp == nil {
- *dbsp = [][]byte{}
- }
- }
- }
- default: // E.g., []byte
- mfi.merge = func(dst, src pointer) {
- sbp := src.toBytes()
- if *sbp != nil {
- dbp := dst.toBytes()
- if !isProto3 || len(*sbp) > 0 {
- *dbp = append([]byte{}, *sbp...)
- }
- }
- }
- }
- case reflect.Struct:
- switch {
- case isSlice && !isPointer: // E.g. []pb.T
- mergeInfo := getMergeInfo(tf)
- zero := reflect.Zero(tf)
- mfi.merge = func(dst, src pointer) {
- // TODO: Make this faster?
- dstsp := dst.asPointerTo(f.Type)
- dsts := dstsp.Elem()
- srcs := src.asPointerTo(f.Type).Elem()
- for i := 0; i < srcs.Len(); i++ {
- dsts = reflect.Append(dsts, zero)
- srcElement := srcs.Index(i).Addr()
- dstElement := dsts.Index(dsts.Len() - 1).Addr()
- mergeInfo.merge(valToPointer(dstElement), valToPointer(srcElement))
- }
- if dsts.IsNil() {
- dsts = reflect.MakeSlice(f.Type, 0, 0)
- }
- dstsp.Elem().Set(dsts)
- }
- case !isPointer:
- mergeInfo := getMergeInfo(tf)
- mfi.merge = func(dst, src pointer) {
- mergeInfo.merge(dst, src)
- }
- case isSlice: // E.g., []*pb.T
- mergeInfo := getMergeInfo(tf)
- mfi.merge = func(dst, src pointer) {
- sps := src.getPointerSlice()
- if sps != nil {
- dps := dst.getPointerSlice()
- for _, sp := range sps {
- var dp pointer
- if !sp.isNil() {
- dp = valToPointer(reflect.New(tf))
- mergeInfo.merge(dp, sp)
- }
- dps = append(dps, dp)
- }
- if dps == nil {
- dps = []pointer{}
- }
- dst.setPointerSlice(dps)
- }
- }
- default: // E.g., *pb.T
- mergeInfo := getMergeInfo(tf)
- mfi.merge = func(dst, src pointer) {
- sp := src.getPointer()
- if !sp.isNil() {
- dp := dst.getPointer()
- if dp.isNil() {
- dp = valToPointer(reflect.New(tf))
- dst.setPointer(dp)
- }
- mergeInfo.merge(dp, sp)
- }
- }
- }
- case reflect.Map:
- switch {
- case isPointer || isSlice:
- panic("bad pointer or slice in map case in " + tf.Name())
- default: // E.g., map[K]V
- mfi.merge = func(dst, src pointer) {
- sm := src.asPointerTo(tf).Elem()
- if sm.Len() == 0 {
- return
- }
- dm := dst.asPointerTo(tf).Elem()
- if dm.IsNil() {
- dm.Set(reflect.MakeMap(tf))
- }
-
- switch tf.Elem().Kind() {
- case reflect.Ptr: // Proto struct (e.g., *T)
- for _, key := range sm.MapKeys() {
- val := sm.MapIndex(key)
- val = reflect.ValueOf(Clone(val.Interface().(Message)))
- dm.SetMapIndex(key, val)
- }
- case reflect.Slice: // E.g. Bytes type (e.g., []byte)
- for _, key := range sm.MapKeys() {
- val := sm.MapIndex(key)
- val = reflect.ValueOf(append([]byte{}, val.Bytes()...))
- dm.SetMapIndex(key, val)
- }
- default: // Basic type (e.g., string)
- for _, key := range sm.MapKeys() {
- val := sm.MapIndex(key)
- dm.SetMapIndex(key, val)
- }
- }
- }
- }
- case reflect.Interface:
- // Must be oneof field.
- switch {
- case isPointer || isSlice:
- panic("bad pointer or slice in interface case in " + tf.Name())
- default: // E.g., interface{}
- // TODO: Make this faster?
- mfi.merge = func(dst, src pointer) {
- su := src.asPointerTo(tf).Elem()
- if !su.IsNil() {
- du := dst.asPointerTo(tf).Elem()
- typ := su.Elem().Type()
- if du.IsNil() || du.Elem().Type() != typ {
- du.Set(reflect.New(typ.Elem())) // Initialize interface if empty
- }
- sv := su.Elem().Elem().Field(0)
- if sv.Kind() == reflect.Ptr && sv.IsNil() {
- return
- }
- dv := du.Elem().Elem().Field(0)
- if dv.Kind() == reflect.Ptr && dv.IsNil() {
- dv.Set(reflect.New(sv.Type().Elem())) // Initialize proto message if empty
- }
- switch sv.Type().Kind() {
- case reflect.Ptr: // Proto struct (e.g., *T)
- Merge(dv.Interface().(Message), sv.Interface().(Message))
- case reflect.Slice: // E.g. Bytes type (e.g., []byte)
- dv.Set(reflect.ValueOf(append([]byte{}, sv.Bytes()...)))
- default: // Basic type (e.g., string)
- dv.Set(sv)
- }
- }
- }
- }
- default:
- panic(fmt.Sprintf("merger not found for type:%s", tf))
- }
- mi.fields = append(mi.fields, mfi)
- }
-
- mi.unrecognized = invalidField
- if f, ok := t.FieldByName("XXX_unrecognized"); ok {
- if f.Type != reflect.TypeOf([]byte{}) {
- panic("expected XXX_unrecognized to be of type []byte")
- }
- mi.unrecognized = toField(&f)
- }
-
- atomic.StoreInt32(&mi.initialized, 1)
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/table_unmarshal.go b/api/vendor/github.com/gogo/protobuf/proto/table_unmarshal.go
deleted file mode 100644
index 937229386a27..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/table_unmarshal.go
+++ /dev/null
@@ -1,2249 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2016 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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
-// OWNER 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.
-
-package proto
-
-import (
- "errors"
- "fmt"
- "io"
- "math"
- "reflect"
- "strconv"
- "strings"
- "sync"
- "sync/atomic"
- "unicode/utf8"
-)
-
-// Unmarshal is the entry point from the generated .pb.go files.
-// This function is not intended to be used by non-generated code.
-// This function is not subject to any compatibility guarantee.
-// msg contains a pointer to a protocol buffer struct.
-// b is the data to be unmarshaled into the protocol buffer.
-// a is a pointer to a place to store cached unmarshal information.
-func (a *InternalMessageInfo) Unmarshal(msg Message, b []byte) error {
- // Load the unmarshal information for this message type.
- // The atomic load ensures memory consistency.
- u := atomicLoadUnmarshalInfo(&a.unmarshal)
- if u == nil {
- // Slow path: find unmarshal info for msg, update a with it.
- u = getUnmarshalInfo(reflect.TypeOf(msg).Elem())
- atomicStoreUnmarshalInfo(&a.unmarshal, u)
- }
- // Then do the unmarshaling.
- err := u.unmarshal(toPointer(&msg), b)
- return err
-}
-
-type unmarshalInfo struct {
- typ reflect.Type // type of the protobuf struct
-
- // 0 = only typ field is initialized
- // 1 = completely initialized
- initialized int32
- lock sync.Mutex // prevents double initialization
- dense []unmarshalFieldInfo // fields indexed by tag #
- sparse map[uint64]unmarshalFieldInfo // fields indexed by tag #
- reqFields []string // names of required fields
- reqMask uint64 // 1< 0 {
- // Read tag and wire type.
- // Special case 1 and 2 byte varints.
- var x uint64
- if b[0] < 128 {
- x = uint64(b[0])
- b = b[1:]
- } else if len(b) >= 2 && b[1] < 128 {
- x = uint64(b[0]&0x7f) + uint64(b[1])<<7
- b = b[2:]
- } else {
- var n int
- x, n = decodeVarint(b)
- if n == 0 {
- return io.ErrUnexpectedEOF
- }
- b = b[n:]
- }
- tag := x >> 3
- wire := int(x) & 7
-
- // Dispatch on the tag to one of the unmarshal* functions below.
- var f unmarshalFieldInfo
- if tag < uint64(len(u.dense)) {
- f = u.dense[tag]
- } else {
- f = u.sparse[tag]
- }
- if fn := f.unmarshal; fn != nil {
- var err error
- b, err = fn(b, m.offset(f.field), wire)
- if err == nil {
- reqMask |= f.reqMask
- continue
- }
- if r, ok := err.(*RequiredNotSetError); ok {
- // Remember this error, but keep parsing. We need to produce
- // a full parse even if a required field is missing.
- if errLater == nil {
- errLater = r
- }
- reqMask |= f.reqMask
- continue
- }
- if err != errInternalBadWireType {
- if err == errInvalidUTF8 {
- if errLater == nil {
- fullName := revProtoTypes[reflect.PtrTo(u.typ)] + "." + f.name
- errLater = &invalidUTF8Error{fullName}
- }
- continue
- }
- return err
- }
- // Fragments with bad wire type are treated as unknown fields.
- }
-
- // Unknown tag.
- if !u.unrecognized.IsValid() {
- // Don't keep unrecognized data; just skip it.
- var err error
- b, err = skipField(b, wire)
- if err != nil {
- return err
- }
- continue
- }
- // Keep unrecognized data around.
- // maybe in extensions, maybe in the unrecognized field.
- z := m.offset(u.unrecognized).toBytes()
- var emap map[int32]Extension
- var e Extension
- for _, r := range u.extensionRanges {
- if uint64(r.Start) <= tag && tag <= uint64(r.End) {
- if u.extensions.IsValid() {
- mp := m.offset(u.extensions).toExtensions()
- emap = mp.extensionsWrite()
- e = emap[int32(tag)]
- z = &e.enc
- break
- }
- if u.oldExtensions.IsValid() {
- p := m.offset(u.oldExtensions).toOldExtensions()
- emap = *p
- if emap == nil {
- emap = map[int32]Extension{}
- *p = emap
- }
- e = emap[int32(tag)]
- z = &e.enc
- break
- }
- if u.bytesExtensions.IsValid() {
- z = m.offset(u.bytesExtensions).toBytes()
- break
- }
- panic("no extensions field available")
- }
- }
- // Use wire type to skip data.
- var err error
- b0 := b
- b, err = skipField(b, wire)
- if err != nil {
- return err
- }
- *z = encodeVarint(*z, tag<<3|uint64(wire))
- *z = append(*z, b0[:len(b0)-len(b)]...)
-
- if emap != nil {
- emap[int32(tag)] = e
- }
- }
- if reqMask != u.reqMask && errLater == nil {
- // A required field of this message is missing.
- for _, n := range u.reqFields {
- if reqMask&1 == 0 {
- errLater = &RequiredNotSetError{n}
- }
- reqMask >>= 1
- }
- }
- return errLater
-}
-
-// computeUnmarshalInfo fills in u with information for use
-// in unmarshaling protocol buffers of type u.typ.
-func (u *unmarshalInfo) computeUnmarshalInfo() {
- u.lock.Lock()
- defer u.lock.Unlock()
- if u.initialized != 0 {
- return
- }
- t := u.typ
- n := t.NumField()
-
- // Set up the "not found" value for the unrecognized byte buffer.
- // This is the default for proto3.
- u.unrecognized = invalidField
- u.extensions = invalidField
- u.oldExtensions = invalidField
- u.bytesExtensions = invalidField
-
- // List of the generated type and offset for each oneof field.
- type oneofField struct {
- ityp reflect.Type // interface type of oneof field
- field field // offset in containing message
- }
- var oneofFields []oneofField
-
- for i := 0; i < n; i++ {
- f := t.Field(i)
- if f.Name == "XXX_unrecognized" {
- // The byte slice used to hold unrecognized input is special.
- if f.Type != reflect.TypeOf(([]byte)(nil)) {
- panic("bad type for XXX_unrecognized field: " + f.Type.Name())
- }
- u.unrecognized = toField(&f)
- continue
- }
- if f.Name == "XXX_InternalExtensions" {
- // Ditto here.
- if f.Type != reflect.TypeOf(XXX_InternalExtensions{}) {
- panic("bad type for XXX_InternalExtensions field: " + f.Type.Name())
- }
- u.extensions = toField(&f)
- if f.Tag.Get("protobuf_messageset") == "1" {
- u.isMessageSet = true
- }
- continue
- }
- if f.Name == "XXX_extensions" {
- // An older form of the extensions field.
- if f.Type == reflect.TypeOf((map[int32]Extension)(nil)) {
- u.oldExtensions = toField(&f)
- continue
- } else if f.Type == reflect.TypeOf(([]byte)(nil)) {
- u.bytesExtensions = toField(&f)
- continue
- }
- panic("bad type for XXX_extensions field: " + f.Type.Name())
- }
- if f.Name == "XXX_NoUnkeyedLiteral" || f.Name == "XXX_sizecache" {
- continue
- }
-
- oneof := f.Tag.Get("protobuf_oneof")
- if oneof != "" {
- oneofFields = append(oneofFields, oneofField{f.Type, toField(&f)})
- // The rest of oneof processing happens below.
- continue
- }
-
- tags := f.Tag.Get("protobuf")
- tagArray := strings.Split(tags, ",")
- if len(tagArray) < 2 {
- panic("protobuf tag not enough fields in " + t.Name() + "." + f.Name + ": " + tags)
- }
- tag, err := strconv.Atoi(tagArray[1])
- if err != nil {
- panic("protobuf tag field not an integer: " + tagArray[1])
- }
-
- name := ""
- for _, tag := range tagArray[3:] {
- if strings.HasPrefix(tag, "name=") {
- name = tag[5:]
- }
- }
-
- // Extract unmarshaling function from the field (its type and tags).
- unmarshal := fieldUnmarshaler(&f)
-
- // Required field?
- var reqMask uint64
- if tagArray[2] == "req" {
- bit := len(u.reqFields)
- u.reqFields = append(u.reqFields, name)
- reqMask = uint64(1) << uint(bit)
- // TODO: if we have more than 64 required fields, we end up
- // not verifying that all required fields are present.
- // Fix this, perhaps using a count of required fields?
- }
-
- // Store the info in the correct slot in the message.
- u.setTag(tag, toField(&f), unmarshal, reqMask, name)
- }
-
- // Find any types associated with oneof fields.
- // gogo: len(oneofFields) > 0 is needed for embedded oneof messages, without a marshaler and unmarshaler
- if len(oneofFields) > 0 {
- var oneofImplementers []interface{}
- switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) {
- case oneofFuncsIface:
- _, _, _, oneofImplementers = m.XXX_OneofFuncs()
- case oneofWrappersIface:
- oneofImplementers = m.XXX_OneofWrappers()
- }
- for _, v := range oneofImplementers {
- tptr := reflect.TypeOf(v) // *Msg_X
- typ := tptr.Elem() // Msg_X
-
- f := typ.Field(0) // oneof implementers have one field
- baseUnmarshal := fieldUnmarshaler(&f)
- tags := strings.Split(f.Tag.Get("protobuf"), ",")
- fieldNum, err := strconv.Atoi(tags[1])
- if err != nil {
- panic("protobuf tag field not an integer: " + tags[1])
- }
- var name string
- for _, tag := range tags {
- if strings.HasPrefix(tag, "name=") {
- name = strings.TrimPrefix(tag, "name=")
- break
- }
- }
-
- // Find the oneof field that this struct implements.
- // Might take O(n^2) to process all of the oneofs, but who cares.
- for _, of := range oneofFields {
- if tptr.Implements(of.ityp) {
- // We have found the corresponding interface for this struct.
- // That lets us know where this struct should be stored
- // when we encounter it during unmarshaling.
- unmarshal := makeUnmarshalOneof(typ, of.ityp, baseUnmarshal)
- u.setTag(fieldNum, of.field, unmarshal, 0, name)
- }
- }
-
- }
- }
-
- // Get extension ranges, if any.
- fn := reflect.Zero(reflect.PtrTo(t)).MethodByName("ExtensionRangeArray")
- if fn.IsValid() {
- if !u.extensions.IsValid() && !u.oldExtensions.IsValid() && !u.bytesExtensions.IsValid() {
- panic("a message with extensions, but no extensions field in " + t.Name())
- }
- u.extensionRanges = fn.Call(nil)[0].Interface().([]ExtensionRange)
- }
-
- // Explicitly disallow tag 0. This will ensure we flag an error
- // when decoding a buffer of all zeros. Without this code, we
- // would decode and skip an all-zero buffer of even length.
- // [0 0] is [tag=0/wiretype=varint varint-encoded-0].
- u.setTag(0, zeroField, func(b []byte, f pointer, w int) ([]byte, error) {
- return nil, fmt.Errorf("proto: %s: illegal tag 0 (wire type %d)", t, w)
- }, 0, "")
-
- // Set mask for required field check.
- u.reqMask = uint64(1)<= 0 && (tag < 16 || tag < 2*n) { // TODO: what are the right numbers here?
- for len(u.dense) <= tag {
- u.dense = append(u.dense, unmarshalFieldInfo{})
- }
- u.dense[tag] = i
- return
- }
- if u.sparse == nil {
- u.sparse = map[uint64]unmarshalFieldInfo{}
- }
- u.sparse[uint64(tag)] = i
-}
-
-// fieldUnmarshaler returns an unmarshaler for the given field.
-func fieldUnmarshaler(f *reflect.StructField) unmarshaler {
- if f.Type.Kind() == reflect.Map {
- return makeUnmarshalMap(f)
- }
- return typeUnmarshaler(f.Type, f.Tag.Get("protobuf"))
-}
-
-// typeUnmarshaler returns an unmarshaler for the given field type / field tag pair.
-func typeUnmarshaler(t reflect.Type, tags string) unmarshaler {
- tagArray := strings.Split(tags, ",")
- encoding := tagArray[0]
- name := "unknown"
- ctype := false
- isTime := false
- isDuration := false
- isWktPointer := false
- proto3 := false
- validateUTF8 := true
- for _, tag := range tagArray[3:] {
- if strings.HasPrefix(tag, "name=") {
- name = tag[5:]
- }
- if tag == "proto3" {
- proto3 = true
- }
- if strings.HasPrefix(tag, "customtype=") {
- ctype = true
- }
- if tag == "stdtime" {
- isTime = true
- }
- if tag == "stdduration" {
- isDuration = true
- }
- if tag == "wktptr" {
- isWktPointer = true
- }
- }
- validateUTF8 = validateUTF8 && proto3
-
- // Figure out packaging (pointer, slice, or both)
- slice := false
- pointer := false
- if t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8 {
- slice = true
- t = t.Elem()
- }
- if t.Kind() == reflect.Ptr {
- pointer = true
- t = t.Elem()
- }
-
- if ctype {
- if reflect.PtrTo(t).Implements(customType) {
- if slice {
- return makeUnmarshalCustomSlice(getUnmarshalInfo(t), name)
- }
- if pointer {
- return makeUnmarshalCustomPtr(getUnmarshalInfo(t), name)
- }
- return makeUnmarshalCustom(getUnmarshalInfo(t), name)
- } else {
- panic(fmt.Sprintf("custom type: type: %v, does not implement the proto.custom interface", t))
- }
- }
-
- if isTime {
- if pointer {
- if slice {
- return makeUnmarshalTimePtrSlice(getUnmarshalInfo(t), name)
- }
- return makeUnmarshalTimePtr(getUnmarshalInfo(t), name)
- }
- if slice {
- return makeUnmarshalTimeSlice(getUnmarshalInfo(t), name)
- }
- return makeUnmarshalTime(getUnmarshalInfo(t), name)
- }
-
- if isDuration {
- if pointer {
- if slice {
- return makeUnmarshalDurationPtrSlice(getUnmarshalInfo(t), name)
- }
- return makeUnmarshalDurationPtr(getUnmarshalInfo(t), name)
- }
- if slice {
- return makeUnmarshalDurationSlice(getUnmarshalInfo(t), name)
- }
- return makeUnmarshalDuration(getUnmarshalInfo(t), name)
- }
-
- if isWktPointer {
- switch t.Kind() {
- case reflect.Float64:
- if pointer {
- if slice {
- return makeStdDoubleValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name)
- }
- return makeStdDoubleValuePtrUnmarshaler(getUnmarshalInfo(t), name)
- }
- if slice {
- return makeStdDoubleValueSliceUnmarshaler(getUnmarshalInfo(t), name)
- }
- return makeStdDoubleValueUnmarshaler(getUnmarshalInfo(t), name)
- case reflect.Float32:
- if pointer {
- if slice {
- return makeStdFloatValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name)
- }
- return makeStdFloatValuePtrUnmarshaler(getUnmarshalInfo(t), name)
- }
- if slice {
- return makeStdFloatValueSliceUnmarshaler(getUnmarshalInfo(t), name)
- }
- return makeStdFloatValueUnmarshaler(getUnmarshalInfo(t), name)
- case reflect.Int64:
- if pointer {
- if slice {
- return makeStdInt64ValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name)
- }
- return makeStdInt64ValuePtrUnmarshaler(getUnmarshalInfo(t), name)
- }
- if slice {
- return makeStdInt64ValueSliceUnmarshaler(getUnmarshalInfo(t), name)
- }
- return makeStdInt64ValueUnmarshaler(getUnmarshalInfo(t), name)
- case reflect.Uint64:
- if pointer {
- if slice {
- return makeStdUInt64ValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name)
- }
- return makeStdUInt64ValuePtrUnmarshaler(getUnmarshalInfo(t), name)
- }
- if slice {
- return makeStdUInt64ValueSliceUnmarshaler(getUnmarshalInfo(t), name)
- }
- return makeStdUInt64ValueUnmarshaler(getUnmarshalInfo(t), name)
- case reflect.Int32:
- if pointer {
- if slice {
- return makeStdInt32ValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name)
- }
- return makeStdInt32ValuePtrUnmarshaler(getUnmarshalInfo(t), name)
- }
- if slice {
- return makeStdInt32ValueSliceUnmarshaler(getUnmarshalInfo(t), name)
- }
- return makeStdInt32ValueUnmarshaler(getUnmarshalInfo(t), name)
- case reflect.Uint32:
- if pointer {
- if slice {
- return makeStdUInt32ValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name)
- }
- return makeStdUInt32ValuePtrUnmarshaler(getUnmarshalInfo(t), name)
- }
- if slice {
- return makeStdUInt32ValueSliceUnmarshaler(getUnmarshalInfo(t), name)
- }
- return makeStdUInt32ValueUnmarshaler(getUnmarshalInfo(t), name)
- case reflect.Bool:
- if pointer {
- if slice {
- return makeStdBoolValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name)
- }
- return makeStdBoolValuePtrUnmarshaler(getUnmarshalInfo(t), name)
- }
- if slice {
- return makeStdBoolValueSliceUnmarshaler(getUnmarshalInfo(t), name)
- }
- return makeStdBoolValueUnmarshaler(getUnmarshalInfo(t), name)
- case reflect.String:
- if pointer {
- if slice {
- return makeStdStringValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name)
- }
- return makeStdStringValuePtrUnmarshaler(getUnmarshalInfo(t), name)
- }
- if slice {
- return makeStdStringValueSliceUnmarshaler(getUnmarshalInfo(t), name)
- }
- return makeStdStringValueUnmarshaler(getUnmarshalInfo(t), name)
- case uint8SliceType:
- if pointer {
- if slice {
- return makeStdBytesValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name)
- }
- return makeStdBytesValuePtrUnmarshaler(getUnmarshalInfo(t), name)
- }
- if slice {
- return makeStdBytesValueSliceUnmarshaler(getUnmarshalInfo(t), name)
- }
- return makeStdBytesValueUnmarshaler(getUnmarshalInfo(t), name)
- default:
- panic(fmt.Sprintf("unknown wktpointer type %#v", t))
- }
- }
-
- // We'll never have both pointer and slice for basic types.
- if pointer && slice && t.Kind() != reflect.Struct {
- panic("both pointer and slice for basic type in " + t.Name())
- }
-
- switch t.Kind() {
- case reflect.Bool:
- if pointer {
- return unmarshalBoolPtr
- }
- if slice {
- return unmarshalBoolSlice
- }
- return unmarshalBoolValue
- case reflect.Int32:
- switch encoding {
- case "fixed32":
- if pointer {
- return unmarshalFixedS32Ptr
- }
- if slice {
- return unmarshalFixedS32Slice
- }
- return unmarshalFixedS32Value
- case "varint":
- // this could be int32 or enum
- if pointer {
- return unmarshalInt32Ptr
- }
- if slice {
- return unmarshalInt32Slice
- }
- return unmarshalInt32Value
- case "zigzag32":
- if pointer {
- return unmarshalSint32Ptr
- }
- if slice {
- return unmarshalSint32Slice
- }
- return unmarshalSint32Value
- }
- case reflect.Int64:
- switch encoding {
- case "fixed64":
- if pointer {
- return unmarshalFixedS64Ptr
- }
- if slice {
- return unmarshalFixedS64Slice
- }
- return unmarshalFixedS64Value
- case "varint":
- if pointer {
- return unmarshalInt64Ptr
- }
- if slice {
- return unmarshalInt64Slice
- }
- return unmarshalInt64Value
- case "zigzag64":
- if pointer {
- return unmarshalSint64Ptr
- }
- if slice {
- return unmarshalSint64Slice
- }
- return unmarshalSint64Value
- }
- case reflect.Uint32:
- switch encoding {
- case "fixed32":
- if pointer {
- return unmarshalFixed32Ptr
- }
- if slice {
- return unmarshalFixed32Slice
- }
- return unmarshalFixed32Value
- case "varint":
- if pointer {
- return unmarshalUint32Ptr
- }
- if slice {
- return unmarshalUint32Slice
- }
- return unmarshalUint32Value
- }
- case reflect.Uint64:
- switch encoding {
- case "fixed64":
- if pointer {
- return unmarshalFixed64Ptr
- }
- if slice {
- return unmarshalFixed64Slice
- }
- return unmarshalFixed64Value
- case "varint":
- if pointer {
- return unmarshalUint64Ptr
- }
- if slice {
- return unmarshalUint64Slice
- }
- return unmarshalUint64Value
- }
- case reflect.Float32:
- if pointer {
- return unmarshalFloat32Ptr
- }
- if slice {
- return unmarshalFloat32Slice
- }
- return unmarshalFloat32Value
- case reflect.Float64:
- if pointer {
- return unmarshalFloat64Ptr
- }
- if slice {
- return unmarshalFloat64Slice
- }
- return unmarshalFloat64Value
- case reflect.Map:
- panic("map type in typeUnmarshaler in " + t.Name())
- case reflect.Slice:
- if pointer {
- panic("bad pointer in slice case in " + t.Name())
- }
- if slice {
- return unmarshalBytesSlice
- }
- return unmarshalBytesValue
- case reflect.String:
- if validateUTF8 {
- if pointer {
- return unmarshalUTF8StringPtr
- }
- if slice {
- return unmarshalUTF8StringSlice
- }
- return unmarshalUTF8StringValue
- }
- if pointer {
- return unmarshalStringPtr
- }
- if slice {
- return unmarshalStringSlice
- }
- return unmarshalStringValue
- case reflect.Struct:
- // message or group field
- if !pointer {
- switch encoding {
- case "bytes":
- if slice {
- return makeUnmarshalMessageSlice(getUnmarshalInfo(t), name)
- }
- return makeUnmarshalMessage(getUnmarshalInfo(t), name)
- }
- }
- switch encoding {
- case "bytes":
- if slice {
- return makeUnmarshalMessageSlicePtr(getUnmarshalInfo(t), name)
- }
- return makeUnmarshalMessagePtr(getUnmarshalInfo(t), name)
- case "group":
- if slice {
- return makeUnmarshalGroupSlicePtr(getUnmarshalInfo(t), name)
- }
- return makeUnmarshalGroupPtr(getUnmarshalInfo(t), name)
- }
- }
- panic(fmt.Sprintf("unmarshaler not found type:%s encoding:%s", t, encoding))
-}
-
-// Below are all the unmarshalers for individual fields of various types.
-
-func unmarshalInt64Value(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := int64(x)
- *f.toInt64() = v
- return b, nil
-}
-
-func unmarshalInt64Ptr(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := int64(x)
- *f.toInt64Ptr() = &v
- return b, nil
-}
-
-func unmarshalInt64Slice(b []byte, f pointer, w int) ([]byte, error) {
- if w == WireBytes { // packed
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- res := b[x:]
- b = b[:x]
- for len(b) > 0 {
- x, n = decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := int64(x)
- s := f.toInt64Slice()
- *s = append(*s, v)
- }
- return res, nil
- }
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := int64(x)
- s := f.toInt64Slice()
- *s = append(*s, v)
- return b, nil
-}
-
-func unmarshalSint64Value(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := int64(x>>1) ^ int64(x)<<63>>63
- *f.toInt64() = v
- return b, nil
-}
-
-func unmarshalSint64Ptr(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := int64(x>>1) ^ int64(x)<<63>>63
- *f.toInt64Ptr() = &v
- return b, nil
-}
-
-func unmarshalSint64Slice(b []byte, f pointer, w int) ([]byte, error) {
- if w == WireBytes { // packed
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- res := b[x:]
- b = b[:x]
- for len(b) > 0 {
- x, n = decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := int64(x>>1) ^ int64(x)<<63>>63
- s := f.toInt64Slice()
- *s = append(*s, v)
- }
- return res, nil
- }
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := int64(x>>1) ^ int64(x)<<63>>63
- s := f.toInt64Slice()
- *s = append(*s, v)
- return b, nil
-}
-
-func unmarshalUint64Value(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := uint64(x)
- *f.toUint64() = v
- return b, nil
-}
-
-func unmarshalUint64Ptr(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := uint64(x)
- *f.toUint64Ptr() = &v
- return b, nil
-}
-
-func unmarshalUint64Slice(b []byte, f pointer, w int) ([]byte, error) {
- if w == WireBytes { // packed
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- res := b[x:]
- b = b[:x]
- for len(b) > 0 {
- x, n = decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := uint64(x)
- s := f.toUint64Slice()
- *s = append(*s, v)
- }
- return res, nil
- }
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := uint64(x)
- s := f.toUint64Slice()
- *s = append(*s, v)
- return b, nil
-}
-
-func unmarshalInt32Value(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := int32(x)
- *f.toInt32() = v
- return b, nil
-}
-
-func unmarshalInt32Ptr(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := int32(x)
- f.setInt32Ptr(v)
- return b, nil
-}
-
-func unmarshalInt32Slice(b []byte, f pointer, w int) ([]byte, error) {
- if w == WireBytes { // packed
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- res := b[x:]
- b = b[:x]
- for len(b) > 0 {
- x, n = decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := int32(x)
- f.appendInt32Slice(v)
- }
- return res, nil
- }
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := int32(x)
- f.appendInt32Slice(v)
- return b, nil
-}
-
-func unmarshalSint32Value(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := int32(x>>1) ^ int32(x)<<31>>31
- *f.toInt32() = v
- return b, nil
-}
-
-func unmarshalSint32Ptr(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := int32(x>>1) ^ int32(x)<<31>>31
- f.setInt32Ptr(v)
- return b, nil
-}
-
-func unmarshalSint32Slice(b []byte, f pointer, w int) ([]byte, error) {
- if w == WireBytes { // packed
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- res := b[x:]
- b = b[:x]
- for len(b) > 0 {
- x, n = decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := int32(x>>1) ^ int32(x)<<31>>31
- f.appendInt32Slice(v)
- }
- return res, nil
- }
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := int32(x>>1) ^ int32(x)<<31>>31
- f.appendInt32Slice(v)
- return b, nil
-}
-
-func unmarshalUint32Value(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := uint32(x)
- *f.toUint32() = v
- return b, nil
-}
-
-func unmarshalUint32Ptr(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := uint32(x)
- *f.toUint32Ptr() = &v
- return b, nil
-}
-
-func unmarshalUint32Slice(b []byte, f pointer, w int) ([]byte, error) {
- if w == WireBytes { // packed
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- res := b[x:]
- b = b[:x]
- for len(b) > 0 {
- x, n = decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := uint32(x)
- s := f.toUint32Slice()
- *s = append(*s, v)
- }
- return res, nil
- }
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- v := uint32(x)
- s := f.toUint32Slice()
- *s = append(*s, v)
- return b, nil
-}
-
-func unmarshalFixed64Value(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireFixed64 {
- return b, errInternalBadWireType
- }
- if len(b) < 8 {
- return nil, io.ErrUnexpectedEOF
- }
- v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
- *f.toUint64() = v
- return b[8:], nil
-}
-
-func unmarshalFixed64Ptr(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireFixed64 {
- return b, errInternalBadWireType
- }
- if len(b) < 8 {
- return nil, io.ErrUnexpectedEOF
- }
- v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
- *f.toUint64Ptr() = &v
- return b[8:], nil
-}
-
-func unmarshalFixed64Slice(b []byte, f pointer, w int) ([]byte, error) {
- if w == WireBytes { // packed
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- res := b[x:]
- b = b[:x]
- for len(b) > 0 {
- if len(b) < 8 {
- return nil, io.ErrUnexpectedEOF
- }
- v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
- s := f.toUint64Slice()
- *s = append(*s, v)
- b = b[8:]
- }
- return res, nil
- }
- if w != WireFixed64 {
- return b, errInternalBadWireType
- }
- if len(b) < 8 {
- return nil, io.ErrUnexpectedEOF
- }
- v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
- s := f.toUint64Slice()
- *s = append(*s, v)
- return b[8:], nil
-}
-
-func unmarshalFixedS64Value(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireFixed64 {
- return b, errInternalBadWireType
- }
- if len(b) < 8 {
- return nil, io.ErrUnexpectedEOF
- }
- v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56
- *f.toInt64() = v
- return b[8:], nil
-}
-
-func unmarshalFixedS64Ptr(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireFixed64 {
- return b, errInternalBadWireType
- }
- if len(b) < 8 {
- return nil, io.ErrUnexpectedEOF
- }
- v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56
- *f.toInt64Ptr() = &v
- return b[8:], nil
-}
-
-func unmarshalFixedS64Slice(b []byte, f pointer, w int) ([]byte, error) {
- if w == WireBytes { // packed
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- res := b[x:]
- b = b[:x]
- for len(b) > 0 {
- if len(b) < 8 {
- return nil, io.ErrUnexpectedEOF
- }
- v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56
- s := f.toInt64Slice()
- *s = append(*s, v)
- b = b[8:]
- }
- return res, nil
- }
- if w != WireFixed64 {
- return b, errInternalBadWireType
- }
- if len(b) < 8 {
- return nil, io.ErrUnexpectedEOF
- }
- v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56
- s := f.toInt64Slice()
- *s = append(*s, v)
- return b[8:], nil
-}
-
-func unmarshalFixed32Value(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireFixed32 {
- return b, errInternalBadWireType
- }
- if len(b) < 4 {
- return nil, io.ErrUnexpectedEOF
- }
- v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24
- *f.toUint32() = v
- return b[4:], nil
-}
-
-func unmarshalFixed32Ptr(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireFixed32 {
- return b, errInternalBadWireType
- }
- if len(b) < 4 {
- return nil, io.ErrUnexpectedEOF
- }
- v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24
- *f.toUint32Ptr() = &v
- return b[4:], nil
-}
-
-func unmarshalFixed32Slice(b []byte, f pointer, w int) ([]byte, error) {
- if w == WireBytes { // packed
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- res := b[x:]
- b = b[:x]
- for len(b) > 0 {
- if len(b) < 4 {
- return nil, io.ErrUnexpectedEOF
- }
- v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24
- s := f.toUint32Slice()
- *s = append(*s, v)
- b = b[4:]
- }
- return res, nil
- }
- if w != WireFixed32 {
- return b, errInternalBadWireType
- }
- if len(b) < 4 {
- return nil, io.ErrUnexpectedEOF
- }
- v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24
- s := f.toUint32Slice()
- *s = append(*s, v)
- return b[4:], nil
-}
-
-func unmarshalFixedS32Value(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireFixed32 {
- return b, errInternalBadWireType
- }
- if len(b) < 4 {
- return nil, io.ErrUnexpectedEOF
- }
- v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24
- *f.toInt32() = v
- return b[4:], nil
-}
-
-func unmarshalFixedS32Ptr(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireFixed32 {
- return b, errInternalBadWireType
- }
- if len(b) < 4 {
- return nil, io.ErrUnexpectedEOF
- }
- v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24
- f.setInt32Ptr(v)
- return b[4:], nil
-}
-
-func unmarshalFixedS32Slice(b []byte, f pointer, w int) ([]byte, error) {
- if w == WireBytes { // packed
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- res := b[x:]
- b = b[:x]
- for len(b) > 0 {
- if len(b) < 4 {
- return nil, io.ErrUnexpectedEOF
- }
- v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24
- f.appendInt32Slice(v)
- b = b[4:]
- }
- return res, nil
- }
- if w != WireFixed32 {
- return b, errInternalBadWireType
- }
- if len(b) < 4 {
- return nil, io.ErrUnexpectedEOF
- }
- v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24
- f.appendInt32Slice(v)
- return b[4:], nil
-}
-
-func unmarshalBoolValue(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- // Note: any length varint is allowed, even though any sane
- // encoder will use one byte.
- // See https://github.com/golang/protobuf/issues/76
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- // TODO: check if x>1? Tests seem to indicate no.
- v := x != 0
- *f.toBool() = v
- return b[n:], nil
-}
-
-func unmarshalBoolPtr(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- v := x != 0
- *f.toBoolPtr() = &v
- return b[n:], nil
-}
-
-func unmarshalBoolSlice(b []byte, f pointer, w int) ([]byte, error) {
- if w == WireBytes { // packed
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- res := b[x:]
- b = b[:x]
- for len(b) > 0 {
- x, n = decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- v := x != 0
- s := f.toBoolSlice()
- *s = append(*s, v)
- b = b[n:]
- }
- return res, nil
- }
- if w != WireVarint {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- v := x != 0
- s := f.toBoolSlice()
- *s = append(*s, v)
- return b[n:], nil
-}
-
-func unmarshalFloat64Value(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireFixed64 {
- return b, errInternalBadWireType
- }
- if len(b) < 8 {
- return nil, io.ErrUnexpectedEOF
- }
- v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56)
- *f.toFloat64() = v
- return b[8:], nil
-}
-
-func unmarshalFloat64Ptr(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireFixed64 {
- return b, errInternalBadWireType
- }
- if len(b) < 8 {
- return nil, io.ErrUnexpectedEOF
- }
- v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56)
- *f.toFloat64Ptr() = &v
- return b[8:], nil
-}
-
-func unmarshalFloat64Slice(b []byte, f pointer, w int) ([]byte, error) {
- if w == WireBytes { // packed
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- res := b[x:]
- b = b[:x]
- for len(b) > 0 {
- if len(b) < 8 {
- return nil, io.ErrUnexpectedEOF
- }
- v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56)
- s := f.toFloat64Slice()
- *s = append(*s, v)
- b = b[8:]
- }
- return res, nil
- }
- if w != WireFixed64 {
- return b, errInternalBadWireType
- }
- if len(b) < 8 {
- return nil, io.ErrUnexpectedEOF
- }
- v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56)
- s := f.toFloat64Slice()
- *s = append(*s, v)
- return b[8:], nil
-}
-
-func unmarshalFloat32Value(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireFixed32 {
- return b, errInternalBadWireType
- }
- if len(b) < 4 {
- return nil, io.ErrUnexpectedEOF
- }
- v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24)
- *f.toFloat32() = v
- return b[4:], nil
-}
-
-func unmarshalFloat32Ptr(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireFixed32 {
- return b, errInternalBadWireType
- }
- if len(b) < 4 {
- return nil, io.ErrUnexpectedEOF
- }
- v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24)
- *f.toFloat32Ptr() = &v
- return b[4:], nil
-}
-
-func unmarshalFloat32Slice(b []byte, f pointer, w int) ([]byte, error) {
- if w == WireBytes { // packed
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- res := b[x:]
- b = b[:x]
- for len(b) > 0 {
- if len(b) < 4 {
- return nil, io.ErrUnexpectedEOF
- }
- v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24)
- s := f.toFloat32Slice()
- *s = append(*s, v)
- b = b[4:]
- }
- return res, nil
- }
- if w != WireFixed32 {
- return b, errInternalBadWireType
- }
- if len(b) < 4 {
- return nil, io.ErrUnexpectedEOF
- }
- v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24)
- s := f.toFloat32Slice()
- *s = append(*s, v)
- return b[4:], nil
-}
-
-func unmarshalStringValue(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- v := string(b[:x])
- *f.toString() = v
- return b[x:], nil
-}
-
-func unmarshalStringPtr(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- v := string(b[:x])
- *f.toStringPtr() = &v
- return b[x:], nil
-}
-
-func unmarshalStringSlice(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- v := string(b[:x])
- s := f.toStringSlice()
- *s = append(*s, v)
- return b[x:], nil
-}
-
-func unmarshalUTF8StringValue(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- v := string(b[:x])
- *f.toString() = v
- if !utf8.ValidString(v) {
- return b[x:], errInvalidUTF8
- }
- return b[x:], nil
-}
-
-func unmarshalUTF8StringPtr(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- v := string(b[:x])
- *f.toStringPtr() = &v
- if !utf8.ValidString(v) {
- return b[x:], errInvalidUTF8
- }
- return b[x:], nil
-}
-
-func unmarshalUTF8StringSlice(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- v := string(b[:x])
- s := f.toStringSlice()
- *s = append(*s, v)
- if !utf8.ValidString(v) {
- return b[x:], errInvalidUTF8
- }
- return b[x:], nil
-}
-
-var emptyBuf [0]byte
-
-func unmarshalBytesValue(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- // The use of append here is a trick which avoids the zeroing
- // that would be required if we used a make/copy pair.
- // We append to emptyBuf instead of nil because we want
- // a non-nil result even when the length is 0.
- v := append(emptyBuf[:], b[:x]...)
- *f.toBytes() = v
- return b[x:], nil
-}
-
-func unmarshalBytesSlice(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- v := append(emptyBuf[:], b[:x]...)
- s := f.toBytesSlice()
- *s = append(*s, v)
- return b[x:], nil
-}
-
-func makeUnmarshalMessagePtr(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- // First read the message field to see if something is there.
- // The semantics of multiple submessages are weird. Instead of
- // the last one winning (as it is for all other fields), multiple
- // submessages are merged.
- v := f.getPointer()
- if v.isNil() {
- v = valToPointer(reflect.New(sub.typ))
- f.setPointer(v)
- }
- err := sub.unmarshal(v, b[:x])
- if err != nil {
- if r, ok := err.(*RequiredNotSetError); ok {
- r.field = name + "." + r.field
- } else {
- return nil, err
- }
- }
- return b[x:], err
- }
-}
-
-func makeUnmarshalMessageSlicePtr(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return b, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- v := valToPointer(reflect.New(sub.typ))
- err := sub.unmarshal(v, b[:x])
- if err != nil {
- if r, ok := err.(*RequiredNotSetError); ok {
- r.field = name + "." + r.field
- } else {
- return nil, err
- }
- }
- f.appendPointer(v)
- return b[x:], err
- }
-}
-
-func makeUnmarshalGroupPtr(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireStartGroup {
- return b, errInternalBadWireType
- }
- x, y := findEndGroup(b)
- if x < 0 {
- return nil, io.ErrUnexpectedEOF
- }
- v := f.getPointer()
- if v.isNil() {
- v = valToPointer(reflect.New(sub.typ))
- f.setPointer(v)
- }
- err := sub.unmarshal(v, b[:x])
- if err != nil {
- if r, ok := err.(*RequiredNotSetError); ok {
- r.field = name + "." + r.field
- } else {
- return nil, err
- }
- }
- return b[y:], err
- }
-}
-
-func makeUnmarshalGroupSlicePtr(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireStartGroup {
- return b, errInternalBadWireType
- }
- x, y := findEndGroup(b)
- if x < 0 {
- return nil, io.ErrUnexpectedEOF
- }
- v := valToPointer(reflect.New(sub.typ))
- err := sub.unmarshal(v, b[:x])
- if err != nil {
- if r, ok := err.(*RequiredNotSetError); ok {
- r.field = name + "." + r.field
- } else {
- return nil, err
- }
- }
- f.appendPointer(v)
- return b[y:], err
- }
-}
-
-func makeUnmarshalMap(f *reflect.StructField) unmarshaler {
- t := f.Type
- kt := t.Key()
- vt := t.Elem()
- tagArray := strings.Split(f.Tag.Get("protobuf"), ",")
- valTags := strings.Split(f.Tag.Get("protobuf_val"), ",")
- for _, t := range tagArray {
- if strings.HasPrefix(t, "customtype=") {
- valTags = append(valTags, t)
- }
- if t == "stdtime" {
- valTags = append(valTags, t)
- }
- if t == "stdduration" {
- valTags = append(valTags, t)
- }
- if t == "wktptr" {
- valTags = append(valTags, t)
- }
- }
- unmarshalKey := typeUnmarshaler(kt, f.Tag.Get("protobuf_key"))
- unmarshalVal := typeUnmarshaler(vt, strings.Join(valTags, ","))
- return func(b []byte, f pointer, w int) ([]byte, error) {
- // The map entry is a submessage. Figure out how big it is.
- if w != WireBytes {
- return nil, fmt.Errorf("proto: bad wiretype for map field: got %d want %d", w, WireBytes)
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- r := b[x:] // unused data to return
- b = b[:x] // data for map entry
-
- // Note: we could use #keys * #values ~= 200 functions
- // to do map decoding without reflection. Probably not worth it.
- // Maps will be somewhat slow. Oh well.
-
- // Read key and value from data.
- var nerr nonFatal
- k := reflect.New(kt)
- v := reflect.New(vt)
- for len(b) > 0 {
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- wire := int(x) & 7
- b = b[n:]
-
- var err error
- switch x >> 3 {
- case 1:
- b, err = unmarshalKey(b, valToPointer(k), wire)
- case 2:
- b, err = unmarshalVal(b, valToPointer(v), wire)
- default:
- err = errInternalBadWireType // skip unknown tag
- }
-
- if nerr.Merge(err) {
- continue
- }
- if err != errInternalBadWireType {
- return nil, err
- }
-
- // Skip past unknown fields.
- b, err = skipField(b, wire)
- if err != nil {
- return nil, err
- }
- }
-
- // Get map, allocate if needed.
- m := f.asPointerTo(t).Elem() // an addressable map[K]T
- if m.IsNil() {
- m.Set(reflect.MakeMap(t))
- }
-
- // Insert into map.
- m.SetMapIndex(k.Elem(), v.Elem())
-
- return r, nerr.E
- }
-}
-
-// makeUnmarshalOneof makes an unmarshaler for oneof fields.
-// for:
-// message Msg {
-// oneof F {
-// int64 X = 1;
-// float64 Y = 2;
-// }
-// }
-// typ is the type of the concrete entry for a oneof case (e.g. Msg_X).
-// ityp is the interface type of the oneof field (e.g. isMsg_F).
-// unmarshal is the unmarshaler for the base type of the oneof case (e.g. int64).
-// Note that this function will be called once for each case in the oneof.
-func makeUnmarshalOneof(typ, ityp reflect.Type, unmarshal unmarshaler) unmarshaler {
- sf := typ.Field(0)
- field0 := toField(&sf)
- return func(b []byte, f pointer, w int) ([]byte, error) {
- // Allocate holder for value.
- v := reflect.New(typ)
-
- // Unmarshal data into holder.
- // We unmarshal into the first field of the holder object.
- var err error
- var nerr nonFatal
- b, err = unmarshal(b, valToPointer(v).offset(field0), w)
- if !nerr.Merge(err) {
- return nil, err
- }
-
- // Write pointer to holder into target field.
- f.asPointerTo(ityp).Elem().Set(v)
-
- return b, nerr.E
- }
-}
-
-// Error used by decode internally.
-var errInternalBadWireType = errors.New("proto: internal error: bad wiretype")
-
-// skipField skips past a field of type wire and returns the remaining bytes.
-func skipField(b []byte, wire int) ([]byte, error) {
- switch wire {
- case WireVarint:
- _, k := decodeVarint(b)
- if k == 0 {
- return b, io.ErrUnexpectedEOF
- }
- b = b[k:]
- case WireFixed32:
- if len(b) < 4 {
- return b, io.ErrUnexpectedEOF
- }
- b = b[4:]
- case WireFixed64:
- if len(b) < 8 {
- return b, io.ErrUnexpectedEOF
- }
- b = b[8:]
- case WireBytes:
- m, k := decodeVarint(b)
- if k == 0 || uint64(len(b)-k) < m {
- return b, io.ErrUnexpectedEOF
- }
- b = b[uint64(k)+m:]
- case WireStartGroup:
- _, i := findEndGroup(b)
- if i == -1 {
- return b, io.ErrUnexpectedEOF
- }
- b = b[i:]
- default:
- return b, fmt.Errorf("proto: can't skip unknown wire type %d", wire)
- }
- return b, nil
-}
-
-// findEndGroup finds the index of the next EndGroup tag.
-// Groups may be nested, so the "next" EndGroup tag is the first
-// unpaired EndGroup.
-// findEndGroup returns the indexes of the start and end of the EndGroup tag.
-// Returns (-1,-1) if it can't find one.
-func findEndGroup(b []byte) (int, int) {
- depth := 1
- i := 0
- for {
- x, n := decodeVarint(b[i:])
- if n == 0 {
- return -1, -1
- }
- j := i
- i += n
- switch x & 7 {
- case WireVarint:
- _, k := decodeVarint(b[i:])
- if k == 0 {
- return -1, -1
- }
- i += k
- case WireFixed32:
- if len(b)-4 < i {
- return -1, -1
- }
- i += 4
- case WireFixed64:
- if len(b)-8 < i {
- return -1, -1
- }
- i += 8
- case WireBytes:
- m, k := decodeVarint(b[i:])
- if k == 0 {
- return -1, -1
- }
- i += k
- if uint64(len(b)-i) < m {
- return -1, -1
- }
- i += int(m)
- case WireStartGroup:
- depth++
- case WireEndGroup:
- depth--
- if depth == 0 {
- return j, i
- }
- default:
- return -1, -1
- }
- }
-}
-
-// encodeVarint appends a varint-encoded integer to b and returns the result.
-func encodeVarint(b []byte, x uint64) []byte {
- for x >= 1<<7 {
- b = append(b, byte(x&0x7f|0x80))
- x >>= 7
- }
- return append(b, byte(x))
-}
-
-// decodeVarint reads a varint-encoded integer from b.
-// Returns the decoded integer and the number of bytes read.
-// If there is an error, it returns 0,0.
-func decodeVarint(b []byte) (uint64, int) {
- var x, y uint64
- if len(b) == 0 {
- goto bad
- }
- x = uint64(b[0])
- if x < 0x80 {
- return x, 1
- }
- x -= 0x80
-
- if len(b) <= 1 {
- goto bad
- }
- y = uint64(b[1])
- x += y << 7
- if y < 0x80 {
- return x, 2
- }
- x -= 0x80 << 7
-
- if len(b) <= 2 {
- goto bad
- }
- y = uint64(b[2])
- x += y << 14
- if y < 0x80 {
- return x, 3
- }
- x -= 0x80 << 14
-
- if len(b) <= 3 {
- goto bad
- }
- y = uint64(b[3])
- x += y << 21
- if y < 0x80 {
- return x, 4
- }
- x -= 0x80 << 21
-
- if len(b) <= 4 {
- goto bad
- }
- y = uint64(b[4])
- x += y << 28
- if y < 0x80 {
- return x, 5
- }
- x -= 0x80 << 28
-
- if len(b) <= 5 {
- goto bad
- }
- y = uint64(b[5])
- x += y << 35
- if y < 0x80 {
- return x, 6
- }
- x -= 0x80 << 35
-
- if len(b) <= 6 {
- goto bad
- }
- y = uint64(b[6])
- x += y << 42
- if y < 0x80 {
- return x, 7
- }
- x -= 0x80 << 42
-
- if len(b) <= 7 {
- goto bad
- }
- y = uint64(b[7])
- x += y << 49
- if y < 0x80 {
- return x, 8
- }
- x -= 0x80 << 49
-
- if len(b) <= 8 {
- goto bad
- }
- y = uint64(b[8])
- x += y << 56
- if y < 0x80 {
- return x, 9
- }
- x -= 0x80 << 56
-
- if len(b) <= 9 {
- goto bad
- }
- y = uint64(b[9])
- x += y << 63
- if y < 2 {
- return x, 10
- }
-
-bad:
- return 0, 0
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/table_unmarshal_gogo.go b/api/vendor/github.com/gogo/protobuf/proto/table_unmarshal_gogo.go
deleted file mode 100644
index 00d6c7ad9376..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/table_unmarshal_gogo.go
+++ /dev/null
@@ -1,385 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2018, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-//
-// 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
-// OWNER 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.
-
-package proto
-
-import (
- "io"
- "reflect"
-)
-
-func makeUnmarshalMessage(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- // First read the message field to see if something is there.
- // The semantics of multiple submessages are weird. Instead of
- // the last one winning (as it is for all other fields), multiple
- // submessages are merged.
- v := f // gogo: changed from v := f.getPointer()
- if v.isNil() {
- v = valToPointer(reflect.New(sub.typ))
- f.setPointer(v)
- }
- err := sub.unmarshal(v, b[:x])
- if err != nil {
- if r, ok := err.(*RequiredNotSetError); ok {
- r.field = name + "." + r.field
- } else {
- return nil, err
- }
- }
- return b[x:], err
- }
-}
-
-func makeUnmarshalMessageSlice(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- v := valToPointer(reflect.New(sub.typ))
- err := sub.unmarshal(v, b[:x])
- if err != nil {
- if r, ok := err.(*RequiredNotSetError); ok {
- r.field = name + "." + r.field
- } else {
- return nil, err
- }
- }
- f.appendRef(v, sub.typ) // gogo: changed from f.appendPointer(v)
- return b[x:], err
- }
-}
-
-func makeUnmarshalCustomPtr(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
-
- s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem()
- s.Set(reflect.New(sub.typ))
- m := s.Interface().(custom)
- if err := m.Unmarshal(b[:x]); err != nil {
- return nil, err
- }
- return b[x:], nil
- }
-}
-
-func makeUnmarshalCustomSlice(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := reflect.New(sub.typ)
- c := m.Interface().(custom)
- if err := c.Unmarshal(b[:x]); err != nil {
- return nil, err
- }
- v := valToPointer(m)
- f.appendRef(v, sub.typ)
- return b[x:], nil
- }
-}
-
-func makeUnmarshalCustom(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
-
- m := f.asPointerTo(sub.typ).Interface().(custom)
- if err := m.Unmarshal(b[:x]); err != nil {
- return nil, err
- }
- return b[x:], nil
- }
-}
-
-func makeUnmarshalTime(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := ×tamp{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- t, err := timestampFromProto(m)
- if err != nil {
- return nil, err
- }
- s := f.asPointerTo(sub.typ).Elem()
- s.Set(reflect.ValueOf(t))
- return b[x:], nil
- }
-}
-
-func makeUnmarshalTimePtr(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := ×tamp{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- t, err := timestampFromProto(m)
- if err != nil {
- return nil, err
- }
- s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem()
- s.Set(reflect.ValueOf(&t))
- return b[x:], nil
- }
-}
-
-func makeUnmarshalTimePtrSlice(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := ×tamp{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- t, err := timestampFromProto(m)
- if err != nil {
- return nil, err
- }
- slice := f.getSlice(reflect.PtrTo(sub.typ))
- newSlice := reflect.Append(slice, reflect.ValueOf(&t))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeUnmarshalTimeSlice(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := ×tamp{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- t, err := timestampFromProto(m)
- if err != nil {
- return nil, err
- }
- slice := f.getSlice(sub.typ)
- newSlice := reflect.Append(slice, reflect.ValueOf(t))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeUnmarshalDurationPtr(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &duration{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- d, err := durationFromProto(m)
- if err != nil {
- return nil, err
- }
- s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem()
- s.Set(reflect.ValueOf(&d))
- return b[x:], nil
- }
-}
-
-func makeUnmarshalDuration(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &duration{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- d, err := durationFromProto(m)
- if err != nil {
- return nil, err
- }
- s := f.asPointerTo(sub.typ).Elem()
- s.Set(reflect.ValueOf(d))
- return b[x:], nil
- }
-}
-
-func makeUnmarshalDurationPtrSlice(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &duration{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- d, err := durationFromProto(m)
- if err != nil {
- return nil, err
- }
- slice := f.getSlice(reflect.PtrTo(sub.typ))
- newSlice := reflect.Append(slice, reflect.ValueOf(&d))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeUnmarshalDurationSlice(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &duration{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- d, err := durationFromProto(m)
- if err != nil {
- return nil, err
- }
- slice := f.getSlice(sub.typ)
- newSlice := reflect.Append(slice, reflect.ValueOf(d))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/text.go b/api/vendor/github.com/gogo/protobuf/proto/text.go
deleted file mode 100644
index 87416afe9550..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/text.go
+++ /dev/null
@@ -1,930 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2013, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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
-// OWNER 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.
-
-package proto
-
-// Functions for writing the text protocol buffer format.
-
-import (
- "bufio"
- "bytes"
- "encoding"
- "errors"
- "fmt"
- "io"
- "log"
- "math"
- "reflect"
- "sort"
- "strings"
- "sync"
- "time"
-)
-
-var (
- newline = []byte("\n")
- spaces = []byte(" ")
- endBraceNewline = []byte("}\n")
- backslashN = []byte{'\\', 'n'}
- backslashR = []byte{'\\', 'r'}
- backslashT = []byte{'\\', 't'}
- backslashDQ = []byte{'\\', '"'}
- backslashBS = []byte{'\\', '\\'}
- posInf = []byte("inf")
- negInf = []byte("-inf")
- nan = []byte("nan")
-)
-
-type writer interface {
- io.Writer
- WriteByte(byte) error
-}
-
-// textWriter is an io.Writer that tracks its indentation level.
-type textWriter struct {
- ind int
- complete bool // if the current position is a complete line
- compact bool // whether to write out as a one-liner
- w writer
-}
-
-func (w *textWriter) WriteString(s string) (n int, err error) {
- if !strings.Contains(s, "\n") {
- if !w.compact && w.complete {
- w.writeIndent()
- }
- w.complete = false
- return io.WriteString(w.w, s)
- }
- // WriteString is typically called without newlines, so this
- // codepath and its copy are rare. We copy to avoid
- // duplicating all of Write's logic here.
- return w.Write([]byte(s))
-}
-
-func (w *textWriter) Write(p []byte) (n int, err error) {
- newlines := bytes.Count(p, newline)
- if newlines == 0 {
- if !w.compact && w.complete {
- w.writeIndent()
- }
- n, err = w.w.Write(p)
- w.complete = false
- return n, err
- }
-
- frags := bytes.SplitN(p, newline, newlines+1)
- if w.compact {
- for i, frag := range frags {
- if i > 0 {
- if err := w.w.WriteByte(' '); err != nil {
- return n, err
- }
- n++
- }
- nn, err := w.w.Write(frag)
- n += nn
- if err != nil {
- return n, err
- }
- }
- return n, nil
- }
-
- for i, frag := range frags {
- if w.complete {
- w.writeIndent()
- }
- nn, err := w.w.Write(frag)
- n += nn
- if err != nil {
- return n, err
- }
- if i+1 < len(frags) {
- if err := w.w.WriteByte('\n'); err != nil {
- return n, err
- }
- n++
- }
- }
- w.complete = len(frags[len(frags)-1]) == 0
- return n, nil
-}
-
-func (w *textWriter) WriteByte(c byte) error {
- if w.compact && c == '\n' {
- c = ' '
- }
- if !w.compact && w.complete {
- w.writeIndent()
- }
- err := w.w.WriteByte(c)
- w.complete = c == '\n'
- return err
-}
-
-func (w *textWriter) indent() { w.ind++ }
-
-func (w *textWriter) unindent() {
- if w.ind == 0 {
- log.Print("proto: textWriter unindented too far")
- return
- }
- w.ind--
-}
-
-func writeName(w *textWriter, props *Properties) error {
- if _, err := w.WriteString(props.OrigName); err != nil {
- return err
- }
- if props.Wire != "group" {
- return w.WriteByte(':')
- }
- return nil
-}
-
-func requiresQuotes(u string) bool {
- // When type URL contains any characters except [0-9A-Za-z./\-]*, it must be quoted.
- for _, ch := range u {
- switch {
- case ch == '.' || ch == '/' || ch == '_':
- continue
- case '0' <= ch && ch <= '9':
- continue
- case 'A' <= ch && ch <= 'Z':
- continue
- case 'a' <= ch && ch <= 'z':
- continue
- default:
- return true
- }
- }
- return false
-}
-
-// isAny reports whether sv is a google.protobuf.Any message
-func isAny(sv reflect.Value) bool {
- type wkt interface {
- XXX_WellKnownType() string
- }
- t, ok := sv.Addr().Interface().(wkt)
- return ok && t.XXX_WellKnownType() == "Any"
-}
-
-// writeProto3Any writes an expanded google.protobuf.Any message.
-//
-// It returns (false, nil) if sv value can't be unmarshaled (e.g. because
-// required messages are not linked in).
-//
-// It returns (true, error) when sv was written in expanded format or an error
-// was encountered.
-func (tm *TextMarshaler) writeProto3Any(w *textWriter, sv reflect.Value) (bool, error) {
- turl := sv.FieldByName("TypeUrl")
- val := sv.FieldByName("Value")
- if !turl.IsValid() || !val.IsValid() {
- return true, errors.New("proto: invalid google.protobuf.Any message")
- }
-
- b, ok := val.Interface().([]byte)
- if !ok {
- return true, errors.New("proto: invalid google.protobuf.Any message")
- }
-
- parts := strings.Split(turl.String(), "/")
- mt := MessageType(parts[len(parts)-1])
- if mt == nil {
- return false, nil
- }
- m := reflect.New(mt.Elem())
- if err := Unmarshal(b, m.Interface().(Message)); err != nil {
- return false, nil
- }
- w.Write([]byte("["))
- u := turl.String()
- if requiresQuotes(u) {
- writeString(w, u)
- } else {
- w.Write([]byte(u))
- }
- if w.compact {
- w.Write([]byte("]:<"))
- } else {
- w.Write([]byte("]: <\n"))
- w.ind++
- }
- if err := tm.writeStruct(w, m.Elem()); err != nil {
- return true, err
- }
- if w.compact {
- w.Write([]byte("> "))
- } else {
- w.ind--
- w.Write([]byte(">\n"))
- }
- return true, nil
-}
-
-func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
- if tm.ExpandAny && isAny(sv) {
- if canExpand, err := tm.writeProto3Any(w, sv); canExpand {
- return err
- }
- }
- st := sv.Type()
- sprops := GetProperties(st)
- for i := 0; i < sv.NumField(); i++ {
- fv := sv.Field(i)
- props := sprops.Prop[i]
- name := st.Field(i).Name
-
- if name == "XXX_NoUnkeyedLiteral" {
- continue
- }
-
- if strings.HasPrefix(name, "XXX_") {
- // There are two XXX_ fields:
- // XXX_unrecognized []byte
- // XXX_extensions map[int32]proto.Extension
- // The first is handled here;
- // the second is handled at the bottom of this function.
- if name == "XXX_unrecognized" && !fv.IsNil() {
- if err := writeUnknownStruct(w, fv.Interface().([]byte)); err != nil {
- return err
- }
- }
- continue
- }
- if fv.Kind() == reflect.Ptr && fv.IsNil() {
- // Field not filled in. This could be an optional field or
- // a required field that wasn't filled in. Either way, there
- // isn't anything we can show for it.
- continue
- }
- if fv.Kind() == reflect.Slice && fv.IsNil() {
- // Repeated field that is empty, or a bytes field that is unused.
- continue
- }
-
- if props.Repeated && fv.Kind() == reflect.Slice {
- // Repeated field.
- for j := 0; j < fv.Len(); j++ {
- if err := writeName(w, props); err != nil {
- return err
- }
- if !w.compact {
- if err := w.WriteByte(' '); err != nil {
- return err
- }
- }
- v := fv.Index(j)
- if v.Kind() == reflect.Ptr && v.IsNil() {
- // A nil message in a repeated field is not valid,
- // but we can handle that more gracefully than panicking.
- if _, err := w.Write([]byte("\n")); err != nil {
- return err
- }
- continue
- }
- if len(props.Enum) > 0 {
- if err := tm.writeEnum(w, v, props); err != nil {
- return err
- }
- } else if err := tm.writeAny(w, v, props); err != nil {
- return err
- }
- if err := w.WriteByte('\n'); err != nil {
- return err
- }
- }
- continue
- }
- if fv.Kind() == reflect.Map {
- // Map fields are rendered as a repeated struct with key/value fields.
- keys := fv.MapKeys()
- sort.Sort(mapKeys(keys))
- for _, key := range keys {
- val := fv.MapIndex(key)
- if err := writeName(w, props); err != nil {
- return err
- }
- if !w.compact {
- if err := w.WriteByte(' '); err != nil {
- return err
- }
- }
- // open struct
- if err := w.WriteByte('<'); err != nil {
- return err
- }
- if !w.compact {
- if err := w.WriteByte('\n'); err != nil {
- return err
- }
- }
- w.indent()
- // key
- if _, err := w.WriteString("key:"); err != nil {
- return err
- }
- if !w.compact {
- if err := w.WriteByte(' '); err != nil {
- return err
- }
- }
- if err := tm.writeAny(w, key, props.MapKeyProp); err != nil {
- return err
- }
- if err := w.WriteByte('\n'); err != nil {
- return err
- }
- // nil values aren't legal, but we can avoid panicking because of them.
- if val.Kind() != reflect.Ptr || !val.IsNil() {
- // value
- if _, err := w.WriteString("value:"); err != nil {
- return err
- }
- if !w.compact {
- if err := w.WriteByte(' '); err != nil {
- return err
- }
- }
- if err := tm.writeAny(w, val, props.MapValProp); err != nil {
- return err
- }
- if err := w.WriteByte('\n'); err != nil {
- return err
- }
- }
- // close struct
- w.unindent()
- if err := w.WriteByte('>'); err != nil {
- return err
- }
- if err := w.WriteByte('\n'); err != nil {
- return err
- }
- }
- continue
- }
- if props.proto3 && fv.Kind() == reflect.Slice && fv.Len() == 0 {
- // empty bytes field
- continue
- }
- if props.proto3 && fv.Kind() != reflect.Ptr && fv.Kind() != reflect.Slice {
- // proto3 non-repeated scalar field; skip if zero value
- if isProto3Zero(fv) {
- continue
- }
- }
-
- if fv.Kind() == reflect.Interface {
- // Check if it is a oneof.
- if st.Field(i).Tag.Get("protobuf_oneof") != "" {
- // fv is nil, or holds a pointer to generated struct.
- // That generated struct has exactly one field,
- // which has a protobuf struct tag.
- if fv.IsNil() {
- continue
- }
- inner := fv.Elem().Elem() // interface -> *T -> T
- tag := inner.Type().Field(0).Tag.Get("protobuf")
- props = new(Properties) // Overwrite the outer props var, but not its pointee.
- props.Parse(tag)
- // Write the value in the oneof, not the oneof itself.
- fv = inner.Field(0)
-
- // Special case to cope with malformed messages gracefully:
- // If the value in the oneof is a nil pointer, don't panic
- // in writeAny.
- if fv.Kind() == reflect.Ptr && fv.IsNil() {
- // Use errors.New so writeAny won't render quotes.
- msg := errors.New("/* nil */")
- fv = reflect.ValueOf(&msg).Elem()
- }
- }
- }
-
- if err := writeName(w, props); err != nil {
- return err
- }
- if !w.compact {
- if err := w.WriteByte(' '); err != nil {
- return err
- }
- }
-
- if len(props.Enum) > 0 {
- if err := tm.writeEnum(w, fv, props); err != nil {
- return err
- }
- } else if err := tm.writeAny(w, fv, props); err != nil {
- return err
- }
-
- if err := w.WriteByte('\n'); err != nil {
- return err
- }
- }
-
- // Extensions (the XXX_extensions field).
- pv := sv
- if pv.CanAddr() {
- pv = sv.Addr()
- } else {
- pv = reflect.New(sv.Type())
- pv.Elem().Set(sv)
- }
- if _, err := extendable(pv.Interface()); err == nil {
- if err := tm.writeExtensions(w, pv); err != nil {
- return err
- }
- }
-
- return nil
-}
-
-var textMarshalerType = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem()
-
-// writeAny writes an arbitrary field.
-func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Properties) error {
- v = reflect.Indirect(v)
-
- if props != nil {
- if len(props.CustomType) > 0 {
- custom, ok := v.Interface().(Marshaler)
- if ok {
- data, err := custom.Marshal()
- if err != nil {
- return err
- }
- if err := writeString(w, string(data)); err != nil {
- return err
- }
- return nil
- }
- } else if len(props.CastType) > 0 {
- if _, ok := v.Interface().(interface {
- String() string
- }); ok {
- switch v.Kind() {
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
- reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
- _, err := fmt.Fprintf(w, "%d", v.Interface())
- return err
- }
- }
- } else if props.StdTime {
- t, ok := v.Interface().(time.Time)
- if !ok {
- return fmt.Errorf("stdtime is not time.Time, but %T", v.Interface())
- }
- tproto, err := timestampProto(t)
- if err != nil {
- return err
- }
- propsCopy := *props // Make a copy so that this is goroutine-safe
- propsCopy.StdTime = false
- err = tm.writeAny(w, reflect.ValueOf(tproto), &propsCopy)
- return err
- } else if props.StdDuration {
- d, ok := v.Interface().(time.Duration)
- if !ok {
- return fmt.Errorf("stdtime is not time.Duration, but %T", v.Interface())
- }
- dproto := durationProto(d)
- propsCopy := *props // Make a copy so that this is goroutine-safe
- propsCopy.StdDuration = false
- err := tm.writeAny(w, reflect.ValueOf(dproto), &propsCopy)
- return err
- }
- }
-
- // Floats have special cases.
- if v.Kind() == reflect.Float32 || v.Kind() == reflect.Float64 {
- x := v.Float()
- var b []byte
- switch {
- case math.IsInf(x, 1):
- b = posInf
- case math.IsInf(x, -1):
- b = negInf
- case math.IsNaN(x):
- b = nan
- }
- if b != nil {
- _, err := w.Write(b)
- return err
- }
- // Other values are handled below.
- }
-
- // We don't attempt to serialise every possible value type; only those
- // that can occur in protocol buffers.
- switch v.Kind() {
- case reflect.Slice:
- // Should only be a []byte; repeated fields are handled in writeStruct.
- if err := writeString(w, string(v.Bytes())); err != nil {
- return err
- }
- case reflect.String:
- if err := writeString(w, v.String()); err != nil {
- return err
- }
- case reflect.Struct:
- // Required/optional group/message.
- var bra, ket byte = '<', '>'
- if props != nil && props.Wire == "group" {
- bra, ket = '{', '}'
- }
- if err := w.WriteByte(bra); err != nil {
- return err
- }
- if !w.compact {
- if err := w.WriteByte('\n'); err != nil {
- return err
- }
- }
- w.indent()
- if v.CanAddr() {
- // Calling v.Interface on a struct causes the reflect package to
- // copy the entire struct. This is racy with the new Marshaler
- // since we atomically update the XXX_sizecache.
- //
- // Thus, we retrieve a pointer to the struct if possible to avoid
- // a race since v.Interface on the pointer doesn't copy the struct.
- //
- // If v is not addressable, then we are not worried about a race
- // since it implies that the binary Marshaler cannot possibly be
- // mutating this value.
- v = v.Addr()
- }
- if v.Type().Implements(textMarshalerType) {
- text, err := v.Interface().(encoding.TextMarshaler).MarshalText()
- if err != nil {
- return err
- }
- if _, err = w.Write(text); err != nil {
- return err
- }
- } else {
- if v.Kind() == reflect.Ptr {
- v = v.Elem()
- }
- if err := tm.writeStruct(w, v); err != nil {
- return err
- }
- }
- w.unindent()
- if err := w.WriteByte(ket); err != nil {
- return err
- }
- default:
- _, err := fmt.Fprint(w, v.Interface())
- return err
- }
- return nil
-}
-
-// equivalent to C's isprint.
-func isprint(c byte) bool {
- return c >= 0x20 && c < 0x7f
-}
-
-// writeString writes a string in the protocol buffer text format.
-// It is similar to strconv.Quote except we don't use Go escape sequences,
-// we treat the string as a byte sequence, and we use octal escapes.
-// These differences are to maintain interoperability with the other
-// languages' implementations of the text format.
-func writeString(w *textWriter, s string) error {
- // use WriteByte here to get any needed indent
- if err := w.WriteByte('"'); err != nil {
- return err
- }
- // Loop over the bytes, not the runes.
- for i := 0; i < len(s); i++ {
- var err error
- // Divergence from C++: we don't escape apostrophes.
- // There's no need to escape them, and the C++ parser
- // copes with a naked apostrophe.
- switch c := s[i]; c {
- case '\n':
- _, err = w.w.Write(backslashN)
- case '\r':
- _, err = w.w.Write(backslashR)
- case '\t':
- _, err = w.w.Write(backslashT)
- case '"':
- _, err = w.w.Write(backslashDQ)
- case '\\':
- _, err = w.w.Write(backslashBS)
- default:
- if isprint(c) {
- err = w.w.WriteByte(c)
- } else {
- _, err = fmt.Fprintf(w.w, "\\%03o", c)
- }
- }
- if err != nil {
- return err
- }
- }
- return w.WriteByte('"')
-}
-
-func writeUnknownStruct(w *textWriter, data []byte) (err error) {
- if !w.compact {
- if _, err := fmt.Fprintf(w, "/* %d unknown bytes */\n", len(data)); err != nil {
- return err
- }
- }
- b := NewBuffer(data)
- for b.index < len(b.buf) {
- x, err := b.DecodeVarint()
- if err != nil {
- _, ferr := fmt.Fprintf(w, "/* %v */\n", err)
- return ferr
- }
- wire, tag := x&7, x>>3
- if wire == WireEndGroup {
- w.unindent()
- if _, werr := w.Write(endBraceNewline); werr != nil {
- return werr
- }
- continue
- }
- if _, ferr := fmt.Fprint(w, tag); ferr != nil {
- return ferr
- }
- if wire != WireStartGroup {
- if err = w.WriteByte(':'); err != nil {
- return err
- }
- }
- if !w.compact || wire == WireStartGroup {
- if err = w.WriteByte(' '); err != nil {
- return err
- }
- }
- switch wire {
- case WireBytes:
- buf, e := b.DecodeRawBytes(false)
- if e == nil {
- _, err = fmt.Fprintf(w, "%q", buf)
- } else {
- _, err = fmt.Fprintf(w, "/* %v */", e)
- }
- case WireFixed32:
- x, err = b.DecodeFixed32()
- err = writeUnknownInt(w, x, err)
- case WireFixed64:
- x, err = b.DecodeFixed64()
- err = writeUnknownInt(w, x, err)
- case WireStartGroup:
- err = w.WriteByte('{')
- w.indent()
- case WireVarint:
- x, err = b.DecodeVarint()
- err = writeUnknownInt(w, x, err)
- default:
- _, err = fmt.Fprintf(w, "/* unknown wire type %d */", wire)
- }
- if err != nil {
- return err
- }
- if err := w.WriteByte('\n'); err != nil {
- return err
- }
- }
- return nil
-}
-
-func writeUnknownInt(w *textWriter, x uint64, err error) error {
- if err == nil {
- _, err = fmt.Fprint(w, x)
- } else {
- _, err = fmt.Fprintf(w, "/* %v */", err)
- }
- return err
-}
-
-type int32Slice []int32
-
-func (s int32Slice) Len() int { return len(s) }
-func (s int32Slice) Less(i, j int) bool { return s[i] < s[j] }
-func (s int32Slice) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-
-// writeExtensions writes all the extensions in pv.
-// pv is assumed to be a pointer to a protocol message struct that is extendable.
-func (tm *TextMarshaler) writeExtensions(w *textWriter, pv reflect.Value) error {
- emap := extensionMaps[pv.Type().Elem()]
- e := pv.Interface().(Message)
-
- var m map[int32]Extension
- var mu sync.Locker
- if em, ok := e.(extensionsBytes); ok {
- eb := em.GetExtensions()
- var err error
- m, err = BytesToExtensionsMap(*eb)
- if err != nil {
- return err
- }
- mu = notLocker{}
- } else if _, ok := e.(extendableProto); ok {
- ep, _ := extendable(e)
- m, mu = ep.extensionsRead()
- if m == nil {
- return nil
- }
- }
-
- // Order the extensions by ID.
- // This isn't strictly necessary, but it will give us
- // canonical output, which will also make testing easier.
-
- mu.Lock()
- ids := make([]int32, 0, len(m))
- for id := range m {
- ids = append(ids, id)
- }
- sort.Sort(int32Slice(ids))
- mu.Unlock()
-
- for _, extNum := range ids {
- ext := m[extNum]
- var desc *ExtensionDesc
- if emap != nil {
- desc = emap[extNum]
- }
- if desc == nil {
- // Unknown extension.
- if err := writeUnknownStruct(w, ext.enc); err != nil {
- return err
- }
- continue
- }
-
- pb, err := GetExtension(e, desc)
- if err != nil {
- return fmt.Errorf("failed getting extension: %v", err)
- }
-
- // Repeated extensions will appear as a slice.
- if !desc.repeated() {
- if err := tm.writeExtension(w, desc.Name, pb); err != nil {
- return err
- }
- } else {
- v := reflect.ValueOf(pb)
- for i := 0; i < v.Len(); i++ {
- if err := tm.writeExtension(w, desc.Name, v.Index(i).Interface()); err != nil {
- return err
- }
- }
- }
- }
- return nil
-}
-
-func (tm *TextMarshaler) writeExtension(w *textWriter, name string, pb interface{}) error {
- if _, err := fmt.Fprintf(w, "[%s]:", name); err != nil {
- return err
- }
- if !w.compact {
- if err := w.WriteByte(' '); err != nil {
- return err
- }
- }
- if err := tm.writeAny(w, reflect.ValueOf(pb), nil); err != nil {
- return err
- }
- if err := w.WriteByte('\n'); err != nil {
- return err
- }
- return nil
-}
-
-func (w *textWriter) writeIndent() {
- if !w.complete {
- return
- }
- remain := w.ind * 2
- for remain > 0 {
- n := remain
- if n > len(spaces) {
- n = len(spaces)
- }
- w.w.Write(spaces[:n])
- remain -= n
- }
- w.complete = false
-}
-
-// TextMarshaler is a configurable text format marshaler.
-type TextMarshaler struct {
- Compact bool // use compact text format (one line).
- ExpandAny bool // expand google.protobuf.Any messages of known types
-}
-
-// Marshal writes a given protocol buffer in text format.
-// The only errors returned are from w.
-func (tm *TextMarshaler) Marshal(w io.Writer, pb Message) error {
- val := reflect.ValueOf(pb)
- if pb == nil || val.IsNil() {
- w.Write([]byte(""))
- return nil
- }
- var bw *bufio.Writer
- ww, ok := w.(writer)
- if !ok {
- bw = bufio.NewWriter(w)
- ww = bw
- }
- aw := &textWriter{
- w: ww,
- complete: true,
- compact: tm.Compact,
- }
-
- if etm, ok := pb.(encoding.TextMarshaler); ok {
- text, err := etm.MarshalText()
- if err != nil {
- return err
- }
- if _, err = aw.Write(text); err != nil {
- return err
- }
- if bw != nil {
- return bw.Flush()
- }
- return nil
- }
- // Dereference the received pointer so we don't have outer < and >.
- v := reflect.Indirect(val)
- if err := tm.writeStruct(aw, v); err != nil {
- return err
- }
- if bw != nil {
- return bw.Flush()
- }
- return nil
-}
-
-// Text is the same as Marshal, but returns the string directly.
-func (tm *TextMarshaler) Text(pb Message) string {
- var buf bytes.Buffer
- tm.Marshal(&buf, pb)
- return buf.String()
-}
-
-var (
- defaultTextMarshaler = TextMarshaler{}
- compactTextMarshaler = TextMarshaler{Compact: true}
-)
-
-// TODO: consider removing some of the Marshal functions below.
-
-// MarshalText writes a given protocol buffer in text format.
-// The only errors returned are from w.
-func MarshalText(w io.Writer, pb Message) error { return defaultTextMarshaler.Marshal(w, pb) }
-
-// MarshalTextString is the same as MarshalText, but returns the string directly.
-func MarshalTextString(pb Message) string { return defaultTextMarshaler.Text(pb) }
-
-// CompactText writes a given protocol buffer in compact text format (one line).
-func CompactText(w io.Writer, pb Message) error { return compactTextMarshaler.Marshal(w, pb) }
-
-// CompactTextString is the same as CompactText, but returns the string directly.
-func CompactTextString(pb Message) string { return compactTextMarshaler.Text(pb) }
diff --git a/api/vendor/github.com/gogo/protobuf/proto/text_gogo.go b/api/vendor/github.com/gogo/protobuf/proto/text_gogo.go
deleted file mode 100644
index 1d6c6aa0e41b..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/text_gogo.go
+++ /dev/null
@@ -1,57 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2013, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-//
-// 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
-// OWNER 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.
-
-package proto
-
-import (
- "fmt"
- "reflect"
-)
-
-func (tm *TextMarshaler) writeEnum(w *textWriter, v reflect.Value, props *Properties) error {
- m, ok := enumStringMaps[props.Enum]
- if !ok {
- if err := tm.writeAny(w, v, props); err != nil {
- return err
- }
- }
- key := int32(0)
- if v.Kind() == reflect.Ptr {
- key = int32(v.Elem().Int())
- } else {
- key = int32(v.Int())
- }
- s, ok := m[key]
- if !ok {
- if err := tm.writeAny(w, v, props); err != nil {
- return err
- }
- }
- _, err := fmt.Fprint(w, s)
- return err
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/text_parser.go b/api/vendor/github.com/gogo/protobuf/proto/text_parser.go
deleted file mode 100644
index f85c0cc81a76..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/text_parser.go
+++ /dev/null
@@ -1,1018 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2013, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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
-// OWNER 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.
-
-package proto
-
-// Functions for parsing the Text protocol buffer format.
-// TODO: message sets.
-
-import (
- "encoding"
- "errors"
- "fmt"
- "reflect"
- "strconv"
- "strings"
- "time"
- "unicode/utf8"
-)
-
-// Error string emitted when deserializing Any and fields are already set
-const anyRepeatedlyUnpacked = "Any message unpacked multiple times, or %q already set"
-
-type ParseError struct {
- Message string
- Line int // 1-based line number
- Offset int // 0-based byte offset from start of input
-}
-
-func (p *ParseError) Error() string {
- if p.Line == 1 {
- // show offset only for first line
- return fmt.Sprintf("line 1.%d: %v", p.Offset, p.Message)
- }
- return fmt.Sprintf("line %d: %v", p.Line, p.Message)
-}
-
-type token struct {
- value string
- err *ParseError
- line int // line number
- offset int // byte number from start of input, not start of line
- unquoted string // the unquoted version of value, if it was a quoted string
-}
-
-func (t *token) String() string {
- if t.err == nil {
- return fmt.Sprintf("%q (line=%d, offset=%d)", t.value, t.line, t.offset)
- }
- return fmt.Sprintf("parse error: %v", t.err)
-}
-
-type textParser struct {
- s string // remaining input
- done bool // whether the parsing is finished (success or error)
- backed bool // whether back() was called
- offset, line int
- cur token
-}
-
-func newTextParser(s string) *textParser {
- p := new(textParser)
- p.s = s
- p.line = 1
- p.cur.line = 1
- return p
-}
-
-func (p *textParser) errorf(format string, a ...interface{}) *ParseError {
- pe := &ParseError{fmt.Sprintf(format, a...), p.cur.line, p.cur.offset}
- p.cur.err = pe
- p.done = true
- return pe
-}
-
-// Numbers and identifiers are matched by [-+._A-Za-z0-9]
-func isIdentOrNumberChar(c byte) bool {
- switch {
- case 'A' <= c && c <= 'Z', 'a' <= c && c <= 'z':
- return true
- case '0' <= c && c <= '9':
- return true
- }
- switch c {
- case '-', '+', '.', '_':
- return true
- }
- return false
-}
-
-func isWhitespace(c byte) bool {
- switch c {
- case ' ', '\t', '\n', '\r':
- return true
- }
- return false
-}
-
-func isQuote(c byte) bool {
- switch c {
- case '"', '\'':
- return true
- }
- return false
-}
-
-func (p *textParser) skipWhitespace() {
- i := 0
- for i < len(p.s) && (isWhitespace(p.s[i]) || p.s[i] == '#') {
- if p.s[i] == '#' {
- // comment; skip to end of line or input
- for i < len(p.s) && p.s[i] != '\n' {
- i++
- }
- if i == len(p.s) {
- break
- }
- }
- if p.s[i] == '\n' {
- p.line++
- }
- i++
- }
- p.offset += i
- p.s = p.s[i:len(p.s)]
- if len(p.s) == 0 {
- p.done = true
- }
-}
-
-func (p *textParser) advance() {
- // Skip whitespace
- p.skipWhitespace()
- if p.done {
- return
- }
-
- // Start of non-whitespace
- p.cur.err = nil
- p.cur.offset, p.cur.line = p.offset, p.line
- p.cur.unquoted = ""
- switch p.s[0] {
- case '<', '>', '{', '}', ':', '[', ']', ';', ',', '/':
- // Single symbol
- p.cur.value, p.s = p.s[0:1], p.s[1:len(p.s)]
- case '"', '\'':
- // Quoted string
- i := 1
- for i < len(p.s) && p.s[i] != p.s[0] && p.s[i] != '\n' {
- if p.s[i] == '\\' && i+1 < len(p.s) {
- // skip escaped char
- i++
- }
- i++
- }
- if i >= len(p.s) || p.s[i] != p.s[0] {
- p.errorf("unmatched quote")
- return
- }
- unq, err := unquoteC(p.s[1:i], rune(p.s[0]))
- if err != nil {
- p.errorf("invalid quoted string %s: %v", p.s[0:i+1], err)
- return
- }
- p.cur.value, p.s = p.s[0:i+1], p.s[i+1:len(p.s)]
- p.cur.unquoted = unq
- default:
- i := 0
- for i < len(p.s) && isIdentOrNumberChar(p.s[i]) {
- i++
- }
- if i == 0 {
- p.errorf("unexpected byte %#x", p.s[0])
- return
- }
- p.cur.value, p.s = p.s[0:i], p.s[i:len(p.s)]
- }
- p.offset += len(p.cur.value)
-}
-
-var (
- errBadUTF8 = errors.New("proto: bad UTF-8")
-)
-
-func unquoteC(s string, quote rune) (string, error) {
- // This is based on C++'s tokenizer.cc.
- // Despite its name, this is *not* parsing C syntax.
- // For instance, "\0" is an invalid quoted string.
-
- // Avoid allocation in trivial cases.
- simple := true
- for _, r := range s {
- if r == '\\' || r == quote {
- simple = false
- break
- }
- }
- if simple {
- return s, nil
- }
-
- buf := make([]byte, 0, 3*len(s)/2)
- for len(s) > 0 {
- r, n := utf8.DecodeRuneInString(s)
- if r == utf8.RuneError && n == 1 {
- return "", errBadUTF8
- }
- s = s[n:]
- if r != '\\' {
- if r < utf8.RuneSelf {
- buf = append(buf, byte(r))
- } else {
- buf = append(buf, string(r)...)
- }
- continue
- }
-
- ch, tail, err := unescape(s)
- if err != nil {
- return "", err
- }
- buf = append(buf, ch...)
- s = tail
- }
- return string(buf), nil
-}
-
-func unescape(s string) (ch string, tail string, err error) {
- r, n := utf8.DecodeRuneInString(s)
- if r == utf8.RuneError && n == 1 {
- return "", "", errBadUTF8
- }
- s = s[n:]
- switch r {
- case 'a':
- return "\a", s, nil
- case 'b':
- return "\b", s, nil
- case 'f':
- return "\f", s, nil
- case 'n':
- return "\n", s, nil
- case 'r':
- return "\r", s, nil
- case 't':
- return "\t", s, nil
- case 'v':
- return "\v", s, nil
- case '?':
- return "?", s, nil // trigraph workaround
- case '\'', '"', '\\':
- return string(r), s, nil
- case '0', '1', '2', '3', '4', '5', '6', '7':
- if len(s) < 2 {
- return "", "", fmt.Errorf(`\%c requires 2 following digits`, r)
- }
- ss := string(r) + s[:2]
- s = s[2:]
- i, err := strconv.ParseUint(ss, 8, 8)
- if err != nil {
- return "", "", fmt.Errorf(`\%s contains non-octal digits`, ss)
- }
- return string([]byte{byte(i)}), s, nil
- case 'x', 'X', 'u', 'U':
- var n int
- switch r {
- case 'x', 'X':
- n = 2
- case 'u':
- n = 4
- case 'U':
- n = 8
- }
- if len(s) < n {
- return "", "", fmt.Errorf(`\%c requires %d following digits`, r, n)
- }
- ss := s[:n]
- s = s[n:]
- i, err := strconv.ParseUint(ss, 16, 64)
- if err != nil {
- return "", "", fmt.Errorf(`\%c%s contains non-hexadecimal digits`, r, ss)
- }
- if r == 'x' || r == 'X' {
- return string([]byte{byte(i)}), s, nil
- }
- if i > utf8.MaxRune {
- return "", "", fmt.Errorf(`\%c%s is not a valid Unicode code point`, r, ss)
- }
- return string(rune(i)), s, nil
- }
- return "", "", fmt.Errorf(`unknown escape \%c`, r)
-}
-
-// Back off the parser by one token. Can only be done between calls to next().
-// It makes the next advance() a no-op.
-func (p *textParser) back() { p.backed = true }
-
-// Advances the parser and returns the new current token.
-func (p *textParser) next() *token {
- if p.backed || p.done {
- p.backed = false
- return &p.cur
- }
- p.advance()
- if p.done {
- p.cur.value = ""
- } else if len(p.cur.value) > 0 && isQuote(p.cur.value[0]) {
- // Look for multiple quoted strings separated by whitespace,
- // and concatenate them.
- cat := p.cur
- for {
- p.skipWhitespace()
- if p.done || !isQuote(p.s[0]) {
- break
- }
- p.advance()
- if p.cur.err != nil {
- return &p.cur
- }
- cat.value += " " + p.cur.value
- cat.unquoted += p.cur.unquoted
- }
- p.done = false // parser may have seen EOF, but we want to return cat
- p.cur = cat
- }
- return &p.cur
-}
-
-func (p *textParser) consumeToken(s string) error {
- tok := p.next()
- if tok.err != nil {
- return tok.err
- }
- if tok.value != s {
- p.back()
- return p.errorf("expected %q, found %q", s, tok.value)
- }
- return nil
-}
-
-// Return a RequiredNotSetError indicating which required field was not set.
-func (p *textParser) missingRequiredFieldError(sv reflect.Value) *RequiredNotSetError {
- st := sv.Type()
- sprops := GetProperties(st)
- for i := 0; i < st.NumField(); i++ {
- if !isNil(sv.Field(i)) {
- continue
- }
-
- props := sprops.Prop[i]
- if props.Required {
- return &RequiredNotSetError{fmt.Sprintf("%v.%v", st, props.OrigName)}
- }
- }
- return &RequiredNotSetError{fmt.Sprintf("%v.", st)} // should not happen
-}
-
-// Returns the index in the struct for the named field, as well as the parsed tag properties.
-func structFieldByName(sprops *StructProperties, name string) (int, *Properties, bool) {
- i, ok := sprops.decoderOrigNames[name]
- if ok {
- return i, sprops.Prop[i], true
- }
- return -1, nil, false
-}
-
-// Consume a ':' from the input stream (if the next token is a colon),
-// returning an error if a colon is needed but not present.
-func (p *textParser) checkForColon(props *Properties, typ reflect.Type) *ParseError {
- tok := p.next()
- if tok.err != nil {
- return tok.err
- }
- if tok.value != ":" {
- // Colon is optional when the field is a group or message.
- needColon := true
- switch props.Wire {
- case "group":
- needColon = false
- case "bytes":
- // A "bytes" field is either a message, a string, or a repeated field;
- // those three become *T, *string and []T respectively, so we can check for
- // this field being a pointer to a non-string.
- if typ.Kind() == reflect.Ptr {
- // *T or *string
- if typ.Elem().Kind() == reflect.String {
- break
- }
- } else if typ.Kind() == reflect.Slice {
- // []T or []*T
- if typ.Elem().Kind() != reflect.Ptr {
- break
- }
- } else if typ.Kind() == reflect.String {
- // The proto3 exception is for a string field,
- // which requires a colon.
- break
- }
- needColon = false
- }
- if needColon {
- return p.errorf("expected ':', found %q", tok.value)
- }
- p.back()
- }
- return nil
-}
-
-func (p *textParser) readStruct(sv reflect.Value, terminator string) error {
- st := sv.Type()
- sprops := GetProperties(st)
- reqCount := sprops.reqCount
- var reqFieldErr error
- fieldSet := make(map[string]bool)
- // A struct is a sequence of "name: value", terminated by one of
- // '>' or '}', or the end of the input. A name may also be
- // "[extension]" or "[type/url]".
- //
- // The whole struct can also be an expanded Any message, like:
- // [type/url] < ... struct contents ... >
- for {
- tok := p.next()
- if tok.err != nil {
- return tok.err
- }
- if tok.value == terminator {
- break
- }
- if tok.value == "[" {
- // Looks like an extension or an Any.
- //
- // TODO: Check whether we need to handle
- // namespace rooted names (e.g. ".something.Foo").
- extName, err := p.consumeExtName()
- if err != nil {
- return err
- }
-
- if s := strings.LastIndex(extName, "/"); s >= 0 {
- // If it contains a slash, it's an Any type URL.
- messageName := extName[s+1:]
- mt := MessageType(messageName)
- if mt == nil {
- return p.errorf("unrecognized message %q in google.protobuf.Any", messageName)
- }
- tok = p.next()
- if tok.err != nil {
- return tok.err
- }
- // consume an optional colon
- if tok.value == ":" {
- tok = p.next()
- if tok.err != nil {
- return tok.err
- }
- }
- var terminator string
- switch tok.value {
- case "<":
- terminator = ">"
- case "{":
- terminator = "}"
- default:
- return p.errorf("expected '{' or '<', found %q", tok.value)
- }
- v := reflect.New(mt.Elem())
- if pe := p.readStruct(v.Elem(), terminator); pe != nil {
- return pe
- }
- b, err := Marshal(v.Interface().(Message))
- if err != nil {
- return p.errorf("failed to marshal message of type %q: %v", messageName, err)
- }
- if fieldSet["type_url"] {
- return p.errorf(anyRepeatedlyUnpacked, "type_url")
- }
- if fieldSet["value"] {
- return p.errorf(anyRepeatedlyUnpacked, "value")
- }
- sv.FieldByName("TypeUrl").SetString(extName)
- sv.FieldByName("Value").SetBytes(b)
- fieldSet["type_url"] = true
- fieldSet["value"] = true
- continue
- }
-
- var desc *ExtensionDesc
- // This could be faster, but it's functional.
- // TODO: Do something smarter than a linear scan.
- for _, d := range RegisteredExtensions(reflect.New(st).Interface().(Message)) {
- if d.Name == extName {
- desc = d
- break
- }
- }
- if desc == nil {
- return p.errorf("unrecognized extension %q", extName)
- }
-
- props := &Properties{}
- props.Parse(desc.Tag)
-
- typ := reflect.TypeOf(desc.ExtensionType)
- if err := p.checkForColon(props, typ); err != nil {
- return err
- }
-
- rep := desc.repeated()
-
- // Read the extension structure, and set it in
- // the value we're constructing.
- var ext reflect.Value
- if !rep {
- ext = reflect.New(typ).Elem()
- } else {
- ext = reflect.New(typ.Elem()).Elem()
- }
- if err := p.readAny(ext, props); err != nil {
- if _, ok := err.(*RequiredNotSetError); !ok {
- return err
- }
- reqFieldErr = err
- }
- ep := sv.Addr().Interface().(Message)
- if !rep {
- SetExtension(ep, desc, ext.Interface())
- } else {
- old, err := GetExtension(ep, desc)
- var sl reflect.Value
- if err == nil {
- sl = reflect.ValueOf(old) // existing slice
- } else {
- sl = reflect.MakeSlice(typ, 0, 1)
- }
- sl = reflect.Append(sl, ext)
- SetExtension(ep, desc, sl.Interface())
- }
- if err := p.consumeOptionalSeparator(); err != nil {
- return err
- }
- continue
- }
-
- // This is a normal, non-extension field.
- name := tok.value
- var dst reflect.Value
- fi, props, ok := structFieldByName(sprops, name)
- if ok {
- dst = sv.Field(fi)
- } else if oop, ok := sprops.OneofTypes[name]; ok {
- // It is a oneof.
- props = oop.Prop
- nv := reflect.New(oop.Type.Elem())
- dst = nv.Elem().Field(0)
- field := sv.Field(oop.Field)
- if !field.IsNil() {
- return p.errorf("field '%s' would overwrite already parsed oneof '%s'", name, sv.Type().Field(oop.Field).Name)
- }
- field.Set(nv)
- }
- if !dst.IsValid() {
- return p.errorf("unknown field name %q in %v", name, st)
- }
-
- if dst.Kind() == reflect.Map {
- // Consume any colon.
- if err := p.checkForColon(props, dst.Type()); err != nil {
- return err
- }
-
- // Construct the map if it doesn't already exist.
- if dst.IsNil() {
- dst.Set(reflect.MakeMap(dst.Type()))
- }
- key := reflect.New(dst.Type().Key()).Elem()
- val := reflect.New(dst.Type().Elem()).Elem()
-
- // The map entry should be this sequence of tokens:
- // < key : KEY value : VALUE >
- // However, implementations may omit key or value, and technically
- // we should support them in any order. See b/28924776 for a time
- // this went wrong.
-
- tok := p.next()
- var terminator string
- switch tok.value {
- case "<":
- terminator = ">"
- case "{":
- terminator = "}"
- default:
- return p.errorf("expected '{' or '<', found %q", tok.value)
- }
- for {
- tok := p.next()
- if tok.err != nil {
- return tok.err
- }
- if tok.value == terminator {
- break
- }
- switch tok.value {
- case "key":
- if err := p.consumeToken(":"); err != nil {
- return err
- }
- if err := p.readAny(key, props.MapKeyProp); err != nil {
- return err
- }
- if err := p.consumeOptionalSeparator(); err != nil {
- return err
- }
- case "value":
- if err := p.checkForColon(props.MapValProp, dst.Type().Elem()); err != nil {
- return err
- }
- if err := p.readAny(val, props.MapValProp); err != nil {
- return err
- }
- if err := p.consumeOptionalSeparator(); err != nil {
- return err
- }
- default:
- p.back()
- return p.errorf(`expected "key", "value", or %q, found %q`, terminator, tok.value)
- }
- }
-
- dst.SetMapIndex(key, val)
- continue
- }
-
- // Check that it's not already set if it's not a repeated field.
- if !props.Repeated && fieldSet[name] {
- return p.errorf("non-repeated field %q was repeated", name)
- }
-
- if err := p.checkForColon(props, dst.Type()); err != nil {
- return err
- }
-
- // Parse into the field.
- fieldSet[name] = true
- if err := p.readAny(dst, props); err != nil {
- if _, ok := err.(*RequiredNotSetError); !ok {
- return err
- }
- reqFieldErr = err
- }
- if props.Required {
- reqCount--
- }
-
- if err := p.consumeOptionalSeparator(); err != nil {
- return err
- }
-
- }
-
- if reqCount > 0 {
- return p.missingRequiredFieldError(sv)
- }
- return reqFieldErr
-}
-
-// consumeExtName consumes extension name or expanded Any type URL and the
-// following ']'. It returns the name or URL consumed.
-func (p *textParser) consumeExtName() (string, error) {
- tok := p.next()
- if tok.err != nil {
- return "", tok.err
- }
-
- // If extension name or type url is quoted, it's a single token.
- if len(tok.value) > 2 && isQuote(tok.value[0]) && tok.value[len(tok.value)-1] == tok.value[0] {
- name, err := unquoteC(tok.value[1:len(tok.value)-1], rune(tok.value[0]))
- if err != nil {
- return "", err
- }
- return name, p.consumeToken("]")
- }
-
- // Consume everything up to "]"
- var parts []string
- for tok.value != "]" {
- parts = append(parts, tok.value)
- tok = p.next()
- if tok.err != nil {
- return "", p.errorf("unrecognized type_url or extension name: %s", tok.err)
- }
- if p.done && tok.value != "]" {
- return "", p.errorf("unclosed type_url or extension name")
- }
- }
- return strings.Join(parts, ""), nil
-}
-
-// consumeOptionalSeparator consumes an optional semicolon or comma.
-// It is used in readStruct to provide backward compatibility.
-func (p *textParser) consumeOptionalSeparator() error {
- tok := p.next()
- if tok.err != nil {
- return tok.err
- }
- if tok.value != ";" && tok.value != "," {
- p.back()
- }
- return nil
-}
-
-func (p *textParser) readAny(v reflect.Value, props *Properties) error {
- tok := p.next()
- if tok.err != nil {
- return tok.err
- }
- if tok.value == "" {
- return p.errorf("unexpected EOF")
- }
- if len(props.CustomType) > 0 {
- if props.Repeated {
- t := reflect.TypeOf(v.Interface())
- if t.Kind() == reflect.Slice {
- tc := reflect.TypeOf(new(Marshaler))
- ok := t.Elem().Implements(tc.Elem())
- if ok {
- fv := v
- flen := fv.Len()
- if flen == fv.Cap() {
- nav := reflect.MakeSlice(v.Type(), flen, 2*flen+1)
- reflect.Copy(nav, fv)
- fv.Set(nav)
- }
- fv.SetLen(flen + 1)
-
- // Read one.
- p.back()
- return p.readAny(fv.Index(flen), props)
- }
- }
- }
- if reflect.TypeOf(v.Interface()).Kind() == reflect.Ptr {
- custom := reflect.New(props.ctype.Elem()).Interface().(Unmarshaler)
- err := custom.Unmarshal([]byte(tok.unquoted))
- if err != nil {
- return p.errorf("%v %v: %v", err, v.Type(), tok.value)
- }
- v.Set(reflect.ValueOf(custom))
- } else {
- custom := reflect.New(reflect.TypeOf(v.Interface())).Interface().(Unmarshaler)
- err := custom.Unmarshal([]byte(tok.unquoted))
- if err != nil {
- return p.errorf("%v %v: %v", err, v.Type(), tok.value)
- }
- v.Set(reflect.Indirect(reflect.ValueOf(custom)))
- }
- return nil
- }
- if props.StdTime {
- fv := v
- p.back()
- props.StdTime = false
- tproto := ×tamp{}
- err := p.readAny(reflect.ValueOf(tproto).Elem(), props)
- props.StdTime = true
- if err != nil {
- return err
- }
- tim, err := timestampFromProto(tproto)
- if err != nil {
- return err
- }
- if props.Repeated {
- t := reflect.TypeOf(v.Interface())
- if t.Kind() == reflect.Slice {
- if t.Elem().Kind() == reflect.Ptr {
- ts := fv.Interface().([]*time.Time)
- ts = append(ts, &tim)
- fv.Set(reflect.ValueOf(ts))
- return nil
- } else {
- ts := fv.Interface().([]time.Time)
- ts = append(ts, tim)
- fv.Set(reflect.ValueOf(ts))
- return nil
- }
- }
- }
- if reflect.TypeOf(v.Interface()).Kind() == reflect.Ptr {
- v.Set(reflect.ValueOf(&tim))
- } else {
- v.Set(reflect.Indirect(reflect.ValueOf(&tim)))
- }
- return nil
- }
- if props.StdDuration {
- fv := v
- p.back()
- props.StdDuration = false
- dproto := &duration{}
- err := p.readAny(reflect.ValueOf(dproto).Elem(), props)
- props.StdDuration = true
- if err != nil {
- return err
- }
- dur, err := durationFromProto(dproto)
- if err != nil {
- return err
- }
- if props.Repeated {
- t := reflect.TypeOf(v.Interface())
- if t.Kind() == reflect.Slice {
- if t.Elem().Kind() == reflect.Ptr {
- ds := fv.Interface().([]*time.Duration)
- ds = append(ds, &dur)
- fv.Set(reflect.ValueOf(ds))
- return nil
- } else {
- ds := fv.Interface().([]time.Duration)
- ds = append(ds, dur)
- fv.Set(reflect.ValueOf(ds))
- return nil
- }
- }
- }
- if reflect.TypeOf(v.Interface()).Kind() == reflect.Ptr {
- v.Set(reflect.ValueOf(&dur))
- } else {
- v.Set(reflect.Indirect(reflect.ValueOf(&dur)))
- }
- return nil
- }
- switch fv := v; fv.Kind() {
- case reflect.Slice:
- at := v.Type()
- if at.Elem().Kind() == reflect.Uint8 {
- // Special case for []byte
- if tok.value[0] != '"' && tok.value[0] != '\'' {
- // Deliberately written out here, as the error after
- // this switch statement would write "invalid []byte: ...",
- // which is not as user-friendly.
- return p.errorf("invalid string: %v", tok.value)
- }
- bytes := []byte(tok.unquoted)
- fv.Set(reflect.ValueOf(bytes))
- return nil
- }
- // Repeated field.
- if tok.value == "[" {
- // Repeated field with list notation, like [1,2,3].
- for {
- fv.Set(reflect.Append(fv, reflect.New(at.Elem()).Elem()))
- err := p.readAny(fv.Index(fv.Len()-1), props)
- if err != nil {
- return err
- }
- ntok := p.next()
- if ntok.err != nil {
- return ntok.err
- }
- if ntok.value == "]" {
- break
- }
- if ntok.value != "," {
- return p.errorf("Expected ']' or ',' found %q", ntok.value)
- }
- }
- return nil
- }
- // One value of the repeated field.
- p.back()
- fv.Set(reflect.Append(fv, reflect.New(at.Elem()).Elem()))
- return p.readAny(fv.Index(fv.Len()-1), props)
- case reflect.Bool:
- // true/1/t/True or false/f/0/False.
- switch tok.value {
- case "true", "1", "t", "True":
- fv.SetBool(true)
- return nil
- case "false", "0", "f", "False":
- fv.SetBool(false)
- return nil
- }
- case reflect.Float32, reflect.Float64:
- v := tok.value
- // Ignore 'f' for compatibility with output generated by C++, but don't
- // remove 'f' when the value is "-inf" or "inf".
- if strings.HasSuffix(v, "f") && tok.value != "-inf" && tok.value != "inf" {
- v = v[:len(v)-1]
- }
- if f, err := strconv.ParseFloat(v, fv.Type().Bits()); err == nil {
- fv.SetFloat(f)
- return nil
- }
- case reflect.Int8:
- if x, err := strconv.ParseInt(tok.value, 0, 8); err == nil {
- fv.SetInt(x)
- return nil
- }
- case reflect.Int16:
- if x, err := strconv.ParseInt(tok.value, 0, 16); err == nil {
- fv.SetInt(x)
- return nil
- }
- case reflect.Int32:
- if x, err := strconv.ParseInt(tok.value, 0, 32); err == nil {
- fv.SetInt(x)
- return nil
- }
-
- if len(props.Enum) == 0 {
- break
- }
- m, ok := enumValueMaps[props.Enum]
- if !ok {
- break
- }
- x, ok := m[tok.value]
- if !ok {
- break
- }
- fv.SetInt(int64(x))
- return nil
- case reflect.Int64:
- if x, err := strconv.ParseInt(tok.value, 0, 64); err == nil {
- fv.SetInt(x)
- return nil
- }
-
- case reflect.Ptr:
- // A basic field (indirected through pointer), or a repeated message/group
- p.back()
- fv.Set(reflect.New(fv.Type().Elem()))
- return p.readAny(fv.Elem(), props)
- case reflect.String:
- if tok.value[0] == '"' || tok.value[0] == '\'' {
- fv.SetString(tok.unquoted)
- return nil
- }
- case reflect.Struct:
- var terminator string
- switch tok.value {
- case "{":
- terminator = "}"
- case "<":
- terminator = ">"
- default:
- return p.errorf("expected '{' or '<', found %q", tok.value)
- }
- // TODO: Handle nested messages which implement encoding.TextUnmarshaler.
- return p.readStruct(fv, terminator)
- case reflect.Uint8:
- if x, err := strconv.ParseUint(tok.value, 0, 8); err == nil {
- fv.SetUint(x)
- return nil
- }
- case reflect.Uint16:
- if x, err := strconv.ParseUint(tok.value, 0, 16); err == nil {
- fv.SetUint(x)
- return nil
- }
- case reflect.Uint32:
- if x, err := strconv.ParseUint(tok.value, 0, 32); err == nil {
- fv.SetUint(uint64(x))
- return nil
- }
- case reflect.Uint64:
- if x, err := strconv.ParseUint(tok.value, 0, 64); err == nil {
- fv.SetUint(x)
- return nil
- }
- }
- return p.errorf("invalid %v: %v", v.Type(), tok.value)
-}
-
-// UnmarshalText reads a protocol buffer in Text format. UnmarshalText resets pb
-// before starting to unmarshal, so any existing data in pb is always removed.
-// If a required field is not set and no other error occurs,
-// UnmarshalText returns *RequiredNotSetError.
-func UnmarshalText(s string, pb Message) error {
- if um, ok := pb.(encoding.TextUnmarshaler); ok {
- return um.UnmarshalText([]byte(s))
- }
- pb.Reset()
- v := reflect.ValueOf(pb)
- return newTextParser(s).readStruct(v.Elem(), "")
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/timestamp.go b/api/vendor/github.com/gogo/protobuf/proto/timestamp.go
deleted file mode 100644
index 9324f6542bcf..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/timestamp.go
+++ /dev/null
@@ -1,113 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2016 The Go Authors. All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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
-// OWNER 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.
-
-package proto
-
-// This file implements operations on google.protobuf.Timestamp.
-
-import (
- "errors"
- "fmt"
- "time"
-)
-
-const (
- // Seconds field of the earliest valid Timestamp.
- // This is time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC).Unix().
- minValidSeconds = -62135596800
- // Seconds field just after the latest valid Timestamp.
- // This is time.Date(10000, 1, 1, 0, 0, 0, 0, time.UTC).Unix().
- maxValidSeconds = 253402300800
-)
-
-// validateTimestamp determines whether a Timestamp is valid.
-// A valid timestamp represents a time in the range
-// [0001-01-01, 10000-01-01) and has a Nanos field
-// in the range [0, 1e9).
-//
-// If the Timestamp is valid, validateTimestamp returns nil.
-// Otherwise, it returns an error that describes
-// the problem.
-//
-// Every valid Timestamp can be represented by a time.Time, but the converse is not true.
-func validateTimestamp(ts *timestamp) error {
- if ts == nil {
- return errors.New("timestamp: nil Timestamp")
- }
- if ts.Seconds < minValidSeconds {
- return fmt.Errorf("timestamp: %#v before 0001-01-01", ts)
- }
- if ts.Seconds >= maxValidSeconds {
- return fmt.Errorf("timestamp: %#v after 10000-01-01", ts)
- }
- if ts.Nanos < 0 || ts.Nanos >= 1e9 {
- return fmt.Errorf("timestamp: %#v: nanos not in range [0, 1e9)", ts)
- }
- return nil
-}
-
-// TimestampFromProto converts a google.protobuf.Timestamp proto to a time.Time.
-// It returns an error if the argument is invalid.
-//
-// Unlike most Go functions, if Timestamp returns an error, the first return value
-// is not the zero time.Time. Instead, it is the value obtained from the
-// time.Unix function when passed the contents of the Timestamp, in the UTC
-// locale. This may or may not be a meaningful time; many invalid Timestamps
-// do map to valid time.Times.
-//
-// A nil Timestamp returns an error. The first return value in that case is
-// undefined.
-func timestampFromProto(ts *timestamp) (time.Time, error) {
- // Don't return the zero value on error, because corresponds to a valid
- // timestamp. Instead return whatever time.Unix gives us.
- var t time.Time
- if ts == nil {
- t = time.Unix(0, 0).UTC() // treat nil like the empty Timestamp
- } else {
- t = time.Unix(ts.Seconds, int64(ts.Nanos)).UTC()
- }
- return t, validateTimestamp(ts)
-}
-
-// TimestampProto converts the time.Time to a google.protobuf.Timestamp proto.
-// It returns an error if the resulting Timestamp is invalid.
-func timestampProto(t time.Time) (*timestamp, error) {
- seconds := t.Unix()
- nanos := int32(t.Sub(time.Unix(seconds, 0)))
- ts := ×tamp{
- Seconds: seconds,
- Nanos: nanos,
- }
- if err := validateTimestamp(ts); err != nil {
- return nil, err
- }
- return ts, nil
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/timestamp_gogo.go b/api/vendor/github.com/gogo/protobuf/proto/timestamp_gogo.go
deleted file mode 100644
index 38439fa99013..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/timestamp_gogo.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2016, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-//
-// 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
-// OWNER 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.
-
-package proto
-
-import (
- "reflect"
- "time"
-)
-
-var timeType = reflect.TypeOf((*time.Time)(nil)).Elem()
-
-type timestamp struct {
- Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"`
- Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"`
-}
-
-func (m *timestamp) Reset() { *m = timestamp{} }
-func (*timestamp) ProtoMessage() {}
-func (*timestamp) String() string { return "timestamp" }
-
-func init() {
- RegisterType((*timestamp)(nil), "gogo.protobuf.proto.timestamp")
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/wrappers.go b/api/vendor/github.com/gogo/protobuf/proto/wrappers.go
deleted file mode 100644
index b175d1b64234..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/wrappers.go
+++ /dev/null
@@ -1,1888 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2018, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-//
-// 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
-// OWNER 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.
-
-package proto
-
-import (
- "io"
- "reflect"
-)
-
-func makeStdDoubleValueMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- t := ptr.asPointerTo(u.typ).Interface().(*float64)
- v := &float64Value{*t}
- siz := Size(v)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- t := ptr.asPointerTo(u.typ).Interface().(*float64)
- v := &float64Value{*t}
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeStdDoubleValuePtrMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- if ptr.isNil() {
- return 0
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*float64)
- v := &float64Value{*t}
- siz := Size(v)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- if ptr.isNil() {
- return b, nil
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*float64)
- v := &float64Value{*t}
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeStdDoubleValueSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(u.typ)
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(float64)
- v := &float64Value{t}
- siz := Size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(u.typ)
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(float64)
- v := &float64Value{t}
- siz := Size(v)
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeStdDoubleValuePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*float64)
- v := &float64Value{*t}
- siz := Size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*float64)
- v := &float64Value{*t}
- siz := Size(v)
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeStdDoubleValueUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &float64Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- s := f.asPointerTo(sub.typ).Elem()
- s.Set(reflect.ValueOf(m.Value))
- return b[x:], nil
- }
-}
-
-func makeStdDoubleValuePtrUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &float64Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem()
- s.Set(reflect.ValueOf(&m.Value))
- return b[x:], nil
- }
-}
-
-func makeStdDoubleValuePtrSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &float64Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- slice := f.getSlice(reflect.PtrTo(sub.typ))
- newSlice := reflect.Append(slice, reflect.ValueOf(&m.Value))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeStdDoubleValueSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &float64Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- slice := f.getSlice(sub.typ)
- newSlice := reflect.Append(slice, reflect.ValueOf(m.Value))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeStdFloatValueMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- t := ptr.asPointerTo(u.typ).Interface().(*float32)
- v := &float32Value{*t}
- siz := Size(v)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- t := ptr.asPointerTo(u.typ).Interface().(*float32)
- v := &float32Value{*t}
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeStdFloatValuePtrMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- if ptr.isNil() {
- return 0
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*float32)
- v := &float32Value{*t}
- siz := Size(v)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- if ptr.isNil() {
- return b, nil
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*float32)
- v := &float32Value{*t}
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeStdFloatValueSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(u.typ)
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(float32)
- v := &float32Value{t}
- siz := Size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(u.typ)
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(float32)
- v := &float32Value{t}
- siz := Size(v)
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeStdFloatValuePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*float32)
- v := &float32Value{*t}
- siz := Size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*float32)
- v := &float32Value{*t}
- siz := Size(v)
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeStdFloatValueUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &float32Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- s := f.asPointerTo(sub.typ).Elem()
- s.Set(reflect.ValueOf(m.Value))
- return b[x:], nil
- }
-}
-
-func makeStdFloatValuePtrUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &float32Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem()
- s.Set(reflect.ValueOf(&m.Value))
- return b[x:], nil
- }
-}
-
-func makeStdFloatValuePtrSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &float32Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- slice := f.getSlice(reflect.PtrTo(sub.typ))
- newSlice := reflect.Append(slice, reflect.ValueOf(&m.Value))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeStdFloatValueSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &float32Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- slice := f.getSlice(sub.typ)
- newSlice := reflect.Append(slice, reflect.ValueOf(m.Value))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeStdInt64ValueMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- t := ptr.asPointerTo(u.typ).Interface().(*int64)
- v := &int64Value{*t}
- siz := Size(v)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- t := ptr.asPointerTo(u.typ).Interface().(*int64)
- v := &int64Value{*t}
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeStdInt64ValuePtrMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- if ptr.isNil() {
- return 0
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*int64)
- v := &int64Value{*t}
- siz := Size(v)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- if ptr.isNil() {
- return b, nil
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*int64)
- v := &int64Value{*t}
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeStdInt64ValueSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(u.typ)
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(int64)
- v := &int64Value{t}
- siz := Size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(u.typ)
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(int64)
- v := &int64Value{t}
- siz := Size(v)
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeStdInt64ValuePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*int64)
- v := &int64Value{*t}
- siz := Size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*int64)
- v := &int64Value{*t}
- siz := Size(v)
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeStdInt64ValueUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &int64Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- s := f.asPointerTo(sub.typ).Elem()
- s.Set(reflect.ValueOf(m.Value))
- return b[x:], nil
- }
-}
-
-func makeStdInt64ValuePtrUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &int64Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem()
- s.Set(reflect.ValueOf(&m.Value))
- return b[x:], nil
- }
-}
-
-func makeStdInt64ValuePtrSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &int64Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- slice := f.getSlice(reflect.PtrTo(sub.typ))
- newSlice := reflect.Append(slice, reflect.ValueOf(&m.Value))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeStdInt64ValueSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &int64Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- slice := f.getSlice(sub.typ)
- newSlice := reflect.Append(slice, reflect.ValueOf(m.Value))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeStdUInt64ValueMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- t := ptr.asPointerTo(u.typ).Interface().(*uint64)
- v := &uint64Value{*t}
- siz := Size(v)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- t := ptr.asPointerTo(u.typ).Interface().(*uint64)
- v := &uint64Value{*t}
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeStdUInt64ValuePtrMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- if ptr.isNil() {
- return 0
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*uint64)
- v := &uint64Value{*t}
- siz := Size(v)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- if ptr.isNil() {
- return b, nil
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*uint64)
- v := &uint64Value{*t}
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeStdUInt64ValueSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(u.typ)
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(uint64)
- v := &uint64Value{t}
- siz := Size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(u.typ)
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(uint64)
- v := &uint64Value{t}
- siz := Size(v)
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeStdUInt64ValuePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*uint64)
- v := &uint64Value{*t}
- siz := Size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*uint64)
- v := &uint64Value{*t}
- siz := Size(v)
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeStdUInt64ValueUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &uint64Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- s := f.asPointerTo(sub.typ).Elem()
- s.Set(reflect.ValueOf(m.Value))
- return b[x:], nil
- }
-}
-
-func makeStdUInt64ValuePtrUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &uint64Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem()
- s.Set(reflect.ValueOf(&m.Value))
- return b[x:], nil
- }
-}
-
-func makeStdUInt64ValuePtrSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &uint64Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- slice := f.getSlice(reflect.PtrTo(sub.typ))
- newSlice := reflect.Append(slice, reflect.ValueOf(&m.Value))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeStdUInt64ValueSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &uint64Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- slice := f.getSlice(sub.typ)
- newSlice := reflect.Append(slice, reflect.ValueOf(m.Value))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeStdInt32ValueMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- t := ptr.asPointerTo(u.typ).Interface().(*int32)
- v := &int32Value{*t}
- siz := Size(v)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- t := ptr.asPointerTo(u.typ).Interface().(*int32)
- v := &int32Value{*t}
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeStdInt32ValuePtrMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- if ptr.isNil() {
- return 0
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*int32)
- v := &int32Value{*t}
- siz := Size(v)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- if ptr.isNil() {
- return b, nil
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*int32)
- v := &int32Value{*t}
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeStdInt32ValueSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(u.typ)
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(int32)
- v := &int32Value{t}
- siz := Size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(u.typ)
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(int32)
- v := &int32Value{t}
- siz := Size(v)
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeStdInt32ValuePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*int32)
- v := &int32Value{*t}
- siz := Size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*int32)
- v := &int32Value{*t}
- siz := Size(v)
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeStdInt32ValueUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &int32Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- s := f.asPointerTo(sub.typ).Elem()
- s.Set(reflect.ValueOf(m.Value))
- return b[x:], nil
- }
-}
-
-func makeStdInt32ValuePtrUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &int32Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem()
- s.Set(reflect.ValueOf(&m.Value))
- return b[x:], nil
- }
-}
-
-func makeStdInt32ValuePtrSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &int32Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- slice := f.getSlice(reflect.PtrTo(sub.typ))
- newSlice := reflect.Append(slice, reflect.ValueOf(&m.Value))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeStdInt32ValueSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &int32Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- slice := f.getSlice(sub.typ)
- newSlice := reflect.Append(slice, reflect.ValueOf(m.Value))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeStdUInt32ValueMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- t := ptr.asPointerTo(u.typ).Interface().(*uint32)
- v := &uint32Value{*t}
- siz := Size(v)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- t := ptr.asPointerTo(u.typ).Interface().(*uint32)
- v := &uint32Value{*t}
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeStdUInt32ValuePtrMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- if ptr.isNil() {
- return 0
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*uint32)
- v := &uint32Value{*t}
- siz := Size(v)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- if ptr.isNil() {
- return b, nil
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*uint32)
- v := &uint32Value{*t}
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeStdUInt32ValueSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(u.typ)
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(uint32)
- v := &uint32Value{t}
- siz := Size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(u.typ)
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(uint32)
- v := &uint32Value{t}
- siz := Size(v)
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeStdUInt32ValuePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*uint32)
- v := &uint32Value{*t}
- siz := Size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*uint32)
- v := &uint32Value{*t}
- siz := Size(v)
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeStdUInt32ValueUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &uint32Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- s := f.asPointerTo(sub.typ).Elem()
- s.Set(reflect.ValueOf(m.Value))
- return b[x:], nil
- }
-}
-
-func makeStdUInt32ValuePtrUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &uint32Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem()
- s.Set(reflect.ValueOf(&m.Value))
- return b[x:], nil
- }
-}
-
-func makeStdUInt32ValuePtrSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &uint32Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- slice := f.getSlice(reflect.PtrTo(sub.typ))
- newSlice := reflect.Append(slice, reflect.ValueOf(&m.Value))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeStdUInt32ValueSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &uint32Value{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- slice := f.getSlice(sub.typ)
- newSlice := reflect.Append(slice, reflect.ValueOf(m.Value))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeStdBoolValueMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- t := ptr.asPointerTo(u.typ).Interface().(*bool)
- v := &boolValue{*t}
- siz := Size(v)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- t := ptr.asPointerTo(u.typ).Interface().(*bool)
- v := &boolValue{*t}
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeStdBoolValuePtrMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- if ptr.isNil() {
- return 0
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*bool)
- v := &boolValue{*t}
- siz := Size(v)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- if ptr.isNil() {
- return b, nil
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*bool)
- v := &boolValue{*t}
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeStdBoolValueSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(u.typ)
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(bool)
- v := &boolValue{t}
- siz := Size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(u.typ)
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(bool)
- v := &boolValue{t}
- siz := Size(v)
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeStdBoolValuePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*bool)
- v := &boolValue{*t}
- siz := Size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*bool)
- v := &boolValue{*t}
- siz := Size(v)
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeStdBoolValueUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &boolValue{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- s := f.asPointerTo(sub.typ).Elem()
- s.Set(reflect.ValueOf(m.Value))
- return b[x:], nil
- }
-}
-
-func makeStdBoolValuePtrUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &boolValue{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem()
- s.Set(reflect.ValueOf(&m.Value))
- return b[x:], nil
- }
-}
-
-func makeStdBoolValuePtrSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &boolValue{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- slice := f.getSlice(reflect.PtrTo(sub.typ))
- newSlice := reflect.Append(slice, reflect.ValueOf(&m.Value))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeStdBoolValueSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &boolValue{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- slice := f.getSlice(sub.typ)
- newSlice := reflect.Append(slice, reflect.ValueOf(m.Value))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeStdStringValueMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- t := ptr.asPointerTo(u.typ).Interface().(*string)
- v := &stringValue{*t}
- siz := Size(v)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- t := ptr.asPointerTo(u.typ).Interface().(*string)
- v := &stringValue{*t}
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeStdStringValuePtrMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- if ptr.isNil() {
- return 0
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*string)
- v := &stringValue{*t}
- siz := Size(v)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- if ptr.isNil() {
- return b, nil
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*string)
- v := &stringValue{*t}
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeStdStringValueSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(u.typ)
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(string)
- v := &stringValue{t}
- siz := Size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(u.typ)
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(string)
- v := &stringValue{t}
- siz := Size(v)
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeStdStringValuePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*string)
- v := &stringValue{*t}
- siz := Size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*string)
- v := &stringValue{*t}
- siz := Size(v)
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeStdStringValueUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &stringValue{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- s := f.asPointerTo(sub.typ).Elem()
- s.Set(reflect.ValueOf(m.Value))
- return b[x:], nil
- }
-}
-
-func makeStdStringValuePtrUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &stringValue{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem()
- s.Set(reflect.ValueOf(&m.Value))
- return b[x:], nil
- }
-}
-
-func makeStdStringValuePtrSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &stringValue{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- slice := f.getSlice(reflect.PtrTo(sub.typ))
- newSlice := reflect.Append(slice, reflect.ValueOf(&m.Value))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeStdStringValueSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &stringValue{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- slice := f.getSlice(sub.typ)
- newSlice := reflect.Append(slice, reflect.ValueOf(m.Value))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeStdBytesValueMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- t := ptr.asPointerTo(u.typ).Interface().(*[]byte)
- v := &bytesValue{*t}
- siz := Size(v)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- t := ptr.asPointerTo(u.typ).Interface().(*[]byte)
- v := &bytesValue{*t}
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeStdBytesValuePtrMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- if ptr.isNil() {
- return 0
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*[]byte)
- v := &bytesValue{*t}
- siz := Size(v)
- return tagsize + SizeVarint(uint64(siz)) + siz
- }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- if ptr.isNil() {
- return b, nil
- }
- t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*[]byte)
- v := &bytesValue{*t}
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(len(buf)))
- b = append(b, buf...)
- return b, nil
- }
-}
-
-func makeStdBytesValueSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(u.typ)
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().([]byte)
- v := &bytesValue{t}
- siz := Size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(u.typ)
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().([]byte)
- v := &bytesValue{t}
- siz := Size(v)
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeStdBytesValuePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
- return func(ptr pointer, tagsize int) int {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- n := 0
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*[]byte)
- v := &bytesValue{*t}
- siz := Size(v)
- n += siz + SizeVarint(uint64(siz)) + tagsize
- }
- return n
- },
- func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
- s := ptr.getSlice(reflect.PtrTo(u.typ))
- for i := 0; i < s.Len(); i++ {
- elem := s.Index(i)
- t := elem.Interface().(*[]byte)
- v := &bytesValue{*t}
- siz := Size(v)
- buf, err := Marshal(v)
- if err != nil {
- return nil, err
- }
- b = appendVarint(b, wiretag)
- b = appendVarint(b, uint64(siz))
- b = append(b, buf...)
- }
-
- return b, nil
- }
-}
-
-func makeStdBytesValueUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &bytesValue{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- s := f.asPointerTo(sub.typ).Elem()
- s.Set(reflect.ValueOf(m.Value))
- return b[x:], nil
- }
-}
-
-func makeStdBytesValuePtrUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &bytesValue{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem()
- s.Set(reflect.ValueOf(&m.Value))
- return b[x:], nil
- }
-}
-
-func makeStdBytesValuePtrSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &bytesValue{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- slice := f.getSlice(reflect.PtrTo(sub.typ))
- newSlice := reflect.Append(slice, reflect.ValueOf(&m.Value))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
-
-func makeStdBytesValueSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler {
- return func(b []byte, f pointer, w int) ([]byte, error) {
- if w != WireBytes {
- return nil, errInternalBadWireType
- }
- x, n := decodeVarint(b)
- if n == 0 {
- return nil, io.ErrUnexpectedEOF
- }
- b = b[n:]
- if x > uint64(len(b)) {
- return nil, io.ErrUnexpectedEOF
- }
- m := &bytesValue{}
- if err := Unmarshal(b[:x], m); err != nil {
- return nil, err
- }
- slice := f.getSlice(sub.typ)
- newSlice := reflect.Append(slice, reflect.ValueOf(m.Value))
- slice.Set(newSlice)
- return b[x:], nil
- }
-}
diff --git a/api/vendor/github.com/gogo/protobuf/proto/wrappers_gogo.go b/api/vendor/github.com/gogo/protobuf/proto/wrappers_gogo.go
deleted file mode 100644
index c1cf7bf85e9a..000000000000
--- a/api/vendor/github.com/gogo/protobuf/proto/wrappers_gogo.go
+++ /dev/null
@@ -1,113 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2018, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-//
-// 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
-// OWNER 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.
-
-package proto
-
-type float64Value struct {
- Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"`
-}
-
-func (m *float64Value) Reset() { *m = float64Value{} }
-func (*float64Value) ProtoMessage() {}
-func (*float64Value) String() string { return "float64" }
-
-type float32Value struct {
- Value float32 `protobuf:"fixed32,1,opt,name=value,proto3" json:"value,omitempty"`
-}
-
-func (m *float32Value) Reset() { *m = float32Value{} }
-func (*float32Value) ProtoMessage() {}
-func (*float32Value) String() string { return "float32" }
-
-type int64Value struct {
- Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
-}
-
-func (m *int64Value) Reset() { *m = int64Value{} }
-func (*int64Value) ProtoMessage() {}
-func (*int64Value) String() string { return "int64" }
-
-type uint64Value struct {
- Value uint64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
-}
-
-func (m *uint64Value) Reset() { *m = uint64Value{} }
-func (*uint64Value) ProtoMessage() {}
-func (*uint64Value) String() string { return "uint64" }
-
-type int32Value struct {
- Value int32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
-}
-
-func (m *int32Value) Reset() { *m = int32Value{} }
-func (*int32Value) ProtoMessage() {}
-func (*int32Value) String() string { return "int32" }
-
-type uint32Value struct {
- Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
-}
-
-func (m *uint32Value) Reset() { *m = uint32Value{} }
-func (*uint32Value) ProtoMessage() {}
-func (*uint32Value) String() string { return "uint32" }
-
-type boolValue struct {
- Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
-}
-
-func (m *boolValue) Reset() { *m = boolValue{} }
-func (*boolValue) ProtoMessage() {}
-func (*boolValue) String() string { return "bool" }
-
-type stringValue struct {
- Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
-}
-
-func (m *stringValue) Reset() { *m = stringValue{} }
-func (*stringValue) ProtoMessage() {}
-func (*stringValue) String() string { return "string" }
-
-type bytesValue struct {
- Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
-}
-
-func (m *bytesValue) Reset() { *m = bytesValue{} }
-func (*bytesValue) ProtoMessage() {}
-func (*bytesValue) String() string { return "[]byte" }
-
-func init() {
- RegisterType((*float64Value)(nil), "gogo.protobuf.proto.DoubleValue")
- RegisterType((*float32Value)(nil), "gogo.protobuf.proto.FloatValue")
- RegisterType((*int64Value)(nil), "gogo.protobuf.proto.Int64Value")
- RegisterType((*uint64Value)(nil), "gogo.protobuf.proto.UInt64Value")
- RegisterType((*int32Value)(nil), "gogo.protobuf.proto.Int32Value")
- RegisterType((*uint32Value)(nil), "gogo.protobuf.proto.UInt32Value")
- RegisterType((*boolValue)(nil), "gogo.protobuf.proto.BoolValue")
- RegisterType((*stringValue)(nil), "gogo.protobuf.proto.StringValue")
- RegisterType((*bytesValue)(nil), "gogo.protobuf.proto.BytesValue")
-}
diff --git a/api/vendor/github.com/gogo/protobuf/sortkeys/sortkeys.go b/api/vendor/github.com/gogo/protobuf/sortkeys/sortkeys.go
deleted file mode 100644
index ceadde6a5e10..000000000000
--- a/api/vendor/github.com/gogo/protobuf/sortkeys/sortkeys.go
+++ /dev/null
@@ -1,101 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2013, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-//
-// 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
-// OWNER 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.
-
-package sortkeys
-
-import (
- "sort"
-)
-
-func Strings(l []string) {
- sort.Strings(l)
-}
-
-func Float64s(l []float64) {
- sort.Float64s(l)
-}
-
-func Float32s(l []float32) {
- sort.Sort(Float32Slice(l))
-}
-
-func Int64s(l []int64) {
- sort.Sort(Int64Slice(l))
-}
-
-func Int32s(l []int32) {
- sort.Sort(Int32Slice(l))
-}
-
-func Uint64s(l []uint64) {
- sort.Sort(Uint64Slice(l))
-}
-
-func Uint32s(l []uint32) {
- sort.Sort(Uint32Slice(l))
-}
-
-func Bools(l []bool) {
- sort.Sort(BoolSlice(l))
-}
-
-type BoolSlice []bool
-
-func (p BoolSlice) Len() int { return len(p) }
-func (p BoolSlice) Less(i, j int) bool { return p[j] }
-func (p BoolSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
-
-type Int64Slice []int64
-
-func (p Int64Slice) Len() int { return len(p) }
-func (p Int64Slice) Less(i, j int) bool { return p[i] < p[j] }
-func (p Int64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
-
-type Int32Slice []int32
-
-func (p Int32Slice) Len() int { return len(p) }
-func (p Int32Slice) Less(i, j int) bool { return p[i] < p[j] }
-func (p Int32Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
-
-type Uint64Slice []uint64
-
-func (p Uint64Slice) Len() int { return len(p) }
-func (p Uint64Slice) Less(i, j int) bool { return p[i] < p[j] }
-func (p Uint64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
-
-type Uint32Slice []uint32
-
-func (p Uint32Slice) Len() int { return len(p) }
-func (p Uint32Slice) Less(i, j int) bool { return p[i] < p[j] }
-func (p Uint32Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
-
-type Float32Slice []float32
-
-func (p Float32Slice) Len() int { return len(p) }
-func (p Float32Slice) Less(i, j int) bool { return p[i] < p[j] }
-func (p Float32Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
diff --git a/api/vendor/github.com/google/uuid/CHANGELOG.md b/api/vendor/github.com/google/uuid/CHANGELOG.md
new file mode 100644
index 000000000000..7ec5ac7ea909
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/CHANGELOG.md
@@ -0,0 +1,41 @@
+# Changelog
+
+## [1.6.0](https://github.com/google/uuid/compare/v1.5.0...v1.6.0) (2024-01-16)
+
+
+### Features
+
+* add Max UUID constant ([#149](https://github.com/google/uuid/issues/149)) ([c58770e](https://github.com/google/uuid/commit/c58770eb495f55fe2ced6284f93c5158a62e53e3))
+
+
+### Bug Fixes
+
+* fix typo in version 7 uuid documentation ([#153](https://github.com/google/uuid/issues/153)) ([016b199](https://github.com/google/uuid/commit/016b199544692f745ffc8867b914129ecb47ef06))
+* Monotonicity in UUIDv7 ([#150](https://github.com/google/uuid/issues/150)) ([a2b2b32](https://github.com/google/uuid/commit/a2b2b32373ff0b1a312b7fdf6d38a977099698a6))
+
+## [1.5.0](https://github.com/google/uuid/compare/v1.4.0...v1.5.0) (2023-12-12)
+
+
+### Features
+
+* Validate UUID without creating new UUID ([#141](https://github.com/google/uuid/issues/141)) ([9ee7366](https://github.com/google/uuid/commit/9ee7366e66c9ad96bab89139418a713dc584ae29))
+
+## [1.4.0](https://github.com/google/uuid/compare/v1.3.1...v1.4.0) (2023-10-26)
+
+
+### Features
+
+* UUIDs slice type with Strings() convenience method ([#133](https://github.com/google/uuid/issues/133)) ([cd5fbbd](https://github.com/google/uuid/commit/cd5fbbdd02f3e3467ac18940e07e062be1f864b4))
+
+### Fixes
+
+* Clarify that Parse's job is to parse but not necessarily validate strings. (Documents current behavior)
+
+## [1.3.1](https://github.com/google/uuid/compare/v1.3.0...v1.3.1) (2023-08-18)
+
+
+### Bug Fixes
+
+* Use .EqualFold() to parse urn prefixed UUIDs ([#118](https://github.com/google/uuid/issues/118)) ([574e687](https://github.com/google/uuid/commit/574e6874943741fb99d41764c705173ada5293f0))
+
+## Changelog
diff --git a/api/vendor/github.com/google/uuid/CONTRIBUTING.md b/api/vendor/github.com/google/uuid/CONTRIBUTING.md
new file mode 100644
index 000000000000..a502fdc515ac
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/CONTRIBUTING.md
@@ -0,0 +1,26 @@
+# How to contribute
+
+We definitely welcome patches and contribution to this project!
+
+### Tips
+
+Commits must be formatted according to the [Conventional Commits Specification](https://www.conventionalcommits.org).
+
+Always try to include a test case! If it is not possible or not necessary,
+please explain why in the pull request description.
+
+### Releasing
+
+Commits that would precipitate a SemVer change, as described in the Conventional
+Commits Specification, will trigger [`release-please`](https://github.com/google-github-actions/release-please-action)
+to create a release candidate pull request. Once submitted, `release-please`
+will create a release.
+
+For tips on how to work with `release-please`, see its documentation.
+
+### Legal requirements
+
+In order to protect both you and ourselves, you will need to sign the
+[Contributor License Agreement](https://cla.developers.google.com/clas).
+
+You may have already signed it for other Google projects.
diff --git a/api/vendor/github.com/google/uuid/CONTRIBUTORS b/api/vendor/github.com/google/uuid/CONTRIBUTORS
new file mode 100644
index 000000000000..b4bb97f6bcd0
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/CONTRIBUTORS
@@ -0,0 +1,9 @@
+Paul Borman
+bmatsuo
+shawnps
+theory
+jboverfelt
+dsymonds
+cd1
+wallclockbuilder
+dansouza
diff --git a/vendor/github.com/imdario/mergo/LICENSE b/api/vendor/github.com/google/uuid/LICENSE
similarity index 92%
rename from vendor/github.com/imdario/mergo/LICENSE
rename to api/vendor/github.com/google/uuid/LICENSE
index 686680298da2..5dc68268d900 100644
--- a/vendor/github.com/imdario/mergo/LICENSE
+++ b/api/vendor/github.com/google/uuid/LICENSE
@@ -1,5 +1,4 @@
-Copyright (c) 2013 Dario Castañé. All rights reserved.
-Copyright (c) 2012 The Go Authors. All rights reserved.
+Copyright (c) 2009,2014 Google Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
diff --git a/api/vendor/github.com/google/uuid/README.md b/api/vendor/github.com/google/uuid/README.md
new file mode 100644
index 000000000000..3e9a61889de4
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/README.md
@@ -0,0 +1,21 @@
+# uuid
+The uuid package generates and inspects UUIDs based on
+[RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122)
+and DCE 1.1: Authentication and Security Services.
+
+This package is based on the github.com/pborman/uuid package (previously named
+code.google.com/p/go-uuid). It differs from these earlier packages in that
+a UUID is a 16 byte array rather than a byte slice. One loss due to this
+change is the ability to represent an invalid UUID (vs a NIL UUID).
+
+###### Install
+```sh
+go get github.com/google/uuid
+```
+
+###### Documentation
+[](https://pkg.go.dev/github.com/google/uuid)
+
+Full `go doc` style documentation for the package can be viewed online without
+installing this package by using the GoDoc site here:
+http://pkg.go.dev/github.com/google/uuid
diff --git a/api/vendor/github.com/google/uuid/dce.go b/api/vendor/github.com/google/uuid/dce.go
new file mode 100644
index 000000000000..fa820b9d3092
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/dce.go
@@ -0,0 +1,80 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "encoding/binary"
+ "fmt"
+ "os"
+)
+
+// A Domain represents a Version 2 domain
+type Domain byte
+
+// Domain constants for DCE Security (Version 2) UUIDs.
+const (
+ Person = Domain(0)
+ Group = Domain(1)
+ Org = Domain(2)
+)
+
+// NewDCESecurity returns a DCE Security (Version 2) UUID.
+//
+// The domain should be one of Person, Group or Org.
+// On a POSIX system the id should be the users UID for the Person
+// domain and the users GID for the Group. The meaning of id for
+// the domain Org or on non-POSIX systems is site defined.
+//
+// For a given domain/id pair the same token may be returned for up to
+// 7 minutes and 10 seconds.
+func NewDCESecurity(domain Domain, id uint32) (UUID, error) {
+ uuid, err := NewUUID()
+ if err == nil {
+ uuid[6] = (uuid[6] & 0x0f) | 0x20 // Version 2
+ uuid[9] = byte(domain)
+ binary.BigEndian.PutUint32(uuid[0:], id)
+ }
+ return uuid, err
+}
+
+// NewDCEPerson returns a DCE Security (Version 2) UUID in the person
+// domain with the id returned by os.Getuid.
+//
+// NewDCESecurity(Person, uint32(os.Getuid()))
+func NewDCEPerson() (UUID, error) {
+ return NewDCESecurity(Person, uint32(os.Getuid()))
+}
+
+// NewDCEGroup returns a DCE Security (Version 2) UUID in the group
+// domain with the id returned by os.Getgid.
+//
+// NewDCESecurity(Group, uint32(os.Getgid()))
+func NewDCEGroup() (UUID, error) {
+ return NewDCESecurity(Group, uint32(os.Getgid()))
+}
+
+// Domain returns the domain for a Version 2 UUID. Domains are only defined
+// for Version 2 UUIDs.
+func (uuid UUID) Domain() Domain {
+ return Domain(uuid[9])
+}
+
+// ID returns the id for a Version 2 UUID. IDs are only defined for Version 2
+// UUIDs.
+func (uuid UUID) ID() uint32 {
+ return binary.BigEndian.Uint32(uuid[0:4])
+}
+
+func (d Domain) String() string {
+ switch d {
+ case Person:
+ return "Person"
+ case Group:
+ return "Group"
+ case Org:
+ return "Org"
+ }
+ return fmt.Sprintf("Domain%d", int(d))
+}
diff --git a/api/vendor/github.com/google/uuid/doc.go b/api/vendor/github.com/google/uuid/doc.go
new file mode 100644
index 000000000000..5b8a4b9af8ce
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/doc.go
@@ -0,0 +1,12 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package uuid generates and inspects UUIDs.
+//
+// UUIDs are based on RFC 4122 and DCE 1.1: Authentication and Security
+// Services.
+//
+// A UUID is a 16 byte (128 bit) array. UUIDs may be used as keys to
+// maps or compared directly.
+package uuid
diff --git a/api/vendor/github.com/google/uuid/hash.go b/api/vendor/github.com/google/uuid/hash.go
new file mode 100644
index 000000000000..dc60082d3b3b
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/hash.go
@@ -0,0 +1,59 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "crypto/md5"
+ "crypto/sha1"
+ "hash"
+)
+
+// Well known namespace IDs and UUIDs
+var (
+ NameSpaceDNS = Must(Parse("6ba7b810-9dad-11d1-80b4-00c04fd430c8"))
+ NameSpaceURL = Must(Parse("6ba7b811-9dad-11d1-80b4-00c04fd430c8"))
+ NameSpaceOID = Must(Parse("6ba7b812-9dad-11d1-80b4-00c04fd430c8"))
+ NameSpaceX500 = Must(Parse("6ba7b814-9dad-11d1-80b4-00c04fd430c8"))
+ Nil UUID // empty UUID, all zeros
+
+ // The Max UUID is special form of UUID that is specified to have all 128 bits set to 1.
+ Max = UUID{
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ }
+)
+
+// NewHash returns a new UUID derived from the hash of space concatenated with
+// data generated by h. The hash should be at least 16 byte in length. The
+// first 16 bytes of the hash are used to form the UUID. The version of the
+// UUID will be the lower 4 bits of version. NewHash is used to implement
+// NewMD5 and NewSHA1.
+func NewHash(h hash.Hash, space UUID, data []byte, version int) UUID {
+ h.Reset()
+ h.Write(space[:]) //nolint:errcheck
+ h.Write(data) //nolint:errcheck
+ s := h.Sum(nil)
+ var uuid UUID
+ copy(uuid[:], s)
+ uuid[6] = (uuid[6] & 0x0f) | uint8((version&0xf)<<4)
+ uuid[8] = (uuid[8] & 0x3f) | 0x80 // RFC 4122 variant
+ return uuid
+}
+
+// NewMD5 returns a new MD5 (Version 3) UUID based on the
+// supplied name space and data. It is the same as calling:
+//
+// NewHash(md5.New(), space, data, 3)
+func NewMD5(space UUID, data []byte) UUID {
+ return NewHash(md5.New(), space, data, 3)
+}
+
+// NewSHA1 returns a new SHA1 (Version 5) UUID based on the
+// supplied name space and data. It is the same as calling:
+//
+// NewHash(sha1.New(), space, data, 5)
+func NewSHA1(space UUID, data []byte) UUID {
+ return NewHash(sha1.New(), space, data, 5)
+}
diff --git a/api/vendor/github.com/google/uuid/marshal.go b/api/vendor/github.com/google/uuid/marshal.go
new file mode 100644
index 000000000000..14bd34072b64
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/marshal.go
@@ -0,0 +1,38 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import "fmt"
+
+// MarshalText implements encoding.TextMarshaler.
+func (uuid UUID) MarshalText() ([]byte, error) {
+ var js [36]byte
+ encodeHex(js[:], uuid)
+ return js[:], nil
+}
+
+// UnmarshalText implements encoding.TextUnmarshaler.
+func (uuid *UUID) UnmarshalText(data []byte) error {
+ id, err := ParseBytes(data)
+ if err != nil {
+ return err
+ }
+ *uuid = id
+ return nil
+}
+
+// MarshalBinary implements encoding.BinaryMarshaler.
+func (uuid UUID) MarshalBinary() ([]byte, error) {
+ return uuid[:], nil
+}
+
+// UnmarshalBinary implements encoding.BinaryUnmarshaler.
+func (uuid *UUID) UnmarshalBinary(data []byte) error {
+ if len(data) != 16 {
+ return fmt.Errorf("invalid UUID (got %d bytes)", len(data))
+ }
+ copy(uuid[:], data)
+ return nil
+}
diff --git a/api/vendor/github.com/google/uuid/node.go b/api/vendor/github.com/google/uuid/node.go
new file mode 100644
index 000000000000..d651a2b0619f
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/node.go
@@ -0,0 +1,90 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "sync"
+)
+
+var (
+ nodeMu sync.Mutex
+ ifname string // name of interface being used
+ nodeID [6]byte // hardware for version 1 UUIDs
+ zeroID [6]byte // nodeID with only 0's
+)
+
+// NodeInterface returns the name of the interface from which the NodeID was
+// derived. The interface "user" is returned if the NodeID was set by
+// SetNodeID.
+func NodeInterface() string {
+ defer nodeMu.Unlock()
+ nodeMu.Lock()
+ return ifname
+}
+
+// SetNodeInterface selects the hardware address to be used for Version 1 UUIDs.
+// If name is "" then the first usable interface found will be used or a random
+// Node ID will be generated. If a named interface cannot be found then false
+// is returned.
+//
+// SetNodeInterface never fails when name is "".
+func SetNodeInterface(name string) bool {
+ defer nodeMu.Unlock()
+ nodeMu.Lock()
+ return setNodeInterface(name)
+}
+
+func setNodeInterface(name string) bool {
+ iname, addr := getHardwareInterface(name) // null implementation for js
+ if iname != "" && addr != nil {
+ ifname = iname
+ copy(nodeID[:], addr)
+ return true
+ }
+
+ // We found no interfaces with a valid hardware address. If name
+ // does not specify a specific interface generate a random Node ID
+ // (section 4.1.6)
+ if name == "" {
+ ifname = "random"
+ randomBits(nodeID[:])
+ return true
+ }
+ return false
+}
+
+// NodeID returns a slice of a copy of the current Node ID, setting the Node ID
+// if not already set.
+func NodeID() []byte {
+ defer nodeMu.Unlock()
+ nodeMu.Lock()
+ if nodeID == zeroID {
+ setNodeInterface("")
+ }
+ nid := nodeID
+ return nid[:]
+}
+
+// SetNodeID sets the Node ID to be used for Version 1 UUIDs. The first 6 bytes
+// of id are used. If id is less than 6 bytes then false is returned and the
+// Node ID is not set.
+func SetNodeID(id []byte) bool {
+ if len(id) < 6 {
+ return false
+ }
+ defer nodeMu.Unlock()
+ nodeMu.Lock()
+ copy(nodeID[:], id)
+ ifname = "user"
+ return true
+}
+
+// NodeID returns the 6 byte node id encoded in uuid. It returns nil if uuid is
+// not valid. The NodeID is only well defined for version 1 and 2 UUIDs.
+func (uuid UUID) NodeID() []byte {
+ var node [6]byte
+ copy(node[:], uuid[10:])
+ return node[:]
+}
diff --git a/api/vendor/github.com/google/uuid/node_js.go b/api/vendor/github.com/google/uuid/node_js.go
new file mode 100644
index 000000000000..b2a0bc8711b3
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/node_js.go
@@ -0,0 +1,12 @@
+// Copyright 2017 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build js
+
+package uuid
+
+// getHardwareInterface returns nil values for the JS version of the code.
+// This removes the "net" dependency, because it is not used in the browser.
+// Using the "net" library inflates the size of the transpiled JS code by 673k bytes.
+func getHardwareInterface(name string) (string, []byte) { return "", nil }
diff --git a/api/vendor/github.com/google/uuid/node_net.go b/api/vendor/github.com/google/uuid/node_net.go
new file mode 100644
index 000000000000..0cbbcddbd6e8
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/node_net.go
@@ -0,0 +1,33 @@
+// Copyright 2017 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build !js
+
+package uuid
+
+import "net"
+
+var interfaces []net.Interface // cached list of interfaces
+
+// getHardwareInterface returns the name and hardware address of interface name.
+// If name is "" then the name and hardware address of one of the system's
+// interfaces is returned. If no interfaces are found (name does not exist or
+// there are no interfaces) then "", nil is returned.
+//
+// Only addresses of at least 6 bytes are returned.
+func getHardwareInterface(name string) (string, []byte) {
+ if interfaces == nil {
+ var err error
+ interfaces, err = net.Interfaces()
+ if err != nil {
+ return "", nil
+ }
+ }
+ for _, ifs := range interfaces {
+ if len(ifs.HardwareAddr) >= 6 && (name == "" || name == ifs.Name) {
+ return ifs.Name, ifs.HardwareAddr
+ }
+ }
+ return "", nil
+}
diff --git a/api/vendor/github.com/google/uuid/null.go b/api/vendor/github.com/google/uuid/null.go
new file mode 100644
index 000000000000..d7fcbf286516
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/null.go
@@ -0,0 +1,118 @@
+// Copyright 2021 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "bytes"
+ "database/sql/driver"
+ "encoding/json"
+ "fmt"
+)
+
+var jsonNull = []byte("null")
+
+// NullUUID represents a UUID that may be null.
+// NullUUID implements the SQL driver.Scanner interface so
+// it can be used as a scan destination:
+//
+// var u uuid.NullUUID
+// err := db.QueryRow("SELECT name FROM foo WHERE id=?", id).Scan(&u)
+// ...
+// if u.Valid {
+// // use u.UUID
+// } else {
+// // NULL value
+// }
+//
+type NullUUID struct {
+ UUID UUID
+ Valid bool // Valid is true if UUID is not NULL
+}
+
+// Scan implements the SQL driver.Scanner interface.
+func (nu *NullUUID) Scan(value interface{}) error {
+ if value == nil {
+ nu.UUID, nu.Valid = Nil, false
+ return nil
+ }
+
+ err := nu.UUID.Scan(value)
+ if err != nil {
+ nu.Valid = false
+ return err
+ }
+
+ nu.Valid = true
+ return nil
+}
+
+// Value implements the driver Valuer interface.
+func (nu NullUUID) Value() (driver.Value, error) {
+ if !nu.Valid {
+ return nil, nil
+ }
+ // Delegate to UUID Value function
+ return nu.UUID.Value()
+}
+
+// MarshalBinary implements encoding.BinaryMarshaler.
+func (nu NullUUID) MarshalBinary() ([]byte, error) {
+ if nu.Valid {
+ return nu.UUID[:], nil
+ }
+
+ return []byte(nil), nil
+}
+
+// UnmarshalBinary implements encoding.BinaryUnmarshaler.
+func (nu *NullUUID) UnmarshalBinary(data []byte) error {
+ if len(data) != 16 {
+ return fmt.Errorf("invalid UUID (got %d bytes)", len(data))
+ }
+ copy(nu.UUID[:], data)
+ nu.Valid = true
+ return nil
+}
+
+// MarshalText implements encoding.TextMarshaler.
+func (nu NullUUID) MarshalText() ([]byte, error) {
+ if nu.Valid {
+ return nu.UUID.MarshalText()
+ }
+
+ return jsonNull, nil
+}
+
+// UnmarshalText implements encoding.TextUnmarshaler.
+func (nu *NullUUID) UnmarshalText(data []byte) error {
+ id, err := ParseBytes(data)
+ if err != nil {
+ nu.Valid = false
+ return err
+ }
+ nu.UUID = id
+ nu.Valid = true
+ return nil
+}
+
+// MarshalJSON implements json.Marshaler.
+func (nu NullUUID) MarshalJSON() ([]byte, error) {
+ if nu.Valid {
+ return json.Marshal(nu.UUID)
+ }
+
+ return jsonNull, nil
+}
+
+// UnmarshalJSON implements json.Unmarshaler.
+func (nu *NullUUID) UnmarshalJSON(data []byte) error {
+ if bytes.Equal(data, jsonNull) {
+ *nu = NullUUID{}
+ return nil // valid null UUID
+ }
+ err := json.Unmarshal(data, &nu.UUID)
+ nu.Valid = err == nil
+ return err
+}
diff --git a/api/vendor/github.com/google/uuid/sql.go b/api/vendor/github.com/google/uuid/sql.go
new file mode 100644
index 000000000000..2e02ec06c012
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/sql.go
@@ -0,0 +1,59 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "database/sql/driver"
+ "fmt"
+)
+
+// Scan implements sql.Scanner so UUIDs can be read from databases transparently.
+// Currently, database types that map to string and []byte are supported. Please
+// consult database-specific driver documentation for matching types.
+func (uuid *UUID) Scan(src interface{}) error {
+ switch src := src.(type) {
+ case nil:
+ return nil
+
+ case string:
+ // if an empty UUID comes from a table, we return a null UUID
+ if src == "" {
+ return nil
+ }
+
+ // see Parse for required string format
+ u, err := Parse(src)
+ if err != nil {
+ return fmt.Errorf("Scan: %v", err)
+ }
+
+ *uuid = u
+
+ case []byte:
+ // if an empty UUID comes from a table, we return a null UUID
+ if len(src) == 0 {
+ return nil
+ }
+
+ // assumes a simple slice of bytes if 16 bytes
+ // otherwise attempts to parse
+ if len(src) != 16 {
+ return uuid.Scan(string(src))
+ }
+ copy((*uuid)[:], src)
+
+ default:
+ return fmt.Errorf("Scan: unable to scan type %T into UUID", src)
+ }
+
+ return nil
+}
+
+// Value implements sql.Valuer so that UUIDs can be written to databases
+// transparently. Currently, UUIDs map to strings. Please consult
+// database-specific driver documentation for matching types.
+func (uuid UUID) Value() (driver.Value, error) {
+ return uuid.String(), nil
+}
diff --git a/api/vendor/github.com/google/uuid/time.go b/api/vendor/github.com/google/uuid/time.go
new file mode 100644
index 000000000000..c351129279f3
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/time.go
@@ -0,0 +1,134 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "encoding/binary"
+ "sync"
+ "time"
+)
+
+// A Time represents a time as the number of 100's of nanoseconds since 15 Oct
+// 1582.
+type Time int64
+
+const (
+ lillian = 2299160 // Julian day of 15 Oct 1582
+ unix = 2440587 // Julian day of 1 Jan 1970
+ epoch = unix - lillian // Days between epochs
+ g1582 = epoch * 86400 // seconds between epochs
+ g1582ns100 = g1582 * 10000000 // 100s of a nanoseconds between epochs
+)
+
+var (
+ timeMu sync.Mutex
+ lasttime uint64 // last time we returned
+ clockSeq uint16 // clock sequence for this run
+
+ timeNow = time.Now // for testing
+)
+
+// UnixTime converts t the number of seconds and nanoseconds using the Unix
+// epoch of 1 Jan 1970.
+func (t Time) UnixTime() (sec, nsec int64) {
+ sec = int64(t - g1582ns100)
+ nsec = (sec % 10000000) * 100
+ sec /= 10000000
+ return sec, nsec
+}
+
+// GetTime returns the current Time (100s of nanoseconds since 15 Oct 1582) and
+// clock sequence as well as adjusting the clock sequence as needed. An error
+// is returned if the current time cannot be determined.
+func GetTime() (Time, uint16, error) {
+ defer timeMu.Unlock()
+ timeMu.Lock()
+ return getTime()
+}
+
+func getTime() (Time, uint16, error) {
+ t := timeNow()
+
+ // If we don't have a clock sequence already, set one.
+ if clockSeq == 0 {
+ setClockSequence(-1)
+ }
+ now := uint64(t.UnixNano()/100) + g1582ns100
+
+ // If time has gone backwards with this clock sequence then we
+ // increment the clock sequence
+ if now <= lasttime {
+ clockSeq = ((clockSeq + 1) & 0x3fff) | 0x8000
+ }
+ lasttime = now
+ return Time(now), clockSeq, nil
+}
+
+// ClockSequence returns the current clock sequence, generating one if not
+// already set. The clock sequence is only used for Version 1 UUIDs.
+//
+// The uuid package does not use global static storage for the clock sequence or
+// the last time a UUID was generated. Unless SetClockSequence is used, a new
+// random clock sequence is generated the first time a clock sequence is
+// requested by ClockSequence, GetTime, or NewUUID. (section 4.2.1.1)
+func ClockSequence() int {
+ defer timeMu.Unlock()
+ timeMu.Lock()
+ return clockSequence()
+}
+
+func clockSequence() int {
+ if clockSeq == 0 {
+ setClockSequence(-1)
+ }
+ return int(clockSeq & 0x3fff)
+}
+
+// SetClockSequence sets the clock sequence to the lower 14 bits of seq. Setting to
+// -1 causes a new sequence to be generated.
+func SetClockSequence(seq int) {
+ defer timeMu.Unlock()
+ timeMu.Lock()
+ setClockSequence(seq)
+}
+
+func setClockSequence(seq int) {
+ if seq == -1 {
+ var b [2]byte
+ randomBits(b[:]) // clock sequence
+ seq = int(b[0])<<8 | int(b[1])
+ }
+ oldSeq := clockSeq
+ clockSeq = uint16(seq&0x3fff) | 0x8000 // Set our variant
+ if oldSeq != clockSeq {
+ lasttime = 0
+ }
+}
+
+// Time returns the time in 100s of nanoseconds since 15 Oct 1582 encoded in
+// uuid. The time is only defined for version 1, 2, 6 and 7 UUIDs.
+func (uuid UUID) Time() Time {
+ var t Time
+ switch uuid.Version() {
+ case 6:
+ time := binary.BigEndian.Uint64(uuid[:8]) // Ignore uuid[6] version b0110
+ t = Time(time)
+ case 7:
+ time := binary.BigEndian.Uint64(uuid[:8])
+ t = Time((time>>16)*10000 + g1582ns100)
+ default: // forward compatible
+ time := int64(binary.BigEndian.Uint32(uuid[0:4]))
+ time |= int64(binary.BigEndian.Uint16(uuid[4:6])) << 32
+ time |= int64(binary.BigEndian.Uint16(uuid[6:8])&0xfff) << 48
+ t = Time(time)
+ }
+ return t
+}
+
+// ClockSequence returns the clock sequence encoded in uuid.
+// The clock sequence is only well defined for version 1 and 2 UUIDs.
+func (uuid UUID) ClockSequence() int {
+ return int(binary.BigEndian.Uint16(uuid[8:10])) & 0x3fff
+}
diff --git a/api/vendor/github.com/google/uuid/util.go b/api/vendor/github.com/google/uuid/util.go
new file mode 100644
index 000000000000..5ea6c737806e
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/util.go
@@ -0,0 +1,43 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "io"
+)
+
+// randomBits completely fills slice b with random data.
+func randomBits(b []byte) {
+ if _, err := io.ReadFull(rander, b); err != nil {
+ panic(err.Error()) // rand should never fail
+ }
+}
+
+// xvalues returns the value of a byte as a hexadecimal digit or 255.
+var xvalues = [256]byte{
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 255, 255, 255, 255, 255, 255,
+ 255, 10, 11, 12, 13, 14, 15, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 10, 11, 12, 13, 14, 15, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+}
+
+// xtob converts hex characters x1 and x2 into a byte.
+func xtob(x1, x2 byte) (byte, bool) {
+ b1 := xvalues[x1]
+ b2 := xvalues[x2]
+ return (b1 << 4) | b2, b1 != 255 && b2 != 255
+}
diff --git a/api/vendor/github.com/google/uuid/uuid.go b/api/vendor/github.com/google/uuid/uuid.go
new file mode 100644
index 000000000000..5232b486780d
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/uuid.go
@@ -0,0 +1,365 @@
+// Copyright 2018 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "bytes"
+ "crypto/rand"
+ "encoding/hex"
+ "errors"
+ "fmt"
+ "io"
+ "strings"
+ "sync"
+)
+
+// A UUID is a 128 bit (16 byte) Universal Unique IDentifier as defined in RFC
+// 4122.
+type UUID [16]byte
+
+// A Version represents a UUID's version.
+type Version byte
+
+// A Variant represents a UUID's variant.
+type Variant byte
+
+// Constants returned by Variant.
+const (
+ Invalid = Variant(iota) // Invalid UUID
+ RFC4122 // The variant specified in RFC4122
+ Reserved // Reserved, NCS backward compatibility.
+ Microsoft // Reserved, Microsoft Corporation backward compatibility.
+ Future // Reserved for future definition.
+)
+
+const randPoolSize = 16 * 16
+
+var (
+ rander = rand.Reader // random function
+ poolEnabled = false
+ poolMu sync.Mutex
+ poolPos = randPoolSize // protected with poolMu
+ pool [randPoolSize]byte // protected with poolMu
+)
+
+type invalidLengthError struct{ len int }
+
+func (err invalidLengthError) Error() string {
+ return fmt.Sprintf("invalid UUID length: %d", err.len)
+}
+
+// IsInvalidLengthError is matcher function for custom error invalidLengthError
+func IsInvalidLengthError(err error) bool {
+ _, ok := err.(invalidLengthError)
+ return ok
+}
+
+// Parse decodes s into a UUID or returns an error if it cannot be parsed. Both
+// the standard UUID forms defined in RFC 4122
+// (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and
+// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) are decoded. In addition,
+// Parse accepts non-standard strings such as the raw hex encoding
+// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx and 38 byte "Microsoft style" encodings,
+// e.g. {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}. Only the middle 36 bytes are
+// examined in the latter case. Parse should not be used to validate strings as
+// it parses non-standard encodings as indicated above.
+func Parse(s string) (UUID, error) {
+ var uuid UUID
+ switch len(s) {
+ // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+ case 36:
+
+ // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+ case 36 + 9:
+ if !strings.EqualFold(s[:9], "urn:uuid:") {
+ return uuid, fmt.Errorf("invalid urn prefix: %q", s[:9])
+ }
+ s = s[9:]
+
+ // {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
+ case 36 + 2:
+ s = s[1:]
+
+ // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ case 32:
+ var ok bool
+ for i := range uuid {
+ uuid[i], ok = xtob(s[i*2], s[i*2+1])
+ if !ok {
+ return uuid, errors.New("invalid UUID format")
+ }
+ }
+ return uuid, nil
+ default:
+ return uuid, invalidLengthError{len(s)}
+ }
+ // s is now at least 36 bytes long
+ // it must be of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+ if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' {
+ return uuid, errors.New("invalid UUID format")
+ }
+ for i, x := range [16]int{
+ 0, 2, 4, 6,
+ 9, 11,
+ 14, 16,
+ 19, 21,
+ 24, 26, 28, 30, 32, 34,
+ } {
+ v, ok := xtob(s[x], s[x+1])
+ if !ok {
+ return uuid, errors.New("invalid UUID format")
+ }
+ uuid[i] = v
+ }
+ return uuid, nil
+}
+
+// ParseBytes is like Parse, except it parses a byte slice instead of a string.
+func ParseBytes(b []byte) (UUID, error) {
+ var uuid UUID
+ switch len(b) {
+ case 36: // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+ case 36 + 9: // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+ if !bytes.EqualFold(b[:9], []byte("urn:uuid:")) {
+ return uuid, fmt.Errorf("invalid urn prefix: %q", b[:9])
+ }
+ b = b[9:]
+ case 36 + 2: // {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
+ b = b[1:]
+ case 32: // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ var ok bool
+ for i := 0; i < 32; i += 2 {
+ uuid[i/2], ok = xtob(b[i], b[i+1])
+ if !ok {
+ return uuid, errors.New("invalid UUID format")
+ }
+ }
+ return uuid, nil
+ default:
+ return uuid, invalidLengthError{len(b)}
+ }
+ // s is now at least 36 bytes long
+ // it must be of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+ if b[8] != '-' || b[13] != '-' || b[18] != '-' || b[23] != '-' {
+ return uuid, errors.New("invalid UUID format")
+ }
+ for i, x := range [16]int{
+ 0, 2, 4, 6,
+ 9, 11,
+ 14, 16,
+ 19, 21,
+ 24, 26, 28, 30, 32, 34,
+ } {
+ v, ok := xtob(b[x], b[x+1])
+ if !ok {
+ return uuid, errors.New("invalid UUID format")
+ }
+ uuid[i] = v
+ }
+ return uuid, nil
+}
+
+// MustParse is like Parse but panics if the string cannot be parsed.
+// It simplifies safe initialization of global variables holding compiled UUIDs.
+func MustParse(s string) UUID {
+ uuid, err := Parse(s)
+ if err != nil {
+ panic(`uuid: Parse(` + s + `): ` + err.Error())
+ }
+ return uuid
+}
+
+// FromBytes creates a new UUID from a byte slice. Returns an error if the slice
+// does not have a length of 16. The bytes are copied from the slice.
+func FromBytes(b []byte) (uuid UUID, err error) {
+ err = uuid.UnmarshalBinary(b)
+ return uuid, err
+}
+
+// Must returns uuid if err is nil and panics otherwise.
+func Must(uuid UUID, err error) UUID {
+ if err != nil {
+ panic(err)
+ }
+ return uuid
+}
+
+// Validate returns an error if s is not a properly formatted UUID in one of the following formats:
+// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+// {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
+// It returns an error if the format is invalid, otherwise nil.
+func Validate(s string) error {
+ switch len(s) {
+ // Standard UUID format
+ case 36:
+
+ // UUID with "urn:uuid:" prefix
+ case 36 + 9:
+ if !strings.EqualFold(s[:9], "urn:uuid:") {
+ return fmt.Errorf("invalid urn prefix: %q", s[:9])
+ }
+ s = s[9:]
+
+ // UUID enclosed in braces
+ case 36 + 2:
+ if s[0] != '{' || s[len(s)-1] != '}' {
+ return fmt.Errorf("invalid bracketed UUID format")
+ }
+ s = s[1 : len(s)-1]
+
+ // UUID without hyphens
+ case 32:
+ for i := 0; i < len(s); i += 2 {
+ _, ok := xtob(s[i], s[i+1])
+ if !ok {
+ return errors.New("invalid UUID format")
+ }
+ }
+
+ default:
+ return invalidLengthError{len(s)}
+ }
+
+ // Check for standard UUID format
+ if len(s) == 36 {
+ if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' {
+ return errors.New("invalid UUID format")
+ }
+ for _, x := range []int{0, 2, 4, 6, 9, 11, 14, 16, 19, 21, 24, 26, 28, 30, 32, 34} {
+ if _, ok := xtob(s[x], s[x+1]); !ok {
+ return errors.New("invalid UUID format")
+ }
+ }
+ }
+
+ return nil
+}
+
+// String returns the string form of uuid, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+// , or "" if uuid is invalid.
+func (uuid UUID) String() string {
+ var buf [36]byte
+ encodeHex(buf[:], uuid)
+ return string(buf[:])
+}
+
+// URN returns the RFC 2141 URN form of uuid,
+// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, or "" if uuid is invalid.
+func (uuid UUID) URN() string {
+ var buf [36 + 9]byte
+ copy(buf[:], "urn:uuid:")
+ encodeHex(buf[9:], uuid)
+ return string(buf[:])
+}
+
+func encodeHex(dst []byte, uuid UUID) {
+ hex.Encode(dst, uuid[:4])
+ dst[8] = '-'
+ hex.Encode(dst[9:13], uuid[4:6])
+ dst[13] = '-'
+ hex.Encode(dst[14:18], uuid[6:8])
+ dst[18] = '-'
+ hex.Encode(dst[19:23], uuid[8:10])
+ dst[23] = '-'
+ hex.Encode(dst[24:], uuid[10:])
+}
+
+// Variant returns the variant encoded in uuid.
+func (uuid UUID) Variant() Variant {
+ switch {
+ case (uuid[8] & 0xc0) == 0x80:
+ return RFC4122
+ case (uuid[8] & 0xe0) == 0xc0:
+ return Microsoft
+ case (uuid[8] & 0xe0) == 0xe0:
+ return Future
+ default:
+ return Reserved
+ }
+}
+
+// Version returns the version of uuid.
+func (uuid UUID) Version() Version {
+ return Version(uuid[6] >> 4)
+}
+
+func (v Version) String() string {
+ if v > 15 {
+ return fmt.Sprintf("BAD_VERSION_%d", v)
+ }
+ return fmt.Sprintf("VERSION_%d", v)
+}
+
+func (v Variant) String() string {
+ switch v {
+ case RFC4122:
+ return "RFC4122"
+ case Reserved:
+ return "Reserved"
+ case Microsoft:
+ return "Microsoft"
+ case Future:
+ return "Future"
+ case Invalid:
+ return "Invalid"
+ }
+ return fmt.Sprintf("BadVariant%d", int(v))
+}
+
+// SetRand sets the random number generator to r, which implements io.Reader.
+// If r.Read returns an error when the package requests random data then
+// a panic will be issued.
+//
+// Calling SetRand with nil sets the random number generator to the default
+// generator.
+func SetRand(r io.Reader) {
+ if r == nil {
+ rander = rand.Reader
+ return
+ }
+ rander = r
+}
+
+// EnableRandPool enables internal randomness pool used for Random
+// (Version 4) UUID generation. The pool contains random bytes read from
+// the random number generator on demand in batches. Enabling the pool
+// may improve the UUID generation throughput significantly.
+//
+// Since the pool is stored on the Go heap, this feature may be a bad fit
+// for security sensitive applications.
+//
+// Both EnableRandPool and DisableRandPool are not thread-safe and should
+// only be called when there is no possibility that New or any other
+// UUID Version 4 generation function will be called concurrently.
+func EnableRandPool() {
+ poolEnabled = true
+}
+
+// DisableRandPool disables the randomness pool if it was previously
+// enabled with EnableRandPool.
+//
+// Both EnableRandPool and DisableRandPool are not thread-safe and should
+// only be called when there is no possibility that New or any other
+// UUID Version 4 generation function will be called concurrently.
+func DisableRandPool() {
+ poolEnabled = false
+ defer poolMu.Unlock()
+ poolMu.Lock()
+ poolPos = randPoolSize
+}
+
+// UUIDs is a slice of UUID types.
+type UUIDs []UUID
+
+// Strings returns a string slice containing the string form of each UUID in uuids.
+func (uuids UUIDs) Strings() []string {
+ var uuidStrs = make([]string, len(uuids))
+ for i, uuid := range uuids {
+ uuidStrs[i] = uuid.String()
+ }
+ return uuidStrs
+}
diff --git a/api/vendor/github.com/google/uuid/version1.go b/api/vendor/github.com/google/uuid/version1.go
new file mode 100644
index 000000000000..463109629eee
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/version1.go
@@ -0,0 +1,44 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "encoding/binary"
+)
+
+// NewUUID returns a Version 1 UUID based on the current NodeID and clock
+// sequence, and the current time. If the NodeID has not been set by SetNodeID
+// or SetNodeInterface then it will be set automatically. If the NodeID cannot
+// be set NewUUID returns nil. If clock sequence has not been set by
+// SetClockSequence then it will be set automatically. If GetTime fails to
+// return the current NewUUID returns nil and an error.
+//
+// In most cases, New should be used.
+func NewUUID() (UUID, error) {
+ var uuid UUID
+ now, seq, err := GetTime()
+ if err != nil {
+ return uuid, err
+ }
+
+ timeLow := uint32(now & 0xffffffff)
+ timeMid := uint16((now >> 32) & 0xffff)
+ timeHi := uint16((now >> 48) & 0x0fff)
+ timeHi |= 0x1000 // Version 1
+
+ binary.BigEndian.PutUint32(uuid[0:], timeLow)
+ binary.BigEndian.PutUint16(uuid[4:], timeMid)
+ binary.BigEndian.PutUint16(uuid[6:], timeHi)
+ binary.BigEndian.PutUint16(uuid[8:], seq)
+
+ nodeMu.Lock()
+ if nodeID == zeroID {
+ setNodeInterface("")
+ }
+ copy(uuid[10:], nodeID[:])
+ nodeMu.Unlock()
+
+ return uuid, nil
+}
diff --git a/api/vendor/github.com/google/uuid/version4.go b/api/vendor/github.com/google/uuid/version4.go
new file mode 100644
index 000000000000..7697802e4d16
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/version4.go
@@ -0,0 +1,76 @@
+// Copyright 2016 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import "io"
+
+// New creates a new random UUID or panics. New is equivalent to
+// the expression
+//
+// uuid.Must(uuid.NewRandom())
+func New() UUID {
+ return Must(NewRandom())
+}
+
+// NewString creates a new random UUID and returns it as a string or panics.
+// NewString is equivalent to the expression
+//
+// uuid.New().String()
+func NewString() string {
+ return Must(NewRandom()).String()
+}
+
+// NewRandom returns a Random (Version 4) UUID.
+//
+// The strength of the UUIDs is based on the strength of the crypto/rand
+// package.
+//
+// Uses the randomness pool if it was enabled with EnableRandPool.
+//
+// A note about uniqueness derived from the UUID Wikipedia entry:
+//
+// Randomly generated UUIDs have 122 random bits. One's annual risk of being
+// hit by a meteorite is estimated to be one chance in 17 billion, that
+// means the probability is about 0.00000000006 (6 × 10−11),
+// equivalent to the odds of creating a few tens of trillions of UUIDs in a
+// year and having one duplicate.
+func NewRandom() (UUID, error) {
+ if !poolEnabled {
+ return NewRandomFromReader(rander)
+ }
+ return newRandomFromPool()
+}
+
+// NewRandomFromReader returns a UUID based on bytes read from a given io.Reader.
+func NewRandomFromReader(r io.Reader) (UUID, error) {
+ var uuid UUID
+ _, err := io.ReadFull(r, uuid[:])
+ if err != nil {
+ return Nil, err
+ }
+ uuid[6] = (uuid[6] & 0x0f) | 0x40 // Version 4
+ uuid[8] = (uuid[8] & 0x3f) | 0x80 // Variant is 10
+ return uuid, nil
+}
+
+func newRandomFromPool() (UUID, error) {
+ var uuid UUID
+ poolMu.Lock()
+ if poolPos == randPoolSize {
+ _, err := io.ReadFull(rander, pool[:])
+ if err != nil {
+ poolMu.Unlock()
+ return Nil, err
+ }
+ poolPos = 0
+ }
+ copy(uuid[:], pool[poolPos:(poolPos+16)])
+ poolPos += 16
+ poolMu.Unlock()
+
+ uuid[6] = (uuid[6] & 0x0f) | 0x40 // Version 4
+ uuid[8] = (uuid[8] & 0x3f) | 0x80 // Variant is 10
+ return uuid, nil
+}
diff --git a/api/vendor/github.com/google/uuid/version6.go b/api/vendor/github.com/google/uuid/version6.go
new file mode 100644
index 000000000000..339a959a7a26
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/version6.go
@@ -0,0 +1,56 @@
+// Copyright 2023 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import "encoding/binary"
+
+// UUID version 6 is a field-compatible version of UUIDv1, reordered for improved DB locality.
+// It is expected that UUIDv6 will primarily be used in contexts where there are existing v1 UUIDs.
+// Systems that do not involve legacy UUIDv1 SHOULD consider using UUIDv7 instead.
+//
+// see https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-03#uuidv6
+//
+// NewV6 returns a Version 6 UUID based on the current NodeID and clock
+// sequence, and the current time. If the NodeID has not been set by SetNodeID
+// or SetNodeInterface then it will be set automatically. If the NodeID cannot
+// be set NewV6 set NodeID is random bits automatically . If clock sequence has not been set by
+// SetClockSequence then it will be set automatically. If GetTime fails to
+// return the current NewV6 returns Nil and an error.
+func NewV6() (UUID, error) {
+ var uuid UUID
+ now, seq, err := GetTime()
+ if err != nil {
+ return uuid, err
+ }
+
+ /*
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | time_high |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | time_mid | time_low_and_version |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |clk_seq_hi_res | clk_seq_low | node (0-1) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | node (2-5) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+
+ binary.BigEndian.PutUint64(uuid[0:], uint64(now))
+ binary.BigEndian.PutUint16(uuid[8:], seq)
+
+ uuid[6] = 0x60 | (uuid[6] & 0x0F)
+ uuid[8] = 0x80 | (uuid[8] & 0x3F)
+
+ nodeMu.Lock()
+ if nodeID == zeroID {
+ setNodeInterface("")
+ }
+ copy(uuid[10:], nodeID[:])
+ nodeMu.Unlock()
+
+ return uuid, nil
+}
diff --git a/api/vendor/github.com/google/uuid/version7.go b/api/vendor/github.com/google/uuid/version7.go
new file mode 100644
index 000000000000..3167b643d459
--- /dev/null
+++ b/api/vendor/github.com/google/uuid/version7.go
@@ -0,0 +1,104 @@
+// Copyright 2023 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package uuid
+
+import (
+ "io"
+)
+
+// UUID version 7 features a time-ordered value field derived from the widely
+// implemented and well known Unix Epoch timestamp source,
+// the number of milliseconds seconds since midnight 1 Jan 1970 UTC, leap seconds excluded.
+// As well as improved entropy characteristics over versions 1 or 6.
+//
+// see https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-03#name-uuid-version-7
+//
+// Implementations SHOULD utilize UUID version 7 over UUID version 1 and 6 if possible.
+//
+// NewV7 returns a Version 7 UUID based on the current time(Unix Epoch).
+// Uses the randomness pool if it was enabled with EnableRandPool.
+// On error, NewV7 returns Nil and an error
+func NewV7() (UUID, error) {
+ uuid, err := NewRandom()
+ if err != nil {
+ return uuid, err
+ }
+ makeV7(uuid[:])
+ return uuid, nil
+}
+
+// NewV7FromReader returns a Version 7 UUID based on the current time(Unix Epoch).
+// it use NewRandomFromReader fill random bits.
+// On error, NewV7FromReader returns Nil and an error.
+func NewV7FromReader(r io.Reader) (UUID, error) {
+ uuid, err := NewRandomFromReader(r)
+ if err != nil {
+ return uuid, err
+ }
+
+ makeV7(uuid[:])
+ return uuid, nil
+}
+
+// makeV7 fill 48 bits time (uuid[0] - uuid[5]), set version b0111 (uuid[6])
+// uuid[8] already has the right version number (Variant is 10)
+// see function NewV7 and NewV7FromReader
+func makeV7(uuid []byte) {
+ /*
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | unix_ts_ms |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | unix_ts_ms | ver | rand_a (12 bit seq) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |var| rand_b |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | rand_b |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ _ = uuid[15] // bounds check
+
+ t, s := getV7Time()
+
+ uuid[0] = byte(t >> 40)
+ uuid[1] = byte(t >> 32)
+ uuid[2] = byte(t >> 24)
+ uuid[3] = byte(t >> 16)
+ uuid[4] = byte(t >> 8)
+ uuid[5] = byte(t)
+
+ uuid[6] = 0x70 | (0x0F & byte(s>>8))
+ uuid[7] = byte(s)
+}
+
+// lastV7time is the last time we returned stored as:
+//
+// 52 bits of time in milliseconds since epoch
+// 12 bits of (fractional nanoseconds) >> 8
+var lastV7time int64
+
+const nanoPerMilli = 1000000
+
+// getV7Time returns the time in milliseconds and nanoseconds / 256.
+// The returned (milli << 12 + seq) is guarenteed to be greater than
+// (milli << 12 + seq) returned by any previous call to getV7Time.
+func getV7Time() (milli, seq int64) {
+ timeMu.Lock()
+ defer timeMu.Unlock()
+
+ nano := timeNow().UnixNano()
+ milli = nano / nanoPerMilli
+ // Sequence number is between 0 and 3906 (nanoPerMilli>>8)
+ seq = (nano - milli*nanoPerMilli) >> 8
+ now := milli<<12 + seq
+ if now <= lastV7time {
+ now = lastV7time + 1
+ milli = now >> 12
+ seq = now & 0xfff
+ }
+ lastV7time = now
+ return milli, seq
+}
diff --git a/api/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go b/api/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go
index ff7b27c5b203..e68108f86876 100644
--- a/api/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go
+++ b/api/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go
@@ -8,7 +8,6 @@
package jlexer
import (
- "reflect"
"unsafe"
)
@@ -18,7 +17,5 @@ import (
// chunk may be either blocked from being freed by GC because of a single string or the buffer.Data
// may be garbage-collected even when the string exists.
func bytesToStr(data []byte) string {
- h := (*reflect.SliceHeader)(unsafe.Pointer(&data))
- shdr := reflect.StringHeader{Data: h.Data, Len: h.Len}
- return *(*string)(unsafe.Pointer(&shdr))
+ return *(*string)(unsafe.Pointer(&data))
}
diff --git a/api/vendor/github.com/mailru/easyjson/jlexer/lexer.go b/api/vendor/github.com/mailru/easyjson/jlexer/lexer.go
index b5f5e2613293..a27705b12b54 100644
--- a/api/vendor/github.com/mailru/easyjson/jlexer/lexer.go
+++ b/api/vendor/github.com/mailru/easyjson/jlexer/lexer.go
@@ -19,21 +19,21 @@ import (
"github.com/josharian/intern"
)
-// tokenKind determines type of a token.
-type tokenKind byte
+// TokenKind determines type of a token.
+type TokenKind byte
const (
- tokenUndef tokenKind = iota // No token.
- tokenDelim // Delimiter: one of '{', '}', '[' or ']'.
- tokenString // A string literal, e.g. "abc\u1234"
- tokenNumber // Number literal, e.g. 1.5e5
- tokenBool // Boolean literal: true or false.
- tokenNull // null keyword.
+ TokenUndef TokenKind = iota // No token.
+ TokenDelim // Delimiter: one of '{', '}', '[' or ']'.
+ TokenString // A string literal, e.g. "abc\u1234"
+ TokenNumber // Number literal, e.g. 1.5e5
+ TokenBool // Boolean literal: true or false.
+ TokenNull // null keyword.
)
// token describes a single token: type, position in the input and value.
type token struct {
- kind tokenKind // Type of a token.
+ kind TokenKind // Type of a token.
boolValue bool // Value if a boolean literal token.
byteValueCloned bool // true if byteValue was allocated and does not refer to original json body
@@ -47,7 +47,7 @@ type Lexer struct {
start int // Start of the current token.
pos int // Current unscanned position in the input stream.
- token token // Last scanned token, if token.kind != tokenUndef.
+ token token // Last scanned token, if token.kind != TokenUndef.
firstElement bool // Whether current element is the first in array or an object.
wantSep byte // A comma or a colon character, which need to occur before a token.
@@ -59,7 +59,7 @@ type Lexer struct {
// FetchToken scans the input for the next token.
func (r *Lexer) FetchToken() {
- r.token.kind = tokenUndef
+ r.token.kind = TokenUndef
r.start = r.pos
// Check if r.Data has r.pos element
@@ -90,7 +90,7 @@ func (r *Lexer) FetchToken() {
r.errSyntax()
}
- r.token.kind = tokenString
+ r.token.kind = TokenString
r.fetchString()
return
@@ -99,7 +99,7 @@ func (r *Lexer) FetchToken() {
r.errSyntax()
}
r.firstElement = true
- r.token.kind = tokenDelim
+ r.token.kind = TokenDelim
r.token.delimValue = r.Data[r.pos]
r.pos++
return
@@ -109,7 +109,7 @@ func (r *Lexer) FetchToken() {
r.errSyntax()
}
r.wantSep = 0
- r.token.kind = tokenDelim
+ r.token.kind = TokenDelim
r.token.delimValue = r.Data[r.pos]
r.pos++
return
@@ -118,7 +118,7 @@ func (r *Lexer) FetchToken() {
if r.wantSep != 0 {
r.errSyntax()
}
- r.token.kind = tokenNumber
+ r.token.kind = TokenNumber
r.fetchNumber()
return
@@ -127,7 +127,7 @@ func (r *Lexer) FetchToken() {
r.errSyntax()
}
- r.token.kind = tokenNull
+ r.token.kind = TokenNull
r.fetchNull()
return
@@ -136,7 +136,7 @@ func (r *Lexer) FetchToken() {
r.errSyntax()
}
- r.token.kind = tokenBool
+ r.token.kind = TokenBool
r.token.boolValue = true
r.fetchTrue()
return
@@ -146,7 +146,7 @@ func (r *Lexer) FetchToken() {
r.errSyntax()
}
- r.token.kind = tokenBool
+ r.token.kind = TokenBool
r.token.boolValue = false
r.fetchFalse()
return
@@ -391,7 +391,7 @@ func (r *Lexer) fetchString() {
// scanToken scans the next token if no token is currently available in the lexer.
func (r *Lexer) scanToken() {
- if r.token.kind != tokenUndef || r.fatalError != nil {
+ if r.token.kind != TokenUndef || r.fatalError != nil {
return
}
@@ -400,7 +400,7 @@ func (r *Lexer) scanToken() {
// consume resets the current token to allow scanning the next one.
func (r *Lexer) consume() {
- r.token.kind = tokenUndef
+ r.token.kind = TokenUndef
r.token.byteValueCloned = false
r.token.delimValue = 0
}
@@ -443,10 +443,10 @@ func (r *Lexer) errInvalidToken(expected string) {
switch expected {
case "[":
r.token.delimValue = ']'
- r.token.kind = tokenDelim
+ r.token.kind = TokenDelim
case "{":
r.token.delimValue = '}'
- r.token.kind = tokenDelim
+ r.token.kind = TokenDelim
}
r.addNonfatalError(&LexerError{
Reason: fmt.Sprintf("expected %s", expected),
@@ -475,7 +475,7 @@ func (r *Lexer) GetPos() int {
// Delim consumes a token and verifies that it is the given delimiter.
func (r *Lexer) Delim(c byte) {
- if r.token.kind == tokenUndef && r.Ok() {
+ if r.token.kind == TokenUndef && r.Ok() {
r.FetchToken()
}
@@ -489,7 +489,7 @@ func (r *Lexer) Delim(c byte) {
// IsDelim returns true if there was no scanning error and next token is the given delimiter.
func (r *Lexer) IsDelim(c byte) bool {
- if r.token.kind == tokenUndef && r.Ok() {
+ if r.token.kind == TokenUndef && r.Ok() {
r.FetchToken()
}
return !r.Ok() || r.token.delimValue == c
@@ -497,10 +497,10 @@ func (r *Lexer) IsDelim(c byte) bool {
// Null verifies that the next token is null and consumes it.
func (r *Lexer) Null() {
- if r.token.kind == tokenUndef && r.Ok() {
+ if r.token.kind == TokenUndef && r.Ok() {
r.FetchToken()
}
- if !r.Ok() || r.token.kind != tokenNull {
+ if !r.Ok() || r.token.kind != TokenNull {
r.errInvalidToken("null")
}
r.consume()
@@ -508,15 +508,15 @@ func (r *Lexer) Null() {
// IsNull returns true if the next token is a null keyword.
func (r *Lexer) IsNull() bool {
- if r.token.kind == tokenUndef && r.Ok() {
+ if r.token.kind == TokenUndef && r.Ok() {
r.FetchToken()
}
- return r.Ok() && r.token.kind == tokenNull
+ return r.Ok() && r.token.kind == TokenNull
}
// Skip skips a single token.
func (r *Lexer) Skip() {
- if r.token.kind == tokenUndef && r.Ok() {
+ if r.token.kind == TokenUndef && r.Ok() {
r.FetchToken()
}
r.consume()
@@ -621,10 +621,10 @@ func (r *Lexer) Consumed() {
}
func (r *Lexer) unsafeString(skipUnescape bool) (string, []byte) {
- if r.token.kind == tokenUndef && r.Ok() {
+ if r.token.kind == TokenUndef && r.Ok() {
r.FetchToken()
}
- if !r.Ok() || r.token.kind != tokenString {
+ if !r.Ok() || r.token.kind != TokenString {
r.errInvalidToken("string")
return "", nil
}
@@ -664,10 +664,10 @@ func (r *Lexer) UnsafeFieldName(skipUnescape bool) string {
// String reads a string literal.
func (r *Lexer) String() string {
- if r.token.kind == tokenUndef && r.Ok() {
+ if r.token.kind == TokenUndef && r.Ok() {
r.FetchToken()
}
- if !r.Ok() || r.token.kind != tokenString {
+ if !r.Ok() || r.token.kind != TokenString {
r.errInvalidToken("string")
return ""
}
@@ -687,10 +687,10 @@ func (r *Lexer) String() string {
// StringIntern reads a string literal, and performs string interning on it.
func (r *Lexer) StringIntern() string {
- if r.token.kind == tokenUndef && r.Ok() {
+ if r.token.kind == TokenUndef && r.Ok() {
r.FetchToken()
}
- if !r.Ok() || r.token.kind != tokenString {
+ if !r.Ok() || r.token.kind != TokenString {
r.errInvalidToken("string")
return ""
}
@@ -705,10 +705,10 @@ func (r *Lexer) StringIntern() string {
// Bytes reads a string literal and base64 decodes it into a byte slice.
func (r *Lexer) Bytes() []byte {
- if r.token.kind == tokenUndef && r.Ok() {
+ if r.token.kind == TokenUndef && r.Ok() {
r.FetchToken()
}
- if !r.Ok() || r.token.kind != tokenString {
+ if !r.Ok() || r.token.kind != TokenString {
r.errInvalidToken("string")
return nil
}
@@ -731,10 +731,10 @@ func (r *Lexer) Bytes() []byte {
// Bool reads a true or false boolean keyword.
func (r *Lexer) Bool() bool {
- if r.token.kind == tokenUndef && r.Ok() {
+ if r.token.kind == TokenUndef && r.Ok() {
r.FetchToken()
}
- if !r.Ok() || r.token.kind != tokenBool {
+ if !r.Ok() || r.token.kind != TokenBool {
r.errInvalidToken("bool")
return false
}
@@ -744,10 +744,10 @@ func (r *Lexer) Bool() bool {
}
func (r *Lexer) number() string {
- if r.token.kind == tokenUndef && r.Ok() {
+ if r.token.kind == TokenUndef && r.Ok() {
r.FetchToken()
}
- if !r.Ok() || r.token.kind != tokenNumber {
+ if !r.Ok() || r.token.kind != TokenNumber {
r.errInvalidToken("number")
return ""
}
@@ -1151,7 +1151,7 @@ func (r *Lexer) GetNonFatalErrors() []*LexerError {
// JsonNumber fetches and json.Number from 'encoding/json' package.
// Both int, float or string, contains them are valid values
func (r *Lexer) JsonNumber() json.Number {
- if r.token.kind == tokenUndef && r.Ok() {
+ if r.token.kind == TokenUndef && r.Ok() {
r.FetchToken()
}
if !r.Ok() {
@@ -1160,11 +1160,11 @@ func (r *Lexer) JsonNumber() json.Number {
}
switch r.token.kind {
- case tokenString:
+ case TokenString:
return json.Number(r.String())
- case tokenNumber:
+ case TokenNumber:
return json.Number(r.Raw())
- case tokenNull:
+ case TokenNull:
r.Null()
return json.Number("")
default:
@@ -1175,7 +1175,7 @@ func (r *Lexer) JsonNumber() json.Number {
// Interface fetches an interface{} analogous to the 'encoding/json' package.
func (r *Lexer) Interface() interface{} {
- if r.token.kind == tokenUndef && r.Ok() {
+ if r.token.kind == TokenUndef && r.Ok() {
r.FetchToken()
}
@@ -1183,13 +1183,13 @@ func (r *Lexer) Interface() interface{} {
return nil
}
switch r.token.kind {
- case tokenString:
+ case TokenString:
return r.String()
- case tokenNumber:
+ case TokenNumber:
return r.Float64()
- case tokenBool:
+ case TokenBool:
return r.Bool()
- case tokenNull:
+ case TokenNull:
r.Null()
return nil
}
@@ -1242,3 +1242,16 @@ func (r *Lexer) WantColon() {
r.wantSep = ':'
r.firstElement = false
}
+
+// CurrentToken returns current token kind if there were no errors and TokenUndef otherwise
+func (r *Lexer) CurrentToken() TokenKind {
+ if r.token.kind == TokenUndef && r.Ok() {
+ r.FetchToken()
+ }
+
+ if !r.Ok() {
+ return TokenUndef
+ }
+
+ return r.token.kind
+}
diff --git a/api/vendor/github.com/mailru/easyjson/jwriter/writer.go b/api/vendor/github.com/mailru/easyjson/jwriter/writer.go
index 2c5b20105bb9..34b0ade46852 100644
--- a/api/vendor/github.com/mailru/easyjson/jwriter/writer.go
+++ b/api/vendor/github.com/mailru/easyjson/jwriter/writer.go
@@ -67,6 +67,18 @@ func (w *Writer) RawString(s string) {
w.Buffer.AppendString(s)
}
+// RawBytesString appends string from bytes to the buffer.
+func (w *Writer) RawBytesString(data []byte, err error) {
+ switch {
+ case w.Error != nil:
+ return
+ case err != nil:
+ w.Error = err
+ default:
+ w.String(string(data))
+ }
+}
+
// Raw appends raw binary data to the buffer or sets the error if it is given. Useful for
// calling with results of MarshalJSON-like functions.
func (w *Writer) Raw(data []byte, err error) {
diff --git a/api/vendor/github.com/openshift/api/config/v1/types_apiserver.go b/api/vendor/github.com/openshift/api/config/v1/types_apiserver.go
index 0afe7b1d8dee..b8a4399dbc3d 100644
--- a/api/vendor/github.com/openshift/api/config/v1/types_apiserver.go
+++ b/api/vendor/github.com/openshift/api/config/v1/types_apiserver.go
@@ -34,6 +34,7 @@ type APIServer struct {
Status APIServerStatus `json:"status"`
}
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=TLSAdherence,rule="has(oldSelf.tlsAdherence) ? has(self.tlsAdherence) : true",message="tlsAdherence may not be removed once set"
type APIServerSpec struct {
// servingCert is the TLS cert info for serving secure traffic. If not specified, operator managed certificates
// will be used for serving secure traffic.
@@ -62,6 +63,39 @@ type APIServerSpec struct {
// The current default is the Intermediate profile.
// +optional
TLSSecurityProfile *TLSSecurityProfile `json:"tlsSecurityProfile,omitempty"`
+ // tlsAdherence controls if components in the cluster adhere to the TLS security profile
+ // configured on this APIServer resource.
+ //
+ // Valid values are "LegacyAdheringComponentsOnly" and "StrictAllComponents".
+ //
+ // When set to "LegacyAdheringComponentsOnly", components that already honor the
+ // cluster-wide TLS profile continue to do so. Components that do not already honor
+ // it continue to use their individual TLS configurations.
+ //
+ // When set to "StrictAllComponents", all components must honor the configured TLS
+ // profile unless they have a component-specific TLS configuration that overrides
+ // it. This mode is recommended for security-conscious deployments and is required
+ // for certain compliance frameworks.
+ //
+ // Note: Some components such as Kubelet and IngressController have their own
+ // dedicated TLS configuration mechanisms via KubeletConfig and IngressController
+ // CRs respectively. When these component-specific TLS configurations are set,
+ // they take precedence over the cluster-wide tlsSecurityProfile. When not set,
+ // these components fall back to the cluster-wide default.
+ //
+ // Components that encounter an unknown value for tlsAdherence should treat it
+ // as "StrictAllComponents" and log a warning to ensure forward compatibility
+ // while defaulting to the more secure behavior.
+ //
+ // This field is optional.
+ // When omitted, this means the user has no opinion and the platform is left
+ // to choose reasonable defaults. These defaults are subject to change over time.
+ // The current default is LegacyAdheringComponentsOnly.
+ //
+ // Once set, this field may be changed to a different value, but may not be removed.
+ // +openshift:enable:FeatureGate=TLSAdherence
+ // +optional
+ TLSAdherence TLSAdherencePolicy `json:"tlsAdherence,omitempty"`
// audit specifies the settings for audit configuration to be applied to all OpenShift-provided
// API servers in the cluster.
// +optional
@@ -212,6 +246,7 @@ type APIServerEncryption struct {
// +openshift:validation:FeatureGateAwareEnum:featureGate="",enum="";identity;aescbc;aesgcm
// +openshift:validation:FeatureGateAwareEnum:featureGate=KMSEncryptionProvider,enum="";identity;aescbc;aesgcm;KMS
+// +openshift:validation:FeatureGateAwareEnum:featureGate=KMSEncryption,enum="";identity;aescbc;aesgcm;KMS
type EncryptionType string
const (
@@ -236,6 +271,35 @@ const (
type APIServerStatus struct {
}
+// TLSAdherencePolicy defines which components adhere to the TLS security profile.
+// Implementors should use the ShouldHonorClusterTLSProfile helper function from library-go
+// rather than checking these values directly.
+// +kubebuilder:validation:Enum=LegacyAdheringComponentsOnly;StrictAllComponents
+type TLSAdherencePolicy string
+
+const (
+ // TLSAdherencePolicyNoOpinion represents an empty/unset value for tlsAdherence.
+ // This value cannot be explicitly set and is only present when the field is omitted.
+ // When the field is omitted, the cluster defaults to LegacyAdheringComponentsOnly
+ // behavior. Components should treat this the same as LegacyAdheringComponentsOnly.
+ TLSAdherencePolicyNoOpinion TLSAdherencePolicy = ""
+
+ // TLSAdherencePolicyLegacyAdheringComponentsOnly maintains backward-compatible behavior.
+ // Components that already honor the cluster-wide TLS profile (such as kube-apiserver,
+ // openshift-apiserver, oauth-apiserver, and others) continue to do so. Components that do
+ // not already honor it continue to use their individual TLS configurations (e.g.,
+ // IngressController.spec.tlsSecurityProfile, KubeletConfig.spec.tlsSecurityProfile,
+ // or component defaults). No additional components are required to start honoring the
+ // cluster-wide profile in this mode.
+ TLSAdherencePolicyLegacyAdheringComponentsOnly TLSAdherencePolicy = "LegacyAdheringComponentsOnly"
+
+ // TLSAdherencePolicyStrictAllComponents means all components must honor the configured TLS
+ // profile unless they have a component-specific TLS configuration that overrides it.
+ // This mode is recommended for security-conscious deployments and is required
+ // for certain compliance frameworks.
+ TLSAdherencePolicyStrictAllComponents TLSAdherencePolicy = "StrictAllComponents"
+)
+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
diff --git a/api/vendor/github.com/openshift/api/config/v1/types_authentication.go b/api/vendor/github.com/openshift/api/config/v1/types_authentication.go
index 52a41b2fef28..64d0f399b097 100644
--- a/api/vendor/github.com/openshift/api/config/v1/types_authentication.go
+++ b/api/vendor/github.com/openshift/api/config/v1/types_authentication.go
@@ -5,7 +5,7 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-// +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDC;ExternalOIDCWithUIDAndExtraClaimMappings,rule="!has(self.spec.oidcProviders) || self.spec.oidcProviders.all(p, !has(p.oidcClients) || p.oidcClients.all(specC, self.status.oidcClients.exists(statusC, statusC.componentNamespace == specC.componentNamespace && statusC.componentName == specC.componentName) || (has(oldSelf.spec.oidcProviders) && oldSelf.spec.oidcProviders.exists(oldP, oldP.name == p.name && has(oldP.oidcClients) && oldP.oidcClients.exists(oldC, oldC.componentNamespace == specC.componentNamespace && oldC.componentName == specC.componentName)))))",message="all oidcClients in the oidcProviders must match their componentName and componentNamespace to either a previously configured oidcClient or they must exist in the status.oidcClients"
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDC;ExternalOIDCWithUIDAndExtraClaimMappings;ExternalOIDCWithUpstreamParity,rule="!has(self.spec.oidcProviders) || self.spec.oidcProviders.all(p, !has(p.oidcClients) || p.oidcClients.all(specC, self.status.oidcClients.exists(statusC, statusC.componentNamespace == specC.componentNamespace && statusC.componentName == specC.componentName) || (has(oldSelf.spec.oidcProviders) && oldSelf.spec.oidcProviders.exists(oldP, oldP.name == p.name && has(oldP.oidcClients) && oldP.oidcClients.exists(oldC, oldC.componentNamespace == specC.componentNamespace && oldC.componentName == specC.componentName)))))",message="all oidcClients in the oidcProviders must match their componentName and componentNamespace to either a previously configured oidcClient or they must exist in the status.oidcClients"
// Authentication specifies cluster-wide settings for authentication (like OAuth and
// webhook token authenticators). The canonical name of an instance is `cluster`.
@@ -80,8 +80,7 @@ type AuthenticationSpec struct {
// +optional
ServiceAccountIssuer string `json:"serviceAccountIssuer"`
- // oidcProviders are OIDC identity providers that can issue tokens
- // for this cluster
+ // oidcProviders are OIDC identity providers that can issue tokens for this cluster
// Can only be set if "Type" is set to "OIDC".
//
// At most one provider can be configured.
@@ -91,6 +90,7 @@ type AuthenticationSpec struct {
// +kubebuilder:validation:MaxItems=1
// +openshift:enable:FeatureGate=ExternalOIDC
// +openshift:enable:FeatureGate=ExternalOIDCWithUIDAndExtraClaimMappings
+ // +openshift:enable:FeatureGate=ExternalOIDCWithUpstreamParity
// +optional
OIDCProviders []OIDCProvider `json:"oidcProviders,omitempty"`
}
@@ -112,8 +112,7 @@ type AuthenticationStatus struct {
// +optional
IntegratedOAuthMetadata ConfigMapNameReference `json:"integratedOAuthMetadata"`
- // oidcClients is where participating operators place the current OIDC client status
- // for OIDC clients that can be customized by the cluster-admin.
+ // oidcClients is where participating operators place the current OIDC client status for OIDC clients that can be customized by the cluster-admin.
//
// +listType=map
// +listMapKey=componentNamespace
@@ -145,8 +144,7 @@ type AuthenticationType string
const (
// None means that no cluster managed authentication system is in place.
- // Note that user login will only work if a manually configured system is in place and
- // referenced in authentication spec via oauthMetadata and
+ // Note that user login will only work if a manually configured system is in place and referenced in authentication spec via oauthMetadata and
// webhookTokenAuthenticator/oidcProviders
AuthenticationTypeNone AuthenticationType = "None"
@@ -198,10 +196,8 @@ const (
)
type OIDCProvider struct {
- // name is a required field that configures the unique human-readable identifier
- // associated with the identity provider.
- // It is used to distinguish between multiple identity providers
- // and has no impact on token validation or authentication mechanics.
+ // name is a required field that configures the unique human-readable identifier associated with the identity provider.
+ // It is used to distinguish between multiple identity providers and has no impact on token validation or authentication mechanics.
//
// name must not be an empty string ("").
//
@@ -209,15 +205,12 @@ type OIDCProvider struct {
// +required
Name string `json:"name"`
- // issuer is a required field that configures how the platform interacts
- // with the identity provider and how tokens issued from the identity provider
- // are evaluated by the Kubernetes API server.
+ // issuer is a required field that configures how the platform interacts with the identity provider and how tokens issued from the identity provider are evaluated by the Kubernetes API server.
//
// +required
Issuer TokenIssuer `json:"issuer"`
- // oidcClients is an optional field that configures how on-cluster,
- // platform clients should request tokens from the identity provider.
+ // oidcClients is an optional field that configures how on-cluster, platform clients should request tokens from the identity provider.
// oidcClients must not exceed 20 entries and entries must have unique namespace/name pairs.
//
// +listType=map
@@ -227,32 +220,40 @@ type OIDCProvider struct {
// +optional
OIDCClients []OIDCClientConfig `json:"oidcClients"`
- // claimMappings is a required field that configures the rules to be used by
- // the Kubernetes API server for translating claims in a JWT token, issued
- // by the identity provider, to a cluster identity.
+ // claimMappings is a required field that configures the rules to be used by the Kubernetes API server for translating claims in a JWT token, issued by the identity provider, to a cluster identity.
//
// +required
ClaimMappings TokenClaimMappings `json:"claimMappings"`
- // claimValidationRules is an optional field that configures the rules to
- // be used by the Kubernetes API server for validating the claims in a JWT
- // token issued by the identity provider.
+ // claimValidationRules is an optional field that configures the rules to be used by the Kubernetes API server for validating the claims in a JWT token issued by the identity provider.
//
// Validation rules are joined via an AND operation.
//
// +listType=atomic
// +optional
ClaimValidationRules []TokenClaimValidationRule `json:"claimValidationRules,omitempty"`
+
+ // userValidationRules is an optional field that configures the set of rules used to validate the cluster user identity that was constructed via mapping token claims to user identity attributes.
+ // Rules are CEL expressions that must evaluate to 'true' for authentication to succeed.
+ // If any rule in the chain of rules evaluates to 'false', authentication will fail.
+ // When specified, at least one rule must be specified and no more than 64 rules may be specified.
+ //
+ // +kubebuilder:validation:MaxItems=64
+ // +kubebuilder:validation:MinItems=1
+ // +listType=map
+ // +listMapKey=expression
+ // +optional
+ // +openshift:enable:FeatureGate=ExternalOIDCWithUpstreamParity
+ UserValidationRules []TokenUserValidationRule `json:"userValidationRules,omitempty"`
}
// +kubebuilder:validation:MinLength=1
type TokenAudience string
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDCWithUpstreamParity,rule="self.?discoveryURL.orValue(\"\").size() > 0 ? (self.issuerURL.size() == 0 || self.discoveryURL.find('^.+[^/]') != self.issuerURL.find('^.+[^/]')) : true",message="discoveryURL must be different from issuerURL"
type TokenIssuer struct {
- // issuerURL is a required field that configures the URL used to issue tokens
- // by the identity provider.
- // The Kubernetes API server determines how authentication tokens should be handled
- // by matching the 'iss' claim in the JWT to the issuerURL of configured identity providers.
+ // issuerURL is a required field that configures the URL used to issue tokens by the identity provider.
+ // The Kubernetes API server determines how authentication tokens should be handled by matching the 'iss' claim in the JWT to the issuerURL of configured identity providers.
//
// Must be at least 1 character and must not exceed 512 characters in length.
// Must be a valid URL that uses the 'https' scheme and does not contain a query, fragment or user.
@@ -267,8 +268,7 @@ type TokenIssuer struct {
// +required
URL string `json:"issuerURL"`
- // audiences is a required field that configures the acceptable audiences
- // the JWT token, issued by the identity provider, must be issued to.
+ // audiences is a required field that configures the acceptable audiences the JWT token, issued by the identity provider, must be issued to.
// At least one of the entries must match the 'aud' claim in the JWT token.
//
// audiences must contain at least one entry and must not exceed ten entries.
@@ -279,54 +279,65 @@ type TokenIssuer struct {
// +required
Audiences []TokenAudience `json:"audiences"`
- // issuerCertificateAuthority is an optional field that configures the
- // certificate authority, used by the Kubernetes API server, to validate
- // the connection to the identity provider when fetching discovery information.
+ // issuerCertificateAuthority is an optional field that configures the certificate authority, used by the Kubernetes API server, to validate the connection to the identity provider when fetching discovery information.
//
// When not specified, the system trust is used.
//
- // When specified, it must reference a ConfigMap in the openshift-config
- // namespace containing the PEM-encoded CA certificates under the 'ca-bundle.crt'
- // key in the data field of the ConfigMap.
+ // When specified, it must reference a ConfigMap in the openshift-config namespace containing the PEM-encoded CA certificates under the 'ca-bundle.crt' key in the data field of the ConfigMap.
//
// +optional
CertificateAuthority ConfigMapNameReference `json:"issuerCertificateAuthority"`
+ // discoveryURL is an optional field that, if specified, overrides the default discovery endpoint used to retrieve OIDC configuration metadata.
+ // By default, the discovery URL is derived from `issuerURL` as "{issuerURL}/.well-known/openid-configuration".
+ //
+ // The discoveryURL must be a valid absolute HTTPS URL.
+ // It must not contain query parameters, user information, or fragments.
+ // Additionally, it must differ from the value of `issuerURL` (ignoring trailing slashes).
+ // The discoveryURL value must be at least 1 character long and no longer than 2048 characters.
+ //
+ // +optional
+ // +openshift:enable:FeatureGate=ExternalOIDCWithUpstreamParity
+ // +kubebuilder:validation:XValidation:rule="isURL(self)",message="discoveryURL must be a valid URL"
+ // +kubebuilder:validation:XValidation:rule="url(self).getScheme() == 'https'",message="discoveryURL must be a valid https URL"
+ // +kubebuilder:validation:XValidation:rule="url(self).getQuery().size() == 0",message="discoveryURL must not contain query parameters"
+ // +kubebuilder:validation:XValidation:rule="self.matches('^[^#]*$')",message="discoveryURL must not contain fragments"
+ // +kubebuilder:validation:XValidation:rule="!self.matches('^https://.+:.+@.+/.*$')",message="discoveryURL must not contain user info"
+ // +kubebuilder:validation:MinLength=1
+ // +kubebuilder:validation:MaxLength=2048
+ DiscoveryURL string `json:"discoveryURL,omitempty"`
}
type TokenClaimMappings struct {
- // username is a required field that configures how the username of a cluster identity
- // should be constructed from the claims in a JWT token issued by the identity provider.
+ // username is a required field that configures how the username of a cluster identity should be constructed from the claims in a JWT token issued by the identity provider.
//
// +required
Username UsernameClaimMapping `json:"username"`
- // groups is an optional field that configures how the groups of a cluster identity
- // should be constructed from the claims in a JWT token issued
- // by the identity provider.
- // When referencing a claim, if the claim is present in the JWT
- // token, its value must be a list of groups separated by a comma (',').
+ // groups is an optional field that configures how the groups of a cluster identity should be constructed from the claims in a JWT token issued by the identity provider.
+ //
+ // When referencing a claim, if the claim is present in the JWT token, its value must be a list of groups separated by a comma (',').
+ //
// For example - '"example"' and '"exampleOne", "exampleTwo", "exampleThree"' are valid claim values.
//
// +optional
Groups PrefixedClaimMapping `json:"groups,omitempty"`
- // uid is an optional field for configuring the claim mapping
- // used to construct the uid for the cluster identity.
+ // uid is an optional field for configuring the claim mapping used to construct the uid for the cluster identity.
//
// When using uid.claim to specify the claim it must be a single string value.
// When using uid.expression the expression must result in a single string value.
//
- // When omitted, this means the user has no opinion and the platform
- // is left to choose a default, which is subject to change over time.
+ // When omitted, this means the user has no opinion and the platform is left to choose a default, which is subject to change over time.
+ //
// The current default is to use the 'sub' claim.
//
// +optional
// +openshift:enable:FeatureGate=ExternalOIDCWithUIDAndExtraClaimMappings
UID *TokenClaimOrExpressionMapping `json:"uid,omitempty"`
- // extra is an optional field for configuring the mappings
- // used to construct the extra attribute for the cluster identity.
+ // extra is an optional field for configuring the mappings used to construct the extra attribute for the cluster identity.
// When omitted, no extra attributes will be present on the cluster identity.
+ //
// key values for extra mappings must be unique.
// A maximum of 32 extra attribute mappings may be provided.
//
@@ -338,52 +349,63 @@ type TokenClaimMappings struct {
Extra []ExtraMapping `json:"extra,omitempty"`
}
-// TokenClaimMapping allows specifying a JWT token
-// claim to be used when mapping claims from an
-// authentication token to cluster identities.
+// TokenClaimMapping allows specifying a JWT token claim to be used when mapping claims from an authentication token to cluster identities.
+// +openshift:validation:FeatureGateAwareXValidation:featureGate="",rule="has(self.claim)",message="claim is required"
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDC,rule="has(self.claim)",message="claim is required"
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDCWithUIDAndExtraClaimMappings,rule="has(self.claim)",message="claim is required"
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDCWithUpstreamParity,rule="(size(self.?claim.orValue(\"\")) > 0) ? !has(self.expression) : true",message="expression must not be set if claim is specified and is not an empty string"
type TokenClaimMapping struct {
- // claim is a required field that configures the JWT token
- // claim whose value is assigned to the cluster identity
- // field associated with this mapping.
+ // claim is an optional field for specifying the JWT token claim that is used in the mapping.
+ // The value of this claim will be assigned to the field in which this mapping is associated.
+ // claim must not exceed 256 characters in length.
+ // When set to the empty string `""`, this means that no named claim should be used for the group mapping.
+ // claim is required when the ExternalOIDCWithUpstreamParity feature gate is not enabled.
//
- // +required
+ // +optional
+ // +kubebuilder:validation:MaxLength=256
Claim string `json:"claim"`
+
+ // expression is an optional CEL expression used to derive
+ // group values from JWT claims.
+ //
+ // CEL expressions have access to the token claims through a CEL variable, 'claims'.
+ //
+ // expression must be at least 1 character and must not exceed 1024 characters in length .
+ //
+ // When specified, claim must not be set or be explicitly set to the empty string (`""`).
+ //
+ // +optional
+ // +openshift:enable:FeatureGate=ExternalOIDCWithUpstreamParity
+ // +kubebuilder:validation:MinLength=1
+ // +kubebuilder:validation:MaxLength=1024
+ Expression string `json:"expression,omitempty"`
}
-// TokenClaimOrExpressionMapping allows specifying either a JWT
-// token claim or CEL expression to be used when mapping claims
-// from an authentication token to cluster identities.
+// TokenClaimOrExpressionMapping allows specifying either a JWT token claim or CEL expression to be used when mapping claims from an authentication token to cluster identities.
// +kubebuilder:validation:XValidation:rule="has(self.claim) ? !has(self.expression) : has(self.expression)",message="precisely one of claim or expression must be set"
type TokenClaimOrExpressionMapping struct {
- // claim is an optional field for specifying the
- // JWT token claim that is used in the mapping.
- // The value of this claim will be assigned to
- // the field in which this mapping is associated.
+ // claim is an optional field for specifying the JWT token claim that is used in the mapping.
+ // The value of this claim will be assigned to the field in which this mapping is associated.
//
// Precisely one of claim or expression must be set.
// claim must not be specified when expression is set.
- // When specified, claim must be at least 1 character in length
- // and must not exceed 256 characters in length.
+ // When specified, claim must be at least 1 character in length and must not exceed 256 characters in length.
//
// +optional
// +kubebuilder:validation:MaxLength=256
// +kubebuilder:validation:MinLength=1
Claim string `json:"claim,omitempty"`
- // expression is an optional field for specifying a
- // CEL expression that produces a string value from
- // JWT token claims.
+ // expression is an optional field for specifying a CEL expression that produces a string value from JWT token claims.
//
- // CEL expressions have access to the token claims
- // through a CEL variable, 'claims'.
+ // CEL expressions have access to the token claims through a CEL variable, 'claims'.
// 'claims' is a map of claim names to claim values.
// For example, the 'sub' claim value can be accessed as 'claims.sub'.
// Nested claims can be accessed using dot notation ('claims.foo.bar').
//
// Precisely one of claim or expression must be set.
// expression must not be specified when claim is set.
- // When specified, expression must be at least 1 character in length
- // and must not exceed 1024 characters in length.
+ // When specified, expression must be at least 1 character in length and must not exceed 1024 characters in length.
//
// +optional
// +kubebuilder:validation:MaxLength=1024
@@ -391,13 +413,10 @@ type TokenClaimOrExpressionMapping struct {
Expression string `json:"expression,omitempty"`
}
-// ExtraMapping allows specifying a key and CEL expression
-// to evaluate the keys' value. It is used to create additional
-// mappings and attributes added to a cluster identity from
-// a provided authentication token.
+// ExtraMapping allows specifying a key and CEL expression to evaluate the keys' value.
+// It is used to create additional mappings and attributes added to a cluster identity from a provided authentication token.
type ExtraMapping struct {
- // key is a required field that specifies the string
- // to use as the extra attribute key.
+ // key is a required field that specifies the string to use as the extra attribute key.
//
// key must be a domain-prefix path (e.g 'example.org/foo').
// key must not exceed 510 characters in length.
@@ -410,8 +429,7 @@ type ExtraMapping struct {
// It must only contain lower case alphanumeric characters and '-' or '.'.
// It must not use the reserved domains, or be subdomains of, "kubernetes.io", "k8s.io", and "openshift.io".
//
- // The path portion of the key (string of characters after the '/') must not be empty and must consist of at least one
- // alphanumeric character, percent-encoded octets, '-', '.', '_', '~', '!', '$', '&', ''', '(', ')', '*', '+', ',', ';', '=', and ':'.
+ // The path portion of the key (string of characters after the '/') must not be empty and must consist of at least one alphanumeric character, percent-encoded octets, '-', '.', '_', '~', '!', '$', '&', ''', '(', ')', '*', '+', ',', ';', '=', and ':'.
// It must not exceed 256 characters in length.
//
// +required
@@ -433,14 +451,12 @@ type ExtraMapping struct {
// +kubebuilder:validation:XValidation:rule="self.split('/', 2)[1].size() <= 256",message="the path of the key must not exceed 256 characters in length"
Key string `json:"key"`
- // valueExpression is a required field to specify the CEL expression to extract
- // the extra attribute value from a JWT token's claims.
+ // valueExpression is a required field to specify the CEL expression to extract the extra attribute value from a JWT token's claims.
// valueExpression must produce a string or string array value.
// "", [], and null are treated as the extra mapping not being present.
// Empty string values within an array are filtered out.
//
- // CEL expressions have access to the token claims
- // through a CEL variable, 'claims'.
+ // CEL expressions have access to the token claims through a CEL variable, 'claims'.
// 'claims' is a map of claim names to claim values.
// For example, the 'sub' claim value can be accessed as 'claims.sub'.
// Nested claims can be accessed using dot notation ('claims.foo.bar').
@@ -454,12 +470,10 @@ type ExtraMapping struct {
ValueExpression string `json:"valueExpression"`
}
-// OIDCClientConfig configures how platform clients
-// interact with identity providers as an authentication
-// method
+// OIDCClientConfig configures how platform clients interact with identity providers as an authentication method.
type OIDCClientConfig struct {
- // componentName is a required field that specifies the name of the platform
- // component being configured to use the identity provider as an authentication mode.
+ // componentName is a required field that specifies the name of the platform component being configured to use the identity provider as an authentication mode.
+ //
// It is used in combination with componentNamespace as a unique identifier.
//
// componentName must not be an empty string ("") and must not exceed 256 characters in length.
@@ -469,9 +483,8 @@ type OIDCClientConfig struct {
// +required
ComponentName string `json:"componentName"`
- // componentNamespace is a required field that specifies the namespace in which the
- // platform component being configured to use the identity provider as an authentication
- // mode is running.
+ // componentNamespace is a required field that specifies the namespace in which the platform component being configured to use the identity provider as an authentication mode is running.
+ //
// It is used in combination with componentName as a unique identifier.
//
// componentNamespace must not be an empty string ("") and must not exceed 63 characters in length.
@@ -481,11 +494,8 @@ type OIDCClientConfig struct {
// +required
ComponentNamespace string `json:"componentNamespace"`
- // clientID is a required field that configures the client identifier, from
- // the identity provider, that the platform component uses for authentication
- // requests made to the identity provider.
- // The identity provider must accept this identifier for platform components
- // to be able to use the identity provider as an authentication mode.
+ // clientID is a required field that configures the client identifier, from the identity provider, that the platform component uses for authentication requests made to the identity provider.
+ // The identity provider must accept this identifier for platform components to be able to use the identity provider as an authentication mode.
//
// clientID must not be an empty string ("").
//
@@ -493,27 +503,21 @@ type OIDCClientConfig struct {
// +required
ClientID string `json:"clientID"`
- // clientSecret is an optional field that configures the client secret used
- // by the platform component when making authentication requests to the identity provider.
+ // clientSecret is an optional field that configures the client secret used by the platform component when making authentication requests to the identity provider.
+ //
+ // When not specified, no client secret will be used when making authentication requests to the identity provider.
//
- // When not specified, no client secret will be used when making authentication requests
- // to the identity provider.
+ // When specified, clientSecret references a Secret in the 'openshift-config' namespace that contains the client secret in the 'clientSecret' key of the '.data' field.
//
- // When specified, clientSecret references a Secret in the 'openshift-config'
- // namespace that contains the client secret in the 'clientSecret' key of the '.data' field.
// The client secret will be used when making authentication requests to the identity provider.
//
- // Public clients do not require a client secret but private
- // clients do require a client secret to work with the identity provider.
+ // Public clients do not require a client secret but private clients do require a client secret to work with the identity provider.
//
// +optional
ClientSecret SecretNameReference `json:"clientSecret"`
- // extraScopes is an optional field that configures the extra scopes that should
- // be requested by the platform component when making authentication requests to the
- // identity provider.
- // This is useful if you have configured claim mappings that requires specific
- // scopes to be requested beyond the standard OIDC scopes.
+ // extraScopes is an optional field that configures the extra scopes that should be requested by the platform component when making authentication requests to the identity provider.
+ // This is useful if you have configured claim mappings that requires specific scopes to be requested beyond the standard OIDC scopes.
//
// When omitted, no additional scopes are requested.
//
@@ -526,8 +530,7 @@ type OIDCClientConfig struct {
// of platform components and how they interact with
// the configured identity providers.
type OIDCClientStatus struct {
- // componentName is a required field that specifies the name of the platform
- // component using the identity provider as an authentication mode.
+ // componentName is a required field that specifies the name of the platform component using the identity provider as an authentication mode.
// It is used in combination with componentNamespace as a unique identifier.
//
// componentName must not be an empty string ("") and must not exceed 256 characters in length.
@@ -537,9 +540,8 @@ type OIDCClientStatus struct {
// +required
ComponentName string `json:"componentName"`
- // componentNamespace is a required field that specifies the namespace in which the
- // platform component using the identity provider as an authentication
- // mode is running.
+ // componentNamespace is a required field that specifies the namespace in which the platform component using the identity provider as an authentication mode is running.
+ //
// It is used in combination with componentName as a unique identifier.
//
// componentNamespace must not be an empty string ("") and must not exceed 63 characters in length.
@@ -550,6 +552,7 @@ type OIDCClientStatus struct {
ComponentNamespace string `json:"componentNamespace"`
// currentOIDCClients is an optional list of clients that the component is currently using.
+ //
// Entries must have unique issuerURL/clientID pairs.
//
// +listType=map
@@ -558,8 +561,7 @@ type OIDCClientStatus struct {
// +optional
CurrentOIDCClients []OIDCClientReference `json:"currentOIDCClients"`
- // consumingUsers is an optional list of ServiceAccounts requiring
- // read permissions on the `clientSecret` secret.
+ // consumingUsers is an optional list of ServiceAccounts requiring read permissions on the `clientSecret` secret.
//
// consumingUsers must not exceed 5 entries.
//
@@ -585,8 +587,7 @@ type OIDCClientStatus struct {
// OIDCClientReference is a reference to a platform component
// client configuration.
type OIDCClientReference struct {
- // oidcProviderName is a required reference to the 'name' of the identity provider
- // configured in 'oidcProviders' that this client is associated with.
+ // oidcProviderName is a required reference to the 'name' of the identity provider configured in 'oidcProviders' that this client is associated with.
//
// oidcProviderName must not be an empty string ("").
//
@@ -594,8 +595,7 @@ type OIDCClientReference struct {
// +required
OIDCProviderName string `json:"oidcProviderName"`
- // issuerURL is a required field that specifies the URL of the identity
- // provider that this client is configured to make requests against.
+ // issuerURL is a required field that specifies the URL of the identity provider that this client is configured to make requests against.
//
// issuerURL must use the 'https' scheme.
//
@@ -603,9 +603,7 @@ type OIDCClientReference struct {
// +required
IssuerURL string `json:"issuerURL"`
- // clientID is a required field that specifies the client identifier, from
- // the identity provider, that the platform component is using for authentication
- // requests made to the identity provider.
+ // clientID is a required field that specifies the client identifier, from the identity provider, that the platform component is using for authentication requests made to the identity provider.
//
// clientID must not be empty.
//
@@ -616,35 +614,52 @@ type OIDCClientReference struct {
// +kubebuilder:validation:XValidation:rule="has(self.prefixPolicy) && self.prefixPolicy == 'Prefix' ? (has(self.prefix) && size(self.prefix.prefixString) > 0) : !has(self.prefix)",message="prefix must be set if prefixPolicy is 'Prefix', but must remain unset otherwise"
// +union
+// +openshift:validation:FeatureGateAwareXValidation:featureGate="",rule="has(self.claim)",message="claim is required"
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDC,rule="has(self.claim)",message="claim is required"
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDCWithUIDAndExtraClaimMappings,rule="has(self.claim)",message="claim is required"
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDCWithUpstreamParity,rule="has(self.claim) ? !has(self.expression) : has(self.expression)",message="precisely one of claim or expression must be set"
type UsernameClaimMapping struct {
- // claim is a required field that configures the JWT token
- // claim whose value is assigned to the cluster identity
- // field associated with this mapping.
+ // claim is an optional field that configures the JWT token claim whose value is assigned to the cluster identity field associated with this mapping.
+ // claim is required when the ExternalOIDCWithUpstreamParity feature gate is not enabled.
+ // When the ExternalOIDCWithUpstreamParity feature gate is enabled, claim must not be set when expression is set.
//
// claim must not be an empty string ("") and must not exceed 256 characters.
//
- // +required
+ // +optional
// +kubebuilder:validation:MinLength:=1
// +kubebuilder:validation:MaxLength:=256
- Claim string `json:"claim"`
+ Claim string `json:"claim,omitempty"`
+
+ // expression is an optional CEL expression used to derive
+ // the username from JWT claims.
+ //
+ // CEL expressions have access to the token claims
+ // through a CEL variable, 'claims'.
+ //
+ // expression must be at least 1 character and must not exceed 1024 characters in length.
+ // expression must not be set when claim is set.
+ //
+ // +optional
+ // +openshift:enable:FeatureGate=ExternalOIDCWithUpstreamParity
+ // +kubebuilder:validation:MinLength=1
+ // +kubebuilder:validation:MaxLength=1024
+ Expression string `json:"expression,omitempty"`
- // prefixPolicy is an optional field that configures how a prefix should be
- // applied to the value of the JWT claim specified in the 'claim' field.
+ // prefixPolicy is an optional field that configures how a prefix should be applied to the value of the JWT claim specified in the 'claim' field.
//
// Allowed values are 'Prefix', 'NoPrefix', and omitted (not provided or an empty string).
//
- // When set to 'Prefix', the value specified in the prefix field will be
- // prepended to the value of the JWT claim.
+ // When set to 'Prefix', the value specified in the prefix field will be prepended to the value of the JWT claim.
+ //
// The prefix field must be set when prefixPolicy is 'Prefix'.
//
- // When set to 'NoPrefix', no prefix will be prepended to the value
- // of the JWT claim.
+ // When set to 'NoPrefix', no prefix will be prepended to the value of the JWT claim.
+ //
+ // When omitted, this means no opinion and the platform is left to choose any prefixes that are applied which is subject to change over time.
+ // Currently, the platform prepends `{issuerURL}#` to the value of the JWT claim when the claim is not 'email'.
//
- // When omitted, this means no opinion and the platform is left to choose
- // any prefixes that are applied which is subject to change over time.
- // Currently, the platform prepends `{issuerURL}#` to the value of the JWT claim
- // when the claim is not 'email'.
// As an example, consider the following scenario:
+ //
// `prefix` is unset, `issuerURL` is set to `https://myoidc.tld`,
// the JWT claims include "username":"userA" and "email":"userA@myoidc.tld",
// and `claim` is set to:
@@ -656,8 +671,7 @@ type UsernameClaimMapping struct {
// +unionDiscriminator
PrefixPolicy UsernamePrefixPolicy `json:"prefixPolicy"`
- // prefix configures the prefix that should be prepended to the value
- // of the JWT claim.
+ // prefix configures the prefix that should be prepended to the value of the JWT claim.
//
// prefix must be set when prefixPolicy is set to 'Prefix' and must be unset otherwise.
//
@@ -666,9 +680,7 @@ type UsernameClaimMapping struct {
Prefix *UsernamePrefix `json:"prefix"`
}
-// UsernamePrefixPolicy configures how prefixes should be applied
-// to values extracted from the JWT claims during the process of mapping
-// JWT claims to cluster identity attributes.
+// UsernamePrefixPolicy configures how prefixes should be applied to values extracted from the JWT claims during the process of mapping JWT claims to cluster identity attributes.
// +enum
type UsernamePrefixPolicy string
@@ -687,9 +699,7 @@ var (
// UsernamePrefix configures the string that should
// be used as a prefix for username claim mappings.
type UsernamePrefix struct {
- // prefixString is a required field that configures the prefix that will
- // be applied to cluster identity username attribute
- // during the process of mapping JWT claims to cluster identity attributes.
+ // prefixString is a required field that configures the prefix that will be applied to cluster identity username attribute during the process of mapping JWT claims to cluster identity attributes.
//
// prefixString must not be an empty string ("").
//
@@ -703,51 +713,62 @@ type UsernamePrefix struct {
type PrefixedClaimMapping struct {
TokenClaimMapping `json:",inline"`
- // prefix is an optional field that configures the prefix that will be
- // applied to the cluster identity attribute during the process of mapping
- // JWT claims to cluster identity attributes.
+ // prefix is an optional field that configures the prefix that will be applied to the cluster identity attribute during the process of mapping JWT claims to cluster identity attributes.
//
// When omitted (""), no prefix is applied to the cluster identity attribute.
//
- // Example: if `prefix` is set to "myoidc:" and the `claim` in JWT contains
- // an array of strings "a", "b" and "c", the mapping will result in an
- // array of string "myoidc:a", "myoidc:b" and "myoidc:c".
+ // Example: if `prefix` is set to "myoidc:" and the `claim` in JWT contains an array of strings "a", "b" and "c", the mapping will result in an array of string "myoidc:a", "myoidc:b" and "myoidc:c".
//
// +optional
Prefix string `json:"prefix"`
}
-// TokenValidationRuleType represents the different
-// claim validation rule types that can be configured.
+// TokenValidationRuleType defines the type of token validation rule.
// +enum
+// +openshift:validation:FeatureGateAwareEnum:featureGate="",enum="RequiredClaim";
+// +openshift:validation:FeatureGateAwareEnum:featureGate=ExternalOIDC,enum="RequiredClaim";
+// +openshift:validation:FeatureGateAwareEnum:featureGate=ExternalOIDCWithUIDAndExtraClaimMappings,enum="RequiredClaim";
+// +openshift:validation:FeatureGateAwareEnum:featureGate=ExternalOIDCWithUpstreamParity,enum="RequiredClaim";"CEL"
type TokenValidationRuleType string
const (
+ // TokenValidationRuleTypeRequiredClaim indicates that the token must contain a specific claim.
+ // Used as a value for TokenValidationRuleType.
TokenValidationRuleTypeRequiredClaim = "RequiredClaim"
+ // TokenValidationRuleTypeCEL indicates that the token validation is defined via a CEL expression.
+ // Used as a value for TokenValidationRuleType.
+ TokenValidationRuleTypeCEL = "CEL"
)
+// TokenClaimValidationRule represents a validation rule based on token claims.
+// If type is RequiredClaim, requiredClaim must be set.
+// If Type is CEL, CEL must be set and RequiredClaim must be omitted.
+//
+// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'RequiredClaim' ? has(self.requiredClaim) : !has(self.requiredClaim)",message="requiredClaim must be set when type is 'RequiredClaim', and forbidden otherwise"
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDCWithUpstreamParity,rule="has(self.type) && self.type == 'CEL' ? has(self.cel) : !has(self.cel)",message="cel must be set when type is 'CEL', and forbidden otherwise"
type TokenClaimValidationRule struct {
// type is an optional field that configures the type of the validation rule.
//
- // Allowed values are 'RequiredClaim' and omitted (not provided or an empty string).
+ // Allowed values are "RequiredClaim" and "CEL".
//
- // When set to 'RequiredClaim', the Kubernetes API server
- // will be configured to validate that the incoming JWT
- // contains the required claim and that its value matches
- // the required value.
+ // When set to 'RequiredClaim', the Kubernetes API server will be configured to validate that the incoming JWT contains the required claim and that its value matches the required value.
//
- // Defaults to 'RequiredClaim'.
- //
- // +kubebuilder:validation:Enum={"RequiredClaim"}
- // +kubebuilder:default="RequiredClaim"
+ // When set to 'CEL', the Kubernetes API server will be configured to validate the incoming JWT against the configured CEL expression.
+ // +required
Type TokenValidationRuleType `json:"type"`
- // requiredClaim is an optional field that configures the required claim
- // and value that the Kubernetes API server will use to validate if an incoming
- // JWT is valid for this identity provider.
+ // requiredClaim allows configuring a required claim name and its expected value.
+ // This field is required when `type` is set to RequiredClaim, and must be omitted when `type` is set to any other value.
+ // The Kubernetes API server uses this field to validate if an incoming JWT is valid for this identity provider.
//
// +optional
RequiredClaim *TokenRequiredClaim `json:"requiredClaim,omitempty"`
+
+ // cel holds the CEL expression and message for validation.
+ // Must be set when Type is "CEL", and forbidden otherwise.
+ // +optional
+ // +openshift:enable:FeatureGate=ExternalOIDCWithUpstreamParity
+ CEL TokenClaimValidationCELRule `json:"cel,omitempty,omitzero"`
}
type TokenRequiredClaim struct {
@@ -760,10 +781,8 @@ type TokenRequiredClaim struct {
// +required
Claim string `json:"claim"`
- // requiredValue is a required field that configures the value that 'claim' must
- // have when taken from the incoming JWT claims.
- // If the value in the JWT claims does not match, the token
- // will be rejected for authentication.
+ // requiredValue is a required field that configures the value that 'claim' must have when taken from the incoming JWT claims.
+ // If the value in the JWT claims does not match, the token will be rejected for authentication.
//
// requiredValue must not be an empty string ("").
//
@@ -771,3 +790,43 @@ type TokenRequiredClaim struct {
// +required
RequiredValue string `json:"requiredValue"`
}
+
+type TokenClaimValidationCELRule struct {
+ // expression is a CEL expression evaluated against token claims.
+ // expression is required, must be at least 1 character in length and must not exceed 1024 characters.
+ // The expression must return a boolean value where 'true' signals a valid token and 'false' an invalid one.
+ //
+ // +kubebuilder:validation:MinLength=1
+ // +kubebuilder:validation:MaxLength=1024
+ // +required
+ Expression string `json:"expression,omitempty"`
+
+ // message is a required human-readable message to be logged by the Kubernetes API server if the CEL expression defined in 'expression' fails.
+ // message must be at least 1 character in length and must not exceed 256 characters.
+ // +required
+ // +kubebuilder:validation:MinLength=1
+ // +kubebuilder:validation:MaxLength=256
+ Message string `json:"message,omitempty"`
+}
+
+// TokenUserValidationRule provides a CEL-based rule used to validate a token subject.
+// Each rule contains a CEL expression that is evaluated against the token’s claims.
+type TokenUserValidationRule struct {
+ // expression is a required CEL expression that performs a validation on cluster user identity attributes like username, groups, etc.
+ //
+ // The expression must evaluate to a boolean value.
+ // When the expression evaluates to 'true', the cluster user identity is considered valid.
+ // When the expression evaluates to 'false', the cluster user identity is not considered valid.
+ // expression must be at least 1 character in length and must not exceed 1024 characters.
+ //
+ // +required
+ // +kubebuilder:validation:MinLength=1
+ // +kubebuilder:validation:MaxLength=1024
+ Expression string `json:"expression,omitempty"`
+ // message is a required human-readable message to be logged by the Kubernetes API server if the CEL expression defined in 'expression' fails.
+ // message must be at least 1 character in length and must not exceed 256 characters.
+ // +required
+ // +kubebuilder:validation:MinLength=1
+ // +kubebuilder:validation:MaxLength=256
+ Message string `json:"message,omitempty"`
+}
diff --git a/api/vendor/github.com/openshift/api/config/v1/types_cluster_image_policy.go b/api/vendor/github.com/openshift/api/config/v1/types_cluster_image_policy.go
index ca604e05c5bd..491390098c37 100644
--- a/api/vendor/github.com/openshift/api/config/v1/types_cluster_image_policy.go
+++ b/api/vendor/github.com/openshift/api/config/v1/types_cluster_image_policy.go
@@ -52,7 +52,7 @@ type ClusterImagePolicySpec struct {
// policy is a required field that contains configuration to allow scopes to be verified, and defines how
// images not matching the verification policy will be treated.
// +required
- Policy Policy `json:"policy"`
+ Policy ImageSigstoreVerificationPolicy `json:"policy"`
}
// +k8s:deepcopy-gen=true
diff --git a/api/vendor/github.com/openshift/api/config/v1/types_cluster_version.go b/api/vendor/github.com/openshift/api/config/v1/types_cluster_version.go
index e5aad151eada..f8d45114a83e 100644
--- a/api/vendor/github.com/openshift/api/config/v1/types_cluster_version.go
+++ b/api/vendor/github.com/openshift/api/config/v1/types_cluster_version.go
@@ -199,9 +199,23 @@ type ClusterVersionStatus struct {
// availableUpdates. This list may be empty if no updates are
// recommended, if the update service is unavailable, or if an empty
// or invalid channel has been specified.
+ // +kubebuilder:validation:MaxItems=500
// +listType=atomic
// +optional
ConditionalUpdates []ConditionalUpdate `json:"conditionalUpdates,omitempty"`
+
+ // conditionalUpdateRisks contains the list of risks associated with conditionalUpdates.
+ // When performing a conditional update, all its associated risks will be compared with the set of accepted risks in the spec.desiredUpdate.acceptRisks field.
+ // If all risks for a conditional update are included in the spec.desiredUpdate.acceptRisks set, the conditional update can proceed, otherwise it is blocked.
+ // The risk names in the list must be unique.
+ // conditionalUpdateRisks must not contain more than 500 entries.
+ // +openshift:enable:FeatureGate=ClusterUpdateAcceptRisks
+ // +kubebuilder:validation:MaxItems=500
+ // +kubebuilder:validation:MinItems=1
+ // +listType=map
+ // +listMapKey=name
+ // +optional
+ ConditionalUpdateRisks []ConditionalUpdateRisk `json:"conditionalUpdateRisks,omitempty"`
}
// UpdateState is a constant representing whether an update was successfully
@@ -258,7 +272,7 @@ type UpdateHistory struct {
Verified bool `json:"verified"`
// acceptedRisks records risks which were accepted to initiate the update.
- // For example, it may menition an Upgradeable=False or missing signature
+ // For example, it may mention an Upgradeable=False or missing signature
// that was overridden via desiredUpdate.force, or an update that was
// initiated despite not being in the availableUpdates set of recommended
// update targets.
@@ -269,6 +283,16 @@ type UpdateHistory struct {
// ClusterID is string RFC4122 uuid.
type ClusterID string
+// UpdateMode defines how an update should be processed.
+// +enum
+// +kubebuilder:validation:Enum=Preflight
+type UpdateMode string
+
+const (
+ // UpdateModePreflight allows an update to be checked for compatibility without committing to updating the cluster.
+ UpdateModePreflight UpdateMode = "Preflight"
+)
+
// ClusterVersionArchitecture enumerates valid cluster architectures.
// +kubebuilder:validation:Enum="Multi";""
type ClusterVersionArchitecture string
@@ -732,6 +756,46 @@ type Update struct {
//
// +optional
Force bool `json:"force"`
+
+ // acceptRisks is an optional set of names of conditional update risks that are considered acceptable.
+ // A conditional update is performed only if all of its risks are acceptable.
+ // This list may contain entries that apply to current, previous or future updates.
+ // The entries therefore may not map directly to a risk in .status.conditionalUpdateRisks.
+ // acceptRisks must not contain more than 1000 entries.
+ // Entries in this list must be unique.
+ // +openshift:enable:FeatureGate=ClusterUpdateAcceptRisks
+ // +kubebuilder:validation:MaxItems=1000
+ // +kubebuilder:validation:MinItems=1
+ // +listType=map
+ // +listMapKey=name
+ // +optional
+ AcceptRisks []AcceptRisk `json:"acceptRisks,omitempty"`
+
+ // mode determines how an update should be processed.
+ // The only valid value is "Preflight".
+ // When omitted, the cluster performs a normal update by applying the specified version or image to the cluster.
+ // This is the standard update behavior.
+ // When set to "Preflight", the cluster runs compatibility checks against the target release without
+ // performing an actual update. Compatibility results, including any detected risks, are reported
+ // in status.conditionalUpdates and status.conditionalUpdateRisks alongside risks from the update
+ // recommendation service.
+ // This allows administrators to assess update readiness and address issues before committing to the update.
+ // Preflight mode is particularly useful for skip-level updates where upgrade compatibility needs to be
+ // verified across multiple minor versions.
+ // When mode is set to "Preflight", the same rules for version, image, and architecture apply as for normal updates.
+ // +openshift:enable:FeatureGate=ClusterUpdatePreflight
+ // +optional
+ Mode UpdateMode `json:"mode,omitempty"`
+}
+
+// AcceptRisk represents a risk that is considered acceptable.
+type AcceptRisk struct {
+ // name is the name of the acceptable risk.
+ // It must be a non-empty string and must not exceed 256 characters.
+ // +kubebuilder:validation:MinLength=1
+ // +kubebuilder:validation:MaxLength=256
+ // +required
+ Name string `json:"name,omitempty"`
}
// Release represents an OpenShift release image and associated metadata.
@@ -787,12 +851,27 @@ type ConditionalUpdate struct {
// +required
Release Release `json:"release"`
+ // riskNames represents the set of the names of conditionalUpdateRisks that are relevant to this update for some clusters.
+ // The Applies condition of each conditionalUpdateRisks entry declares if that risk applies to this cluster.
+ // A conditional update is accepted only if each of its risks either does not apply to the cluster or is considered acceptable by the cluster administrator.
+ // The latter means that the risk names are included in value of the spec.desiredUpdate.acceptRisks field.
+ // Entries must be unique and must not exceed 256 characters.
+ // riskNames must not contain more than 500 entries.
+ // +openshift:enable:FeatureGate=ClusterUpdateAcceptRisks
+ // +kubebuilder:validation:MinItems=1
+ // +kubebuilder:validation:items:MaxLength=256
+ // +kubebuilder:validation:MaxItems=500
+ // +listType=set
+ // +optional
+ RiskNames []string `json:"riskNames,omitempty"`
+
// risks represents the range of issues associated with
// updating to the target release. The cluster-version
// operator will evaluate all entries, and only recommend the
// update if there is at least one entry and all entries
// recommend the update.
// +kubebuilder:validation:MinItems=1
+ // +kubebuilder:validation:MaxItems=200
// +patchMergeKey=name
// +patchStrategy=merge
// +listType=map
@@ -813,6 +892,20 @@ type ConditionalUpdate struct {
// for not recommending a conditional update.
// +k8s:deepcopy-gen=true
type ConditionalUpdateRisk struct {
+ // conditions represents the observations of the conditional update
+ // risk's current status. Known types are:
+ // * Applies, for whether the risk applies to the current cluster.
+ // The condition's types in the list must be unique.
+ // conditions must not contain more than one entry.
+ // +openshift:enable:FeatureGate=ClusterUpdateAcceptRisks
+ // +kubebuilder:validation:XValidation:rule="self.exists_one(x, x.type == 'Applies')",message="must contain a condition of type 'Applies'"
+ // +kubebuilder:validation:MaxItems=8
+ // +kubebuilder:validation:MinItems=1
+ // +listType=map
+ // +listMapKey=type
+ // +optional
+ Conditions []metav1.Condition `json:"conditions,omitempty"`
+
// url contains information about this risk.
// +kubebuilder:validation:Format=uri
// +kubebuilder:validation:MinLength=1
diff --git a/api/vendor/github.com/openshift/api/config/v1/types_feature.go b/api/vendor/github.com/openshift/api/config/v1/types_feature.go
index 169e29c5c5bf..e111d518ab30 100644
--- a/api/vendor/github.com/openshift/api/config/v1/types_feature.go
+++ b/api/vendor/github.com/openshift/api/config/v1/types_feature.go
@@ -53,8 +53,12 @@ var (
// your cluster may fail in an unrecoverable way.
CustomNoUpgrade FeatureSet = "CustomNoUpgrade"
+ // OKD turns on features for OKD. Turning this feature set ON is supported for OKD clusters, but NOT for OpenShift clusters.
+ // Once enabled, this feature set cannot be changed back to Default, but can be changed to other feature sets and it allows upgrades.
+ OKD FeatureSet = "OKD"
+
// AllFixedFeatureSets are the featuresets that have known featuregates. Custom doesn't for instance. LatencySensitive is dead
- AllFixedFeatureSets = []FeatureSet{Default, TechPreviewNoUpgrade, DevPreviewNoUpgrade}
+ AllFixedFeatureSets = []FeatureSet{Default, TechPreviewNoUpgrade, DevPreviewNoUpgrade, OKD}
)
type FeatureGateSpec struct {
@@ -67,10 +71,11 @@ type FeatureGateSelection struct {
// Turning on or off features may cause irreversible changes in your cluster which cannot be undone.
// +unionDiscriminator
// +optional
- // +kubebuilder:validation:Enum=CustomNoUpgrade;DevPreviewNoUpgrade;TechPreviewNoUpgrade;""
+ // +kubebuilder:validation:Enum=CustomNoUpgrade;DevPreviewNoUpgrade;TechPreviewNoUpgrade;OKD;""
// +kubebuilder:validation:XValidation:rule="oldSelf == 'CustomNoUpgrade' ? self == 'CustomNoUpgrade' : true",message="CustomNoUpgrade may not be changed"
// +kubebuilder:validation:XValidation:rule="oldSelf == 'TechPreviewNoUpgrade' ? self == 'TechPreviewNoUpgrade' : true",message="TechPreviewNoUpgrade may not be changed"
// +kubebuilder:validation:XValidation:rule="oldSelf == 'DevPreviewNoUpgrade' ? self == 'DevPreviewNoUpgrade' : true",message="DevPreviewNoUpgrade may not be changed"
+ // +kubebuilder:validation:XValidation:rule="oldSelf == 'OKD' ? self != '' : true",message="OKD cannot transition to Default"
FeatureSet FeatureSet `json:"featureSet,omitempty"`
// customNoUpgrade allows the enabling or disabling of any feature. Turning this feature set on IS NOT SUPPORTED, CANNOT BE UNDONE, and PREVENTS UPGRADES.
diff --git a/api/vendor/github.com/openshift/api/config/v1/types_image_policy.go b/api/vendor/github.com/openshift/api/config/v1/types_image_policy.go
index 54bd21adb4ed..3cc46141c9c9 100644
--- a/api/vendor/github.com/openshift/api/config/v1/types_image_policy.go
+++ b/api/vendor/github.com/openshift/api/config/v1/types_image_policy.go
@@ -51,7 +51,7 @@ type ImagePolicySpec struct {
// policy is a required field that contains configuration to allow scopes to be verified, and defines how
// images not matching the verification policy will be treated.
// +required
- Policy Policy `json:"policy"`
+ Policy ImageSigstoreVerificationPolicy `json:"policy"`
}
// +kubebuilder:validation:XValidation:rule="size(self.split('/')[0].split('.')) == 1 ? self.split('/')[0].split('.')[0].split(':')[0] == 'localhost' : true",message="invalid image scope format, scope must contain a fully qualified domain name or 'localhost'"
@@ -60,8 +60,8 @@ type ImagePolicySpec struct {
// +kubebuilder:validation:MaxLength=512
type ImageScope string
-// Policy defines the verification policy for the items in the scopes list.
-type Policy struct {
+// ImageSigstoreVerificationPolicy defines the verification policy for the items in the scopes list.
+type ImageSigstoreVerificationPolicy struct {
// rootOfTrust is a required field that defines the root of trust for verifying image signatures during retrieval.
// This allows image consumers to specify policyType and corresponding configuration of the policy, matching how the policy was generated.
// +required
@@ -82,25 +82,25 @@ type PolicyRootOfTrust struct {
// Allowed values are "PublicKey", "FulcioCAWithRekor", and "PKI".
// When set to "PublicKey", the policy relies on a sigstore publicKey and may optionally use a Rekor verification.
// When set to "FulcioCAWithRekor", the policy is based on the Fulcio certification and incorporates a Rekor verification.
- // When set to "PKI", the policy is based on the certificates from Bring Your Own Public Key Infrastructure (BYOPKI). This value is enabled by turning on the SigstoreImageVerificationPKI feature gate.
+ // When set to "PKI", the policy is based on the certificates from Bring Your Own Public Key Infrastructure (BYOPKI).
// +unionDiscriminator
// +required
PolicyType PolicyType `json:"policyType"`
// publicKey defines the root of trust configuration based on a sigstore public key. Optionally include a Rekor public key for Rekor verification.
// publicKey is required when policyType is PublicKey, and forbidden otherwise.
// +optional
- PublicKey *PublicKey `json:"publicKey,omitempty"`
+ PublicKey *ImagePolicyPublicKeyRootOfTrust `json:"publicKey,omitempty"`
// fulcioCAWithRekor defines the root of trust configuration based on the Fulcio certificate and the Rekor public key.
// fulcioCAWithRekor is required when policyType is FulcioCAWithRekor, and forbidden otherwise
// For more information about Fulcio and Rekor, please refer to the document at:
// https://github.com/sigstore/fulcio and https://github.com/sigstore/rekor
// +optional
- FulcioCAWithRekor *FulcioCAWithRekor `json:"fulcioCAWithRekor,omitempty"`
+ FulcioCAWithRekor *ImagePolicyFulcioCAWithRekorRootOfTrust `json:"fulcioCAWithRekor,omitempty"`
// pki defines the root of trust configuration based on Bring Your Own Public Key Infrastructure (BYOPKI) Root CA(s) and corresponding intermediate certificates.
// pki is required when policyType is PKI, and forbidden otherwise.
// +optional
// +openshift:enable:FeatureGate=SigstoreImageVerificationPKI
- PKI *PKI `json:"pki,omitempty"`
+ PKI *ImagePolicyPKIRootOfTrust `json:"pki,omitempty"`
}
// +openshift:validation:FeatureGateAwareEnum:featureGate="",enum=PublicKey;FulcioCAWithRekor
@@ -113,8 +113,8 @@ const (
PKIRootOfTrust PolicyType = "PKI"
)
-// PublicKey defines the root of trust based on a sigstore public key.
-type PublicKey struct {
+// ImagePolicyPublicKeyRootOfTrust defines the root of trust based on a sigstore public key.
+type ImagePolicyPublicKeyRootOfTrust struct {
// keyData is a required field contains inline base64-encoded data for the PEM format public key.
// keyData must be at most 8192 characters.
// +required
@@ -132,8 +132,8 @@ type PublicKey struct {
RekorKeyData []byte `json:"rekorKeyData,omitempty"`
}
-// FulcioCAWithRekor defines the root of trust based on the Fulcio certificate and the Rekor public key.
-type FulcioCAWithRekor struct {
+// ImagePolicyFulcioCAWithRekorRootOfTrust defines the root of trust based on the Fulcio certificate and the Rekor public key.
+type ImagePolicyFulcioCAWithRekorRootOfTrust struct {
// fulcioCAData is a required field contains inline base64-encoded data for the PEM format fulcio CA.
// fulcioCAData must be at most 8192 characters.
// +required
@@ -172,8 +172,8 @@ type PolicyFulcioSubject struct {
SignedEmail string `json:"signedEmail"`
}
-// PKI defines the root of trust based on Root CA(s) and corresponding intermediate certificates.
-type PKI struct {
+// ImagePolicyPKIRootOfTrust defines the root of trust based on Root CA(s) and corresponding intermediate certificates.
+type ImagePolicyPKIRootOfTrust struct {
// caRootsData contains base64-encoded data of a certificate bundle PEM file, which contains one or more CA roots in the PEM format. The total length of the data must not exceed 8192 characters.
// +required
// +kubebuilder:validation:MaxLength=8192
diff --git a/api/vendor/github.com/openshift/api/config/v1/types_infrastructure.go b/api/vendor/github.com/openshift/api/config/v1/types_infrastructure.go
index 2f80945d3816..369ba1e7a000 100644
--- a/api/vendor/github.com/openshift/api/config/v1/types_infrastructure.go
+++ b/api/vendor/github.com/openshift/api/config/v1/types_infrastructure.go
@@ -302,9 +302,10 @@ type PlatformSpec struct {
// balancers, dynamic volume provisioning, machine creation and deletion, and
// other integrations are enabled. If None, no infrastructure automation is
// enabled. Allowed values are "AWS", "Azure", "BareMetal", "GCP", "Libvirt",
- // "OpenStack", "VSphere", "oVirt", "KubeVirt", "EquinixMetal", "PowerVS",
- // "AlibabaCloud", "Nutanix" and "None". Individual components may not support all platforms,
- // and must handle unrecognized platforms as None if they do not support that platform.
+ // "OpenStack", "VSphere", "oVirt", "IBMCloud", "KubeVirt", "EquinixMetal",
+ // "PowerVS", "AlibabaCloud", "Nutanix", "External", and "None". Individual
+ // components may not support all platforms, and must handle unrecognized
+ // platforms as None if they do not support that platform.
//
// +unionDiscriminator
Type PlatformType `json:"type"`
@@ -699,74 +700,43 @@ const (
AzureStackCloud AzureCloudEnvironment = "AzureStackCloud"
)
+// Start: TOMBSTONE
+
// GCPServiceEndpointName is the name of the GCP Service Endpoint.
// +kubebuilder:validation:Enum=Compute;Container;CloudResourceManager;DNS;File;IAM;IAMCredentials;OAuth;ServiceUsage;Storage;STS
-type GCPServiceEndpointName string
-
-const (
- // GCPServiceEndpointNameCompute is the name used for the GCP Compute Service endpoint.
- GCPServiceEndpointNameCompute GCPServiceEndpointName = "Compute"
-
- // GCPServiceEndpointNameContainer is the name used for the GCP Container Service endpoint.
- GCPServiceEndpointNameContainer GCPServiceEndpointName = "Container"
-
- // GCPServiceEndpointNameCloudResource is the name used for the GCP Resource Manager Service endpoint.
- GCPServiceEndpointNameCloudResource GCPServiceEndpointName = "CloudResourceManager"
-
- // GCPServiceEndpointNameDNS is the name used for the GCP DNS Service endpoint.
- GCPServiceEndpointNameDNS GCPServiceEndpointName = "DNS"
-
- // GCPServiceEndpointNameFile is the name used for the GCP File Service endpoint.
- GCPServiceEndpointNameFile GCPServiceEndpointName = "File"
-
- // GCPServiceEndpointNameIAM is the name used for the GCP IAM Service endpoint.
- GCPServiceEndpointNameIAM GCPServiceEndpointName = "IAM"
-
- // GCPServiceEndpointNameIAMCredentials is the name used for the GCP IAM Credentials Service endpoint.
- GCPServiceEndpointNameIAMCredentials GCPServiceEndpointName = "IAMCredentials"
-
- // GCPServiceEndpointNameOAuth is the name used for the GCP OAuth2 Service endpoint.
- GCPServiceEndpointNameOAuth GCPServiceEndpointName = "OAuth"
-
- // GCPServiceEndpointNameServiceUsage is the name used for the GCP Service Usage Service endpoint.
- GCPServiceEndpointNameServiceUsage GCPServiceEndpointName = "ServiceUsage"
-
- // GCPServiceEndpointNameStorage is the name used for the GCP Storage Service endpoint.
- GCPServiceEndpointNameStorage GCPServiceEndpointName = "Storage"
-
- // GCPServiceEndpointNameSTS is the name used for the GCP STS Service endpoint.
- GCPServiceEndpointNameSTS GCPServiceEndpointName = "STS"
-)
+//type GCPServiceEndpointName string
// GCPServiceEndpoint store the configuration of a custom url to
// override existing defaults of GCP Services.
-type GCPServiceEndpoint struct {
- // name is the name of the GCP service whose endpoint is being overridden.
- // This must be provided and cannot be empty.
- //
- // Allowed values are Compute, Container, CloudResourceManager, DNS, File, IAM, ServiceUsage,
- // Storage, and TagManager.
- //
- // As an example, when setting the name to Compute all requests made by the caller to the GCP Compute
- // Service will be directed to the endpoint specified in the url field.
- //
- // +required
- Name GCPServiceEndpointName `json:"name"`
+// type GCPServiceEndpoint struct {
+// name is the name of the GCP service whose endpoint is being overridden.
+// This must be provided and cannot be empty.
+//
+// Allowed values are Compute, Container, CloudResourceManager, DNS, File, IAM, ServiceUsage,
+// Storage, and TagManager.
+//
+// As an example, when setting the name to Compute all requests made by the caller to the GCP Compute
+// Service will be directed to the endpoint specified in the url field.
+//
+// +required
+// Name GCPServiceEndpointName `json:"name"`
- // url is a fully qualified URI that overrides the default endpoint for a client using the GCP service specified
- // in the name field.
- // url is required, must use the scheme https, must not be more than 253 characters in length,
- // and must be a valid URL according to Go's net/url package (https://pkg.go.dev/net/url#URL)
- //
- // An example of a valid endpoint that overrides the Compute Service: "https://compute-myendpoint1.p.googleapis.com"
- //
- // +required
- // +kubebuilder:validation:MaxLength=253
- // +kubebuilder:validation:XValidation:rule="isURL(self)",message="must be a valid URL"
- // +kubebuilder:validation:XValidation:rule="isURL(self) ? (url(self).getScheme() == \"https\") : true",message="scheme must be https"
- // +kubebuilder:validation:XValidation:rule="url(self).getEscapedPath() == \"\" || url(self).getEscapedPath() == \"/\"",message="url must consist only of a scheme and domain. The url path must be empty."
- URL string `json:"url"`
-}
+// url is a fully qualified URI that overrides the default endpoint for a client using the GCP service specified
+// in the name field.
+// url is required, must use the scheme https, must not be more than 253 characters in length,
+// and must be a valid URL according to Go's net/url package (https://pkg.go.dev/net/url#URL)
+//
+// An example of a valid endpoint that overrides the Compute Service: "https://compute-myendpoint1.p.googleapis.com"
+//
+// +required
+// +kubebuilder:validation:MaxLength=253
+// +kubebuilder:validation:XValidation:rule="isURL(self)",message="must be a valid URL"
+// +kubebuilder:validation:XValidation:rule="isURL(self) ? (url(self).getScheme() == \"https\") : true",message="scheme must be https"
+// +kubebuilder:validation:XValidation:rule="url(self).getEscapedPath() == \"\" || url(self).getEscapedPath() == \"/\"",message="url must consist only of a scheme and domain. The url path must be empty."
+// URL string `json:"url"`
+//}
+
+// End: TOMBSTONE
// GCPPlatformSpec holds the desired state of the Google Cloud Platform infrastructure provider.
// This only includes fields that can be modified in the cluster.
@@ -822,18 +792,21 @@ type GCPPlatformStatus struct {
// +nullable
CloudLoadBalancerConfig *CloudLoadBalancerConfig `json:"cloudLoadBalancerConfig,omitempty"`
+ // This field was introduced and removed under tech preview.
// serviceEndpoints specifies endpoints that override the default endpoints
// used when creating clients to interact with GCP services.
// When not specified, the default endpoint for the GCP region will be used.
// Only 1 endpoint override is permitted for each GCP service.
// The maximum number of endpoint overrides allowed is 11.
+ // To avoid conflicts with serialisation, this field name may never be used again.
+ // Tombstone the field as a reminder.
// +listType=map
// +listMapKey=name
// +kubebuilder:validation:MaxItems=11
// +kubebuilder:validation:XValidation:rule="self.all(x, self.exists_one(y, x.name == y.name))",message="only 1 endpoint override is permitted per GCP service name"
// +optional
// +openshift:enable:FeatureGate=GCPCustomAPIEndpointsInstall
- ServiceEndpoints []GCPServiceEndpoint `json:"serviceEndpoints,omitempty"`
+ // ServiceEndpoints []GCPServiceEndpoint `json:"serviceEndpoints,omitempty"`
}
// GCPResourceLabel is a label to apply to GCP resources created for the cluster.
diff --git a/api/vendor/github.com/openshift/api/config/v1/types_ingress.go b/api/vendor/github.com/openshift/api/config/v1/types_ingress.go
index f70fe8f44056..26e0ebf2184b 100644
--- a/api/vendor/github.com/openshift/api/config/v1/types_ingress.go
+++ b/api/vendor/github.com/openshift/api/config/v1/types_ingress.go
@@ -43,6 +43,7 @@ type IngressSpec struct {
// default ingresscontroller domain will follow this pattern: "*.".
//
// Once set, changing domain is not currently supported.
+ // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="domain is immutable once set"
Domain string `json:"domain"`
// appsDomain is an optional domain to use instead of the one specified
diff --git a/api/vendor/github.com/openshift/api/config/v1/types_insights.go b/api/vendor/github.com/openshift/api/config/v1/types_insights.go
index b0959881f15b..710d4303da22 100644
--- a/api/vendor/github.com/openshift/api/config/v1/types_insights.go
+++ b/api/vendor/github.com/openshift/api/config/v1/types_insights.go
@@ -13,6 +13,7 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/2448
// +openshift:file-pattern=cvoRunLevel=0000_10,operatorName=config-operator,operatorOrdering=01
// +openshift:enable:FeatureGate=InsightsConfig
+// +openshift:capability=Insights
//
// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
// +openshift:compatibility-gen:level=1
diff --git a/api/vendor/github.com/openshift/api/config/v1/types_network.go b/api/vendor/github.com/openshift/api/config/v1/types_network.go
index c0d1602b3766..fb8ed2fff743 100644
--- a/api/vendor/github.com/openshift/api/config/v1/types_network.go
+++ b/api/vendor/github.com/openshift/api/config/v1/types_network.go
@@ -41,7 +41,7 @@ type Network struct {
// As a general rule, this SHOULD NOT be read directly. Instead, you should
// consume the NetworkStatus, as it indicates the currently deployed configuration.
// Currently, most spec fields are immutable after installation. Please view the individual ones for further details on each.
-// +openshift:validation:FeatureGateAwareXValidation:featureGate=NetworkDiagnosticsConfig,rule="!has(self.networkDiagnostics) || !has(self.networkDiagnostics.mode) || self.networkDiagnostics.mode!='Disabled' || !has(self.networkDiagnostics.sourcePlacement) && !has(self.networkDiagnostics.targetPlacement)",message="cannot set networkDiagnostics.sourcePlacement and networkDiagnostics.targetPlacement when networkDiagnostics.mode is Disabled"
+// +kubebuilder:validation:XValidation:rule="!has(self.networkDiagnostics) || !has(self.networkDiagnostics.mode) || self.networkDiagnostics.mode!='Disabled' || !has(self.networkDiagnostics.sourcePlacement) && !has(self.networkDiagnostics.targetPlacement)",message="cannot set networkDiagnostics.sourcePlacement and networkDiagnostics.targetPlacement when networkDiagnostics.mode is Disabled"
type NetworkSpec struct {
// IP address pool to use for pod IPs.
// This field is immutable after installation.
@@ -85,7 +85,6 @@ type NetworkSpec struct {
// the network diagnostics feature will be disabled.
//
// +optional
- // +openshift:enable:FeatureGate=NetworkDiagnosticsConfig
NetworkDiagnostics NetworkDiagnostics `json:"networkDiagnostics"`
}
@@ -119,7 +118,6 @@ type NetworkStatus struct {
// +optional
// +listType=map
// +listMapKey=type
- // +openshift:enable:FeatureGate=NetworkDiagnosticsConfig
Conditions []metav1.Condition `json:"conditions,omitempty"`
}
diff --git a/api/vendor/github.com/openshift/api/config/v1/types_scheduling.go b/api/vendor/github.com/openshift/api/config/v1/types_scheduling.go
index c90d5633f68d..a81ed9f30c80 100644
--- a/api/vendor/github.com/openshift/api/config/v1/types_scheduling.go
+++ b/api/vendor/github.com/openshift/api/config/v1/types_scheduling.go
@@ -48,7 +48,9 @@ type SchedulerSpec struct {
// +optional
Profile SchedulerProfile `json:"profile,omitempty"`
// profileCustomizations contains configuration for modifying the default behavior of existing scheduler profiles.
- // +openshift:enable:FeatureGate=DynamicResourceAllocation
+ // Deprecated: no longer needed, since DRA is GA starting with 4.21, and
+ // is enabled by' default in the cluster, this field will be removed in 4.24.
+ // +openshift:enable:FeatureGate=HyperShiftOnlyDynamicResourceAllocation
// +optional
ProfileCustomizations ProfileCustomizations `json:"profileCustomizations"`
// defaultNodeSelector helps set the cluster-wide default node selector to
diff --git a/api/vendor/github.com/openshift/api/config/v1/types_tlssecurityprofile.go b/api/vendor/github.com/openshift/api/config/v1/types_tlssecurityprofile.go
index b18ef647c2fc..48657b089475 100644
--- a/api/vendor/github.com/openshift/api/config/v1/types_tlssecurityprofile.go
+++ b/api/vendor/github.com/openshift/api/config/v1/types_tlssecurityprofile.go
@@ -4,178 +4,115 @@ package v1
// is used by operators to apply TLS security settings to operands.
// +union
type TLSSecurityProfile struct {
- // type is one of Old, Intermediate, Modern or Custom. Custom provides
- // the ability to specify individual TLS security profile parameters.
- // Old, Intermediate and Modern are TLS security profiles based on:
+ // type is one of Old, Intermediate, Modern or Custom. Custom provides the
+ // ability to specify individual TLS security profile parameters.
//
- // https://wiki.mozilla.org/Security/Server_Side_TLS#Recommended_configurations
+ // The profiles are based on version 5.7 of the Mozilla Server Side TLS
+ // configuration guidelines. The cipher lists consist of the configuration's
+ // "ciphersuites" followed by the Go-specific "ciphers" from the guidelines.
+ // See: https://ssl-config.mozilla.org/guidelines/5.7.json
//
- // The profiles are intent based, so they may change over time as new ciphers are developed and existing ciphers
- // are found to be insecure. Depending on precisely which ciphers are available to a process, the list may be
- // reduced.
- //
- // Note that the Modern profile is currently not supported because it is not
- // yet well adopted by common software libraries.
+ // The profiles are intent based, so they may change over time as new ciphers are
+ // developed and existing ciphers are found to be insecure. Depending on
+ // precisely which ciphers are available to a process, the list may be reduced.
//
// +unionDiscriminator
// +optional
Type TLSProfileType `json:"type"`
- // old is a TLS security profile based on:
- //
- // https://wiki.mozilla.org/Security/Server_Side_TLS#Old_backward_compatibility
- //
- // and looks like this (yaml):
+
+ // old is a TLS profile for use when services need to be accessed by very old
+ // clients or libraries and should be used only as a last resort.
//
+ // This profile is equivalent to a Custom profile specified as:
+ // minTLSVersion: VersionTLS10
// ciphers:
- //
// - TLS_AES_128_GCM_SHA256
- //
// - TLS_AES_256_GCM_SHA384
- //
// - TLS_CHACHA20_POLY1305_SHA256
- //
// - ECDHE-ECDSA-AES128-GCM-SHA256
- //
// - ECDHE-RSA-AES128-GCM-SHA256
- //
// - ECDHE-ECDSA-AES256-GCM-SHA384
- //
// - ECDHE-RSA-AES256-GCM-SHA384
- //
// - ECDHE-ECDSA-CHACHA20-POLY1305
- //
// - ECDHE-RSA-CHACHA20-POLY1305
- //
- // - DHE-RSA-AES128-GCM-SHA256
- //
- // - DHE-RSA-AES256-GCM-SHA384
- //
- // - DHE-RSA-CHACHA20-POLY1305
- //
// - ECDHE-ECDSA-AES128-SHA256
- //
// - ECDHE-RSA-AES128-SHA256
- //
// - ECDHE-ECDSA-AES128-SHA
- //
// - ECDHE-RSA-AES128-SHA
- //
- // - ECDHE-ECDSA-AES256-SHA384
- //
- // - ECDHE-RSA-AES256-SHA384
- //
// - ECDHE-ECDSA-AES256-SHA
- //
// - ECDHE-RSA-AES256-SHA
- //
- // - DHE-RSA-AES128-SHA256
- //
- // - DHE-RSA-AES256-SHA256
- //
// - AES128-GCM-SHA256
- //
// - AES256-GCM-SHA384
- //
// - AES128-SHA256
- //
- // - AES256-SHA256
- //
// - AES128-SHA
- //
// - AES256-SHA
- //
// - DES-CBC3-SHA
//
- // minTLSVersion: VersionTLS10
- //
// +optional
// +nullable
Old *OldTLSProfile `json:"old,omitempty"`
- // intermediate is a TLS security profile based on:
- //
- // https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28recommended.29
- //
- // and looks like this (yaml):
+
+ // intermediate is a TLS profile for use when you do not need compatibility with
+ // legacy clients and want to remain highly secure while being compatible with
+ // most clients currently in use.
//
+ // This profile is equivalent to a Custom profile specified as:
+ // minTLSVersion: VersionTLS12
// ciphers:
- //
// - TLS_AES_128_GCM_SHA256
- //
// - TLS_AES_256_GCM_SHA384
- //
// - TLS_CHACHA20_POLY1305_SHA256
- //
// - ECDHE-ECDSA-AES128-GCM-SHA256
- //
// - ECDHE-RSA-AES128-GCM-SHA256
- //
// - ECDHE-ECDSA-AES256-GCM-SHA384
- //
// - ECDHE-RSA-AES256-GCM-SHA384
- //
// - ECDHE-ECDSA-CHACHA20-POLY1305
- //
// - ECDHE-RSA-CHACHA20-POLY1305
//
- // - DHE-RSA-AES128-GCM-SHA256
- //
- // - DHE-RSA-AES256-GCM-SHA384
- //
- // minTLSVersion: VersionTLS12
- //
// +optional
// +nullable
Intermediate *IntermediateTLSProfile `json:"intermediate,omitempty"`
- // modern is a TLS security profile based on:
- //
- // https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility
- //
- // and looks like this (yaml):
+
+ // modern is a TLS security profile for use with clients that support TLS 1.3 and
+ // do not need backward compatibility for older clients.
//
+ // This profile is equivalent to a Custom profile specified as:
+ // minTLSVersion: VersionTLS13
// ciphers:
- //
// - TLS_AES_128_GCM_SHA256
- //
// - TLS_AES_256_GCM_SHA384
- //
// - TLS_CHACHA20_POLY1305_SHA256
//
- // minTLSVersion: VersionTLS13
- //
// +optional
// +nullable
Modern *ModernTLSProfile `json:"modern,omitempty"`
+
// custom is a user-defined TLS security profile. Be extremely careful using a custom
// profile as invalid configurations can be catastrophic. An example custom profile
// looks like this:
//
+ // minTLSVersion: VersionTLS11
// ciphers:
- //
// - ECDHE-ECDSA-CHACHA20-POLY1305
- //
// - ECDHE-RSA-CHACHA20-POLY1305
- //
// - ECDHE-RSA-AES128-GCM-SHA256
- //
// - ECDHE-ECDSA-AES128-GCM-SHA256
//
- // minTLSVersion: VersionTLS11
- //
// +optional
// +nullable
Custom *CustomTLSProfile `json:"custom,omitempty"`
}
-// OldTLSProfile is a TLS security profile based on:
-// https://wiki.mozilla.org/Security/Server_Side_TLS#Old_backward_compatibility
+// OldTLSProfile is a TLS security profile based on the "old" configuration of
+// the Mozilla Server Side TLS configuration guidelines.
type OldTLSProfile struct{}
-// IntermediateTLSProfile is a TLS security profile based on:
-// https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28default.29
+// IntermediateTLSProfile is a TLS security profile based on the "intermediate"
+// configuration of the Mozilla Server Side TLS configuration guidelines.
type IntermediateTLSProfile struct{}
-// ModernTLSProfile is a TLS security profile based on:
-// https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility
+// ModernTLSProfile is a TLS security profile based on the "modern" configuration
+// of the Mozilla Server Side TLS configuration guidelines.
type ModernTLSProfile struct{}
// CustomTLSProfile is a user-defined TLS security profile. Be extremely careful
@@ -189,28 +126,33 @@ type CustomTLSProfile struct {
type TLSProfileType string
const (
- // Old is a TLS security profile based on:
- // https://wiki.mozilla.org/Security/Server_Side_TLS#Old_backward_compatibility
+ // TLSProfileOldType sets parameters based on the "old" configuration of
+ // the Mozilla Server Side TLS configuration guidelines.
TLSProfileOldType TLSProfileType = "Old"
- // Intermediate is a TLS security profile based on:
- // https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28default.29
+
+ // TLSProfileIntermediateType sets parameters based on the "intermediate"
+ // configuration of the Mozilla Server Side TLS configuration guidelines.
TLSProfileIntermediateType TLSProfileType = "Intermediate"
- // Modern is a TLS security profile based on:
- // https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility
+
+ // TLSProfileModernType sets parameters based on the "modern" configuration
+ // of the Mozilla Server Side TLS configuration guidelines.
TLSProfileModernType TLSProfileType = "Modern"
- // Custom is a TLS security profile that allows for user-defined parameters.
+
+ // TLSProfileCustomType is a TLS security profile that allows for user-defined parameters.
TLSProfileCustomType TLSProfileType = "Custom"
)
// TLSProfileSpec is the desired behavior of a TLSSecurityProfile.
type TLSProfileSpec struct {
// ciphers is used to specify the cipher algorithms that are negotiated
- // during the TLS handshake. Operators may remove entries their operands
- // do not support. For example, to use DES-CBC3-SHA (yaml):
+ // during the TLS handshake. Operators may remove entries that their operands
+ // do not support. For example, to use only ECDHE-RSA-AES128-GCM-SHA256 (yaml):
//
// ciphers:
- // - DES-CBC3-SHA
+ // - ECDHE-RSA-AES128-GCM-SHA256
//
+ // TLS 1.3 cipher suites (e.g. TLS_AES_128_GCM_SHA256) are not configurable
+ // and are always enabled when TLS 1.3 is negotiated.
// +listType=atomic
Ciphers []string `json:"ciphers"`
// minTLSVersion is used to specify the minimal version of the TLS protocol
@@ -219,8 +161,6 @@ type TLSProfileSpec struct {
//
// minTLSVersion: VersionTLS11
//
- // NOTE: currently the highest minTLSVersion allowed is VersionTLS12
- //
MinTLSVersion TLSProtocolVersion `json:"minTLSVersion"`
}
@@ -245,11 +185,18 @@ const (
VersionTLS13 TLSProtocolVersion = "VersionTLS13"
)
-// TLSProfiles Contains a map of TLSProfileType names to TLSProfileSpec.
+// TLSProfiles contains a map of TLSProfileType names to TLSProfileSpec.
+//
+// These profiles are based on version 5.7 of the Mozilla Server Side TLS
+// configuration guidelines. See: https://ssl-config.mozilla.org/guidelines/5.7.json
+//
+// Each Ciphers slice is the configuration's "ciphersuites" followed by the
+// Go-specific "ciphers" from the guidelines JSON.
//
-// NOTE: The caller needs to make sure to check that these constants are valid for their binary. Not all
-// entries map to values for all binaries. In the case of ties, the kube-apiserver wins. Do not fail,
-// just be sure to whitelist only and everything will be ok.
+// NOTE: The caller needs to make sure to check that these constants are valid
+// for their binary. Not all entries map to values for all binaries. In the case
+// of ties, the kube-apiserver wins. Do not fail, just be sure to include only
+// valid entries and everything will be ok.
var TLSProfiles = map[TLSProfileType]*TLSProfileSpec{
TLSProfileOldType: {
Ciphers: []string{
@@ -262,23 +209,15 @@ var TLSProfiles = map[TLSProfileType]*TLSProfileSpec{
"ECDHE-RSA-AES256-GCM-SHA384",
"ECDHE-ECDSA-CHACHA20-POLY1305",
"ECDHE-RSA-CHACHA20-POLY1305",
- "DHE-RSA-AES128-GCM-SHA256",
- "DHE-RSA-AES256-GCM-SHA384",
- "DHE-RSA-CHACHA20-POLY1305",
"ECDHE-ECDSA-AES128-SHA256",
"ECDHE-RSA-AES128-SHA256",
"ECDHE-ECDSA-AES128-SHA",
"ECDHE-RSA-AES128-SHA",
- "ECDHE-ECDSA-AES256-SHA384",
- "ECDHE-RSA-AES256-SHA384",
"ECDHE-ECDSA-AES256-SHA",
"ECDHE-RSA-AES256-SHA",
- "DHE-RSA-AES128-SHA256",
- "DHE-RSA-AES256-SHA256",
"AES128-GCM-SHA256",
"AES256-GCM-SHA384",
"AES128-SHA256",
- "AES256-SHA256",
"AES128-SHA",
"AES256-SHA",
"DES-CBC3-SHA",
@@ -296,8 +235,6 @@ var TLSProfiles = map[TLSProfileType]*TLSProfileSpec{
"ECDHE-RSA-AES256-GCM-SHA384",
"ECDHE-ECDSA-CHACHA20-POLY1305",
"ECDHE-RSA-CHACHA20-POLY1305",
- "DHE-RSA-AES128-GCM-SHA256",
- "DHE-RSA-AES256-GCM-SHA384",
},
MinTLSVersion: VersionTLS12,
},
diff --git a/api/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go b/api/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go
index 0863934f22a6..30b85b78e966 100644
--- a/api/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go
+++ b/api/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go
@@ -316,6 +316,22 @@ func (in *AWSServiceEndpoint) DeepCopy() *AWSServiceEndpoint {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AcceptRisk) DeepCopyInto(out *AcceptRisk) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AcceptRisk.
+func (in *AcceptRisk) DeepCopy() *AcceptRisk {
+ if in == nil {
+ return nil
+ }
+ out := new(AcceptRisk)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AdmissionConfig) DeepCopyInto(out *AdmissionConfig) {
*out = *in
@@ -1393,7 +1409,7 @@ func (in *ClusterVersionSpec) DeepCopyInto(out *ClusterVersionSpec) {
if in.DesiredUpdate != nil {
in, out := &in.DesiredUpdate, &out.DesiredUpdate
*out = new(Update)
- **out = **in
+ (*in).DeepCopyInto(*out)
}
if in.Capabilities != nil {
in, out := &in.Capabilities, &out.Capabilities
@@ -1456,6 +1472,13 @@ func (in *ClusterVersionStatus) DeepCopyInto(out *ClusterVersionStatus) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
+ if in.ConditionalUpdateRisks != nil {
+ in, out := &in.ConditionalUpdateRisks, &out.ConditionalUpdateRisks
+ *out = make([]ConditionalUpdateRisk, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
return
}
@@ -1544,6 +1567,11 @@ func (in *ComponentRouteStatus) DeepCopy() *ComponentRouteStatus {
func (in *ConditionalUpdate) DeepCopyInto(out *ConditionalUpdate) {
*out = *in
in.Release.DeepCopyInto(&out.Release)
+ if in.RiskNames != nil {
+ in, out := &in.RiskNames, &out.RiskNames
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
if in.Risks != nil {
in, out := &in.Risks, &out.Risks
*out = make([]ConditionalUpdateRisk, len(*in))
@@ -1574,6 +1602,13 @@ func (in *ConditionalUpdate) DeepCopy() *ConditionalUpdate {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ConditionalUpdateRisk) DeepCopyInto(out *ConditionalUpdateRisk) {
*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])
+ }
+ }
if in.MatchingRules != nil {
in, out := &in.MatchingRules, &out.MatchingRules
*out = make([]ClusterCondition, len(*in))
@@ -2361,33 +2396,6 @@ func (in *FeatureGateTests) DeepCopy() *FeatureGateTests {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *FulcioCAWithRekor) DeepCopyInto(out *FulcioCAWithRekor) {
- *out = *in
- if in.FulcioCAData != nil {
- in, out := &in.FulcioCAData, &out.FulcioCAData
- *out = make([]byte, len(*in))
- copy(*out, *in)
- }
- if in.RekorKeyData != nil {
- in, out := &in.RekorKeyData, &out.RekorKeyData
- *out = make([]byte, len(*in))
- copy(*out, *in)
- }
- out.FulcioSubject = in.FulcioSubject
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FulcioCAWithRekor.
-func (in *FulcioCAWithRekor) DeepCopy() *FulcioCAWithRekor {
- if in == nil {
- return nil
- }
- out := new(FulcioCAWithRekor)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GCPPlatformSpec) DeepCopyInto(out *GCPPlatformSpec) {
*out = *in
@@ -2422,11 +2430,6 @@ func (in *GCPPlatformStatus) DeepCopyInto(out *GCPPlatformStatus) {
*out = new(CloudLoadBalancerConfig)
(*in).DeepCopyInto(*out)
}
- if in.ServiceEndpoints != nil {
- in, out := &in.ServiceEndpoints, &out.ServiceEndpoints
- *out = make([]GCPServiceEndpoint, len(*in))
- copy(*out, *in)
- }
return
}
@@ -2472,22 +2475,6 @@ func (in *GCPResourceTag) DeepCopy() *GCPResourceTag {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *GCPServiceEndpoint) DeepCopyInto(out *GCPServiceEndpoint) {
- *out = *in
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPServiceEndpoint.
-func (in *GCPServiceEndpoint) DeepCopy() *GCPServiceEndpoint {
- if in == nil {
- return nil
- }
- out := new(GCPServiceEndpoint)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GatherConfig) DeepCopyInto(out *GatherConfig) {
*out = *in
@@ -3165,6 +3152,33 @@ func (in *ImagePolicy) DeepCopyObject() runtime.Object {
return nil
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ImagePolicyFulcioCAWithRekorRootOfTrust) DeepCopyInto(out *ImagePolicyFulcioCAWithRekorRootOfTrust) {
+ *out = *in
+ if in.FulcioCAData != nil {
+ in, out := &in.FulcioCAData, &out.FulcioCAData
+ *out = make([]byte, len(*in))
+ copy(*out, *in)
+ }
+ if in.RekorKeyData != nil {
+ in, out := &in.RekorKeyData, &out.RekorKeyData
+ *out = make([]byte, len(*in))
+ copy(*out, *in)
+ }
+ out.FulcioSubject = in.FulcioSubject
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImagePolicyFulcioCAWithRekorRootOfTrust.
+func (in *ImagePolicyFulcioCAWithRekorRootOfTrust) DeepCopy() *ImagePolicyFulcioCAWithRekorRootOfTrust {
+ if in == nil {
+ return nil
+ }
+ out := new(ImagePolicyFulcioCAWithRekorRootOfTrust)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ImagePolicyList) DeepCopyInto(out *ImagePolicyList) {
*out = *in
@@ -3198,6 +3212,59 @@ func (in *ImagePolicyList) DeepCopyObject() runtime.Object {
return nil
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ImagePolicyPKIRootOfTrust) DeepCopyInto(out *ImagePolicyPKIRootOfTrust) {
+ *out = *in
+ if in.CertificateAuthorityRootsData != nil {
+ in, out := &in.CertificateAuthorityRootsData, &out.CertificateAuthorityRootsData
+ *out = make([]byte, len(*in))
+ copy(*out, *in)
+ }
+ if in.CertificateAuthorityIntermediatesData != nil {
+ in, out := &in.CertificateAuthorityIntermediatesData, &out.CertificateAuthorityIntermediatesData
+ *out = make([]byte, len(*in))
+ copy(*out, *in)
+ }
+ out.PKICertificateSubject = in.PKICertificateSubject
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImagePolicyPKIRootOfTrust.
+func (in *ImagePolicyPKIRootOfTrust) DeepCopy() *ImagePolicyPKIRootOfTrust {
+ if in == nil {
+ return nil
+ }
+ out := new(ImagePolicyPKIRootOfTrust)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ImagePolicyPublicKeyRootOfTrust) DeepCopyInto(out *ImagePolicyPublicKeyRootOfTrust) {
+ *out = *in
+ if in.KeyData != nil {
+ in, out := &in.KeyData, &out.KeyData
+ *out = make([]byte, len(*in))
+ copy(*out, *in)
+ }
+ if in.RekorKeyData != nil {
+ in, out := &in.RekorKeyData, &out.RekorKeyData
+ *out = make([]byte, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImagePolicyPublicKeyRootOfTrust.
+func (in *ImagePolicyPublicKeyRootOfTrust) DeepCopy() *ImagePolicyPublicKeyRootOfTrust {
+ if in == nil {
+ return nil
+ }
+ out := new(ImagePolicyPublicKeyRootOfTrust)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ImagePolicySpec) DeepCopyInto(out *ImagePolicySpec) {
*out = *in
@@ -3243,6 +3310,28 @@ func (in *ImagePolicyStatus) DeepCopy() *ImagePolicyStatus {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ImageSigstoreVerificationPolicy) DeepCopyInto(out *ImageSigstoreVerificationPolicy) {
+ *out = *in
+ in.RootOfTrust.DeepCopyInto(&out.RootOfTrust)
+ if in.SignedIdentity != nil {
+ in, out := &in.SignedIdentity, &out.SignedIdentity
+ *out = new(PolicyIdentity)
+ (*in).DeepCopyInto(*out)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageSigstoreVerificationPolicy.
+func (in *ImageSigstoreVerificationPolicy) DeepCopy() *ImageSigstoreVerificationPolicy {
+ if in == nil {
+ return nil
+ }
+ out := new(ImageSigstoreVerificationPolicy)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ImageSpec) DeepCopyInto(out *ImageSpec) {
*out = *in
@@ -4753,6 +4842,11 @@ func (in *OIDCProvider) DeepCopyInto(out *OIDCProvider) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
+ if in.UserValidationRules != nil {
+ in, out := &in.UserValidationRules, &out.UserValidationRules
+ *out = make([]TokenUserValidationRule, len(*in))
+ copy(*out, *in)
+ }
return
}
@@ -5130,33 +5224,6 @@ func (in *OvirtPlatformStatus) DeepCopy() *OvirtPlatformStatus {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *PKI) DeepCopyInto(out *PKI) {
- *out = *in
- if in.CertificateAuthorityRootsData != nil {
- in, out := &in.CertificateAuthorityRootsData, &out.CertificateAuthorityRootsData
- *out = make([]byte, len(*in))
- copy(*out, *in)
- }
- if in.CertificateAuthorityIntermediatesData != nil {
- in, out := &in.CertificateAuthorityIntermediatesData, &out.CertificateAuthorityIntermediatesData
- *out = make([]byte, len(*in))
- copy(*out, *in)
- }
- out.PKICertificateSubject = in.PKICertificateSubject
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PKI.
-func (in *PKI) DeepCopy() *PKI {
- if in == nil {
- return nil
- }
- out := new(PKI)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PKICertificateSubject) DeepCopyInto(out *PKICertificateSubject) {
*out = *in
@@ -5378,28 +5445,6 @@ func (in *PlatformStatus) DeepCopy() *PlatformStatus {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *Policy) DeepCopyInto(out *Policy) {
- *out = *in
- in.RootOfTrust.DeepCopyInto(&out.RootOfTrust)
- if in.SignedIdentity != nil {
- in, out := &in.SignedIdentity, &out.SignedIdentity
- *out = new(PolicyIdentity)
- (*in).DeepCopyInto(*out)
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Policy.
-func (in *Policy) DeepCopy() *Policy {
- if in == nil {
- return nil
- }
- out := new(Policy)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PolicyFulcioSubject) DeepCopyInto(out *PolicyFulcioSubject) {
*out = *in
@@ -5479,17 +5524,17 @@ func (in *PolicyRootOfTrust) DeepCopyInto(out *PolicyRootOfTrust) {
*out = *in
if in.PublicKey != nil {
in, out := &in.PublicKey, &out.PublicKey
- *out = new(PublicKey)
+ *out = new(ImagePolicyPublicKeyRootOfTrust)
(*in).DeepCopyInto(*out)
}
if in.FulcioCAWithRekor != nil {
in, out := &in.FulcioCAWithRekor, &out.FulcioCAWithRekor
- *out = new(FulcioCAWithRekor)
+ *out = new(ImagePolicyFulcioCAWithRekorRootOfTrust)
(*in).DeepCopyInto(*out)
}
if in.PKI != nil {
in, out := &in.PKI, &out.PKI
- *out = new(PKI)
+ *out = new(ImagePolicyPKIRootOfTrust)
(*in).DeepCopyInto(*out)
}
return
@@ -5805,32 +5850,6 @@ func (in *ProxyStatus) DeepCopy() *ProxyStatus {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *PublicKey) DeepCopyInto(out *PublicKey) {
- *out = *in
- if in.KeyData != nil {
- in, out := &in.KeyData, &out.KeyData
- *out = make([]byte, len(*in))
- copy(*out, *in)
- }
- if in.RekorKeyData != nil {
- in, out := &in.RekorKeyData, &out.RekorKeyData
- *out = make([]byte, len(*in))
- copy(*out, *in)
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicKey.
-func (in *PublicKey) DeepCopy() *PublicKey {
- if in == nil {
- return nil
- }
- out := new(PublicKey)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RegistryLocation) DeepCopyInto(out *RegistryLocation) {
*out = *in
@@ -6426,6 +6445,22 @@ func (in *TokenClaimOrExpressionMapping) DeepCopy() *TokenClaimOrExpressionMappi
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *TokenClaimValidationCELRule) DeepCopyInto(out *TokenClaimValidationCELRule) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenClaimValidationCELRule.
+func (in *TokenClaimValidationCELRule) DeepCopy() *TokenClaimValidationCELRule {
+ if in == nil {
+ return nil
+ }
+ out := new(TokenClaimValidationCELRule)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TokenClaimValidationRule) DeepCopyInto(out *TokenClaimValidationRule) {
*out = *in
@@ -6434,6 +6469,7 @@ func (in *TokenClaimValidationRule) DeepCopyInto(out *TokenClaimValidationRule)
*out = new(TokenRequiredClaim)
**out = **in
}
+ out.CEL = in.CEL
return
}
@@ -6506,9 +6542,30 @@ func (in *TokenRequiredClaim) DeepCopy() *TokenRequiredClaim {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *TokenUserValidationRule) DeepCopyInto(out *TokenUserValidationRule) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenUserValidationRule.
+func (in *TokenUserValidationRule) DeepCopy() *TokenUserValidationRule {
+ if in == nil {
+ return nil
+ }
+ out := new(TokenUserValidationRule)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Update) DeepCopyInto(out *Update) {
*out = *in
+ if in.AcceptRisks != nil {
+ in, out := &in.AcceptRisks, &out.AcceptRisks
+ *out = make([]AcceptRisk, len(*in))
+ copy(*out, *in)
+ }
return
}
diff --git a/api/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml b/api/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml
index a1d37f65d005..4b768c3898d5 100644
--- a/api/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml
+++ b/api/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml
@@ -6,7 +6,9 @@ apiservers.config.openshift.io:
Capability: ""
Category: ""
FeatureGates:
+ - KMSEncryption
- KMSEncryptionProvider
+ - TLSAdherence
FilenameOperatorName: config-operator
FilenameOperatorOrdering: "01"
FilenameRunLevel: "0000_10"
@@ -31,6 +33,7 @@ authentications.config.openshift.io:
FeatureGates:
- ExternalOIDC
- ExternalOIDCWithUIDAndExtraClaimMappings
+ - ExternalOIDCWithUpstreamParity
FilenameOperatorName: config-operator
FilenameOperatorOrdering: "01"
FilenameRunLevel: "0000_10"
@@ -141,6 +144,8 @@ clusterversions.config.openshift.io:
Capability: ""
Category: ""
FeatureGates:
+ - ClusterUpdateAcceptRisks
+ - ClusterUpdatePreflight
- ImageStreamImportMode
- SignatureStores
FilenameOperatorName: cluster-version-operator
@@ -368,7 +373,6 @@ infrastructures.config.openshift.io:
- DualReplica
- DyanmicServiceEndpointIBMCloud
- GCPClusterHostedDNSInstall
- - GCPCustomAPIEndpointsInstall
- HighlyAvailableArbiter
- HighlyAvailableArbiter+DualReplica
- NutanixMultiSubnets
@@ -415,7 +419,7 @@ insightsdatagathers.config.openshift.io:
Annotations: {}
ApprovedPRNumber: https://github.com/openshift/api/pull/2448
CRDName: insightsdatagathers.config.openshift.io
- Capability: ""
+ Capability: Insights
Category: ""
FeatureGates:
- InsightsConfig
@@ -441,8 +445,7 @@ networks.config.openshift.io:
CRDName: networks.config.openshift.io
Capability: ""
Category: ""
- FeatureGates:
- - NetworkDiagnosticsConfig
+ FeatureGates: []
FilenameOperatorName: config-operator
FilenameOperatorOrdering: "01"
FilenameRunLevel: "0000_10"
@@ -575,7 +578,7 @@ schedulers.config.openshift.io:
Capability: ""
Category: ""
FeatureGates:
- - DynamicResourceAllocation
+ - HyperShiftOnlyDynamicResourceAllocation
FilenameOperatorName: config-operator
FilenameOperatorOrdering: "01"
FilenameRunLevel: "0000_10"
diff --git a/api/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go b/api/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go
index b9d0799fbdfb..a30061c252c6 100644
--- a/api/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go
+++ b/api/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go
@@ -319,6 +319,7 @@ var map_APIServerSpec = map[string]string{
"additionalCORSAllowedOrigins": "additionalCORSAllowedOrigins lists additional, user-defined regular expressions describing hosts for which the API server allows access using the CORS headers. This may be needed to access the API and the integrated OAuth server from JavaScript applications. The values are regular expressions that correspond to the Golang regular expression language.",
"encryption": "encryption allows the configuration of encryption of resources at the datastore layer.",
"tlsSecurityProfile": "tlsSecurityProfile specifies settings for TLS connections for externally exposed servers.\n\nWhen omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is the Intermediate profile.",
+ "tlsAdherence": "tlsAdherence controls if components in the cluster adhere to the TLS security profile configured on this APIServer resource.\n\nValid values are \"LegacyAdheringComponentsOnly\" and \"StrictAllComponents\".\n\nWhen set to \"LegacyAdheringComponentsOnly\", components that already honor the cluster-wide TLS profile continue to do so. Components that do not already honor it continue to use their individual TLS configurations.\n\nWhen set to \"StrictAllComponents\", all components must honor the configured TLS profile unless they have a component-specific TLS configuration that overrides it. This mode is recommended for security-conscious deployments and is required for certain compliance frameworks.\n\nNote: Some components such as Kubelet and IngressController have their own dedicated TLS configuration mechanisms via KubeletConfig and IngressController CRs respectively. When these component-specific TLS configurations are set, they take precedence over the cluster-wide tlsSecurityProfile. When not set, these components fall back to the cluster-wide default.\n\nComponents that encounter an unknown value for tlsAdherence should treat it as \"StrictAllComponents\" and log a warning to ensure forward compatibility while defaulting to the more secure behavior.\n\nThis field is optional. When omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. The current default is LegacyAdheringComponentsOnly.\n\nOnce set, this field may be changed to a different value, but may not be removed.",
"audit": "audit specifies the settings for audit configuration to be applied to all OpenShift-provided API servers in the cluster.",
}
@@ -407,11 +408,11 @@ func (ExtraMapping) SwaggerDoc() map[string]string {
}
var map_OIDCClientConfig = map[string]string{
- "": "OIDCClientConfig configures how platform clients interact with identity providers as an authentication method",
- "componentName": "componentName is a required field that specifies the name of the platform component being configured to use the identity provider as an authentication mode. It is used in combination with componentNamespace as a unique identifier.\n\ncomponentName must not be an empty string (\"\") and must not exceed 256 characters in length.",
- "componentNamespace": "componentNamespace is a required field that specifies the namespace in which the platform component being configured to use the identity provider as an authentication mode is running. It is used in combination with componentName as a unique identifier.\n\ncomponentNamespace must not be an empty string (\"\") and must not exceed 63 characters in length.",
+ "": "OIDCClientConfig configures how platform clients interact with identity providers as an authentication method.",
+ "componentName": "componentName is a required field that specifies the name of the platform component being configured to use the identity provider as an authentication mode.\n\nIt is used in combination with componentNamespace as a unique identifier.\n\ncomponentName must not be an empty string (\"\") and must not exceed 256 characters in length.",
+ "componentNamespace": "componentNamespace is a required field that specifies the namespace in which the platform component being configured to use the identity provider as an authentication mode is running.\n\nIt is used in combination with componentName as a unique identifier.\n\ncomponentNamespace must not be an empty string (\"\") and must not exceed 63 characters in length.",
"clientID": "clientID is a required field that configures the client identifier, from the identity provider, that the platform component uses for authentication requests made to the identity provider. The identity provider must accept this identifier for platform components to be able to use the identity provider as an authentication mode.\n\nclientID must not be an empty string (\"\").",
- "clientSecret": "clientSecret is an optional field that configures the client secret used by the platform component when making authentication requests to the identity provider.\n\nWhen not specified, no client secret will be used when making authentication requests to the identity provider.\n\nWhen specified, clientSecret references a Secret in the 'openshift-config' namespace that contains the client secret in the 'clientSecret' key of the '.data' field. The client secret will be used when making authentication requests to the identity provider.\n\nPublic clients do not require a client secret but private clients do require a client secret to work with the identity provider.",
+ "clientSecret": "clientSecret is an optional field that configures the client secret used by the platform component when making authentication requests to the identity provider.\n\nWhen not specified, no client secret will be used when making authentication requests to the identity provider.\n\nWhen specified, clientSecret references a Secret in the 'openshift-config' namespace that contains the client secret in the 'clientSecret' key of the '.data' field.\n\nThe client secret will be used when making authentication requests to the identity provider.\n\nPublic clients do not require a client secret but private clients do require a client secret to work with the identity provider.",
"extraScopes": "extraScopes is an optional field that configures the extra scopes that should be requested by the platform component when making authentication requests to the identity provider. This is useful if you have configured claim mappings that requires specific scopes to be requested beyond the standard OIDC scopes.\n\nWhen omitted, no additional scopes are requested.",
}
@@ -433,8 +434,8 @@ func (OIDCClientReference) SwaggerDoc() map[string]string {
var map_OIDCClientStatus = map[string]string{
"": "OIDCClientStatus represents the current state of platform components and how they interact with the configured identity providers.",
"componentName": "componentName is a required field that specifies the name of the platform component using the identity provider as an authentication mode. It is used in combination with componentNamespace as a unique identifier.\n\ncomponentName must not be an empty string (\"\") and must not exceed 256 characters in length.",
- "componentNamespace": "componentNamespace is a required field that specifies the namespace in which the platform component using the identity provider as an authentication mode is running. It is used in combination with componentName as a unique identifier.\n\ncomponentNamespace must not be an empty string (\"\") and must not exceed 63 characters in length.",
- "currentOIDCClients": "currentOIDCClients is an optional list of clients that the component is currently using. Entries must have unique issuerURL/clientID pairs.",
+ "componentNamespace": "componentNamespace is a required field that specifies the namespace in which the platform component using the identity provider as an authentication mode is running.\n\nIt is used in combination with componentName as a unique identifier.\n\ncomponentNamespace must not be an empty string (\"\") and must not exceed 63 characters in length.",
+ "currentOIDCClients": "currentOIDCClients is an optional list of clients that the component is currently using.\n\nEntries must have unique issuerURL/clientID pairs.",
"consumingUsers": "consumingUsers is an optional list of ServiceAccounts requiring read permissions on the `clientSecret` secret.\n\nconsumingUsers must not exceed 5 entries.",
"conditions": "conditions are used to communicate the state of the `oidcClients` entry.\n\nSupported conditions include Available, Degraded and Progressing.\n\nIf Available is true, the component is successfully using the configured client. If Degraded is true, that means something has gone wrong trying to handle the client configuration. If Progressing is true, that means the component is taking some action related to the `oidcClients` entry.",
}
@@ -449,6 +450,7 @@ var map_OIDCProvider = map[string]string{
"oidcClients": "oidcClients is an optional field that configures how on-cluster, platform clients should request tokens from the identity provider. oidcClients must not exceed 20 entries and entries must have unique namespace/name pairs.",
"claimMappings": "claimMappings is a required field that configures the rules to be used by the Kubernetes API server for translating claims in a JWT token, issued by the identity provider, to a cluster identity.",
"claimValidationRules": "claimValidationRules is an optional field that configures the rules to be used by the Kubernetes API server for validating the claims in a JWT token issued by the identity provider.\n\nValidation rules are joined via an AND operation.",
+ "userValidationRules": "userValidationRules is an optional field that configures the set of rules used to validate the cluster user identity that was constructed via mapping token claims to user identity attributes. Rules are CEL expressions that must evaluate to 'true' for authentication to succeed. If any rule in the chain of rules evaluates to 'false', authentication will fail. When specified, at least one rule must be specified and no more than 64 rules may be specified.",
}
func (OIDCProvider) SwaggerDoc() map[string]string {
@@ -457,7 +459,7 @@ func (OIDCProvider) SwaggerDoc() map[string]string {
var map_PrefixedClaimMapping = map[string]string{
"": "PrefixedClaimMapping configures a claim mapping that allows for an optional prefix.",
- "prefix": "prefix is an optional field that configures the prefix that will be applied to the cluster identity attribute during the process of mapping JWT claims to cluster identity attributes.\n\nWhen omitted (\"\"), no prefix is applied to the cluster identity attribute.\n\nExample: if `prefix` is set to \"myoidc:\" and the `claim` in JWT contains an array of strings \"a\", \"b\" and \"c\", the mapping will result in an array of string \"myoidc:a\", \"myoidc:b\" and \"myoidc:c\".",
+ "prefix": "prefix is an optional field that configures the prefix that will be applied to the cluster identity attribute during the process of mapping JWT claims to cluster identity attributes.\n\nWhen omitted (\"\"), no prefix is applied to the cluster identity attribute.\n\nExample: if `prefix` is set to \"myoidc:\" and the `claim` in JWT contains an array of strings \"a\", \"b\" and \"c\", the mapping will result in an array of string \"myoidc:a\", \"myoidc:b\" and \"myoidc:c\".",
}
func (PrefixedClaimMapping) SwaggerDoc() map[string]string {
@@ -465,8 +467,9 @@ func (PrefixedClaimMapping) SwaggerDoc() map[string]string {
}
var map_TokenClaimMapping = map[string]string{
- "": "TokenClaimMapping allows specifying a JWT token claim to be used when mapping claims from an authentication token to cluster identities.",
- "claim": "claim is a required field that configures the JWT token claim whose value is assigned to the cluster identity field associated with this mapping.",
+ "": "TokenClaimMapping allows specifying a JWT token claim to be used when mapping claims from an authentication token to cluster identities.",
+ "claim": "claim is an optional field for specifying the JWT token claim that is used in the mapping. The value of this claim will be assigned to the field in which this mapping is associated. claim must not exceed 256 characters in length. When set to the empty string `\"\"`, this means that no named claim should be used for the group mapping. claim is required when the ExternalOIDCWithUpstreamParity feature gate is not enabled.",
+ "expression": "expression is an optional CEL expression used to derive group values from JWT claims.\n\nCEL expressions have access to the token claims through a CEL variable, 'claims'.\n\nexpression must be at least 1 character and must not exceed 1024 characters in length .\n\nWhen specified, claim must not be set or be explicitly set to the empty string (`\"\"`).",
}
func (TokenClaimMapping) SwaggerDoc() map[string]string {
@@ -475,9 +478,9 @@ func (TokenClaimMapping) SwaggerDoc() map[string]string {
var map_TokenClaimMappings = map[string]string{
"username": "username is a required field that configures how the username of a cluster identity should be constructed from the claims in a JWT token issued by the identity provider.",
- "groups": "groups is an optional field that configures how the groups of a cluster identity should be constructed from the claims in a JWT token issued by the identity provider. When referencing a claim, if the claim is present in the JWT token, its value must be a list of groups separated by a comma (','). For example - '\"example\"' and '\"exampleOne\", \"exampleTwo\", \"exampleThree\"' are valid claim values.",
- "uid": "uid is an optional field for configuring the claim mapping used to construct the uid for the cluster identity.\n\nWhen using uid.claim to specify the claim it must be a single string value. When using uid.expression the expression must result in a single string value.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose a default, which is subject to change over time. The current default is to use the 'sub' claim.",
- "extra": "extra is an optional field for configuring the mappings used to construct the extra attribute for the cluster identity. When omitted, no extra attributes will be present on the cluster identity. key values for extra mappings must be unique. A maximum of 32 extra attribute mappings may be provided.",
+ "groups": "groups is an optional field that configures how the groups of a cluster identity should be constructed from the claims in a JWT token issued by the identity provider.\n\nWhen referencing a claim, if the claim is present in the JWT token, its value must be a list of groups separated by a comma (',').\n\nFor example - '\"example\"' and '\"exampleOne\", \"exampleTwo\", \"exampleThree\"' are valid claim values.",
+ "uid": "uid is an optional field for configuring the claim mapping used to construct the uid for the cluster identity.\n\nWhen using uid.claim to specify the claim it must be a single string value. When using uid.expression the expression must result in a single string value.\n\nWhen omitted, this means the user has no opinion and the platform is left to choose a default, which is subject to change over time.\n\nThe current default is to use the 'sub' claim.",
+ "extra": "extra is an optional field for configuring the mappings used to construct the extra attribute for the cluster identity. When omitted, no extra attributes will be present on the cluster identity.\n\nkey values for extra mappings must be unique. A maximum of 32 extra attribute mappings may be provided.",
}
func (TokenClaimMappings) SwaggerDoc() map[string]string {
@@ -494,9 +497,20 @@ func (TokenClaimOrExpressionMapping) SwaggerDoc() map[string]string {
return map_TokenClaimOrExpressionMapping
}
+var map_TokenClaimValidationCELRule = map[string]string{
+ "expression": "expression is a CEL expression evaluated against token claims. expression is required, must be at least 1 character in length and must not exceed 1024 characters. The expression must return a boolean value where 'true' signals a valid token and 'false' an invalid one.",
+ "message": "message is a required human-readable message to be logged by the Kubernetes API server if the CEL expression defined in 'expression' fails. message must be at least 1 character in length and must not exceed 256 characters.",
+}
+
+func (TokenClaimValidationCELRule) SwaggerDoc() map[string]string {
+ return map_TokenClaimValidationCELRule
+}
+
var map_TokenClaimValidationRule = map[string]string{
- "type": "type is an optional field that configures the type of the validation rule.\n\nAllowed values are 'RequiredClaim' and omitted (not provided or an empty string).\n\nWhen set to 'RequiredClaim', the Kubernetes API server will be configured to validate that the incoming JWT contains the required claim and that its value matches the required value.\n\nDefaults to 'RequiredClaim'.",
- "requiredClaim": "requiredClaim is an optional field that configures the required claim and value that the Kubernetes API server will use to validate if an incoming JWT is valid for this identity provider.",
+ "": "TokenClaimValidationRule represents a validation rule based on token claims. If type is RequiredClaim, requiredClaim must be set. If Type is CEL, CEL must be set and RequiredClaim must be omitted.",
+ "type": "type is an optional field that configures the type of the validation rule.\n\nAllowed values are \"RequiredClaim\" and \"CEL\".\n\nWhen set to 'RequiredClaim', the Kubernetes API server will be configured to validate that the incoming JWT contains the required claim and that its value matches the required value.\n\nWhen set to 'CEL', the Kubernetes API server will be configured to validate the incoming JWT against the configured CEL expression.",
+ "requiredClaim": "requiredClaim allows configuring a required claim name and its expected value. This field is required when `type` is set to RequiredClaim, and must be omitted when `type` is set to any other value. The Kubernetes API server uses this field to validate if an incoming JWT is valid for this identity provider.",
+ "cel": "cel holds the CEL expression and message for validation. Must be set when Type is \"CEL\", and forbidden otherwise.",
}
func (TokenClaimValidationRule) SwaggerDoc() map[string]string {
@@ -507,6 +521,7 @@ var map_TokenIssuer = map[string]string{
"issuerURL": "issuerURL is a required field that configures the URL used to issue tokens by the identity provider. The Kubernetes API server determines how authentication tokens should be handled by matching the 'iss' claim in the JWT to the issuerURL of configured identity providers.\n\nMust be at least 1 character and must not exceed 512 characters in length. Must be a valid URL that uses the 'https' scheme and does not contain a query, fragment or user.",
"audiences": "audiences is a required field that configures the acceptable audiences the JWT token, issued by the identity provider, must be issued to. At least one of the entries must match the 'aud' claim in the JWT token.\n\naudiences must contain at least one entry and must not exceed ten entries.",
"issuerCertificateAuthority": "issuerCertificateAuthority is an optional field that configures the certificate authority, used by the Kubernetes API server, to validate the connection to the identity provider when fetching discovery information.\n\nWhen not specified, the system trust is used.\n\nWhen specified, it must reference a ConfigMap in the openshift-config namespace containing the PEM-encoded CA certificates under the 'ca-bundle.crt' key in the data field of the ConfigMap.",
+ "discoveryURL": "discoveryURL is an optional field that, if specified, overrides the default discovery endpoint used to retrieve OIDC configuration metadata. By default, the discovery URL is derived from `issuerURL` as \"{issuerURL}/.well-known/openid-configuration\".\n\nThe discoveryURL must be a valid absolute HTTPS URL. It must not contain query parameters, user information, or fragments. Additionally, it must differ from the value of `issuerURL` (ignoring trailing slashes). The discoveryURL value must be at least 1 character long and no longer than 2048 characters.",
}
func (TokenIssuer) SwaggerDoc() map[string]string {
@@ -522,9 +537,20 @@ func (TokenRequiredClaim) SwaggerDoc() map[string]string {
return map_TokenRequiredClaim
}
+var map_TokenUserValidationRule = map[string]string{
+ "": "TokenUserValidationRule provides a CEL-based rule used to validate a token subject. Each rule contains a CEL expression that is evaluated against the token’s claims.",
+ "expression": "expression is a required CEL expression that performs a validation on cluster user identity attributes like username, groups, etc.\n\nThe expression must evaluate to a boolean value. When the expression evaluates to 'true', the cluster user identity is considered valid. When the expression evaluates to 'false', the cluster user identity is not considered valid. expression must be at least 1 character in length and must not exceed 1024 characters.",
+ "message": "message is a required human-readable message to be logged by the Kubernetes API server if the CEL expression defined in 'expression' fails. message must be at least 1 character in length and must not exceed 256 characters.",
+}
+
+func (TokenUserValidationRule) SwaggerDoc() map[string]string {
+ return map_TokenUserValidationRule
+}
+
var map_UsernameClaimMapping = map[string]string{
- "claim": "claim is a required field that configures the JWT token claim whose value is assigned to the cluster identity field associated with this mapping.\n\nclaim must not be an empty string (\"\") and must not exceed 256 characters.",
- "prefixPolicy": "prefixPolicy is an optional field that configures how a prefix should be applied to the value of the JWT claim specified in the 'claim' field.\n\nAllowed values are 'Prefix', 'NoPrefix', and omitted (not provided or an empty string).\n\nWhen set to 'Prefix', the value specified in the prefix field will be prepended to the value of the JWT claim. The prefix field must be set when prefixPolicy is 'Prefix'.\n\nWhen set to 'NoPrefix', no prefix will be prepended to the value of the JWT claim.\n\nWhen omitted, this means no opinion and the platform is left to choose any prefixes that are applied which is subject to change over time. Currently, the platform prepends `{issuerURL}#` to the value of the JWT claim when the claim is not 'email'. As an example, consider the following scenario:\n `prefix` is unset, `issuerURL` is set to `https://myoidc.tld`,\n the JWT claims include \"username\":\"userA\" and \"email\":\"userA@myoidc.tld\",\n and `claim` is set to:\n - \"username\": the mapped value will be \"https://myoidc.tld#userA\"\n - \"email\": the mapped value will be \"userA@myoidc.tld\"",
+ "claim": "claim is an optional field that configures the JWT token claim whose value is assigned to the cluster identity field associated with this mapping. claim is required when the ExternalOIDCWithUpstreamParity feature gate is not enabled. When the ExternalOIDCWithUpstreamParity feature gate is enabled, claim must not be set when expression is set.\n\nclaim must not be an empty string (\"\") and must not exceed 256 characters.",
+ "expression": "expression is an optional CEL expression used to derive the username from JWT claims.\n\nCEL expressions have access to the token claims through a CEL variable, 'claims'.\n\nexpression must be at least 1 character and must not exceed 1024 characters in length. expression must not be set when claim is set.",
+ "prefixPolicy": "prefixPolicy is an optional field that configures how a prefix should be applied to the value of the JWT claim specified in the 'claim' field.\n\nAllowed values are 'Prefix', 'NoPrefix', and omitted (not provided or an empty string).\n\nWhen set to 'Prefix', the value specified in the prefix field will be prepended to the value of the JWT claim.\n\nThe prefix field must be set when prefixPolicy is 'Prefix'.\n\nWhen set to 'NoPrefix', no prefix will be prepended to the value of the JWT claim.\n\nWhen omitted, this means no opinion and the platform is left to choose any prefixes that are applied which is subject to change over time. Currently, the platform prepends `{issuerURL}#` to the value of the JWT claim when the claim is not 'email'.\n\nAs an example, consider the following scenario:\n\n `prefix` is unset, `issuerURL` is set to `https://myoidc.tld`,\n the JWT claims include \"username\":\"userA\" and \"email\":\"userA@myoidc.tld\",\n and `claim` is set to:\n - \"username\": the mapped value will be \"https://myoidc.tld#userA\"\n - \"email\": the mapped value will be \"userA@myoidc.tld\"",
"prefix": "prefix configures the prefix that should be prepended to the value of the JWT claim.\n\nprefix must be set when prefixPolicy is set to 'Prefix' and must be unset otherwise.",
}
@@ -724,6 +750,15 @@ func (OperandVersion) SwaggerDoc() map[string]string {
return map_OperandVersion
}
+var map_AcceptRisk = map[string]string{
+ "": "AcceptRisk represents a risk that is considered acceptable.",
+ "name": "name is the name of the acceptable risk. It must be a non-empty string and must not exceed 256 characters.",
+}
+
+func (AcceptRisk) SwaggerDoc() map[string]string {
+ return map_AcceptRisk
+}
+
var map_ClusterCondition = map[string]string{
"": "ClusterCondition is a union of typed cluster conditions. The 'type' property determines which of the type-specific properties are relevant. When evaluated on a cluster, the condition may match, not match, or fail to evaluate.",
"type": "type represents the cluster-condition type. This defines the members and semantics of any additional properties.",
@@ -790,15 +825,16 @@ func (ClusterVersionSpec) SwaggerDoc() map[string]string {
}
var map_ClusterVersionStatus = map[string]string{
- "": "ClusterVersionStatus reports the status of the cluster versioning, including any upgrades that are in progress. The current field will be set to whichever version the cluster is reconciling to, and the conditions array will report whether the update succeeded, is in progress, or is failing.",
- "desired": "desired is the version that the cluster is reconciling towards. If the cluster is not yet fully initialized desired will be set with the information available, which may be an image or a tag.",
- "history": "history contains a list of the most recent versions applied to the cluster. This value may be empty during cluster startup, and then will be updated when a new update is being applied. The newest update is first in the list and it is ordered by recency. Updates in the history have state Completed if the rollout completed - if an update was failing or halfway applied the state will be Partial. Only a limited amount of update history is preserved.",
- "observedGeneration": "observedGeneration reports which version of the spec is being synced. If this value is not equal to metadata.generation, then the desired and conditions fields may represent a previous version.",
- "versionHash": "versionHash is a fingerprint of the content that the cluster will be updated with. It is used by the operator to avoid unnecessary work and is for internal use only.",
- "capabilities": "capabilities describes the state of optional, core cluster components.",
- "conditions": "conditions provides information about the cluster version. The condition \"Available\" is set to true if the desiredUpdate has been reached. The condition \"Progressing\" is set to true if an update is being applied. The condition \"Degraded\" is set to true if an update is currently blocked by a temporary or permanent error. Conditions are only valid for the current desiredUpdate when metadata.generation is equal to status.generation.",
- "availableUpdates": "availableUpdates contains updates recommended for this cluster. Updates which appear in conditionalUpdates but not in availableUpdates may expose this cluster to known issues. This list may be empty if no updates are recommended, if the update service is unavailable, or if an invalid channel has been specified.",
- "conditionalUpdates": "conditionalUpdates contains the list of updates that may be recommended for this cluster if it meets specific required conditions. Consumers interested in the set of updates that are actually recommended for this cluster should use availableUpdates. This list may be empty if no updates are recommended, if the update service is unavailable, or if an empty or invalid channel has been specified.",
+ "": "ClusterVersionStatus reports the status of the cluster versioning, including any upgrades that are in progress. The current field will be set to whichever version the cluster is reconciling to, and the conditions array will report whether the update succeeded, is in progress, or is failing.",
+ "desired": "desired is the version that the cluster is reconciling towards. If the cluster is not yet fully initialized desired will be set with the information available, which may be an image or a tag.",
+ "history": "history contains a list of the most recent versions applied to the cluster. This value may be empty during cluster startup, and then will be updated when a new update is being applied. The newest update is first in the list and it is ordered by recency. Updates in the history have state Completed if the rollout completed - if an update was failing or halfway applied the state will be Partial. Only a limited amount of update history is preserved.",
+ "observedGeneration": "observedGeneration reports which version of the spec is being synced. If this value is not equal to metadata.generation, then the desired and conditions fields may represent a previous version.",
+ "versionHash": "versionHash is a fingerprint of the content that the cluster will be updated with. It is used by the operator to avoid unnecessary work and is for internal use only.",
+ "capabilities": "capabilities describes the state of optional, core cluster components.",
+ "conditions": "conditions provides information about the cluster version. The condition \"Available\" is set to true if the desiredUpdate has been reached. The condition \"Progressing\" is set to true if an update is being applied. The condition \"Degraded\" is set to true if an update is currently blocked by a temporary or permanent error. Conditions are only valid for the current desiredUpdate when metadata.generation is equal to status.generation.",
+ "availableUpdates": "availableUpdates contains updates recommended for this cluster. Updates which appear in conditionalUpdates but not in availableUpdates may expose this cluster to known issues. This list may be empty if no updates are recommended, if the update service is unavailable, or if an invalid channel has been specified.",
+ "conditionalUpdates": "conditionalUpdates contains the list of updates that may be recommended for this cluster if it meets specific required conditions. Consumers interested in the set of updates that are actually recommended for this cluster should use availableUpdates. This list may be empty if no updates are recommended, if the update service is unavailable, or if an empty or invalid channel has been specified.",
+ "conditionalUpdateRisks": "conditionalUpdateRisks contains the list of risks associated with conditionalUpdates. When performing a conditional update, all its associated risks will be compared with the set of accepted risks in the spec.desiredUpdate.acceptRisks field. If all risks for a conditional update are included in the spec.desiredUpdate.acceptRisks set, the conditional update can proceed, otherwise it is blocked. The risk names in the list must be unique. conditionalUpdateRisks must not contain more than 500 entries.",
}
func (ClusterVersionStatus) SwaggerDoc() map[string]string {
@@ -821,6 +857,7 @@ func (ComponentOverride) SwaggerDoc() map[string]string {
var map_ConditionalUpdate = map[string]string{
"": "ConditionalUpdate represents an update which is recommended to some clusters on the version the current cluster is reconciling, but which may not be recommended for the current cluster.",
"release": "release is the target of the update.",
+ "riskNames": "riskNames represents the set of the names of conditionalUpdateRisks that are relevant to this update for some clusters. The Applies condition of each conditionalUpdateRisks entry declares if that risk applies to this cluster. A conditional update is accepted only if each of its risks either does not apply to the cluster or is considered acceptable by the cluster administrator. The latter means that the risk names are included in value of the spec.desiredUpdate.acceptRisks field. Entries must be unique and must not exceed 256 characters. riskNames must not contain more than 500 entries.",
"risks": "risks represents the range of issues associated with updating to the target release. The cluster-version operator will evaluate all entries, and only recommend the update if there is at least one entry and all entries recommend the update.",
"conditions": "conditions represents the observations of the conditional update's current status. Known types are: * Recommended, for whether the update is recommended for the current cluster.",
}
@@ -831,6 +868,7 @@ func (ConditionalUpdate) SwaggerDoc() map[string]string {
var map_ConditionalUpdateRisk = map[string]string{
"": "ConditionalUpdateRisk represents a reason and cluster-state for not recommending a conditional update.",
+ "conditions": "conditions represents the observations of the conditional update risk's current status. Known types are: * Applies, for whether the risk applies to the current cluster. The condition's types in the list must be unique. conditions must not contain more than one entry.",
"url": "url contains information about this risk.",
"name": "name is the CamelCase reason for not recommending a conditional update, in the event that matchingRules match the cluster state.",
"message": "message provides additional information about the risk of updating, in the event that matchingRules match the cluster state. This is only to be consumed by humans. It may contain Line Feed characters (U+000A), which should be rendered as new lines.",
@@ -879,6 +917,8 @@ var map_Update = map[string]string{
"version": "version is a semantic version identifying the update version. version is required if architecture is specified. If both version and image are set, the version extracted from the referenced image must match the specified version.",
"image": "image is a container image location that contains the update. image should be used when the desired version does not exist in availableUpdates or history. When image is set, architecture cannot be specified. If both version and image are set, the version extracted from the referenced image must match the specified version.",
"force": "force allows an administrator to update to an image that has failed verification or upgradeable checks that are designed to keep your cluster safe. Only use this if: * you are testing unsigned release images in short-lived test clusters or * you are working around a known bug in the cluster-version\n operator and you have verified the authenticity of the provided\n image yourself.\nThe provided image will run with full administrative access to the cluster. Do not use this flag with images that come from unknown or potentially malicious sources.",
+ "acceptRisks": "acceptRisks is an optional set of names of conditional update risks that are considered acceptable. A conditional update is performed only if all of its risks are acceptable. This list may contain entries that apply to current, previous or future updates. The entries therefore may not map directly to a risk in .status.conditionalUpdateRisks. acceptRisks must not contain more than 1000 entries. Entries in this list must be unique.",
+ "mode": "mode determines how an update should be processed. The only valid value is \"Preflight\". When omitted, the cluster performs a normal update by applying the specified version or image to the cluster. This is the standard update behavior. When set to \"Preflight\", the cluster runs compatibility checks against the target release without performing an actual update. Compatibility results, including any detected risks, are reported in status.conditionalUpdates and status.conditionalUpdateRisks alongside risks from the update recommendation service. This allows administrators to assess update readiness and address issues before committing to the update. Preflight mode is particularly useful for skip-level updates where upgrade compatibility needs to be verified across multiple minor versions. When mode is set to \"Preflight\", the same rules for version, image, and architecture apply as for normal updates.",
}
func (Update) SwaggerDoc() map[string]string {
@@ -893,7 +933,7 @@ var map_UpdateHistory = map[string]string{
"version": "version is a semantic version identifying the update version. If the requested image does not define a version, or if a failure occurs retrieving the image, this value may be empty.",
"image": "image is a container image location that contains the update. This value is always populated.",
"verified": "verified indicates whether the provided update was properly verified before it was installed. If this is false the cluster may not be trusted. Verified does not cover upgradeable checks that depend on the cluster state at the time when the update target was accepted.",
- "acceptedRisks": "acceptedRisks records risks which were accepted to initiate the update. For example, it may menition an Upgradeable=False or missing signature that was overridden via desiredUpdate.force, or an update that was initiated despite not being in the availableUpdates set of recommended update targets.",
+ "acceptedRisks": "acceptedRisks records risks which were accepted to initiate the update. For example, it may mention an Upgradeable=False or missing signature that was overridden via desiredUpdate.force, or an update that was initiated despite not being in the availableUpdates set of recommended update targets.",
}
func (UpdateHistory) SwaggerDoc() map[string]string {
@@ -1214,17 +1254,6 @@ func (ImageDigestMirrors) SwaggerDoc() map[string]string {
return map_ImageDigestMirrors
}
-var map_FulcioCAWithRekor = map[string]string{
- "": "FulcioCAWithRekor defines the root of trust based on the Fulcio certificate and the Rekor public key.",
- "fulcioCAData": "fulcioCAData is a required field contains inline base64-encoded data for the PEM format fulcio CA. fulcioCAData must be at most 8192 characters. ",
- "rekorKeyData": "rekorKeyData is a required field contains inline base64-encoded data for the PEM format from the Rekor public key. rekorKeyData must be at most 8192 characters. ",
- "fulcioSubject": "fulcioSubject is a required field specifies OIDC issuer and the email of the Fulcio authentication configuration.",
-}
-
-func (FulcioCAWithRekor) SwaggerDoc() map[string]string {
- return map_FulcioCAWithRekor
-}
-
var map_ImagePolicy = map[string]string{
"": "ImagePolicy holds namespace-wide configuration for image signature verification\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).",
"metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
@@ -1236,6 +1265,17 @@ func (ImagePolicy) SwaggerDoc() map[string]string {
return map_ImagePolicy
}
+var map_ImagePolicyFulcioCAWithRekorRootOfTrust = map[string]string{
+ "": "ImagePolicyFulcioCAWithRekorRootOfTrust defines the root of trust based on the Fulcio certificate and the Rekor public key.",
+ "fulcioCAData": "fulcioCAData is a required field contains inline base64-encoded data for the PEM format fulcio CA. fulcioCAData must be at most 8192 characters. ",
+ "rekorKeyData": "rekorKeyData is a required field contains inline base64-encoded data for the PEM format from the Rekor public key. rekorKeyData must be at most 8192 characters. ",
+ "fulcioSubject": "fulcioSubject is a required field specifies OIDC issuer and the email of the Fulcio authentication configuration.",
+}
+
+func (ImagePolicyFulcioCAWithRekorRootOfTrust) SwaggerDoc() map[string]string {
+ return map_ImagePolicyFulcioCAWithRekorRootOfTrust
+}
+
var map_ImagePolicyList = map[string]string{
"": "ImagePolicyList is a list of ImagePolicy resources\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).",
"metadata": "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
@@ -1246,6 +1286,27 @@ func (ImagePolicyList) SwaggerDoc() map[string]string {
return map_ImagePolicyList
}
+var map_ImagePolicyPKIRootOfTrust = map[string]string{
+ "": "ImagePolicyPKIRootOfTrust defines the root of trust based on Root CA(s) and corresponding intermediate certificates.",
+ "caRootsData": "caRootsData contains base64-encoded data of a certificate bundle PEM file, which contains one or more CA roots in the PEM format. The total length of the data must not exceed 8192 characters. ",
+ "caIntermediatesData": "caIntermediatesData contains base64-encoded data of a certificate bundle PEM file, which contains one or more intermediate certificates in the PEM format. The total length of the data must not exceed 8192 characters. caIntermediatesData requires caRootsData to be set. ",
+ "pkiCertificateSubject": "pkiCertificateSubject defines the requirements imposed on the subject to which the certificate was issued.",
+}
+
+func (ImagePolicyPKIRootOfTrust) SwaggerDoc() map[string]string {
+ return map_ImagePolicyPKIRootOfTrust
+}
+
+var map_ImagePolicyPublicKeyRootOfTrust = map[string]string{
+ "": "ImagePolicyPublicKeyRootOfTrust defines the root of trust based on a sigstore public key.",
+ "keyData": "keyData is a required field contains inline base64-encoded data for the PEM format public key. keyData must be at most 8192 characters. ",
+ "rekorKeyData": "rekorKeyData is an optional field contains inline base64-encoded data for the PEM format from the Rekor public key. rekorKeyData must be at most 8192 characters. ",
+}
+
+func (ImagePolicyPublicKeyRootOfTrust) SwaggerDoc() map[string]string {
+ return map_ImagePolicyPublicKeyRootOfTrust
+}
+
var map_ImagePolicySpec = map[string]string{
"": "ImagePolicySpec is the specification of the ImagePolicy CRD.",
"scopes": "scopes is a required field that defines the list of image identities assigned to a policy. Each item refers to a scope in a registry implementing the \"Docker Registry HTTP API V2\". Scopes matching individual images are named Docker references in the fully expanded form, either using a tag or digest. For example, docker.io/library/busybox:latest (not busybox:latest). More general scopes are prefixes of individual-image scopes, and specify a repository (by omitting the tag or digest), a repository namespace, or a registry host (by only specifying the host name and possibly a port number) or a wildcard expression starting with `*.`, for matching all subdomains (not including a port number). Wildcards are only supported for subdomain matching, and may not be used in the middle of the host, i.e. *.example.com is a valid case, but example*.*.com is not. This support no more than 256 scopes in one object. If multiple scopes match a given image, only the policy requirements for the most specific scope apply. The policy requirements for more general scopes are ignored. In addition to setting a policy appropriate for your own deployed applications, make sure that a policy on the OpenShift image repositories quay.io/openshift-release-dev/ocp-release, quay.io/openshift-release-dev/ocp-v4.0-art-dev (or on a more general scope) allows deployment of the OpenShift images required for cluster operation. If a scope is configured in both the ClusterImagePolicy and the ImagePolicy, or if the scope in ImagePolicy is nested under one of the scopes from the ClusterImagePolicy, only the policy from the ClusterImagePolicy will be applied. For additional details about the format, please refer to the document explaining the docker transport field, which can be found at: https://github.com/containers/image/blob/main/docs/containers-policy.json.5.md#docker",
@@ -1264,15 +1325,14 @@ func (ImagePolicyStatus) SwaggerDoc() map[string]string {
return map_ImagePolicyStatus
}
-var map_PKI = map[string]string{
- "": "PKI defines the root of trust based on Root CA(s) and corresponding intermediate certificates.",
- "caRootsData": "caRootsData contains base64-encoded data of a certificate bundle PEM file, which contains one or more CA roots in the PEM format. The total length of the data must not exceed 8192 characters. ",
- "caIntermediatesData": "caIntermediatesData contains base64-encoded data of a certificate bundle PEM file, which contains one or more intermediate certificates in the PEM format. The total length of the data must not exceed 8192 characters. caIntermediatesData requires caRootsData to be set. ",
- "pkiCertificateSubject": "pkiCertificateSubject defines the requirements imposed on the subject to which the certificate was issued.",
+var map_ImageSigstoreVerificationPolicy = map[string]string{
+ "": "ImageSigstoreVerificationPolicy defines the verification policy for the items in the scopes list.",
+ "rootOfTrust": "rootOfTrust is a required field that defines the root of trust for verifying image signatures during retrieval. This allows image consumers to specify policyType and corresponding configuration of the policy, matching how the policy was generated.",
+ "signedIdentity": "signedIdentity is an optional field specifies what image identity the signature claims about the image. This is useful when the image identity in the signature differs from the original image spec, such as when mirror registry is configured for the image scope, the signature from the mirror registry contains the image identity of the mirror instead of the original scope. The required matchPolicy field specifies the approach used in the verification process to verify the identity in the signature and the actual image identity, the default matchPolicy is \"MatchRepoDigestOrExact\".",
}
-func (PKI) SwaggerDoc() map[string]string {
- return map_PKI
+func (ImageSigstoreVerificationPolicy) SwaggerDoc() map[string]string {
+ return map_ImageSigstoreVerificationPolicy
}
var map_PKICertificateSubject = map[string]string{
@@ -1285,16 +1345,6 @@ func (PKICertificateSubject) SwaggerDoc() map[string]string {
return map_PKICertificateSubject
}
-var map_Policy = map[string]string{
- "": "Policy defines the verification policy for the items in the scopes list.",
- "rootOfTrust": "rootOfTrust is a required field that defines the root of trust for verifying image signatures during retrieval. This allows image consumers to specify policyType and corresponding configuration of the policy, matching how the policy was generated.",
- "signedIdentity": "signedIdentity is an optional field specifies what image identity the signature claims about the image. This is useful when the image identity in the signature differs from the original image spec, such as when mirror registry is configured for the image scope, the signature from the mirror registry contains the image identity of the mirror instead of the original scope. The required matchPolicy field specifies the approach used in the verification process to verify the identity in the signature and the actual image identity, the default matchPolicy is \"MatchRepoDigestOrExact\".",
-}
-
-func (Policy) SwaggerDoc() map[string]string {
- return map_Policy
-}
-
var map_PolicyFulcioSubject = map[string]string{
"": "PolicyFulcioSubject defines the OIDC issuer and the email of the Fulcio authentication configuration.",
"oidcIssuer": "oidcIssuer is a required filed contains the expected OIDC issuer. The oidcIssuer must be a valid URL and at most 2048 characters in length. It will be verified that the Fulcio-issued certificate contains a (Fulcio-defined) certificate extension pointing at this OIDC issuer URL. When Fulcio issues certificates, it includes a value based on an URL inside the client-provided ID token. Example: \"https://expected.OIDC.issuer/\"",
@@ -1335,7 +1385,7 @@ func (PolicyMatchRemapIdentity) SwaggerDoc() map[string]string {
var map_PolicyRootOfTrust = map[string]string{
"": "PolicyRootOfTrust defines the root of trust based on the selected policyType.",
- "policyType": "policyType is a required field specifies the type of the policy for verification. This field must correspond to how the policy was generated. Allowed values are \"PublicKey\", \"FulcioCAWithRekor\", and \"PKI\". When set to \"PublicKey\", the policy relies on a sigstore publicKey and may optionally use a Rekor verification. When set to \"FulcioCAWithRekor\", the policy is based on the Fulcio certification and incorporates a Rekor verification. When set to \"PKI\", the policy is based on the certificates from Bring Your Own Public Key Infrastructure (BYOPKI). This value is enabled by turning on the SigstoreImageVerificationPKI feature gate.",
+ "policyType": "policyType is a required field specifies the type of the policy for verification. This field must correspond to how the policy was generated. Allowed values are \"PublicKey\", \"FulcioCAWithRekor\", and \"PKI\". When set to \"PublicKey\", the policy relies on a sigstore publicKey and may optionally use a Rekor verification. When set to \"FulcioCAWithRekor\", the policy is based on the Fulcio certification and incorporates a Rekor verification. When set to \"PKI\", the policy is based on the certificates from Bring Your Own Public Key Infrastructure (BYOPKI).",
"publicKey": "publicKey defines the root of trust configuration based on a sigstore public key. Optionally include a Rekor public key for Rekor verification. publicKey is required when policyType is PublicKey, and forbidden otherwise.",
"fulcioCAWithRekor": "fulcioCAWithRekor defines the root of trust configuration based on the Fulcio certificate and the Rekor public key. fulcioCAWithRekor is required when policyType is FulcioCAWithRekor, and forbidden otherwise For more information about Fulcio and Rekor, please refer to the document at: https://github.com/sigstore/fulcio and https://github.com/sigstore/rekor",
"pki": "pki defines the root of trust configuration based on Bring Your Own Public Key Infrastructure (BYOPKI) Root CA(s) and corresponding intermediate certificates. pki is required when policyType is PKI, and forbidden otherwise.",
@@ -1345,16 +1395,6 @@ func (PolicyRootOfTrust) SwaggerDoc() map[string]string {
return map_PolicyRootOfTrust
}
-var map_PublicKey = map[string]string{
- "": "PublicKey defines the root of trust based on a sigstore public key.",
- "keyData": "keyData is a required field contains inline base64-encoded data for the PEM format public key. keyData must be at most 8192 characters. ",
- "rekorKeyData": "rekorKeyData is an optional field contains inline base64-encoded data for the PEM format from the Rekor public key. rekorKeyData must be at most 8192 characters. ",
-}
-
-func (PublicKey) SwaggerDoc() map[string]string {
- return map_PublicKey
-}
-
var map_ImageTagMirrorSet = map[string]string{
"": "ImageTagMirrorSet holds cluster-wide information about how to handle registry mirror rules on using tag pull specification. When multiple policies are defined, the outcome of the behavior is defined on each field.\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).",
"metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",
@@ -1616,7 +1656,6 @@ var map_GCPPlatformStatus = map[string]string{
"resourceLabels": "resourceLabels is a list of additional labels to apply to GCP resources created for the cluster. See https://cloud.google.com/compute/docs/labeling-resources for information on labeling GCP resources. GCP supports a maximum of 64 labels per resource. OpenShift reserves 32 labels for internal use, allowing 32 labels for user configuration.",
"resourceTags": "resourceTags is a list of additional tags to apply to GCP resources created for the cluster. See https://cloud.google.com/resource-manager/docs/tags/tags-overview for information on tagging GCP resources. GCP supports a maximum of 50 tags per resource.",
"cloudLoadBalancerConfig": "cloudLoadBalancerConfig holds configuration related to DNS and cloud load balancers. It allows configuration of in-cluster DNS as an alternative to the platform default DNS implementation. When using the ClusterHosted DNS type, Load Balancer IP addresses must be provided for the API and internal API load balancers as well as the ingress load balancer.",
- "serviceEndpoints": "serviceEndpoints specifies endpoints that override the default endpoints used when creating clients to interact with GCP services. When not specified, the default endpoint for the GCP region will be used. Only 1 endpoint override is permitted for each GCP service. The maximum number of endpoint overrides allowed is 11.",
}
func (GCPPlatformStatus) SwaggerDoc() map[string]string {
@@ -1644,16 +1683,6 @@ func (GCPResourceTag) SwaggerDoc() map[string]string {
return map_GCPResourceTag
}
-var map_GCPServiceEndpoint = map[string]string{
- "": "GCPServiceEndpoint store the configuration of a custom url to override existing defaults of GCP Services.",
- "name": "name is the name of the GCP service whose endpoint is being overridden. This must be provided and cannot be empty.\n\nAllowed values are Compute, Container, CloudResourceManager, DNS, File, IAM, ServiceUsage, Storage, and TagManager.\n\nAs an example, when setting the name to Compute all requests made by the caller to the GCP Compute Service will be directed to the endpoint specified in the url field.",
- "url": "url is a fully qualified URI that overrides the default endpoint for a client using the GCP service specified in the name field. url is required, must use the scheme https, must not be more than 253 characters in length, and must be a valid URL according to Go's net/url package (https://pkg.go.dev/net/url#URL)\n\nAn example of a valid endpoint that overrides the Compute Service: \"https://compute-myendpoint1.p.googleapis.com\"",
-}
-
-func (GCPServiceEndpoint) SwaggerDoc() map[string]string {
- return map_GCPServiceEndpoint
-}
-
var map_IBMCloudPlatformSpec = map[string]string{
"": "IBMCloudPlatformSpec holds the desired state of the IBMCloud infrastructure provider. This only includes fields that can be modified in the cluster.",
"serviceEndpoints": "serviceEndpoints is a list of custom endpoints which will override the default service endpoints of an IBM service. These endpoints are used by components within the cluster when trying to reach the IBM Cloud Services that have been overridden. The CCCMO reads in the IBMCloudPlatformSpec and validates each endpoint is resolvable. Once validated, the cloud config and IBMCloudPlatformStatus are updated to reflect the same custom endpoints. A maximum of 13 service endpoints overrides are supported.",
@@ -1899,7 +1928,7 @@ func (OvirtPlatformStatus) SwaggerDoc() map[string]string {
var map_PlatformSpec = map[string]string{
"": "PlatformSpec holds the desired state specific to the underlying infrastructure provider of the current cluster. Since these are used at spec-level for the underlying cluster, it is supposed that only one of the spec structs is set.",
- "type": "type is the underlying infrastructure provider for the cluster. This value controls whether infrastructure automation such as service load balancers, dynamic volume provisioning, machine creation and deletion, and other integrations are enabled. If None, no infrastructure automation is enabled. Allowed values are \"AWS\", \"Azure\", \"BareMetal\", \"GCP\", \"Libvirt\", \"OpenStack\", \"VSphere\", \"oVirt\", \"KubeVirt\", \"EquinixMetal\", \"PowerVS\", \"AlibabaCloud\", \"Nutanix\" and \"None\". Individual components may not support all platforms, and must handle unrecognized platforms as None if they do not support that platform.",
+ "type": "type is the underlying infrastructure provider for the cluster. This value controls whether infrastructure automation such as service load balancers, dynamic volume provisioning, machine creation and deletion, and other integrations are enabled. If None, no infrastructure automation is enabled. Allowed values are \"AWS\", \"Azure\", \"BareMetal\", \"GCP\", \"Libvirt\", \"OpenStack\", \"VSphere\", \"oVirt\", \"IBMCloud\", \"KubeVirt\", \"EquinixMetal\", \"PowerVS\", \"AlibabaCloud\", \"Nutanix\", \"External\", and \"None\". Individual components may not support all platforms, and must handle unrecognized platforms as None if they do not support that platform.",
"aws": "aws contains settings specific to the Amazon Web Services infrastructure provider.",
"azure": "azure contains settings specific to the Azure infrastructure provider.",
"gcp": "gcp contains settings specific to the Google Cloud Platform infrastructure provider.",
@@ -2901,7 +2930,7 @@ func (SchedulerList) SwaggerDoc() map[string]string {
var map_SchedulerSpec = map[string]string{
"policy": "DEPRECATED: the scheduler Policy API has been deprecated and will be removed in a future release. policy is a reference to a ConfigMap containing scheduler policy which has user specified predicates and priorities. If this ConfigMap is not available scheduler will default to use DefaultAlgorithmProvider. The namespace for this configmap is openshift-config.",
"profile": "profile sets which scheduling profile should be set in order to configure scheduling decisions for new pods.\n\nValid values are \"LowNodeUtilization\", \"HighNodeUtilization\", \"NoScoring\" Defaults to \"LowNodeUtilization\"",
- "profileCustomizations": "profileCustomizations contains configuration for modifying the default behavior of existing scheduler profiles.",
+ "profileCustomizations": "profileCustomizations contains configuration for modifying the default behavior of existing scheduler profiles. Deprecated: no longer needed, since DRA is GA starting with 4.21, and is enabled by' default in the cluster, this field will be removed in 4.24.",
"defaultNodeSelector": "defaultNodeSelector helps set the cluster-wide default node selector to restrict pod placement to specific nodes. This is applied to the pods created in all namespaces and creates an intersection with any existing nodeSelectors already set on a pod, additionally constraining that pod's selector. For example, defaultNodeSelector: \"type=user-node,region=east\" would set nodeSelector field in pod spec to \"type=user-node,region=east\" to all pods created in all namespaces. Namespaces having project-wide node selectors won't be impacted even if this field is set. This adds an annotation section to the namespace. For example, if a new namespace is created with node-selector='type=user-node,region=east', the annotation openshift.io/node-selector: type=user-node,region=east gets added to the project. When the openshift.io/node-selector annotation is set on the project the value is used in preference to the value we are setting for defaultNodeSelector field. For instance, openshift.io/node-selector: \"type=user-node,region=west\" means that the default of \"type=user-node,region=east\" set in defaultNodeSelector would not be applied.",
"mastersSchedulable": "mastersSchedulable allows masters nodes to be schedulable. When this flag is turned on, all the master nodes in the cluster will be made schedulable, so that workload pods can run on them. The default value for this field is false, meaning none of the master nodes are schedulable. Important Note: Once the workload pods start running on the master nodes, extreme care must be taken to ensure that cluster-critical control plane components are not impacted. Please turn on this field after doing due diligence.",
}
@@ -2954,7 +2983,7 @@ func (CustomTLSProfile) SwaggerDoc() map[string]string {
}
var map_IntermediateTLSProfile = map[string]string{
- "": "IntermediateTLSProfile is a TLS security profile based on: https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28default.29",
+ "": "IntermediateTLSProfile is a TLS security profile based on the \"intermediate\" configuration of the Mozilla Server Side TLS configuration guidelines.",
}
func (IntermediateTLSProfile) SwaggerDoc() map[string]string {
@@ -2962,7 +2991,7 @@ func (IntermediateTLSProfile) SwaggerDoc() map[string]string {
}
var map_ModernTLSProfile = map[string]string{
- "": "ModernTLSProfile is a TLS security profile based on: https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility",
+ "": "ModernTLSProfile is a TLS security profile based on the \"modern\" configuration of the Mozilla Server Side TLS configuration guidelines.",
}
func (ModernTLSProfile) SwaggerDoc() map[string]string {
@@ -2970,7 +2999,7 @@ func (ModernTLSProfile) SwaggerDoc() map[string]string {
}
var map_OldTLSProfile = map[string]string{
- "": "OldTLSProfile is a TLS security profile based on: https://wiki.mozilla.org/Security/Server_Side_TLS#Old_backward_compatibility",
+ "": "OldTLSProfile is a TLS security profile based on the \"old\" configuration of the Mozilla Server Side TLS configuration guidelines.",
}
func (OldTLSProfile) SwaggerDoc() map[string]string {
@@ -2979,8 +3008,8 @@ func (OldTLSProfile) SwaggerDoc() map[string]string {
var map_TLSProfileSpec = map[string]string{
"": "TLSProfileSpec is the desired behavior of a TLSSecurityProfile.",
- "ciphers": "ciphers is used to specify the cipher algorithms that are negotiated during the TLS handshake. Operators may remove entries their operands do not support. For example, to use DES-CBC3-SHA (yaml):\n\n ciphers:\n - DES-CBC3-SHA",
- "minTLSVersion": "minTLSVersion is used to specify the minimal version of the TLS protocol that is negotiated during the TLS handshake. For example, to use TLS versions 1.1, 1.2 and 1.3 (yaml):\n\n minTLSVersion: VersionTLS11\n\nNOTE: currently the highest minTLSVersion allowed is VersionTLS12",
+ "ciphers": "ciphers is used to specify the cipher algorithms that are negotiated during the TLS handshake. Operators may remove entries that their operands do not support. For example, to use only ECDHE-RSA-AES128-GCM-SHA256 (yaml):\n\n ciphers:\n - ECDHE-RSA-AES128-GCM-SHA256\n\nTLS 1.3 cipher suites (e.g. TLS_AES_128_GCM_SHA256) are not configurable and are always enabled when TLS 1.3 is negotiated.",
+ "minTLSVersion": "minTLSVersion is used to specify the minimal version of the TLS protocol that is negotiated during the TLS handshake. For example, to use TLS versions 1.1, 1.2 and 1.3 (yaml):\n\n minTLSVersion: VersionTLS11",
}
func (TLSProfileSpec) SwaggerDoc() map[string]string {
@@ -2989,11 +3018,11 @@ func (TLSProfileSpec) SwaggerDoc() map[string]string {
var map_TLSSecurityProfile = map[string]string{
"": "TLSSecurityProfile defines the schema for a TLS security profile. This object is used by operators to apply TLS security settings to operands.",
- "type": "type is one of Old, Intermediate, Modern or Custom. Custom provides the ability to specify individual TLS security profile parameters. Old, Intermediate and Modern are TLS security profiles based on:\n\nhttps://wiki.mozilla.org/Security/Server_Side_TLS#Recommended_configurations\n\nThe profiles are intent based, so they may change over time as new ciphers are developed and existing ciphers are found to be insecure. Depending on precisely which ciphers are available to a process, the list may be reduced.\n\nNote that the Modern profile is currently not supported because it is not yet well adopted by common software libraries.",
- "old": "old is a TLS security profile based on:\n\nhttps://wiki.mozilla.org/Security/Server_Side_TLS#Old_backward_compatibility\n\nand looks like this (yaml):\n\n ciphers:\n\n - TLS_AES_128_GCM_SHA256\n\n - TLS_AES_256_GCM_SHA384\n\n - TLS_CHACHA20_POLY1305_SHA256\n\n - ECDHE-ECDSA-AES128-GCM-SHA256\n\n - ECDHE-RSA-AES128-GCM-SHA256\n\n - ECDHE-ECDSA-AES256-GCM-SHA384\n\n - ECDHE-RSA-AES256-GCM-SHA384\n\n - ECDHE-ECDSA-CHACHA20-POLY1305\n\n - ECDHE-RSA-CHACHA20-POLY1305\n\n - DHE-RSA-AES128-GCM-SHA256\n\n - DHE-RSA-AES256-GCM-SHA384\n\n - DHE-RSA-CHACHA20-POLY1305\n\n - ECDHE-ECDSA-AES128-SHA256\n\n - ECDHE-RSA-AES128-SHA256\n\n - ECDHE-ECDSA-AES128-SHA\n\n - ECDHE-RSA-AES128-SHA\n\n - ECDHE-ECDSA-AES256-SHA384\n\n - ECDHE-RSA-AES256-SHA384\n\n - ECDHE-ECDSA-AES256-SHA\n\n - ECDHE-RSA-AES256-SHA\n\n - DHE-RSA-AES128-SHA256\n\n - DHE-RSA-AES256-SHA256\n\n - AES128-GCM-SHA256\n\n - AES256-GCM-SHA384\n\n - AES128-SHA256\n\n - AES256-SHA256\n\n - AES128-SHA\n\n - AES256-SHA\n\n - DES-CBC3-SHA\n\n minTLSVersion: VersionTLS10",
- "intermediate": "intermediate is a TLS security profile based on:\n\nhttps://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28recommended.29\n\nand looks like this (yaml):\n\n ciphers:\n\n - TLS_AES_128_GCM_SHA256\n\n - TLS_AES_256_GCM_SHA384\n\n - TLS_CHACHA20_POLY1305_SHA256\n\n - ECDHE-ECDSA-AES128-GCM-SHA256\n\n - ECDHE-RSA-AES128-GCM-SHA256\n\n - ECDHE-ECDSA-AES256-GCM-SHA384\n\n - ECDHE-RSA-AES256-GCM-SHA384\n\n - ECDHE-ECDSA-CHACHA20-POLY1305\n\n - ECDHE-RSA-CHACHA20-POLY1305\n\n - DHE-RSA-AES128-GCM-SHA256\n\n - DHE-RSA-AES256-GCM-SHA384\n\n minTLSVersion: VersionTLS12",
- "modern": "modern is a TLS security profile based on:\n\nhttps://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility\n\nand looks like this (yaml):\n\n ciphers:\n\n - TLS_AES_128_GCM_SHA256\n\n - TLS_AES_256_GCM_SHA384\n\n - TLS_CHACHA20_POLY1305_SHA256\n\n minTLSVersion: VersionTLS13",
- "custom": "custom is a user-defined TLS security profile. Be extremely careful using a custom profile as invalid configurations can be catastrophic. An example custom profile looks like this:\n\n ciphers:\n\n - ECDHE-ECDSA-CHACHA20-POLY1305\n\n - ECDHE-RSA-CHACHA20-POLY1305\n\n - ECDHE-RSA-AES128-GCM-SHA256\n\n - ECDHE-ECDSA-AES128-GCM-SHA256\n\n minTLSVersion: VersionTLS11",
+ "type": "type is one of Old, Intermediate, Modern or Custom. Custom provides the ability to specify individual TLS security profile parameters.\n\nThe profiles are based on version 5.7 of the Mozilla Server Side TLS configuration guidelines. The cipher lists consist of the configuration's \"ciphersuites\" followed by the Go-specific \"ciphers\" from the guidelines. See: https://ssl-config.mozilla.org/guidelines/5.7.json\n\nThe profiles are intent based, so they may change over time as new ciphers are developed and existing ciphers are found to be insecure. Depending on precisely which ciphers are available to a process, the list may be reduced.",
+ "old": "old is a TLS profile for use when services need to be accessed by very old clients or libraries and should be used only as a last resort.\n\nThis profile is equivalent to a Custom profile specified as:\n minTLSVersion: VersionTLS10\n ciphers:\n - TLS_AES_128_GCM_SHA256\n - TLS_AES_256_GCM_SHA384\n - TLS_CHACHA20_POLY1305_SHA256\n - ECDHE-ECDSA-AES128-GCM-SHA256\n - ECDHE-RSA-AES128-GCM-SHA256\n - ECDHE-ECDSA-AES256-GCM-SHA384\n - ECDHE-RSA-AES256-GCM-SHA384\n - ECDHE-ECDSA-CHACHA20-POLY1305\n - ECDHE-RSA-CHACHA20-POLY1305\n - ECDHE-ECDSA-AES128-SHA256\n - ECDHE-RSA-AES128-SHA256\n - ECDHE-ECDSA-AES128-SHA\n - ECDHE-RSA-AES128-SHA\n - ECDHE-ECDSA-AES256-SHA\n - ECDHE-RSA-AES256-SHA\n - AES128-GCM-SHA256\n - AES256-GCM-SHA384\n - AES128-SHA256\n - AES128-SHA\n - AES256-SHA\n - DES-CBC3-SHA",
+ "intermediate": "intermediate is a TLS profile for use when you do not need compatibility with legacy clients and want to remain highly secure while being compatible with most clients currently in use.\n\nThis profile is equivalent to a Custom profile specified as:\n minTLSVersion: VersionTLS12\n ciphers:\n - TLS_AES_128_GCM_SHA256\n - TLS_AES_256_GCM_SHA384\n - TLS_CHACHA20_POLY1305_SHA256\n - ECDHE-ECDSA-AES128-GCM-SHA256\n - ECDHE-RSA-AES128-GCM-SHA256\n - ECDHE-ECDSA-AES256-GCM-SHA384\n - ECDHE-RSA-AES256-GCM-SHA384\n - ECDHE-ECDSA-CHACHA20-POLY1305\n - ECDHE-RSA-CHACHA20-POLY1305",
+ "modern": "modern is a TLS security profile for use with clients that support TLS 1.3 and do not need backward compatibility for older clients.\n\nThis profile is equivalent to a Custom profile specified as:\n minTLSVersion: VersionTLS13\n ciphers:\n - TLS_AES_128_GCM_SHA256\n - TLS_AES_256_GCM_SHA384\n - TLS_CHACHA20_POLY1305_SHA256",
+ "custom": "custom is a user-defined TLS security profile. Be extremely careful using a custom profile as invalid configurations can be catastrophic. An example custom profile looks like this:\n\n minTLSVersion: VersionTLS11\n ciphers:\n - ECDHE-ECDSA-CHACHA20-POLY1305\n - ECDHE-RSA-CHACHA20-POLY1305\n - ECDHE-RSA-AES128-GCM-SHA256\n - ECDHE-ECDSA-AES128-GCM-SHA256",
}
func (TLSSecurityProfile) SwaggerDoc() map[string]string {
diff --git a/api/vendor/github.com/openshift/api/machine/v1/types_controlplanemachineset.go b/api/vendor/github.com/openshift/api/machine/v1/types_controlplanemachineset.go
index d7661cf38938..25ffc9f46d5e 100644
--- a/api/vendor/github.com/openshift/api/machine/v1/types_controlplanemachineset.go
+++ b/api/vendor/github.com/openshift/api/machine/v1/types_controlplanemachineset.go
@@ -53,10 +53,9 @@ type ControlPlaneMachineSetSpec struct {
// For example, if machineNamePrefix is set to 'control-plane',
// and three machines are created, their names might be:
// control-plane-abcde-0, control-plane-fghij-1, control-plane-klmno-2
- // +openshift:validation:FeatureGateAwareXValidation:featureGate=CPMSMachineNamePrefix,rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lowercase alphanumeric characters, hyphens ('-'), and periods ('.'). Each block, separated by periods, must start and end with an alphanumeric character. Hyphens are not allowed at the start or end of a block, and consecutive periods are not permitted."
+ // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lowercase alphanumeric characters, hyphens ('-'), and periods ('.'). Each block, separated by periods, must start and end with an alphanumeric character. Hyphens are not allowed at the start or end of a block, and consecutive periods are not permitted."
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=245
- // +openshift:enable:FeatureGate=CPMSMachineNamePrefix
// +optional
MachineNamePrefix string `json:"machineNamePrefix,omitempty"`
diff --git a/api/vendor/github.com/openshift/api/machine/v1/zz_generated.featuregated-crd-manifests.yaml b/api/vendor/github.com/openshift/api/machine/v1/zz_generated.featuregated-crd-manifests.yaml
index 7be04ec84436..b001170fafe1 100644
--- a/api/vendor/github.com/openshift/api/machine/v1/zz_generated.featuregated-crd-manifests.yaml
+++ b/api/vendor/github.com/openshift/api/machine/v1/zz_generated.featuregated-crd-manifests.yaml
@@ -7,7 +7,6 @@ controlplanemachinesets.machine.openshift.io:
Capability: MachineAPI
Category: ""
FeatureGates:
- - CPMSMachineNamePrefix
- MachineAPIMigration
FilenameOperatorName: control-plane-machine-set
FilenameOperatorOrdering: "01"
diff --git a/api/vendor/github.com/openshift/api/machine/v1beta1/types_awsprovider.go b/api/vendor/github.com/openshift/api/machine/v1beta1/types_awsprovider.go
index 0cc634a5fd2f..e3508d6679d5 100644
--- a/api/vendor/github.com/openshift/api/machine/v1beta1/types_awsprovider.go
+++ b/api/vendor/github.com/openshift/api/machine/v1beta1/types_awsprovider.go
@@ -115,13 +115,14 @@ type AWSMachineProviderConfig struct {
// +optional
MarketType MarketType `json:"marketType,omitempty"`
+ // Tombstone: This field was moved into the Placement struct to belong w/ the Tenancy field due to involvement with the setting.
// hostPlacement configures placement on AWS Dedicated Hosts. This allows admins to assign instances to specific host
// for a variety of needs including for regulatory compliance, to leverage existing per-socket or per-core software licenses (BYOL),
// and to gain visibility and control over instance placement on a physical server.
// When omitted, the instance is not constrained to a dedicated host.
// +openshift:enable:FeatureGate=AWSDedicatedHosts
// +optional
- HostPlacement *HostPlacement `json:"hostPlacement,omitempty"`
+ //HostPlacement *HostPlacement `json:"hostPlacement,omitempty"`
}
// AWSConfidentialComputePolicy represents the confidential compute configuration for the instance.
@@ -294,6 +295,7 @@ type AWSResourceReference struct {
}
// Placement indicates where to create the instance in AWS
+// +kubebuilder:validation:XValidation:rule="has(self.tenancy) && self.tenancy == 'host' ? true : !has(self.host)",message="host may only be specified when tenancy is host"
type Placement struct {
// region is the region to use to create the instance
// +optional
@@ -303,8 +305,19 @@ type Placement struct {
AvailabilityZone string `json:"availabilityZone,omitempty"`
// tenancy indicates if instance should run on shared or single-tenant hardware. There are
// supported 3 options: default, dedicated and host.
+ // When set to default Runs on shared multi-tenant hardware.
+ // When dedicated Runs on single-tenant hardware (any dedicated instance hardware).
+ // When host and the host object is not provided: Runs on Dedicated Host; best-effort restart on same host.
+ // When `host` and `host` object is provided with affinity `dedicatedHost` defined: Runs on specified Dedicated Host.
// +optional
Tenancy InstanceTenancy `json:"tenancy,omitempty"`
+ // host configures placement on AWS Dedicated Hosts. This allows admins to assign instances to specific host
+ // for a variety of needs including for regulatory compliance, to leverage existing per-socket or per-core software licenses (BYOL),
+ // and to gain visibility and control over instance placement on a physical server.
+ // When omitted, the instance is not constrained to a dedicated host.
+ // +openshift:enable:FeatureGate=AWSDedicatedHosts
+ // +optional
+ Host *HostPlacement `json:"host,omitempty"`
}
// Filter is a filter used to identify an AWS resource
@@ -318,9 +331,16 @@ type Filter struct {
// TagSpecification is the name/value pair for a tag
type TagSpecification struct {
- // name of the tag
+ // name of the tag.
+ // This field is required and must be a non-empty string.
+ // Must be between 1 and 128 characters in length.
+ // +kubebuilder:validation:MinLength=1
+ // +kubebuilder:validation:MaxLength=128
+ // +required
Name string `json:"name"`
- // value of the tag
+ // value of the tag.
+ // When omitted, this creates a tag with an empty string as the value.
+ // +optional
Value string `json:"value"`
}
@@ -394,6 +414,26 @@ type AWSMachineProviderStatus struct {
// +listType=map
// +listMapKey=type
Conditions []metav1.Condition `json:"conditions,omitempty"`
+ // dedicatedHost tracks the dynamically allocated dedicated host.
+ // This field is populated when allocationStrategy is Dynamic (with or without DynamicHostAllocation).
+ // When omitted, this indicates that the dedicated host has not yet been allocated, or allocation is in progress.
+ // +optional
+ DedicatedHost *DedicatedHostStatus `json:"dedicatedHost,omitempty"`
+}
+
+// DedicatedHostStatus defines the observed state of a dynamically allocated dedicated host
+// associated with an AWSMachine. This struct is used to track the ID of the dedicated host.
+type DedicatedHostStatus struct {
+ // id tracks the dynamically allocated dedicated host ID.
+ // This field is populated when allocationStrategy is Dynamic (with or without DynamicHostAllocation).
+ // The value must start with "h-" followed by either 8 or 17 lowercase hexadecimal characters (0-9 and a-f).
+ // The use of 8 lowercase hexadecimal characters is for older legacy hosts that may not have been migrated to newer format.
+ // Must be either 10 or 19 characters in length.
+ // +kubebuilder:validation:XValidation:rule="self.matches('^h-([0-9a-f]{8}|[0-9a-f]{17})$')",message="id must start with 'h-' followed by either 8 or 17 lowercase hexadecimal characters (0-9 and a-f)"
+ // +kubebuilder:validation:MinLength=10
+ // +kubebuilder:validation:MaxLength=19
+ // +required
+ ID string `json:"id,omitempty"`
}
// MarketType describes the market type of an EC2 Instance
@@ -416,19 +456,20 @@ const (
)
// HostPlacement is the type that will be used to configure the placement of AWS instances.
-// +kubebuilder:validation:XValidation:rule="has(self.type) && self.affinity == 'DedicatedHost' ? has(self.dedicatedHost) : !has(self.dedicatedHost)",message="dedicatedHost is required when affinity is DedicatedHost, and forbidden otherwise"
+// +kubebuilder:validation:XValidation:rule="has(self.affinity) && self.affinity == 'DedicatedHost' ? has(self.dedicatedHost) : true",message="dedicatedHost is required when affinity is DedicatedHost, and optional otherwise"
// +union
type HostPlacement struct {
// affinity specifies the affinity setting for the instance.
// Allowed values are AnyAvailable and DedicatedHost.
// When Affinity is set to DedicatedHost, an instance started onto a specific host always restarts on the same host if stopped. In this scenario, the `dedicatedHost` field must be set.
// When Affinity is set to AnyAvailable, and you stop and restart the instance, it can be restarted on any available host.
+ // When Affinity is set to AnyAvailable and the `dedicatedHost` field is defined, it runs on specified Dedicated Host, but may move if stopped.
// +required
// +unionDiscriminator
Affinity *HostAffinity `json:"affinity,omitempty"`
// dedicatedHost specifies the exact host that an instance should be restarted on if stopped.
- // dedicatedHost is required when 'affinity' is set to DedicatedHost, and forbidden otherwise.
+ // dedicatedHost is required when 'affinity' is set to DedicatedHost, and optional otherwise.
// +optional
// +unionMember
DedicatedHost *DedicatedHost `json:"dedicatedHost,omitempty"`
@@ -440,20 +481,77 @@ type HostAffinity string
const (
// HostAffinityAnyAvailable lets the platform select any available dedicated host.
+
HostAffinityAnyAvailable HostAffinity = "AnyAvailable"
// HostAffinityDedicatedHost requires specifying a particular host via dedicatedHost.host.hostID.
HostAffinityDedicatedHost HostAffinity = "DedicatedHost"
)
+// AllocationStrategy selects how a dedicated host is provided to the system for assigning to the instance.
+// +kubebuilder:validation:Enum:=UserProvided;Dynamic
+// +enum
+type AllocationStrategy string
+
+const (
+ // AllocationStrategyUserProvided specifies that the system should assign instances to a user-provided dedicated host.
+ AllocationStrategyUserProvided AllocationStrategy = "UserProvided"
+
+ // AllocationStrategyDynamic specifies that the system should dynamically allocate a dedicated host for instances.
+ AllocationStrategyDynamic AllocationStrategy = "Dynamic"
+)
+
// DedicatedHost represents the configuration for the usage of dedicated host.
+// +kubebuilder:validation:XValidation:rule="self.allocationStrategy == 'UserProvided' ? has(self.id) : !has(self.id)",message="id is required when allocationStrategy is UserProvided, and forbidden otherwise"
+// +kubebuilder:validation:XValidation:rule="has(self.dynamicHostAllocation) ? self.allocationStrategy == 'Dynamic' : true",message="dynamicHostAllocation is only allowed when allocationStrategy is Dynamic"
+// +union
type DedicatedHost struct {
+ // allocationStrategy specifies if the dedicated host will be provided by the admin through the id field or if the host will be dynamically allocated.
+ // Valid values are UserProvided and Dynamic.
+ // When omitted, the value defaults to "UserProvided", which requires the id field to be set.
+ // When allocationStrategy is set to UserProvided, an ID of the dedicated host to assign must be provided.
+ // When allocationStrategy is set to Dynamic, a dedicated host will be allocated and used to assign instances.
+ // When allocationStrategy is set to Dynamic, and dynamicHostAllocation is configured, a dedicated host will be allocated and the tags in dynamicHostAllocation will be assigned to that host.
+ // +optional
+ // +unionDiscriminator
+ // +default="UserProvided"
+ AllocationStrategy *AllocationStrategy `json:"allocationStrategy,omitempty"`
+
// id identifies the AWS Dedicated Host on which the instance must run.
- // The value must start with "h-" followed by 17 lowercase hexadecimal characters (0-9 and a-f).
- // Must be exactly 19 characters in length.
- // +kubebuilder:validation:XValidation:rule="self.matches('^h-[0-9a-f]{17}$')",message="hostID must start with 'h-' followed by 17 lowercase hexadecimal characters (0-9 and a-f)"
- // +kubebuilder:validation:MinLength=19
+ // The value must start with "h-" followed by either 8 or 17 lowercase hexadecimal characters (0-9 and a-f).
+ // The use of 8 lowercase hexadecimal characters is for older legacy hosts that may not have been migrated to newer format.
+ // Must be either 10 or 19 characters in length.
+ // This field is required when allocationStrategy is UserProvided, and forbidden otherwise.
+ // When omitted with allocationStrategy set to Dynamic, the platform will dynamically allocate a dedicated host.
+ // +kubebuilder:validation:XValidation:rule="self.matches('^h-([0-9a-f]{8}|[0-9a-f]{17})$')",message="id must start with 'h-' followed by either 8 or 17 lowercase hexadecimal characters (0-9 and a-f)"
+ // +kubebuilder:validation:MinLength=10
// +kubebuilder:validation:MaxLength=19
- // +required
+ // +optional
+ // +unionMember=UserProvided
ID string `json:"id,omitempty"`
+
+ // dynamicHostAllocation specifies tags to apply to a dynamically allocated dedicated host.
+ // This field is only allowed when allocationStrategy is Dynamic, and is mutually exclusive with id.
+ // When specified, a dedicated host will be allocated with the provided tags applied.
+ // When omitted (and allocationStrategy is Dynamic), a dedicated host will be allocated without any additional tags.
+ // +optional
+ // +unionMember=Dynamic
+ DynamicHostAllocation *DynamicHostAllocationSpec `json:"dynamicHostAllocation,omitempty"`
+}
+
+// DynamicHostAllocationSpec defines the configuration for dynamic dedicated host allocation.
+// This specification always allocates exactly one dedicated host per machine.
+// At least one property must be specified when this struct is used.
+// Currently only Tags are available for configuring, but in the future more configs may become available.
+// +kubebuilder:validation:MinProperties=1
+type DynamicHostAllocationSpec struct {
+ // tags specifies a set of key-value pairs to apply to the allocated dedicated host.
+ // When omitted, no additional user-defined tags will be applied to the allocated host.
+ // A maximum of 50 tags can be specified.
+ // +kubebuilder:validation:MinItems=1
+ // +kubebuilder:validation:MaxItems=50
+ // +listType=map
+ // +listMapKey=name
+ // +optional
+ Tags *[]TagSpecification `json:"tags,omitempty"`
}
diff --git a/api/vendor/github.com/openshift/api/machine/v1beta1/types_machine.go b/api/vendor/github.com/openshift/api/machine/v1beta1/types_machine.go
index 33f472f9264d..6bfe850812b8 100644
--- a/api/vendor/github.com/openshift/api/machine/v1beta1/types_machine.go
+++ b/api/vendor/github.com/openshift/api/machine/v1beta1/types_machine.go
@@ -185,6 +185,18 @@ const (
MachineAuthorityMigrating MachineAuthority = "Migrating"
)
+// SynchronizedAPI holds the last stable value of authoritativeAPI.
+// +kubebuilder:validation:Enum=MachineAPI;ClusterAPI
+type SynchronizedAPI string
+
+const (
+ // MachineAPISynchronized indicates that the Machine API is the last synchronized API.
+ MachineAPISynchronized SynchronizedAPI = "MachineAPI"
+
+ // ClusterAPISynchronized indicates that the Cluster API is the last synchronized API.
+ ClusterAPISynchronized SynchronizedAPI = "ClusterAPI"
+)
+
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@@ -317,6 +329,7 @@ type LifecycleHook struct {
// MachineStatus defines the observed state of Machine
// +openshift:validation:FeatureGateAwareXValidation:featureGate=MachineAPIMigration,rule="!has(oldSelf.synchronizedGeneration) || (has(self.synchronizedGeneration) && self.synchronizedGeneration >= oldSelf.synchronizedGeneration) || (oldSelf.authoritativeAPI == 'Migrating' && self.authoritativeAPI != 'Migrating')",message="synchronizedGeneration must not decrease unless authoritativeAPI is transitioning from Migrating to another value"
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=MachineAPIMigration,rule="has(self.authoritativeAPI) || !has(oldSelf.authoritativeAPI)",message="authoritativeAPI may not be removed once set"
type MachineStatus struct {
// nodeRef will point to the corresponding Node if it exists.
// +optional
@@ -406,6 +419,14 @@ type MachineStatus struct {
// +optional
AuthoritativeAPI MachineAuthority `json:"authoritativeAPI,omitempty"`
+ // synchronizedAPI holds the last stable value of authoritativeAPI.
+ // It is used to detect migration cancellation requests and to restore the resource to its previous state.
+ // Valid values are "MachineAPI" and "ClusterAPI".
+ // When omitted, the resource has not yet been reconciled by the migration controller.
+ // +openshift:enable:FeatureGate=MachineAPIMigration
+ // +optional
+ SynchronizedAPI SynchronizedAPI `json:"synchronizedAPI,omitempty"`
+
// synchronizedGeneration is the generation of the authoritative resource that the non-authoritative resource is synchronised with.
// This field is set when the authoritative resource is updated and the sync controller has updated the non-authoritative resource to match.
// +kubebuilder:validation:Minimum=0
diff --git a/api/vendor/github.com/openshift/api/machine/v1beta1/types_machineset.go b/api/vendor/github.com/openshift/api/machine/v1beta1/types_machineset.go
index a2343dc3982f..be5476344b12 100644
--- a/api/vendor/github.com/openshift/api/machine/v1beta1/types_machineset.go
+++ b/api/vendor/github.com/openshift/api/machine/v1beta1/types_machineset.go
@@ -112,6 +112,7 @@ type MachineTemplateSpec struct {
// MachineSetStatus defines the observed state of MachineSet
// +openshift:validation:FeatureGateAwareXValidation:featureGate=MachineAPIMigration,rule="!has(oldSelf.synchronizedGeneration) || (has(self.synchronizedGeneration) && self.synchronizedGeneration >= oldSelf.synchronizedGeneration) || (oldSelf.authoritativeAPI == 'Migrating' && self.authoritativeAPI != 'Migrating')",message="synchronizedGeneration must not decrease unless authoritativeAPI is transitioning from Migrating to another value"
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=MachineAPIMigration,rule="has(self.authoritativeAPI) || !has(oldSelf.authoritativeAPI)",message="authoritativeAPI may not be removed once set"
type MachineSetStatus struct {
// replicas is the most recently observed number of replicas.
// +optional
@@ -168,6 +169,14 @@ type MachineSetStatus struct {
// +optional
AuthoritativeAPI MachineAuthority `json:"authoritativeAPI,omitempty"`
+ // synchronizedAPI holds the last stable value of authoritativeAPI.
+ // It is used to detect migration cancellation requests and to restore the resource to its previous state.
+ // Valid values are "MachineAPI" and "ClusterAPI".
+ // When omitted, the resource has not yet been reconciled by the migration controller.
+ // +openshift:enable:FeatureGate=MachineAPIMigration
+ // +optional
+ SynchronizedAPI SynchronizedAPI `json:"synchronizedAPI,omitempty"`
+
// synchronizedGeneration is the generation of the authoritative resource that the non-authoritative resource is synchronised with.
// This field is set when the authoritative resource is updated and the sync controller has updated the non-authoritative resource to match.
// +kubebuilder:validation:Minimum=0
diff --git a/api/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.deepcopy.go b/api/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.deepcopy.go
index 0150060f4664..63b9bb5ff813 100644
--- a/api/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.deepcopy.go
+++ b/api/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.deepcopy.go
@@ -61,7 +61,7 @@ func (in *AWSMachineProviderConfig) DeepCopyInto(out *AWSMachineProviderConfig)
}
}
in.Subnet.DeepCopyInto(&out.Subnet)
- out.Placement = in.Placement
+ in.Placement.DeepCopyInto(&out.Placement)
if in.LoadBalancers != nil {
in, out := &in.LoadBalancers, &out.LoadBalancers
*out = make([]LoadBalancerReference, len(*in))
@@ -85,11 +85,6 @@ func (in *AWSMachineProviderConfig) DeepCopyInto(out *AWSMachineProviderConfig)
*out = new(int32)
**out = **in
}
- if in.HostPlacement != nil {
- in, out := &in.HostPlacement, &out.HostPlacement
- *out = new(HostPlacement)
- (*in).DeepCopyInto(*out)
- }
return
}
@@ -157,6 +152,11 @@ func (in *AWSMachineProviderStatus) DeepCopyInto(out *AWSMachineProviderStatus)
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
+ if in.DedicatedHost != nil {
+ in, out := &in.DedicatedHost, &out.DedicatedHost
+ *out = new(DedicatedHostStatus)
+ **out = **in
+ }
return
}
@@ -517,6 +517,16 @@ func (in *DataDiskManagedDiskParameters) DeepCopy() *DataDiskManagedDiskParamete
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DedicatedHost) DeepCopyInto(out *DedicatedHost) {
*out = *in
+ if in.AllocationStrategy != nil {
+ in, out := &in.AllocationStrategy, &out.AllocationStrategy
+ *out = new(AllocationStrategy)
+ **out = **in
+ }
+ if in.DynamicHostAllocation != nil {
+ in, out := &in.DynamicHostAllocation, &out.DynamicHostAllocation
+ *out = new(DynamicHostAllocationSpec)
+ (*in).DeepCopyInto(*out)
+ }
return
}
@@ -530,6 +540,22 @@ func (in *DedicatedHost) DeepCopy() *DedicatedHost {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *DedicatedHostStatus) DeepCopyInto(out *DedicatedHostStatus) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DedicatedHostStatus.
+func (in *DedicatedHostStatus) DeepCopy() *DedicatedHostStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(DedicatedHostStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DiskEncryptionSetParameters) DeepCopyInto(out *DiskEncryptionSetParameters) {
*out = *in
@@ -562,6 +588,31 @@ func (in *DiskSettings) DeepCopy() *DiskSettings {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *DynamicHostAllocationSpec) DeepCopyInto(out *DynamicHostAllocationSpec) {
+ *out = *in
+ if in.Tags != nil {
+ in, out := &in.Tags, &out.Tags
+ *out = new([]TagSpecification)
+ if **in != nil {
+ in, out := *in, *out
+ *out = make([]TagSpecification, len(*in))
+ copy(*out, *in)
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicHostAllocationSpec.
+func (in *DynamicHostAllocationSpec) DeepCopy() *DynamicHostAllocationSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(DynamicHostAllocationSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EBSBlockDeviceSpec) DeepCopyInto(out *EBSBlockDeviceSpec) {
*out = *in
@@ -940,7 +991,7 @@ func (in *HostPlacement) DeepCopyInto(out *HostPlacement) {
if in.DedicatedHost != nil {
in, out := &in.DedicatedHost, &out.DedicatedHost
*out = new(DedicatedHost)
- **out = **in
+ (*in).DeepCopyInto(*out)
}
return
}
@@ -1634,6 +1685,11 @@ func (in *ObjectMeta) DeepCopy() *ObjectMeta {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Placement) DeepCopyInto(out *Placement) {
*out = *in
+ if in.Host != nil {
+ in, out := &in.Host, &out.Host
+ *out = new(HostPlacement)
+ (*in).DeepCopyInto(*out)
+ }
return
}
diff --git a/api/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.swagger_doc_generated.go b/api/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.swagger_doc_generated.go
index f03e5cc4ef80..2c4a9030cc9c 100644
--- a/api/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.swagger_doc_generated.go
+++ b/api/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.swagger_doc_generated.go
@@ -35,7 +35,6 @@ var map_AWSMachineProviderConfig = map[string]string{
"placementGroupPartition": "placementGroupPartition is the partition number within the placement group in which to launch the instance. This must be an integer value between 1 and 7. It is only valid if the placement group, referred in `PlacementGroupName` was created with strategy set to partition.",
"capacityReservationId": "capacityReservationId specifies the target Capacity Reservation into which the instance should be launched. The field size should be greater than 0 and the field input must start with cr-***",
"marketType": "marketType specifies the type of market for the EC2 instance. Valid values are OnDemand, Spot, CapacityBlock and omitted.\n\nDefaults to OnDemand. When SpotMarketOptions is provided, the marketType defaults to \"Spot\".\n\nWhen set to OnDemand the instance runs as a standard OnDemand instance. When set to Spot the instance runs as a Spot instance. When set to CapacityBlock the instance utilizes pre-purchased compute capacity (capacity blocks) with AWS Capacity Reservations. If this value is selected, capacityReservationID must be specified to identify the target reservation.",
- "hostPlacement": "hostPlacement configures placement on AWS Dedicated Hosts. This allows admins to assign instances to specific host for a variety of needs including for regulatory compliance, to leverage existing per-socket or per-core software licenses (BYOL), and to gain visibility and control over instance placement on a physical server. When omitted, the instance is not constrained to a dedicated host.",
}
func (AWSMachineProviderConfig) SwaggerDoc() map[string]string {
@@ -55,6 +54,7 @@ var map_AWSMachineProviderStatus = map[string]string{
"instanceId": "instanceId is the instance ID of the machine created in AWS",
"instanceState": "instanceState is the state of the AWS instance for this machine",
"conditions": "conditions is a set of conditions associated with the Machine to indicate errors or other status",
+ "dedicatedHost": "dedicatedHost tracks the dynamically allocated dedicated host. This field is populated when allocationStrategy is Dynamic (with or without DynamicHostAllocation). When omitted, this indicates that the dedicated host has not yet been allocated, or allocation is in progress.",
}
func (AWSMachineProviderStatus) SwaggerDoc() map[string]string {
@@ -94,14 +94,34 @@ func (CPUOptions) SwaggerDoc() map[string]string {
}
var map_DedicatedHost = map[string]string{
- "": "DedicatedHost represents the configuration for the usage of dedicated host.",
- "id": "id identifies the AWS Dedicated Host on which the instance must run. The value must start with \"h-\" followed by 17 lowercase hexadecimal characters (0-9 and a-f). Must be exactly 19 characters in length.",
+ "": "DedicatedHost represents the configuration for the usage of dedicated host.",
+ "allocationStrategy": "allocationStrategy specifies if the dedicated host will be provided by the admin through the id field or if the host will be dynamically allocated. Valid values are UserProvided and Dynamic. When omitted, the value defaults to \"UserProvided\", which requires the id field to be set. When allocationStrategy is set to UserProvided, an ID of the dedicated host to assign must be provided. When allocationStrategy is set to Dynamic, a dedicated host will be allocated and used to assign instances. When allocationStrategy is set to Dynamic, and dynamicHostAllocation is configured, a dedicated host will be allocated and the tags in dynamicHostAllocation will be assigned to that host.",
+ "id": "id identifies the AWS Dedicated Host on which the instance must run. The value must start with \"h-\" followed by either 8 or 17 lowercase hexadecimal characters (0-9 and a-f). The use of 8 lowercase hexadecimal characters is for older legacy hosts that may not have been migrated to newer format. Must be either 10 or 19 characters in length. This field is required when allocationStrategy is UserProvided, and forbidden otherwise. When omitted with allocationStrategy set to Dynamic, the platform will dynamically allocate a dedicated host.",
+ "dynamicHostAllocation": "dynamicHostAllocation specifies tags to apply to a dynamically allocated dedicated host. This field is only allowed when allocationStrategy is Dynamic, and is mutually exclusive with id. When specified, a dedicated host will be allocated with the provided tags applied. When omitted (and allocationStrategy is Dynamic), a dedicated host will be allocated without any additional tags.",
}
func (DedicatedHost) SwaggerDoc() map[string]string {
return map_DedicatedHost
}
+var map_DedicatedHostStatus = map[string]string{
+ "": "DedicatedHostStatus defines the observed state of a dynamically allocated dedicated host associated with an AWSMachine. This struct is used to track the ID of the dedicated host.",
+ "id": "id tracks the dynamically allocated dedicated host ID. This field is populated when allocationStrategy is Dynamic (with or without DynamicHostAllocation). The value must start with \"h-\" followed by either 8 or 17 lowercase hexadecimal characters (0-9 and a-f). The use of 8 lowercase hexadecimal characters is for older legacy hosts that may not have been migrated to newer format. Must be either 10 or 19 characters in length.",
+}
+
+func (DedicatedHostStatus) SwaggerDoc() map[string]string {
+ return map_DedicatedHostStatus
+}
+
+var map_DynamicHostAllocationSpec = map[string]string{
+ "": "DynamicHostAllocationSpec defines the configuration for dynamic dedicated host allocation. This specification always allocates exactly one dedicated host per machine. At least one property must be specified when this struct is used. Currently only Tags are available for configuring, but in the future more configs may become available.",
+ "tags": "tags specifies a set of key-value pairs to apply to the allocated dedicated host. When omitted, no additional user-defined tags will be applied to the allocated host. A maximum of 50 tags can be specified.",
+}
+
+func (DynamicHostAllocationSpec) SwaggerDoc() map[string]string {
+ return map_DynamicHostAllocationSpec
+}
+
var map_EBSBlockDeviceSpec = map[string]string{
"": "EBSBlockDeviceSpec describes a block device for an EBS volume. https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EbsBlockDevice",
"deleteOnTermination": "Indicates whether the EBS volume is deleted on machine termination.\n\nDeprecated: setting this field has no effect.",
@@ -129,8 +149,8 @@ func (Filter) SwaggerDoc() map[string]string {
var map_HostPlacement = map[string]string{
"": "HostPlacement is the type that will be used to configure the placement of AWS instances.",
- "affinity": "affinity specifies the affinity setting for the instance. Allowed values are AnyAvailable and DedicatedHost. When Affinity is set to DedicatedHost, an instance started onto a specific host always restarts on the same host if stopped. In this scenario, the `dedicatedHost` field must be set. When Affinity is set to AnyAvailable, and you stop and restart the instance, it can be restarted on any available host.",
- "dedicatedHost": "dedicatedHost specifies the exact host that an instance should be restarted on if stopped. dedicatedHost is required when 'affinity' is set to DedicatedHost, and forbidden otherwise.",
+ "affinity": "affinity specifies the affinity setting for the instance. Allowed values are AnyAvailable and DedicatedHost. When Affinity is set to DedicatedHost, an instance started onto a specific host always restarts on the same host if stopped. In this scenario, the `dedicatedHost` field must be set. When Affinity is set to AnyAvailable, and you stop and restart the instance, it can be restarted on any available host. When Affinity is set to AnyAvailable and the `dedicatedHost` field is defined, it runs on specified Dedicated Host, but may move if stopped.",
+ "dedicatedHost": "dedicatedHost specifies the exact host that an instance should be restarted on if stopped. dedicatedHost is required when 'affinity' is set to DedicatedHost, and optional otherwise.",
}
func (HostPlacement) SwaggerDoc() map[string]string {
@@ -158,7 +178,8 @@ var map_Placement = map[string]string{
"": "Placement indicates where to create the instance in AWS",
"region": "region is the region to use to create the instance",
"availabilityZone": "availabilityZone is the availability zone of the instance",
- "tenancy": "tenancy indicates if instance should run on shared or single-tenant hardware. There are supported 3 options: default, dedicated and host.",
+ "tenancy": "tenancy indicates if instance should run on shared or single-tenant hardware. There are supported 3 options: default, dedicated and host. When set to default Runs on shared multi-tenant hardware. When dedicated Runs on single-tenant hardware (any dedicated instance hardware). When host and the host object is not provided: Runs on Dedicated Host; best-effort restart on same host. When `host` and `host` object is provided with affinity `dedicatedHost` defined: Runs on specified Dedicated Host.",
+ "host": "host configures placement on AWS Dedicated Hosts. This allows admins to assign instances to specific host for a variety of needs including for regulatory compliance, to leverage existing per-socket or per-core software licenses (BYOL), and to gain visibility and control over instance placement on a physical server. When omitted, the instance is not constrained to a dedicated host.",
}
func (Placement) SwaggerDoc() map[string]string {
@@ -176,8 +197,8 @@ func (SpotMarketOptions) SwaggerDoc() map[string]string {
var map_TagSpecification = map[string]string{
"": "TagSpecification is the name/value pair for a tag",
- "name": "name of the tag",
- "value": "value of the tag",
+ "name": "name of the tag. This field is required and must be a non-empty string. Must be between 1 and 128 characters in length.",
+ "value": "value of the tag. When omitted, this creates a tag with an empty string as the value.",
}
func (TagSpecification) SwaggerDoc() map[string]string {
@@ -626,6 +647,7 @@ var map_MachineStatus = map[string]string{
"phase": "phase represents the current phase of machine actuation. One of: Failed, Provisioning, Provisioned, Running, Deleting",
"conditions": "conditions defines the current state of the Machine",
"authoritativeAPI": "authoritativeAPI is the API that is authoritative for this resource. Valid values are MachineAPI, ClusterAPI and Migrating. This value is updated by the migration controller to reflect the authoritative API. Machine API and Cluster API controllers use this value to determine whether or not to reconcile the resource. When set to Migrating, the migration controller is currently performing the handover of authority from one API to the other.",
+ "synchronizedAPI": "synchronizedAPI holds the last stable value of authoritativeAPI. It is used to detect migration cancellation requests and to restore the resource to its previous state. Valid values are \"MachineAPI\" and \"ClusterAPI\". When omitted, the resource has not yet been reconciled by the migration controller.",
"synchronizedGeneration": "synchronizedGeneration is the generation of the authoritative resource that the non-authoritative resource is synchronised with. This field is set when the authoritative resource is updated and the sync controller has updated the non-authoritative resource to match.",
}
@@ -729,6 +751,7 @@ var map_MachineSetStatus = map[string]string{
"errorReason": "In the event that there is a terminal problem reconciling the replicas, both ErrorReason and ErrorMessage will be set. ErrorReason will be populated with a succinct value suitable for machine interpretation, while ErrorMessage will contain a more verbose string suitable for logging and human consumption.\n\nThese fields should not be set for transitive errors that a controller faces that are expected to be fixed automatically over time (like service outages), but instead indicate that something is fundamentally wrong with the MachineTemplate's spec or the configuration of the machine controller, and that manual intervention is required. Examples of terminal errors would be invalid combinations of settings in the spec, values that are unsupported by the machine controller, or the responsible machine controller itself being critically misconfigured.\n\nAny transient errors that occur during the reconciliation of Machines can be added as events to the MachineSet object and/or logged in the controller's output.",
"conditions": "conditions defines the current state of the MachineSet",
"authoritativeAPI": "authoritativeAPI is the API that is authoritative for this resource. Valid values are MachineAPI, ClusterAPI and Migrating. This value is updated by the migration controller to reflect the authoritative API. Machine API and Cluster API controllers use this value to determine whether or not to reconcile the resource. When set to Migrating, the migration controller is currently performing the handover of authority from one API to the other.",
+ "synchronizedAPI": "synchronizedAPI holds the last stable value of authoritativeAPI. It is used to detect migration cancellation requests and to restore the resource to its previous state. Valid values are \"MachineAPI\" and \"ClusterAPI\". When omitted, the resource has not yet been reconciled by the migration controller.",
"synchronizedGeneration": "synchronizedGeneration is the generation of the authoritative resource that the non-authoritative resource is synchronised with. This field is set when the authoritative resource is updated and the sync controller has updated the non-authoritative resource to match.",
}
diff --git a/api/vendor/github.com/openshift/api/operator/v1/types_console.go b/api/vendor/github.com/openshift/api/operator/v1/types_console.go
index e030a65c8601..35795b2b71b8 100644
--- a/api/vendor/github.com/openshift/api/operator/v1/types_console.go
+++ b/api/vendor/github.com/openshift/api/operator/v1/types_console.go
@@ -107,6 +107,9 @@ const (
// gettingStartedBanner is the name of the 'Getting started resources' banner in the console UI Overview page.
GettingStartedBanner ConsoleCapabilityName = "GettingStartedBanner"
+
+ // guidedTour is the name of the 'Guided Tour' feature in console UI.
+ GuidedTour ConsoleCapabilityName = "GuidedTour"
)
// CapabilityState defines the state of the capability in the console UI.
@@ -134,8 +137,8 @@ type CapabilityVisibility struct {
// Capabilities contains set of UI capabilities and their state in the console UI.
type Capability struct {
// name is the unique name of a capability.
- // Available capabilities are LightspeedButton and GettingStartedBanner.
- // +kubebuilder:validation:Enum:="LightspeedButton";"GettingStartedBanner"
+ // Available capabilities are LightspeedButton, GettingStartedBanner, and GuidedTour.
+ // +kubebuilder:validation:Enum:="LightspeedButton";"GettingStartedBanner";"GuidedTour"
// +required
Name ConsoleCapabilityName `json:"name"`
// visibility defines the visibility state of the capability.
@@ -281,10 +284,10 @@ type ConsoleCustomization struct {
// capabilities defines an array of capabilities that can be interacted with in the console UI.
// Each capability defines a visual state that can be interacted with the console to render in the UI.
- // Available capabilities are LightspeedButton and GettingStartedBanner.
+ // Available capabilities are LightspeedButton, GettingStartedBanner, and GuidedTour.
// Each of the available capabilities may appear only once in the list.
// +kubebuilder:validation:MinItems=1
- // +kubebuilder:validation:MaxItems=2
+ // +kubebuilder:validation:MaxItems=3
// +listType=map
// +listMapKey=name
// +optional
diff --git a/api/vendor/github.com/openshift/api/operator/v1/types_machineconfiguration.go b/api/vendor/github.com/openshift/api/operator/v1/types_machineconfiguration.go
index c6bcd22bc0fc..f0c1e01c785c 100644
--- a/api/vendor/github.com/openshift/api/operator/v1/types_machineconfiguration.go
+++ b/api/vendor/github.com/openshift/api/operator/v1/types_machineconfiguration.go
@@ -18,7 +18,8 @@ import (
// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
// +openshift:compatibility-gen:level=1
// +openshift:validation:FeatureGateAwareXValidation:featureGate=BootImageSkewEnforcement,rule="self.?status.bootImageSkewEnforcementStatus.mode.orValue(\"\") == 'Automatic' ? self.?spec.managedBootImages.hasValue() || self.?status.managedBootImagesStatus.hasValue() : true",message="when skew enforcement is in Automatic mode, a boot image configuration is required"
-// +openshift:validation:FeatureGateAwareXValidation:featureGate=BootImageSkewEnforcement,rule="self.?status.bootImageSkewEnforcementStatus.mode.orValue(\"\") == 'Automatic' ? !(self.?spec.managedBootImages.machineManagers.hasValue()) || self.spec.managedBootImages.machineManagers.exists(m, m.selection.mode == 'All' && m.resource == 'machinesets' && m.apiGroup == 'machine.openshift.io') : true",message="when skew enforcement is in Automatic mode, managedBootImages must contain a MachineManager opting in all MachineAPI MachineSets"
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=BootImageSkewEnforcement,rule="self.?status.bootImageSkewEnforcementStatus.mode.orValue(\"\") == 'Automatic' ? !(self.?spec.managedBootImages.machineManagers.hasValue()) || size(self.spec.managedBootImages.machineManagers) > 0 : true",message="when skew enforcement is in Automatic mode, managedBootImages.machineManagers must not be an empty list"
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=BootImageSkewEnforcement,rule="self.?status.bootImageSkewEnforcementStatus.mode.orValue(\"\") == 'Automatic' ? !(self.?spec.managedBootImages.machineManagers.hasValue()) || !self.spec.managedBootImages.machineManagers.exists(m, m.resource == 'machinesets' && m.apiGroup == 'machine.openshift.io') || self.spec.managedBootImages.machineManagers.exists(m, m.resource == 'machinesets' && m.apiGroup == 'machine.openshift.io' && m.selection.mode == 'All') : true",message="when skew enforcement is in Automatic mode, any MachineAPI MachineSet MachineManager must use selection mode 'All'"
// +openshift:validation:FeatureGateAwareXValidation:featureGate=BootImageSkewEnforcement,rule="self.?status.bootImageSkewEnforcementStatus.mode.orValue(\"\") == 'Automatic' ? !(self.?status.managedBootImagesStatus.machineManagers.hasValue()) || self.status.managedBootImagesStatus.machineManagers.exists(m, m.selection.mode == 'All' && m.resource == 'machinesets' && m.apiGroup == 'machine.openshift.io'): true",message="when skew enforcement is in Automatic mode, managedBootImagesStatus must contain a MachineManager opting in all MachineAPI MachineSets"
type MachineConfiguration struct {
metav1.TypeMeta `json:",inline"`
@@ -46,7 +47,6 @@ type MachineConfigurationSpec struct {
// and the platform is left to choose a reasonable default, which is subject to change over time.
// The default for each machine manager mode is All for GCP and AWS platforms, and None for all
// other platforms.
- // +openshift:enable:FeatureGate=ManagedBootImages
// +optional
ManagedBootImages ManagedBootImages `json:"managedBootImages"`
@@ -287,7 +287,6 @@ type MachineConfigurationStatus struct {
// managedBootImagesStatus reflects what the latest cluster-validated boot image configuration is
// and will be used by Machine Config Controller while performing boot image updates.
- // +openshift:enable:FeatureGate=ManagedBootImages
// +optional
ManagedBootImagesStatus ManagedBootImages `json:"managedBootImagesStatus"`
@@ -366,7 +365,7 @@ type ManagedBootImages struct {
// MachineManager describes a target machine resource that is registered for boot image updates. It stores identifying information
// such as the resource type and the API Group of the resource. It also provides granular control via the selection field.
-// +openshift:validation:FeatureGateAwareXValidation:requiredFeatureGate=ManagedBootImages;ManagedBootImagesCPMS,rule="self.resource != 'controlplanemachinesets' || self.selection.mode == 'All' || self.selection.mode == 'None'", message="Only All or None selection mode is permitted for ControlPlaneMachineSets"
+// +openshift:validation:FeatureGateAwareXValidation:requiredFeatureGate=ManagedBootImagesCPMS,rule="self.resource != 'controlplanemachinesets' || self.selection.mode == 'All' || self.selection.mode == 'None'", message="Only All or None selection mode is permitted for ControlPlaneMachineSets"
type MachineManager struct {
// resource is the machine management resource's type.
// Valid values are machinesets and controlplanemachinesets.
@@ -430,8 +429,8 @@ const (
// MachineManagerManagedResourceType is a string enum used in the MachineManager type to describe the resource
// type to be registered.
-// +openshift:validation:FeatureGateAwareEnum:requiredFeatureGate=ManagedBootImages,enum=machinesets
-// +openshift:validation:FeatureGateAwareEnum:requiredFeatureGate=ManagedBootImages;ManagedBootImagesCPMS,enum=machinesets;controlplanemachinesets
+// +openshift:validation:FeatureGateAwareEnum:featureGate="",enum=machinesets
+// +openshift:validation:FeatureGateAwareEnum:featureGate=ManagedBootImagesCPMS,enum=machinesets;controlplanemachinesets
type MachineManagerMachineSetsResourceType string
const (
diff --git a/api/vendor/github.com/openshift/api/operator/v1/types_network.go b/api/vendor/github.com/openshift/api/operator/v1/types_network.go
index 111240eecff0..cd2e2f9e3819 100644
--- a/api/vendor/github.com/openshift/api/operator/v1/types_network.go
+++ b/api/vendor/github.com/openshift/api/operator/v1/types_network.go
@@ -54,7 +54,7 @@ type NetworkList struct {
// NetworkSpec is the top-level network configuration object.
// +kubebuilder:validation:XValidation:rule="!has(self.defaultNetwork) || !has(self.defaultNetwork.ovnKubernetesConfig) || !has(self.defaultNetwork.ovnKubernetesConfig.gatewayConfig) || !has(self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding) || self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding == oldSelf.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding || self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding == 'Restricted' || self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding == 'Global'",message="invalid value for IPForwarding, valid values are 'Restricted' or 'Global'"
-// +openshift:validation:FeatureGateAwareXValidation:featureGate=RouteAdvertisements,rule="(has(self.additionalRoutingCapabilities) && ('FRR' in self.additionalRoutingCapabilities.providers)) || !has(self.defaultNetwork) || !has(self.defaultNetwork.ovnKubernetesConfig) || !has(self.defaultNetwork.ovnKubernetesConfig.routeAdvertisements) || self.defaultNetwork.ovnKubernetesConfig.routeAdvertisements != 'Enabled'",message="Route advertisements cannot be Enabled if 'FRR' routing capability provider is not available"
+// +kubebuilder:validation:XValidation:rule="(has(self.additionalRoutingCapabilities) && ('FRR' in self.additionalRoutingCapabilities.providers)) || !has(self.defaultNetwork) || !has(self.defaultNetwork.ovnKubernetesConfig) || !has(self.defaultNetwork.ovnKubernetesConfig.routeAdvertisements) || self.defaultNetwork.ovnKubernetesConfig.routeAdvertisements != 'Enabled'",message="Route advertisements cannot be Enabled if 'FRR' routing capability provider is not available"
type NetworkSpec struct {
OperatorSpec `json:",inline"`
@@ -136,7 +136,6 @@ type NetworkSpec struct {
// capabilities acquired through the enablement of these components but may
// require specific configuration on their side to do so; refer to their
// respective documentation and configuration options.
- // +openshift:enable:FeatureGate=AdditionalRoutingCapabilities
// +optional
AdditionalRoutingCapabilities *AdditionalRoutingCapabilities `json:"additionalRoutingCapabilities,omitempty"`
}
@@ -157,7 +156,7 @@ const (
)
// NetworkMigration represents the cluster network migration configuration.
-// +openshift:validation:FeatureGateAwareXValidation:featureGate=NetworkLiveMigration,rule="!has(self.mtu) || !has(self.networkType) || self.networkType == \"\" || has(self.mode) && self.mode == 'Live'",message="networkType migration in mode other than 'Live' may not be configured at the same time as mtu migration"
+// +kubebuilder:validation:XValidation:rule="!has(self.mtu) || !has(self.networkType) || self.networkType == \"\" || has(self.mode) && self.mode == 'Live'",message="networkType migration in mode other than 'Live' may not be configured at the same time as mtu migration"
type NetworkMigration struct {
// mtu contains the MTU migration configuration. Set this to allow changing
// the MTU values for the default network. If unset, the operation of
@@ -399,6 +398,12 @@ type OpenShiftSDNConfig struct {
// ovnKubernetesConfig contains the configuration parameters for networks
// using the ovn-kubernetes network project
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=NoOverlayMode,rule="self.?transport.orValue('') == 'NoOverlay' ? self.?routeAdvertisements.orValue('') == 'Enabled' : true",message="routeAdvertisements must be Enabled when transport is NoOverlay"
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=NoOverlayMode,rule="self.?transport.orValue('') == 'NoOverlay' ? has(self.noOverlayConfig) : !has(self.noOverlayConfig)",message="noOverlayConfig must be set if transport is NoOverlay, and is forbidden otherwise"
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=NoOverlayMode,rule="self.?noOverlayConfig.routing.orValue('') == 'Managed' ? has(self.bgpManagedConfig) : true",message="bgpManagedConfig is required when noOverlayConfig.routing is Managed"
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=NoOverlayMode,rule="!has(self.transport) || self.transport == 'Geneve' || has(oldSelf.transport)",message="transport can only be set to Geneve after installation"
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=NoOverlayMode,rule="!has(oldSelf.transport) || has(self.transport)",message="transport may not be removed once set"
+// +openshift:validation:FeatureGateAwareXValidation:featureGate=NoOverlayMode,rule="!has(oldSelf.noOverlayConfig) || has(self.noOverlayConfig)",message="noOverlayConfig may not be removed once set"
type OVNKubernetesConfig struct {
// mtu is the MTU to use for the tunnel interface. This must be 100
// bytes smaller than the uplink mtu.
@@ -465,9 +470,40 @@ type OVNKubernetesConfig struct {
// means the user has no opinion and the platform is left to choose
// reasonable defaults. These defaults are subject to change over time. The
// current default is "Disabled".
- // +openshift:enable:FeatureGate=RouteAdvertisements
// +optional
RouteAdvertisements RouteAdvertisementsEnablement `json:"routeAdvertisements,omitempty"`
+
+ // transport sets the transport mode for pods on the default network.
+ // Allowed values are "NoOverlay" and "Geneve".
+ // "NoOverlay" avoids tunnel encapsulation, routing pod traffic directly between nodes.
+ // "Geneve" encapsulates pod traffic using Geneve tunnels between nodes.
+ // When omitted, this means the user has no opinion and the platform chooses
+ // a reasonable default which is subject to change over time.
+ // The current default is "Geneve".
+ // "NoOverlay" can only be set at installation time and cannot be changed afterwards.
+ // "Geneve" may be set explicitly at any time to lock in the current default.
+ // +openshift:enable:FeatureGate=NoOverlayMode
+ // +kubebuilder:validation:Enum=NoOverlay;Geneve
+ // +openshift:validation:FeatureGateAwareXValidation:featureGate=NoOverlayMode,rule="self == oldSelf",message="transport is immutable once set"
+ // +optional
+ Transport TransportOption `json:"transport,omitempty"`
+
+ // noOverlayConfig contains configuration for no-overlay mode.
+ // This configuration applies to the default network only.
+ // It is required when transport is "NoOverlay".
+ // When omitted, this means the user does not configure no-overlay mode options.
+ // +openshift:enable:FeatureGate=NoOverlayMode
+ // +optional
+ NoOverlayConfig NoOverlayConfig `json:"noOverlayConfig,omitzero,omitempty"`
+
+ // bgpManagedConfig configures the BGP properties for networks (default network or CUDNs)
+ // in no-overlay mode that specify routing="Managed" in their noOverlayConfig.
+ // It is required when noOverlayConfig.routing is set to "Managed".
+ // When omitted, this means the user does not configure BGP for managed routing.
+ // This field can be set at installation time or on day 2, and can be modified at any time.
+ // +openshift:enable:FeatureGate=NoOverlayMode
+ // +optional
+ BGPManagedConfig BGPManagedConfig `json:"bgpManagedConfig,omitzero,omitempty"`
}
type IPv4OVNKubernetesConfig struct {
@@ -898,3 +934,80 @@ type AdditionalRoutingCapabilities struct {
// +kubebuilder:validation:XValidation:rule="self.all(x, self.exists_one(y, x == y))"
Providers []RoutingCapabilitiesProvider `json:"providers"`
}
+
+// TransportOption is the type for network transport options
+type TransportOption string
+
+// SNATOption is the type for SNAT configuration options
+type SNATOption string
+
+// RoutingOption is the type for routing configuration options
+type RoutingOption string
+
+// BGPTopology is the type for BGP topology configuration
+type BGPTopology string
+
+const (
+ // TransportOptionNoOverlay indicates the network operates in no-overlay mode
+ TransportOptionNoOverlay TransportOption = "NoOverlay"
+ // TransportOptionGeneve indicates the network uses Geneve overlay
+ TransportOptionGeneve TransportOption = "Geneve"
+
+ // SNATEnabled indicates outbound SNAT is enabled
+ SNATEnabled SNATOption = "Enabled"
+ // SNATDisabled indicates outbound SNAT is disabled
+ SNATDisabled SNATOption = "Disabled"
+
+ // RoutingManaged indicates routing is managed by OVN-Kubernetes
+ RoutingManaged RoutingOption = "Managed"
+ // RoutingUnmanaged indicates routing is managed by users
+ RoutingUnmanaged RoutingOption = "Unmanaged"
+
+ // BGPTopologyFullMesh indicates a full mesh BGP topology where every node peers directly with every other node
+ BGPTopologyFullMesh BGPTopology = "FullMesh"
+)
+
+// NoOverlayConfig contains configuration options for networks operating in no-overlay mode.
+type NoOverlayConfig struct {
+ // outboundSNAT defines the SNAT behavior for outbound traffic from pods.
+ // Allowed values are "Enabled" and "Disabled".
+ // When set to "Enabled", SNAT is performed on outbound traffic from pods.
+ // When set to "Disabled", SNAT is not performed and pod IPs are preserved in outbound traffic.
+ // This field is required when the network operates in no-overlay mode.
+ // This field can be set to any value at installation time and can be changed afterwards.
+ // +kubebuilder:validation:Enum=Enabled;Disabled
+ // +required
+ OutboundSNAT SNATOption `json:"outboundSNAT,omitempty"`
+
+ // routing specifies whether the pod network routing is managed by OVN-Kubernetes or users.
+ // Allowed values are "Managed" and "Unmanaged".
+ // When set to "Managed", OVN-Kubernetes manages the pod network routing configuration through BGP.
+ // When set to "Unmanaged", users are responsible for configuring the pod network routing.
+ // This field is required when the network operates in no-overlay mode.
+ // This field is immutable once set.
+ // +kubebuilder:validation:Enum=Managed;Unmanaged
+ // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="routing is immutable once set"
+ // +required
+ Routing RoutingOption `json:"routing,omitempty"`
+}
+
+// BGPManagedConfig contains configuration options for BGP when routing is "Managed".
+type BGPManagedConfig struct {
+ // asNumber is the 2-byte or 4-byte Autonomous System Number (ASN)
+ // to be used in the generated FRR configuration.
+ // Valid values are 1 to 4294967295.
+ // When omitted, this defaults to 64512.
+ // +kubebuilder:validation:Minimum=1
+ // +kubebuilder:validation:Maximum=4294967295
+ // +default=64512
+ // +optional
+ ASNumber int64 `json:"asNumber,omitempty"`
+
+ // bgpTopology defines the BGP topology to be used.
+ // Allowed values are "FullMesh".
+ // When set to "FullMesh", every node peers directly with every other node via BGP.
+ // This field is required when BGPManagedConfig is specified.
+ // +kubebuilder:validation:Enum=FullMesh
+ // +required
+ BGPTopology BGPTopology `json:"bgpTopology,omitempty"`
+}
diff --git a/api/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go b/api/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go
index 3bc6b81de467..3d3c8f4f8250 100644
--- a/api/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go
+++ b/api/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go
@@ -390,6 +390,22 @@ func (in *AzureDiskEncryptionSet) DeepCopy() *AzureDiskEncryptionSet {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *BGPManagedConfig) DeepCopyInto(out *BGPManagedConfig) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BGPManagedConfig.
+func (in *BGPManagedConfig) DeepCopy() *BGPManagedConfig {
+ if in == nil {
+ return nil
+ }
+ out := new(BGPManagedConfig)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *BootImageSkewEnforcementConfig) DeepCopyInto(out *BootImageSkewEnforcementConfig) {
*out = *in
@@ -3665,6 +3681,22 @@ func (in *NetworkStatus) DeepCopy() *NetworkStatus {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *NoOverlayConfig) DeepCopyInto(out *NoOverlayConfig) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NoOverlayConfig.
+func (in *NoOverlayConfig) DeepCopy() *NoOverlayConfig {
+ if in == nil {
+ return nil
+ }
+ out := new(NoOverlayConfig)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NodeDisruptionPolicyClusterStatus) DeepCopyInto(out *NodeDisruptionPolicyClusterStatus) {
*out = *in
@@ -4158,6 +4190,8 @@ func (in *OVNKubernetesConfig) DeepCopyInto(out *OVNKubernetesConfig) {
*out = new(IPv6OVNKubernetesConfig)
**out = **in
}
+ out.NoOverlayConfig = in.NoOverlayConfig
+ out.BGPManagedConfig = in.BGPManagedConfig
return
}
diff --git a/api/vendor/github.com/openshift/api/operator/v1/zz_generated.featuregated-crd-manifests.yaml b/api/vendor/github.com/openshift/api/operator/v1/zz_generated.featuregated-crd-manifests.yaml
index e7c94e286946..53cf23ade1f0 100644
--- a/api/vendor/github.com/openshift/api/operator/v1/zz_generated.featuregated-crd-manifests.yaml
+++ b/api/vendor/github.com/openshift/api/operator/v1/zz_generated.featuregated-crd-manifests.yaml
@@ -305,8 +305,7 @@ machineconfigurations.operator.openshift.io:
FeatureGates:
- BootImageSkewEnforcement
- IrreconcilableMachineConfig
- - ManagedBootImages
- - ManagedBootImages+ManagedBootImagesCPMS
+ - ManagedBootImagesCPMS
FilenameOperatorName: machine-config
FilenameOperatorOrdering: "01"
FilenameRunLevel: "0000_80"
@@ -328,9 +327,7 @@ networks.operator.openshift.io:
Capability: ""
Category: ""
FeatureGates:
- - AdditionalRoutingCapabilities
- - NetworkLiveMigration
- - RouteAdvertisements
+ - NoOverlayMode
FilenameOperatorName: network
FilenameOperatorOrdering: "01"
FilenameRunLevel: "0000_70"
diff --git a/api/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go b/api/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go
index 06096a6c81e2..e35d997a763f 100644
--- a/api/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go
+++ b/api/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go
@@ -210,7 +210,7 @@ func (AddPage) SwaggerDoc() map[string]string {
var map_Capability = map[string]string{
"": "Capabilities contains set of UI capabilities and their state in the console UI.",
- "name": "name is the unique name of a capability. Available capabilities are LightspeedButton and GettingStartedBanner.",
+ "name": "name is the unique name of a capability. Available capabilities are LightspeedButton, GettingStartedBanner, and GuidedTour.",
"visibility": "visibility defines the visibility state of the capability.",
}
@@ -259,7 +259,7 @@ func (ConsoleConfigRoute) SwaggerDoc() map[string]string {
var map_ConsoleCustomization = map[string]string{
"": "ConsoleCustomization defines a list of optional configuration for the console UI. Ensure that Logos and CustomLogoFile cannot be set at the same time.",
"logos": "logos is used to replace the OpenShift Masthead and Favicon logos in the console UI with custom logos. logos is an optional field that allows a list of logos. Only one of logos or customLogoFile can be set at a time. If logos is set, customLogoFile must be unset. When specified, there must be at least one entry and no more than 2 entries. Each type must appear only once in the list.",
- "capabilities": "capabilities defines an array of capabilities that can be interacted with in the console UI. Each capability defines a visual state that can be interacted with the console to render in the UI. Available capabilities are LightspeedButton and GettingStartedBanner. Each of the available capabilities may appear only once in the list.",
+ "capabilities": "capabilities defines an array of capabilities that can be interacted with in the console UI. Each capability defines a visual state that can be interacted with the console to render in the UI. Available capabilities are LightspeedButton, GettingStartedBanner, and GuidedTour. Each of the available capabilities may appear only once in the list.",
"brand": "brand is the default branding of the web console which can be overridden by providing the brand field. There is a limited set of specific brand options. This field controls elements of the console such as the logo. Invalid value will prevent a console rollout.",
"documentationBaseURL": "documentationBaseURL links to external documentation are shown in various sections of the web console. Providing documentationBaseURL will override the default documentation URL. Invalid value will prevent a console rollout.",
"customProductName": "customProductName is the name that will be displayed in page titles, logo alt text, and the about dialog instead of the normal OpenShift product name.",
@@ -1669,6 +1669,16 @@ func (AdditionalRoutingCapabilities) SwaggerDoc() map[string]string {
return map_AdditionalRoutingCapabilities
}
+var map_BGPManagedConfig = map[string]string{
+ "": "BGPManagedConfig contains configuration options for BGP when routing is \"Managed\".",
+ "asNumber": "asNumber is the 2-byte or 4-byte Autonomous System Number (ASN) to be used in the generated FRR configuration. Valid values are 1 to 4294967295. When omitted, this defaults to 64512.",
+ "bgpTopology": "bgpTopology defines the BGP topology to be used. Allowed values are \"FullMesh\". When set to \"FullMesh\", every node peers directly with every other node via BGP. This field is required when BGPManagedConfig is specified.",
+}
+
+func (BGPManagedConfig) SwaggerDoc() map[string]string {
+ return map_BGPManagedConfig
+}
+
var map_ClusterNetworkEntry = map[string]string{
"": "ClusterNetworkEntry is a subnet from which to allocate PodIPs. A network of size HostPrefix (in CIDR notation) will be allocated when nodes join the cluster. If the HostPrefix field is not used by the plugin, it can be left unset. Not all network providers support multiple ClusterNetworks",
}
@@ -1896,6 +1906,16 @@ func (NetworkStatus) SwaggerDoc() map[string]string {
return map_NetworkStatus
}
+var map_NoOverlayConfig = map[string]string{
+ "": "NoOverlayConfig contains configuration options for networks operating in no-overlay mode.",
+ "outboundSNAT": "outboundSNAT defines the SNAT behavior for outbound traffic from pods. Allowed values are \"Enabled\" and \"Disabled\". When set to \"Enabled\", SNAT is performed on outbound traffic from pods. When set to \"Disabled\", SNAT is not performed and pod IPs are preserved in outbound traffic. This field is required when the network operates in no-overlay mode. This field can be set to any value at installation time and can be changed afterwards.",
+ "routing": "routing specifies whether the pod network routing is managed by OVN-Kubernetes or users. Allowed values are \"Managed\" and \"Unmanaged\". When set to \"Managed\", OVN-Kubernetes manages the pod network routing configuration through BGP. When set to \"Unmanaged\", users are responsible for configuring the pod network routing. This field is required when the network operates in no-overlay mode. This field is immutable once set.",
+}
+
+func (NoOverlayConfig) SwaggerDoc() map[string]string {
+ return map_NoOverlayConfig
+}
+
var map_OVNKubernetesConfig = map[string]string{
"": "ovnKubernetesConfig contains the configuration parameters for networks using the ovn-kubernetes network project",
"mtu": "mtu is the MTU to use for the tunnel interface. This must be 100 bytes smaller than the uplink mtu. Default is 1400",
@@ -1910,6 +1930,9 @@ var map_OVNKubernetesConfig = map[string]string{
"ipv4": "ipv4 allows users to configure IP settings for IPv4 connections. When ommitted, this means no opinions and the default configuration is used. Check individual fields within ipv4 for details of default values.",
"ipv6": "ipv6 allows users to configure IP settings for IPv6 connections. When ommitted, this means no opinions and the default configuration is used. Check individual fields within ipv4 for details of default values.",
"routeAdvertisements": "routeAdvertisements determines if the functionality to advertise cluster network routes through a dynamic routing protocol, such as BGP, is enabled or not. This functionality is configured through the ovn-kubernetes RouteAdvertisements CRD. Requires the 'FRR' routing capability provider to be enabled as an additional routing capability. Allowed values are \"Enabled\", \"Disabled\" and ommited. When omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. The current default is \"Disabled\".",
+ "transport": "transport sets the transport mode for pods on the default network. Allowed values are \"NoOverlay\" and \"Geneve\". \"NoOverlay\" avoids tunnel encapsulation, routing pod traffic directly between nodes. \"Geneve\" encapsulates pod traffic using Geneve tunnels between nodes. When omitted, this means the user has no opinion and the platform chooses a reasonable default which is subject to change over time. The current default is \"Geneve\". \"NoOverlay\" can only be set at installation time and cannot be changed afterwards. \"Geneve\" may be set explicitly at any time to lock in the current default.",
+ "noOverlayConfig": "noOverlayConfig contains configuration for no-overlay mode. This configuration applies to the default network only. It is required when transport is \"NoOverlay\". When omitted, this means the user does not configure no-overlay mode options.",
+ "bgpManagedConfig": "bgpManagedConfig configures the BGP properties for networks (default network or CUDNs) in no-overlay mode that specify routing=\"Managed\" in their noOverlayConfig. It is required when noOverlayConfig.routing is set to \"Managed\". When omitted, this means the user does not configure BGP for managed routing. This field can be set at installation time or on day 2, and can be modified at any time.",
}
func (OVNKubernetesConfig) SwaggerDoc() map[string]string {
diff --git a/api/vendor/github.com/openshift/hive/apis/hive/v1/clusterdeprovision_types.go b/api/vendor/github.com/openshift/hive/apis/hive/v1/clusterdeprovision_types.go
index 8519b549b591..427990b9804a 100644
--- a/api/vendor/github.com/openshift/hive/apis/hive/v1/clusterdeprovision_types.go
+++ b/api/vendor/github.com/openshift/hive/apis/hive/v1/clusterdeprovision_types.go
@@ -132,8 +132,13 @@ type VSphereClusterDeprovision struct {
// CertificatesSecretRef refers to a secret that contains the vSphere CA certificates
// necessary for communicating with the VCenter.
CertificatesSecretRef corev1.LocalObjectReference `json:"certificatesSecretRef"`
- // VCenter is the vSphere vCenter hostname.
- VCenter string `json:"vCenter"`
+ // DeprecatedVCenter is the vSphere vCenter hostname.
+ // Deprecated: use VCenters instead.
+ // +optional
+ DeprecatedVCenter string `json:"vCenter,omitempty"`
+ // VCenters are potentially multiple vCenter hostnames. Prefer this field over VCenter.
+ // +optional
+ VCenters []string `json:"vCenters,omitempty"`
}
// IBMClusterDeprovision contains IBM Cloud specific configuration for a ClusterDeprovision
diff --git a/api/vendor/github.com/openshift/hive/apis/hive/v1/clusterpool_types.go b/api/vendor/github.com/openshift/hive/apis/hive/v1/clusterpool_types.go
index eca37072a759..c762421ec21e 100644
--- a/api/vendor/github.com/openshift/hive/apis/hive/v1/clusterpool_types.go
+++ b/api/vendor/github.com/openshift/hive/apis/hive/v1/clusterpool_types.go
@@ -91,7 +91,7 @@ type ClusterPoolSpec struct {
// HibernationConfig configures the hibernation/resume behavior of ClusterDeployments owned by the ClusterPool.
// +optional
- HibernationConfig *HibernationConfig `json:"hibernationConfig"`
+ HibernationConfig *HibernationConfig `json:"hibernationConfig,omitempty"`
// Inventory maintains a list of entries consumed by the ClusterPool
// to customize the default ClusterDeployment.
diff --git a/api/vendor/github.com/openshift/hive/apis/hive/v1/vsphere/machinepools.go b/api/vendor/github.com/openshift/hive/apis/hive/v1/vsphere/machinepools.go
index e08c4fab7139..0e0f894f6a52 100644
--- a/api/vendor/github.com/openshift/hive/apis/hive/v1/vsphere/machinepools.go
+++ b/api/vendor/github.com/openshift/hive/apis/hive/v1/vsphere/machinepools.go
@@ -1,33 +1,18 @@
package vsphere
+import "github.com/openshift/installer/pkg/types/vsphere"
+
// MachinePool stores the configuration for a machine pool installed
// on vSphere.
type MachinePool struct {
+ vsphere.MachinePool `json:",inline"`
+
// ResourcePool is the name of the resource pool that will be used for virtual machines.
// If it is not present, a default value will be used.
// +optional
ResourcePool string `json:"resourcePool,omitempty"`
- // NumCPUs is the total number of virtual processor cores to assign a vm.
- NumCPUs int32 `json:"cpus"`
-
- // NumCoresPerSocket is the number of cores per socket in a vm. The number
- // of vCPUs on the vm will be NumCPUs/NumCoresPerSocket.
- NumCoresPerSocket int32 `json:"coresPerSocket"`
-
- // Memory is the size of a VM's memory in MB.
- MemoryMiB int64 `json:"memoryMB"`
-
- // OSDisk defines the storage for instance.
- OSDisk `json:"osDisk"`
-
// TagIDs is a list of up to 10 tags to add to the VMs that this machine set provisions in vSphere.
// +kubebuilder:validation:MaxItems:=10
TagIDs []string `json:"tagIDs,omitempty"`
}
-
-// OSDisk defines the disk for a virtual machine.
-type OSDisk struct {
- // DiskSizeGB defines the size of disk in GB.
- DiskSizeGB int32 `json:"diskSizeGB"`
-}
diff --git a/api/vendor/github.com/openshift/hive/apis/hive/v1/vsphere/platform.go b/api/vendor/github.com/openshift/hive/apis/hive/v1/vsphere/platform.go
index 62f1f84372d6..a1d7c237339b 100644
--- a/api/vendor/github.com/openshift/hive/apis/hive/v1/vsphere/platform.go
+++ b/api/vendor/github.com/openshift/hive/apis/hive/v1/vsphere/platform.go
@@ -1,13 +1,20 @@
package vsphere
import (
+ "github.com/openshift/installer/pkg/types/vsphere"
corev1 "k8s.io/api/core/v1"
)
// Platform stores any global configuration used for vSphere platforms.
type Platform struct {
+ // Infrastructure is the desired state of the vSphere infrastructure provider.
+ Infrastructure *vsphere.Platform `json:"infrastructure,omitempty"`
+
// VCenter is the domain name or IP address of the vCenter.
- VCenter string `json:"vCenter"`
+ // Deprecated: Please use Platform.Infrastructure instead
+ // See also: Platform.ConvertDeprecatedFields
+ // +optional
+ DeprecatedVCenter string `json:"vCenter,omitempty"`
// CredentialsSecretRef refers to a secret that contains the vSphere account access
// credentials: GOVC_USERNAME, GOVC_PASSWORD fields.
@@ -18,18 +25,33 @@ type Platform struct {
CertificatesSecretRef corev1.LocalObjectReference `json:"certificatesSecretRef"`
// Datacenter is the name of the datacenter to use in the vCenter.
- Datacenter string `json:"datacenter"`
+ // Deprecated: Please use Platform.Infrastructure instead
+ // See also: Platform.ConvertDeprecatedFields
+ // +optional
+ DeprecatedDatacenter string `json:"datacenter,omitempty"`
// DefaultDatastore is the default datastore to use for provisioning volumes.
- DefaultDatastore string `json:"defaultDatastore"`
+ // Deprecated: Please use Platform.Infrastructure instead
+ // See also: Platform.ConvertDeprecatedFields
+ // +optional
+ DeprecatedDefaultDatastore string `json:"defaultDatastore,omitempty"`
// Folder is the name of the folder that will be used and/or created for
// virtual machines.
- Folder string `json:"folder,omitempty"`
+ // Deprecated: Please use Platform.Infrastructure instead
+ // See also: Platform.ConvertDeprecatedFields
+ // +optional
+ DeprecatedFolder string `json:"folder,omitempty"`
// Cluster is the name of the cluster virtual machines will be cloned into.
- Cluster string `json:"cluster,omitempty"`
+ // Deprecated: Please use Platform.Infrastructure instead
+ // See also: Platform.ConvertDeprecatedFields
+ // +optional
+ DeprecatedCluster string `json:"cluster,omitempty"`
// Network specifies the name of the network to be used by the cluster.
- Network string `json:"network,omitempty"`
+ // Deprecated: Please use Platform.Infrastructure instead
+ // See also: Platform.ConvertDeprecatedFields
+ // +optional
+ DeprecatedNetwork string `json:"network,omitempty"`
}
diff --git a/api/vendor/github.com/openshift/hive/apis/hive/v1/vsphere/zz_generated.deepcopy.go b/api/vendor/github.com/openshift/hive/apis/hive/v1/vsphere/zz_generated.deepcopy.go
index 6108b1415a7a..a7e6de27d0d7 100644
--- a/api/vendor/github.com/openshift/hive/apis/hive/v1/vsphere/zz_generated.deepcopy.go
+++ b/api/vendor/github.com/openshift/hive/apis/hive/v1/vsphere/zz_generated.deepcopy.go
@@ -5,10 +5,14 @@
package vsphere
+import (
+ typesvsphere "github.com/openshift/installer/pkg/types/vsphere"
+)
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MachinePool) DeepCopyInto(out *MachinePool) {
*out = *in
- out.OSDisk = in.OSDisk
+ in.MachinePool.DeepCopyInto(&out.MachinePool)
if in.TagIDs != nil {
in, out := &in.TagIDs, &out.TagIDs
*out = make([]string, len(*in))
@@ -27,25 +31,14 @@ func (in *MachinePool) DeepCopy() *MachinePool {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *OSDisk) DeepCopyInto(out *OSDisk) {
- *out = *in
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OSDisk.
-func (in *OSDisk) DeepCopy() *OSDisk {
- if in == nil {
- return nil
- }
- out := new(OSDisk)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Platform) DeepCopyInto(out *Platform) {
*out = *in
+ if in.Infrastructure != nil {
+ in, out := &in.Infrastructure, &out.Infrastructure
+ *out = new(typesvsphere.Platform)
+ (*in).DeepCopyInto(*out)
+ }
out.CredentialsSecretRef = in.CredentialsSecretRef
out.CertificatesSecretRef = in.CertificatesSecretRef
return
diff --git a/api/vendor/github.com/openshift/hive/apis/hive/v1/zz_generated.deepcopy.go b/api/vendor/github.com/openshift/hive/apis/hive/v1/zz_generated.deepcopy.go
index 56dcc627cc1c..95379f2f5f7f 100644
--- a/api/vendor/github.com/openshift/hive/apis/hive/v1/zz_generated.deepcopy.go
+++ b/api/vendor/github.com/openshift/hive/apis/hive/v1/zz_generated.deepcopy.go
@@ -1070,7 +1070,7 @@ func (in *ClusterDeprovisionPlatform) DeepCopyInto(out *ClusterDeprovisionPlatfo
if in.VSphere != nil {
in, out := &in.VSphere, &out.VSphere
*out = new(VSphereClusterDeprovision)
- **out = **in
+ (*in).DeepCopyInto(*out)
}
if in.IBMCloud != nil {
in, out := &in.IBMCloud, &out.IBMCloud
@@ -3429,7 +3429,7 @@ func (in *Platform) DeepCopyInto(out *Platform) {
if in.VSphere != nil {
in, out := &in.VSphere, &out.VSphere
*out = new(vsphere.Platform)
- **out = **in
+ (*in).DeepCopyInto(*out)
}
if in.AgentBareMetal != nil {
in, out := &in.AgentBareMetal, &out.AgentBareMetal
@@ -4191,6 +4191,11 @@ func (in *VSphereClusterDeprovision) DeepCopyInto(out *VSphereClusterDeprovision
*out = *in
out.CredentialsSecretRef = in.CredentialsSecretRef
out.CertificatesSecretRef = in.CertificatesSecretRef
+ if in.VCenters != nil {
+ in, out := &in.VCenters, &out.VCenters
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
return
}
diff --git a/api/vendor/github.com/openshift/installer/LICENSE b/api/vendor/github.com/openshift/installer/LICENSE
new file mode 100644
index 000000000000..01e141147fcf
--- /dev/null
+++ b/api/vendor/github.com/openshift/installer/LICENSE
@@ -0,0 +1,202 @@
+Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2023 Red Hat, Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff --git a/api/vendor/github.com/openshift/installer/NOTICE b/api/vendor/github.com/openshift/installer/NOTICE
new file mode 100644
index 000000000000..571695f5f26f
--- /dev/null
+++ b/api/vendor/github.com/openshift/installer/NOTICE
@@ -0,0 +1,5 @@
+CoreOS Project
+Copyright 2017 CoreOS, Inc
+
+This product includes software developed at CoreOS, Inc.
+(http://www.coreos.com/).
diff --git a/api/vendor/github.com/openshift/installer/pkg/types/vsphere/OWNERS b/api/vendor/github.com/openshift/installer/pkg/types/vsphere/OWNERS
new file mode 100644
index 000000000000..d1c39b1b6688
--- /dev/null
+++ b/api/vendor/github.com/openshift/installer/pkg/types/vsphere/OWNERS
@@ -0,0 +1,7 @@
+# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md
+# This file just uses aliases defined in OWNERS_ALIASES.
+
+approvers:
+ - vsphere-approvers
+reviewers:
+ - vsphere-reviewers
diff --git a/api/vendor/github.com/openshift/installer/pkg/types/vsphere/doc.go b/api/vendor/github.com/openshift/installer/pkg/types/vsphere/doc.go
new file mode 100644
index 000000000000..c168fcaa0c03
--- /dev/null
+++ b/api/vendor/github.com/openshift/installer/pkg/types/vsphere/doc.go
@@ -0,0 +1,7 @@
+// Package vsphere contains vSphere-specific structures for installer
+// configuration and management.
+// +k8s:deepcopy-gen=package
+package vsphere
+
+// Name is name for the vsphere platform.
+const Name string = "vsphere"
diff --git a/api/vendor/github.com/openshift/installer/pkg/types/vsphere/machinepool.go b/api/vendor/github.com/openshift/installer/pkg/types/vsphere/machinepool.go
new file mode 100644
index 000000000000..1a0fdb06e326
--- /dev/null
+++ b/api/vendor/github.com/openshift/installer/pkg/types/vsphere/machinepool.go
@@ -0,0 +1,122 @@
+package vsphere
+
+// MachinePool stores the configuration for a machine pool installed
+// on vSphere.
+type MachinePool struct {
+ // NumCPUs is the total number of virtual processor cores to assign a vm.
+ //
+ // +optional
+ NumCPUs int32 `json:"cpus"`
+
+ // NumCoresPerSocket is the number of cores per socket in a vm. The number
+ // of vCPUs on the vm will be NumCPUs/NumCoresPerSocket.
+ //
+ // +optional
+ NumCoresPerSocket int32 `json:"coresPerSocket"`
+
+ // Memory is the size of a VM's memory in MB.
+ //
+ // +optional
+ MemoryMiB int64 `json:"memoryMB"`
+
+ // OSDisk defines the storage for instance.
+ //
+ // +optional
+ OSDisk `json:"osDisk"`
+
+ // DataDisks are additional disks to add to the VM that are not part of the VM's OVA template.
+ //
+ // +optional
+ // +listType=map
+ // +listMapKey=name
+ // +kubebuilder:validation:MaxItems=29
+ DataDisks []DataDisk `json:"dataDisks"`
+
+ // Zones defines available zones
+ // Zones is available in TechPreview.
+ //
+ // +omitempty
+ Zones []string `json:"zones,omitempty"`
+}
+
+// OSDisk defines the disk for a virtual machine.
+type OSDisk struct {
+ // DiskSizeGB defines the size of disk in GB.
+ //
+ // +optional
+ DiskSizeGB int32 `json:"diskSizeGB"`
+}
+
+// DataDisk defines a data disk to add to the VM that is not part of the VM OVA template.
+type DataDisk struct {
+ // name is used to identify the disk definition. name is required needs to be unique so that it can be used to
+ // clearly identify purpose of the disk.
+ // +kubebuilder:example=images_1
+ // +kubebuilder:validation:MaxLength=80
+ // +kubebuilder:validation:Pattern="^[a-zA-Z0-9]([-_a-zA-Z0-9]*[a-zA-Z0-9])?$"
+ // +required
+ Name string `json:"name"`
+ // sizeGiB is the size of the disk in GiB.
+ // The maximum supported size is 16384 GiB.
+ // +kubebuilder:validation:Minimum=1
+ // +kubebuilder:validation:Maximum=16384
+ // +required
+ SizeGiB int32 `json:"sizeGiB"`
+ // provisioningMode is an optional field that specifies the provisioning type to be used by this vSphere data disk.
+ // Allowed values are "Thin", "Thick", "EagerlyZeroed", and omitted.
+ // When set to Thin, the disk will be made using thin provisioning allocating the bare minimum space.
+ // When set to Thick, the full disk size will be allocated when disk is created.
+ // When set to EagerlyZeroed, the disk will be created using eager zero provisioning. An eager zeroed thick disk has all space allocated and wiped clean of any previous contents on the physical media at creation time. Such disks may take longer time during creation compared to other disk formats.
+ // When omitted, no setting will be applied to the data disk and the provisioning mode for the disk will be determined by the default storage policy configured for the datastore in vSphere.
+ // +optional
+ ProvisioningMode ProvisioningMode `json:"provisioningMode,omitempty"`
+}
+
+// ProvisioningMode represents the various provisioning types available to a VMs disk.
+// +kubebuilder:validation:Enum=Thin;Thick;EagerlyZeroed
+type ProvisioningMode string
+
+const (
+ // ProvisioningModeThin creates the disk using thin provisioning. This means a sparse (allocate on demand)
+ // format with additional space optimizations.
+ ProvisioningModeThin ProvisioningMode = "Thin"
+
+ // ProvisioningModeThick creates the disk with all space allocated.
+ ProvisioningModeThick ProvisioningMode = "Thick"
+
+ // ProvisioningModeEagerlyZeroed creates the disk using eager zero provisioning. An eager zeroed thick disk
+ // has all space allocated and wiped clean of any previous contents on the physical media at
+ // creation time. Such disks may take longer time during creation compared to other disk formats.
+ ProvisioningModeEagerlyZeroed ProvisioningMode = "EagerlyZeroed"
+)
+
+// Set sets the values from `required` to `p`.
+func (p *MachinePool) Set(required *MachinePool) {
+ if required == nil || p == nil {
+ return
+ }
+
+ if required.NumCPUs != 0 {
+ p.NumCPUs = required.NumCPUs
+ }
+
+ if required.NumCoresPerSocket != 0 {
+ p.NumCoresPerSocket = required.NumCoresPerSocket
+ }
+
+ if required.MemoryMiB != 0 {
+ p.MemoryMiB = required.MemoryMiB
+ }
+
+ if required.OSDisk.DiskSizeGB != 0 {
+ p.OSDisk.DiskSizeGB = required.OSDisk.DiskSizeGB
+ }
+
+ if len(required.Zones) > 0 {
+ p.Zones = required.Zones
+ }
+
+ if len(required.DataDisks) > 0 {
+ p.DataDisks = required.DataDisks
+ }
+}
diff --git a/api/vendor/github.com/openshift/installer/pkg/types/vsphere/metadata.go b/api/vendor/github.com/openshift/installer/pkg/types/vsphere/metadata.go
new file mode 100644
index 000000000000..703bc641a2b6
--- /dev/null
+++ b/api/vendor/github.com/openshift/installer/pkg/types/vsphere/metadata.go
@@ -0,0 +1,25 @@
+package vsphere
+
+// Metadata contains vSphere metadata (e.g. for uninstalling the cluster).
+type Metadata struct {
+ // VCenter is the domain name or IP address of the vCenter.
+ VCenter string `json:"vCenter,omitempty"`
+ // Username is the name of the user to use to connect to the vCenter.
+ Username string `json:"username,omitempty"`
+ // Password is the password for the user to use to connect to the vCenter.
+ Password string `json:"password,omitempty"`
+ // TerraformPlatform is the type...
+ TerraformPlatform string `json:"terraform_platform"`
+ // VCenters collection of vcenters when multi vcenter support is enabled
+ VCenters []VCenters
+}
+
+// VCenters contains information on individual vcenter.
+type VCenters struct {
+ // VCenter is the domain name or IP address of the vCenter.
+ VCenter string `json:"vCenter"`
+ // Username is the name of the user to use to connect to the vCenter.
+ Username string `json:"username"`
+ // Password is the password for the user to use to connect to the vCenter.
+ Password string `json:"password"`
+}
diff --git a/api/vendor/github.com/openshift/installer/pkg/types/vsphere/platform.go b/api/vendor/github.com/openshift/installer/pkg/types/vsphere/platform.go
new file mode 100644
index 000000000000..f3872746196a
--- /dev/null
+++ b/api/vendor/github.com/openshift/installer/pkg/types/vsphere/platform.go
@@ -0,0 +1,370 @@
+package vsphere
+
+import (
+ configv1 "github.com/openshift/api/config/v1"
+)
+
+// DiskType is a disk provisioning type for vsphere.
+// +kubebuilder:validation:Enum="";thin;thick;eagerZeroedThick
+type DiskType string
+
+// FailureDomainType is the string representation name of the failure domain type.
+// There are three defined failure domains types currently, Datacenter, ComputeCluster and HostGroup.
+// Each represents a vCenter object type within a vSphere environment.
+// +kubebuilder:validation:Enum=HostGroup;Datacenter;ComputeCluster
+type FailureDomainType string
+
+const (
+ // DiskTypeThin uses Thin disk provisioning type for vsphere in the cluster.
+ DiskTypeThin DiskType = "thin"
+
+ // DiskTypeThick uses Thick disk provisioning type for vsphere in the cluster.
+ DiskTypeThick DiskType = "thick"
+
+ // DiskTypeEagerZeroedThick uses EagerZeroedThick disk provisioning type for vsphere in the cluster.
+ DiskTypeEagerZeroedThick DiskType = "eagerZeroedThick"
+
+ // TagCategoryRegion the tag category associated with regions.
+ TagCategoryRegion = "openshift-region"
+
+ // TagCategoryZone the tag category associated with zones.
+ TagCategoryZone = "openshift-zone"
+)
+
+const (
+ // ControlPlaneRole represents control-plane nodes.
+ ControlPlaneRole = "control-plane"
+ // ComputeRole represents worker nodes.
+ ComputeRole = "compute"
+ // BootstrapRole represents bootstrap nodes.
+ BootstrapRole = "bootstrap"
+)
+
+const (
+ // HostGroupFailureDomain is a failure domain for a vCenter vm-host group.
+ HostGroupFailureDomain FailureDomainType = "HostGroup"
+ // ComputeClusterFailureDomain is a failure domain for a vCenter compute cluster.
+ ComputeClusterFailureDomain FailureDomainType = "ComputeCluster"
+ // DatacenterFailureDomain is a failure domain for a vCenter datacenter.
+ DatacenterFailureDomain FailureDomainType = "Datacenter"
+)
+
+// Platform stores any global configuration used for vsphere platforms.
+type Platform struct {
+ // VCenter is the domain name or IP address of the vCenter.
+ // Deprecated: Use VCenters.Server
+ DeprecatedVCenter string `json:"vCenter,omitempty"`
+ // Username is the name of the user to use to connect to the vCenter.
+ // Deprecated: Use VCenters.Username
+ DeprecatedUsername string `json:"username,omitempty"`
+ // Password is the password for the user to use to connect to the vCenter.
+ // Deprecated: Use VCenters.Password
+ DeprecatedPassword string `json:"password,omitempty"`
+ // Datacenter is the name of the datacenter to use in the vCenter.
+ // Deprecated: Use FailureDomains.Topology.Datacenter
+ DeprecatedDatacenter string `json:"datacenter,omitempty"`
+ // DefaultDatastore is the default datastore to use for provisioning volumes.
+ // Deprecated: Use FailureDomains.Topology.Datastore
+ DeprecatedDefaultDatastore string `json:"defaultDatastore,omitempty"`
+ // Folder is the absolute path of the folder that will be used and/or created for
+ // virtual machines. The absolute path is of the form //vm//.
+ // +kubebuilder:validation:Pattern=`^/.*?/vm/.*?`
+ // +optional
+ // Deprecated: Use FailureDomains.Topology.Folder
+ DeprecatedFolder string `json:"folder,omitempty"`
+ // Cluster is the name of the cluster virtual machines will be cloned into.
+ // Deprecated: Use FailureDomains.Topology.Cluster
+ DeprecatedCluster string `json:"cluster,omitempty"`
+ // ResourcePool is the absolute path of the resource pool where virtual machines will be
+ // created. The absolute path is of the form //host//Resources/.
+ // Deprecated: Use FailureDomains.Topology.ResourcePool
+ DeprecatedResourcePool string `json:"resourcePool,omitempty"`
+ // ClusterOSImage overrides the url provided in rhcos.json to download the RHCOS OVA
+ ClusterOSImage string `json:"clusterOSImage,omitempty"`
+
+ // DeprecatedAPIVIP is the virtual IP address for the api endpoint
+ // Deprecated: Use APIVIPs
+ //
+ // +kubebuilder:validation:format=ip
+ // +optional
+ DeprecatedAPIVIP string `json:"apiVIP,omitempty"`
+
+ // APIVIPs contains the VIP(s) for the api endpoint. In dual stack clusters
+ // it contains an IPv4 and IPv6 address, otherwise only one VIP
+ //
+ // +kubebuilder:validation:MaxItems=2
+ // +kubebuilder:validation:Format=ip
+ // +optional
+ APIVIPs []string `json:"apiVIPs,omitempty"`
+
+ // DeprecatedIngressVIP is the virtual IP address for ingress
+ // Deprecated: Use IngressVIPs
+ //
+ // +kubebuilder:validation:format=ip
+ // +optional
+ DeprecatedIngressVIP string `json:"ingressVIP,omitempty"`
+
+ // IngressVIPs contains the VIP(s) for ingress. In dual stack clusters it
+ // contains an IPv4 and IPv6 address, otherwise only one VIP
+ //
+ // +kubebuilder:validation:MaxItems=2
+ // +kubebuilder:validation:Format=ip
+ // +optional
+ IngressVIPs []string `json:"ingressVIPs,omitempty"`
+
+ // DefaultMachinePlatform is the default configuration used when
+ // installing on VSphere for machine pools which do not define their own
+ // platform configuration.
+ // +optional
+ DefaultMachinePlatform *MachinePool `json:"defaultMachinePlatform,omitempty"`
+ // Network specifies the name of the network to be used by the cluster.
+ // Deprecated: Use FailureDomains.Topology.Network
+ DeprecatedNetwork string `json:"network,omitempty"`
+ // DiskType is the name of the disk provisioning type,
+ // valid values are thin, thick, and eagerZeroedThick. When not
+ // specified, it will be set according to the default storage policy
+ // of vsphere.
+ DiskType DiskType `json:"diskType,omitempty"`
+ // VCenters holds the connection details for services to communicate with vCenter.
+ // +kubebuilder:validation:Optional
+ // +kubebuilder:validation:MaxItems=3
+ // +kubebuilder:validation:MinItems=1
+ VCenters []VCenter `json:"vcenters,omitempty"`
+ // FailureDomains holds the VSpherePlatformFailureDomainSpec which contains
+ // the definition of region, zone and the vCenter topology.
+ // If this is omitted failure domains (regions and zones) will not be used.
+ // +kubebuilder:validation:Optional
+ FailureDomains []FailureDomain `json:"failureDomains,omitempty"`
+
+ // nodeNetworking contains the definition of internal and external network constraints for
+ // assigning the node's networking.
+ // If this field is omitted, networking defaults to the legacy
+ // address selection behavior which is to only support a single address and
+ // return the first one found.
+ // +optional
+ NodeNetworking *configv1.VSpherePlatformNodeNetworking `json:"nodeNetworking,omitempty"`
+
+ // LoadBalancer defines how the load balancer used by the cluster is configured.
+ // LoadBalancer is available in TechPreview.
+ // +optional
+ LoadBalancer *configv1.VSpherePlatformLoadBalancer `json:"loadBalancer,omitempty"`
+
+ // dnsRecordsType determines whether records for api, api-int, and ingress
+ // are provided by the internal DNS service or externally.
+ // Allowed values are `Internal`, `External`, and omitted.
+ // When set to `Internal`, records are provided by the internal infrastructure and
+ // no additional user configuration is required for the cluster to function.
+ // When set to `External`, records are not provided by the internal infrastructure
+ // and must be configured by the user on a DNS server outside the cluster.
+ // Cluster nodes must use this external server for their upstream DNS requests.
+ // This value may only be set when loadBalancer.type is set to UserManaged.
+ // When omitted, this means the user has no opinion and the platform is left
+ // to choose reasonable defaults. These defaults are subject to change over time.
+ // The current default is `Internal`.
+ // +openshift:enable:FeatureGate=OnPremDNSRecords
+ // +optional
+ DNSRecordsType configv1.DNSRecordsType `json:"dnsRecordsType,omitempty"`
+
+ // Hosts defines network configurations to be applied by the installer. Hosts is available in TechPreview.
+ Hosts []*Host `json:"hosts,omitempty"`
+}
+
+// FailureDomain holds the region and zone failure domain and
+// the vCenter topology of that failure domain.
+type FailureDomain struct {
+ // name defines the name of the FailureDomain
+ // This name is arbitrary but will be used
+ // in VSpherePlatformDeploymentZone for association.
+ // +kubebuilder:validation:Required
+ // +kubebuilder:validation:MinLength=1
+ // +kubebuilder:validation:MaxLength=256
+ Name string `json:"name"`
+ // region defines a FailureDomainCoordinate which
+ // includes the name of the vCenter tag, the failure domain type
+ // and the name of the vCenter tag category.
+
+ // The region is the name of the tag in vCenter that is associated with the
+ // tag category `openshift-region`. The region name must match the tag name
+ // and must exist prior to installation. When the regionType is Datacenter
+ // the tag must be attached to the toplogy.datacenter object in vCenter.
+ // When the regionType is ComputeCluster the tag must be attached to the topology.computeCluster
+ // object in vCenter.
+ // +kubebuilder:validation:Required
+ Region string `json:"region"`
+ // The zone is the name of the tag in vCenter that is associated with
+ // the tag category `openshift-zone`. The zone name must match the tag name
+ // and must exist prior to installation. When zoneType is HostGroup the
+ // ESXi hosts defined in the provided in the topology.hostGroup field must be tagged.
+ // When the zoneType is ComputeCluster the tag must be attached to the topology.computeCluster
+ // object in vCenter.
+ // +kubebuilder:validation:Required
+ Zone string `json:"zone"`
+ // server is the fully-qualified domain name or the IP address of the vCenter server.
+ // +kubebuilder:validation:Required
+ // +kubebuilder:validation:MinLength=1
+ // +kubebuilder:validation:MaxLength=255
+ Server string `json:"server"`
+ // Topology describes a given failure domain using vSphere constructs
+ // +kubebuilder:validation:Required
+ Topology Topology `json:"topology"`
+
+ // regionType is the type of failure domain region, the current values are "Datacenter" and "ComputeCluster"
+ // +kubebuilder:validation:Enum=Datacenter;ComputeCluster
+ // When regionType is Datacenter the zoneType must be ComputeCluster.
+ // When regionType is ComputeCluster the zoneType must be HostGroup
+ // +optional
+ RegionType FailureDomainType `json:"regionType,omitempty"`
+ // zoneType is the type of the failure domain zone, the current values are "ComputeCluster" and "HostGroup"
+
+ // When zoneType is ComputeCluster the regionType must be Datacenter
+ // When zoneType is HostGroup the regionType must be ComputeCluster
+ // If the zoneType is HostGroup topology.hostGroup must be defined and exist in vCenter
+ // prior to installation.
+ // +kubebuilder:validation:Enum=ComputeCluster;HostGroup
+ // +optional
+ ZoneType FailureDomainType `json:"zoneType,omitempty"`
+}
+
+// Topology holds the required and optional vCenter objects - datacenter,
+// computeCluster, networks, datastore and resourcePool - to provision virtual machines.
+type Topology struct {
+ // datacenter is the vCenter datacenter in which virtual machines will be located
+ // and defined as the failure domain.
+ // +kubebuilder:validation:Required
+ // +kubebuilder:validation:MinLength=1
+ // +kubebuilder:validation:MaxLength=80
+ Datacenter string `json:"datacenter"`
+ // computeCluster as the failure domain
+ // This is required to be a path
+ // +kubebuilder:validation:Required
+ // +kubebuilder:validation:MinLength=1
+ // +kubebuilder:validation:MaxLength=2048
+ ComputeCluster string `json:"computeCluster"`
+ // networks is the list of networks within this failure domain
+ // +kubebuilder:validation:Required
+ // +kubebuilder:validation:MinItems=1
+ // +kubebuilder:validation:MaxItems=10
+ Networks []string `json:"networks,omitempty"`
+ // datastore is the name or inventory path of the datastore in which the
+ // virtual machine is created/located.
+ // +kubebuilder:validation:Required
+ // +kubebuilder:validation:MinLength=1
+ // +kubebuilder:validation:MaxLength=2048
+ Datastore string `json:"datastore"`
+ // resourcePool is the absolute path of the resource pool where virtual machines will be
+ // created. The absolute path is of the form //host//Resources/.
+ // +kubebuilder:validation:MinLength=1
+ // +kubebuilder:validation:MaxLength=2048
+ // +kubebuilder:validation:Pattern=`^/.*?/host/.*?/Resources.*`
+ // +optional
+ ResourcePool string `json:"resourcePool,omitempty"`
+ // folder is the inventory path of the folder in which the
+ // virtual machine is created/located.
+ // +kubebuilder:validation:MinLength=1
+ // +kubebuilder:validation:MaxLength=2048
+ // +kubebuilder:validation:Pattern=`^/.*?/vm/.*?`
+ // +optional
+ Folder string `json:"folder,omitempty"`
+ // template is the inventory path of the virtual machine or template
+ // that will be used for cloning.
+ // +kubebuilder:validation:MinLength=1
+ // +kubebuilder:validation:MaxLength=2048
+ // +kubebuilder:validation:Pattern=`^/.*?/vm/.*?`
+ // +optional
+ Template string `json:"template,omitempty"`
+ // tagIDs is an optional set of tags to add to an instance. Specified tagIDs
+ // must use URN-notation instead of display names. A maximum of 10 tag IDs may be specified.
+ // +kubebuilder:example=`urn:vmomi:InventoryServiceTag:5736bf56-49f5-4667-b38c-b97e09dc9578:GLOBAL`
+ // +optional
+ TagIDs []string `json:"tagIDs,omitempty"`
+
+ // hostGroup is the name of the vm-host group of type host within vCenter for this failure domain.
+ // hostGroup is limited to 80 characters.
+ // This field is required when the ZoneType is HostGroup
+ // +kubebuilder:validation:MaxLength=80
+ // +optional
+ HostGroup string `json:"hostGroup,omitempty"`
+}
+
+// VCenter stores the vCenter connection fields
+// https://github.com/kubernetes/cloud-provider-vsphere/blob/master/pkg/common/config/types_yaml.go
+type VCenter struct {
+ // server is the fully-qualified domain name or the IP address of the vCenter server.
+ // +kubebuilder:validation:Required
+ // +kubebuilder:validation:MaxLength=255
+ Server string `json:"server"`
+ // port is the TCP port that will be used to communicate to
+ // the vCenter endpoint. This is typically unchanged from
+ // the default of HTTPS TCP/443.
+ // +kubebuilder:validation:Optional
+ // +kubebuilder:validation:Minimum=1
+ // +kubebuilder:validation:Maximum=32767
+ // +kubebuilder:default=443
+ Port int32 `json:"port,omitempty"`
+ // Username is the username that will be used to connect to vCenter
+ // +kubebuilder:validation:Required
+ Username string `json:"user"`
+ // Password is the password for the user to use to connect to the vCenter.
+ // +kubebuilder:validation:Required
+ Password string `json:"password"`
+ // Datacenter in which VMs are located.
+ // +kubebuilder:validation:Required
+ // +kubebuilder:validation:MinItems=1
+ Datacenters []string `json:"datacenters"`
+}
+
+// Host defines host VMs to generate as part of the installation.
+type Host struct {
+ // FailureDomain refers to the name of a FailureDomain as described in https://github.com/openshift/enhancements/blob/master/enhancements/installer/vsphere-ipi-zonal.md
+ // +optional
+ FailureDomain string `json:"failureDomain"`
+ // NetworkDeviceSpec to be applied to the host
+ // +kubebuilder:validation:Required
+ NetworkDevice *NetworkDeviceSpec `json:"networkDevice"`
+ // Role defines the role of the node
+ // +kubebuilder:validation:Enum="";bootstrap;control-plane;compute
+ // +kubebuilder:validation:Required
+ Role string `json:"role"`
+}
+
+// NetworkDeviceSpec defines network config for static IP assignment.
+type NetworkDeviceSpec struct {
+ // gateway is an IPv4 or IPv6 address which represents the subnet gateway,
+ // for example, 192.168.1.1.
+ // +kubebuilder:validation:Format=ipv4
+ // +kubebuilder:validation:Format=ipv6
+ Gateway string `json:"gateway,omitempty"`
+
+ // ipAddrs is a list of one or more IPv4 and/or IPv6 addresses and CIDR to assign to
+ // this device, for example, 192.168.1.100/24. IP addresses provided via ipAddrs are
+ // intended to allow explicit assignment of a machine's IP address.
+ // +kubebuilder:validation:Format=ipv4
+ // +kubebuilder:validation:Format=ipv6
+ // +kubebuilder:example=`192.168.1.100/24`
+ // +kubebuilder:example=`2001:DB8:0000:0000:244:17FF:FEB6:D37D/64`
+ // +kubebuilder:validation:Required
+ IPAddrs []string `json:"ipAddrs"`
+
+ // nameservers is a list of IPv4 and/or IPv6 addresses used as DNS nameservers, for example,
+ // 8.8.8.8. a nameserver is not provided by a fulfilled IPAddressClaim. If DHCP is not the
+ // source of IP addresses for this network device, nameservers should include a valid nameserver.
+ // +kubebuilder:validation:Format=ipv4
+ // +kubebuilder:validation:Format=ipv6
+ // +kubebuilder:example=`8.8.8.8`
+ Nameservers []string `json:"nameservers,omitempty"`
+}
+
+// IsControlPlane checks if the current host is a master.
+func (h *Host) IsControlPlane() bool {
+ return h.Role == ControlPlaneRole
+}
+
+// IsCompute checks if the current host is a worker.
+func (h *Host) IsCompute() bool {
+ return h.Role == ComputeRole
+}
+
+// IsBootstrap checks if the current host is a bootstrap.
+func (h *Host) IsBootstrap() bool {
+ return h.Role == BootstrapRole
+}
diff --git a/api/vendor/github.com/openshift/installer/pkg/types/vsphere/zz_generated.deepcopy.go b/api/vendor/github.com/openshift/installer/pkg/types/vsphere/zz_generated.deepcopy.go
new file mode 100644
index 000000000000..7f529e476206
--- /dev/null
+++ b/api/vendor/github.com/openshift/installer/pkg/types/vsphere/zz_generated.deepcopy.go
@@ -0,0 +1,283 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+// Code generated by deepcopy-gen. DO NOT EDIT.
+
+package vsphere
+
+import (
+ v1 "github.com/openshift/api/config/v1"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *DataDisk) DeepCopyInto(out *DataDisk) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataDisk.
+func (in *DataDisk) DeepCopy() *DataDisk {
+ if in == nil {
+ return nil
+ }
+ out := new(DataDisk)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *FailureDomain) DeepCopyInto(out *FailureDomain) {
+ *out = *in
+ in.Topology.DeepCopyInto(&out.Topology)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailureDomain.
+func (in *FailureDomain) DeepCopy() *FailureDomain {
+ if in == nil {
+ return nil
+ }
+ out := new(FailureDomain)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Host) DeepCopyInto(out *Host) {
+ *out = *in
+ if in.NetworkDevice != nil {
+ in, out := &in.NetworkDevice, &out.NetworkDevice
+ *out = new(NetworkDeviceSpec)
+ (*in).DeepCopyInto(*out)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Host.
+func (in *Host) DeepCopy() *Host {
+ if in == nil {
+ return nil
+ }
+ out := new(Host)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MachinePool) DeepCopyInto(out *MachinePool) {
+ *out = *in
+ out.OSDisk = in.OSDisk
+ if in.DataDisks != nil {
+ in, out := &in.DataDisks, &out.DataDisks
+ *out = make([]DataDisk, len(*in))
+ copy(*out, *in)
+ }
+ if in.Zones != nil {
+ in, out := &in.Zones, &out.Zones
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePool.
+func (in *MachinePool) DeepCopy() *MachinePool {
+ if in == nil {
+ return nil
+ }
+ out := new(MachinePool)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Metadata) DeepCopyInto(out *Metadata) {
+ *out = *in
+ if in.VCenters != nil {
+ in, out := &in.VCenters, &out.VCenters
+ *out = make([]VCenters, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Metadata.
+func (in *Metadata) DeepCopy() *Metadata {
+ if in == nil {
+ return nil
+ }
+ out := new(Metadata)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *NetworkDeviceSpec) DeepCopyInto(out *NetworkDeviceSpec) {
+ *out = *in
+ if in.IPAddrs != nil {
+ in, out := &in.IPAddrs, &out.IPAddrs
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.Nameservers != nil {
+ in, out := &in.Nameservers, &out.Nameservers
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkDeviceSpec.
+func (in *NetworkDeviceSpec) DeepCopy() *NetworkDeviceSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(NetworkDeviceSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *OSDisk) DeepCopyInto(out *OSDisk) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OSDisk.
+func (in *OSDisk) DeepCopy() *OSDisk {
+ if in == nil {
+ return nil
+ }
+ out := new(OSDisk)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Platform) DeepCopyInto(out *Platform) {
+ *out = *in
+ if in.APIVIPs != nil {
+ in, out := &in.APIVIPs, &out.APIVIPs
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.IngressVIPs != nil {
+ in, out := &in.IngressVIPs, &out.IngressVIPs
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.DefaultMachinePlatform != nil {
+ in, out := &in.DefaultMachinePlatform, &out.DefaultMachinePlatform
+ *out = new(MachinePool)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.VCenters != nil {
+ in, out := &in.VCenters, &out.VCenters
+ *out = make([]VCenter, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ if in.FailureDomains != nil {
+ in, out := &in.FailureDomains, &out.FailureDomains
+ *out = make([]FailureDomain, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ if in.NodeNetworking != nil {
+ in, out := &in.NodeNetworking, &out.NodeNetworking
+ *out = new(v1.VSpherePlatformNodeNetworking)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.LoadBalancer != nil {
+ in, out := &in.LoadBalancer, &out.LoadBalancer
+ *out = new(v1.VSpherePlatformLoadBalancer)
+ **out = **in
+ }
+ if in.Hosts != nil {
+ in, out := &in.Hosts, &out.Hosts
+ *out = make([]*Host, len(*in))
+ for i := range *in {
+ if (*in)[i] != nil {
+ in, out := &(*in)[i], &(*out)[i]
+ *out = new(Host)
+ (*in).DeepCopyInto(*out)
+ }
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Platform.
+func (in *Platform) DeepCopy() *Platform {
+ if in == nil {
+ return nil
+ }
+ out := new(Platform)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Topology) DeepCopyInto(out *Topology) {
+ *out = *in
+ if in.Networks != nil {
+ in, out := &in.Networks, &out.Networks
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ if in.TagIDs != nil {
+ in, out := &in.TagIDs, &out.TagIDs
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Topology.
+func (in *Topology) DeepCopy() *Topology {
+ if in == nil {
+ return nil
+ }
+ out := new(Topology)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *VCenter) DeepCopyInto(out *VCenter) {
+ *out = *in
+ if in.Datacenters != nil {
+ in, out := &in.Datacenters, &out.Datacenters
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VCenter.
+func (in *VCenter) DeepCopy() *VCenter {
+ if in == nil {
+ return nil
+ }
+ out := new(VCenter)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *VCenters) DeepCopyInto(out *VCenters) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VCenters.
+func (in *VCenters) DeepCopy() *VCenters {
+ if in == nil {
+ return nil
+ }
+ out := new(VCenters)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/array_codec.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/array_codec.go
index 6ca8d9ad6cdb..652aa48b8536 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/array_codec.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/array_codec.go
@@ -15,16 +15,15 @@ import (
// ArrayCodec is the Codec used for bsoncore.Array values.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// ArrayCodec registered.
+// Deprecated: ArrayCodec will not be directly accessible in Go Driver 2.0.
type ArrayCodec struct{}
var defaultArrayCodec = NewArrayCodec()
// NewArrayCodec returns an ArrayCodec.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// ArrayCodec registered.
+// Deprecated: NewArrayCodec will not be available in Go Driver 2.0. See
+// [ArrayCodec] for more details.
func NewArrayCodec() *ArrayCodec {
return &ArrayCodec{}
}
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/byte_slice_codec.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/byte_slice_codec.go
index dde3e76815e4..0134b5a94bec 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/byte_slice_codec.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/byte_slice_codec.go
@@ -17,13 +17,28 @@ import (
// ByteSliceCodec is the Codec used for []byte values.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// ByteSliceCodec registered.
+// Deprecated: ByteSliceCodec will not be directly configurable in Go Driver
+// 2.0. To configure the byte slice encode and decode behavior, use the
+// configuration methods on a [go.mongodb.org/mongo-driver/bson.Encoder] or
+// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the byte slice
+// encode and decode behavior for a mongo.Client, use
+// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions].
+//
+// For example, to configure a mongo.Client to encode nil byte slices as empty
+// BSON binary values, use:
+//
+// opt := options.Client().SetBSONOptions(&options.BSONOptions{
+// NilByteSliceAsEmpty: true,
+// })
+//
+// See the deprecation notice for each field in ByteSliceCodec for the
+// corresponding settings.
type ByteSliceCodec struct {
// EncodeNilAsEmpty causes EncodeValue to marshal nil Go byte slices as empty BSON binary values
// instead of BSON null.
//
- // Deprecated: Use bson.Encoder.NilByteSliceAsEmpty instead.
+ // Deprecated: Use bson.Encoder.NilByteSliceAsEmpty or options.BSONOptions.NilByteSliceAsEmpty
+ // instead.
EncodeNilAsEmpty bool
}
@@ -38,8 +53,8 @@ var (
// NewByteSliceCodec returns a ByteSliceCodec with options opts.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// ByteSliceCodec registered.
+// Deprecated: NewByteSliceCodec will not be available in Go Driver 2.0. See
+// [ByteSliceCodec] for more details.
func NewByteSliceCodec(opts ...*bsonoptions.ByteSliceCodecOptions) *ByteSliceCodec {
byteSliceOpt := bsonoptions.MergeByteSliceCodecOptions(opts...)
codec := ByteSliceCodec{}
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/codec_cache.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/codec_cache.go
new file mode 100644
index 000000000000..844b50299f2f
--- /dev/null
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/codec_cache.go
@@ -0,0 +1,166 @@
+// Copyright (C) MongoDB, Inc. 2017-present.
+//
+// Licensed under the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License. You may obtain
+// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+
+package bsoncodec
+
+import (
+ "reflect"
+ "sync"
+ "sync/atomic"
+)
+
+// Runtime check that the kind encoder and decoder caches can store any valid
+// reflect.Kind constant.
+func init() {
+ if s := reflect.Kind(len(kindEncoderCache{}.entries)).String(); s != "kind27" {
+ panic("The capacity of kindEncoderCache is too small.\n" +
+ "This is due to a new type being added to reflect.Kind.")
+ }
+}
+
+// statically assert array size
+var _ = (kindEncoderCache{}).entries[reflect.UnsafePointer]
+var _ = (kindDecoderCache{}).entries[reflect.UnsafePointer]
+
+type typeEncoderCache struct {
+ cache sync.Map // map[reflect.Type]ValueEncoder
+}
+
+func (c *typeEncoderCache) Store(rt reflect.Type, enc ValueEncoder) {
+ c.cache.Store(rt, enc)
+}
+
+func (c *typeEncoderCache) Load(rt reflect.Type) (ValueEncoder, bool) {
+ if v, _ := c.cache.Load(rt); v != nil {
+ return v.(ValueEncoder), true
+ }
+ return nil, false
+}
+
+func (c *typeEncoderCache) LoadOrStore(rt reflect.Type, enc ValueEncoder) ValueEncoder {
+ if v, loaded := c.cache.LoadOrStore(rt, enc); loaded {
+ enc = v.(ValueEncoder)
+ }
+ return enc
+}
+
+func (c *typeEncoderCache) Clone() *typeEncoderCache {
+ cc := new(typeEncoderCache)
+ c.cache.Range(func(k, v interface{}) bool {
+ if k != nil && v != nil {
+ cc.cache.Store(k, v)
+ }
+ return true
+ })
+ return cc
+}
+
+type typeDecoderCache struct {
+ cache sync.Map // map[reflect.Type]ValueDecoder
+}
+
+func (c *typeDecoderCache) Store(rt reflect.Type, dec ValueDecoder) {
+ c.cache.Store(rt, dec)
+}
+
+func (c *typeDecoderCache) Load(rt reflect.Type) (ValueDecoder, bool) {
+ if v, _ := c.cache.Load(rt); v != nil {
+ return v.(ValueDecoder), true
+ }
+ return nil, false
+}
+
+func (c *typeDecoderCache) LoadOrStore(rt reflect.Type, dec ValueDecoder) ValueDecoder {
+ if v, loaded := c.cache.LoadOrStore(rt, dec); loaded {
+ dec = v.(ValueDecoder)
+ }
+ return dec
+}
+
+func (c *typeDecoderCache) Clone() *typeDecoderCache {
+ cc := new(typeDecoderCache)
+ c.cache.Range(func(k, v interface{}) bool {
+ if k != nil && v != nil {
+ cc.cache.Store(k, v)
+ }
+ return true
+ })
+ return cc
+}
+
+// atomic.Value requires that all calls to Store() have the same concrete type
+// so we wrap the ValueEncoder with a kindEncoderCacheEntry to ensure the type
+// is always the same (since different concrete types may implement the
+// ValueEncoder interface).
+type kindEncoderCacheEntry struct {
+ enc ValueEncoder
+}
+
+type kindEncoderCache struct {
+ entries [reflect.UnsafePointer + 1]atomic.Value // *kindEncoderCacheEntry
+}
+
+func (c *kindEncoderCache) Store(rt reflect.Kind, enc ValueEncoder) {
+ if enc != nil && rt < reflect.Kind(len(c.entries)) {
+ c.entries[rt].Store(&kindEncoderCacheEntry{enc: enc})
+ }
+}
+
+func (c *kindEncoderCache) Load(rt reflect.Kind) (ValueEncoder, bool) {
+ if rt < reflect.Kind(len(c.entries)) {
+ if ent, ok := c.entries[rt].Load().(*kindEncoderCacheEntry); ok {
+ return ent.enc, ent.enc != nil
+ }
+ }
+ return nil, false
+}
+
+func (c *kindEncoderCache) Clone() *kindEncoderCache {
+ cc := new(kindEncoderCache)
+ for i, v := range c.entries {
+ if val := v.Load(); val != nil {
+ cc.entries[i].Store(val)
+ }
+ }
+ return cc
+}
+
+// atomic.Value requires that all calls to Store() have the same concrete type
+// so we wrap the ValueDecoder with a kindDecoderCacheEntry to ensure the type
+// is always the same (since different concrete types may implement the
+// ValueDecoder interface).
+type kindDecoderCacheEntry struct {
+ dec ValueDecoder
+}
+
+type kindDecoderCache struct {
+ entries [reflect.UnsafePointer + 1]atomic.Value // *kindDecoderCacheEntry
+}
+
+func (c *kindDecoderCache) Store(rt reflect.Kind, dec ValueDecoder) {
+ if rt < reflect.Kind(len(c.entries)) {
+ c.entries[rt].Store(&kindDecoderCacheEntry{dec: dec})
+ }
+}
+
+func (c *kindDecoderCache) Load(rt reflect.Kind) (ValueDecoder, bool) {
+ if rt < reflect.Kind(len(c.entries)) {
+ if ent, ok := c.entries[rt].Load().(*kindDecoderCacheEntry); ok {
+ return ent.dec, ent.dec != nil
+ }
+ }
+ return nil, false
+}
+
+func (c *kindDecoderCache) Clone() *kindDecoderCache {
+ cc := new(kindDecoderCache)
+ for i, v := range c.entries {
+ if val := v.Load(); val != nil {
+ cc.entries[i].Store(val)
+ }
+ }
+ return cc
+}
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go
index b5e22c498ab6..8702d6d39e09 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go
@@ -24,7 +24,7 @@ import (
var (
defaultValueDecoders DefaultValueDecoders
- errCannotTruncate = errors.New("float64 can only be truncated to an integer type when truncation is enabled")
+ errCannotTruncate = errors.New("float64 can only be truncated to a lower precision type when truncation is enabled")
)
type decodeBinaryError struct {
@@ -41,7 +41,7 @@ func newDefaultStructCodec() *StructCodec {
if err != nil {
// This function is called from the codec registration path, so errors can't be propagated. If there's an error
// constructing the StructCodec, we panic to avoid losing it.
- panic(fmt.Errorf("error creating default StructCodec: %v", err))
+ panic(fmt.Errorf("error creating default StructCodec: %w", err))
}
return codec
}
@@ -178,7 +178,7 @@ func (dvd DefaultValueDecoders) DDecodeValue(dc DecodeContext, vr bsonrw.ValueRe
for {
key, elemVr, err := dr.ReadElement()
- if err == bsonrw.ErrEOD {
+ if errors.Is(err, bsonrw.ErrEOD) {
break
} else if err != nil {
return err
@@ -330,7 +330,7 @@ func (DefaultValueDecoders) intDecodeType(dc DecodeContext, vr bsonrw.ValueReade
case reflect.Int64:
return reflect.ValueOf(i64), nil
case reflect.Int:
- if int64(int(i64)) != i64 { // Can we fit this inside of an int
+ if i64 > math.MaxInt { // Can we fit this inside of an int
return emptyValue, fmt.Errorf("%d overflows int", i64)
}
@@ -434,7 +434,7 @@ func (dvd DefaultValueDecoders) UintDecodeValue(dc DecodeContext, vr bsonrw.Valu
return fmt.Errorf("%d overflows uint64", i64)
}
case reflect.Uint:
- if i64 < 0 || int64(uint(i64)) != i64 { // Can we fit this inside of an uint
+ if i64 < 0 || uint64(i64) > uint64(math.MaxUint) { // Can we fit this inside of an uint
return fmt.Errorf("%d overflows uint", i64)
}
default:
@@ -1379,7 +1379,7 @@ func (dvd DefaultValueDecoders) MapDecodeValue(dc DecodeContext, vr bsonrw.Value
keyType := val.Type().Key()
for {
key, vr, err := dr.ReadElement()
- if err == bsonrw.ErrEOD {
+ if errors.Is(err, bsonrw.ErrEOD) {
break
}
if err != nil {
@@ -1521,6 +1521,18 @@ func (dvd DefaultValueDecoders) ValueUnmarshalerDecodeValue(_ DecodeContext, vr
return ValueDecoderError{Name: "ValueUnmarshalerDecodeValue", Types: []reflect.Type{tValueUnmarshaler}, Received: val}
}
+ // If BSON value is null and the go value is a pointer, then don't call
+ // UnmarshalBSONValue. Even if the Go pointer is already initialized (i.e.,
+ // non-nil), encountering null in BSON will result in the pointer being
+ // directly set to nil here. Since the pointer is being replaced with nil,
+ // there is no opportunity (or reason) for the custom UnmarshalBSONValue logic
+ // to be called.
+ if vr.Type() == bsontype.Null && val.Kind() == reflect.Ptr {
+ val.Set(reflect.Zero(val.Type()))
+
+ return vr.ReadNull()
+ }
+
if val.Kind() == reflect.Ptr && val.IsNil() {
if !val.CanSet() {
return ValueDecoderError{Name: "ValueUnmarshalerDecodeValue", Types: []reflect.Type{tValueUnmarshaler}, Received: val}
@@ -1540,12 +1552,12 @@ func (dvd DefaultValueDecoders) ValueUnmarshalerDecodeValue(_ DecodeContext, vr
return err
}
- fn := val.Convert(tValueUnmarshaler).MethodByName("UnmarshalBSONValue")
- errVal := fn.Call([]reflect.Value{reflect.ValueOf(t), reflect.ValueOf(src)})[0]
- if !errVal.IsNil() {
- return errVal.Interface().(error)
+ m, ok := val.Interface().(ValueUnmarshaler)
+ if !ok {
+ // NB: this error should be unreachable due to the above checks
+ return ValueDecoderError{Name: "ValueUnmarshalerDecodeValue", Types: []reflect.Type{tValueUnmarshaler}, Received: val}
}
- return nil
+ return m.UnmarshalBSONValue(t, src)
}
// UnmarshalerDecodeValue is the ValueDecoderFunc for Unmarshaler implementations.
@@ -1588,12 +1600,12 @@ func (dvd DefaultValueDecoders) UnmarshalerDecodeValue(_ DecodeContext, vr bsonr
val = val.Addr() // If the type doesn't implement the interface, a pointer to it must.
}
- fn := val.Convert(tUnmarshaler).MethodByName("UnmarshalBSON")
- errVal := fn.Call([]reflect.Value{reflect.ValueOf(src)})[0]
- if !errVal.IsNil() {
- return errVal.Interface().(error)
+ m, ok := val.Interface().(Unmarshaler)
+ if !ok {
+ // NB: this error should be unreachable due to the above checks
+ return ValueDecoderError{Name: "UnmarshalerDecodeValue", Types: []reflect.Type{tUnmarshaler}, Received: val}
}
- return nil
+ return m.UnmarshalBSON(src)
}
// EmptyInterfaceDecodeValue is the ValueDecoderFunc for interface{}.
@@ -1675,7 +1687,7 @@ func (dvd DefaultValueDecoders) decodeDefault(dc DecodeContext, vr bsonrw.ValueR
idx := 0
for {
vr, err := ar.ReadValue()
- if err == bsonrw.ErrEOA {
+ if errors.Is(err, bsonrw.ErrEOA) {
break
}
if err != nil {
@@ -1787,7 +1799,7 @@ func (DefaultValueDecoders) decodeElemsFromDocumentReader(dc DecodeContext, dr b
elems := make([]reflect.Value, 0)
for {
key, vr, err := dr.ReadElement()
- if err == bsonrw.ErrEOD {
+ if errors.Is(err, bsonrw.ErrEOD) {
break
}
if err != nil {
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_encoders.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_encoders.go
index 7d526c4ef88d..4751ae995e7e 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_encoders.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_encoders.go
@@ -343,7 +343,7 @@ func (dve DefaultValueEncoders) mapEncodeValue(ec EncodeContext, dw bsonrw.Docum
}
currEncoder, currVal, lookupErr := dve.lookupElementEncoder(ec, encoder, val.MapIndex(key))
- if lookupErr != nil && lookupErr != errInvalidValue {
+ if lookupErr != nil && !errors.Is(lookupErr, errInvalidValue) {
return lookupErr
}
@@ -352,7 +352,7 @@ func (dve DefaultValueEncoders) mapEncodeValue(ec EncodeContext, dw bsonrw.Docum
return err
}
- if lookupErr == errInvalidValue {
+ if errors.Is(lookupErr, errInvalidValue) {
err = vw.WriteNull()
if err != nil {
return err
@@ -418,7 +418,7 @@ func (dve DefaultValueEncoders) ArrayEncodeValue(ec EncodeContext, vw bsonrw.Val
for idx := 0; idx < val.Len(); idx++ {
currEncoder, currVal, lookupErr := dve.lookupElementEncoder(ec, encoder, val.Index(idx))
- if lookupErr != nil && lookupErr != errInvalidValue {
+ if lookupErr != nil && !errors.Is(lookupErr, errInvalidValue) {
return lookupErr
}
@@ -427,7 +427,7 @@ func (dve DefaultValueEncoders) ArrayEncodeValue(ec EncodeContext, vw bsonrw.Val
return err
}
- if lookupErr == errInvalidValue {
+ if errors.Is(lookupErr, errInvalidValue) {
err = vw.WriteNull()
if err != nil {
return err
@@ -487,7 +487,7 @@ func (dve DefaultValueEncoders) SliceEncodeValue(ec EncodeContext, vw bsonrw.Val
for idx := 0; idx < val.Len(); idx++ {
currEncoder, currVal, lookupErr := dve.lookupElementEncoder(ec, encoder, val.Index(idx))
- if lookupErr != nil && lookupErr != errInvalidValue {
+ if lookupErr != nil && !errors.Is(lookupErr, errInvalidValue) {
return lookupErr
}
@@ -496,7 +496,7 @@ func (dve DefaultValueEncoders) SliceEncodeValue(ec EncodeContext, vw bsonrw.Val
return err
}
- if lookupErr == errInvalidValue {
+ if errors.Is(lookupErr, errInvalidValue) {
err = vw.WriteNull()
if err != nil {
return err
@@ -564,12 +564,14 @@ func (dve DefaultValueEncoders) ValueMarshalerEncodeValue(_ EncodeContext, vw bs
return ValueEncoderError{Name: "ValueMarshalerEncodeValue", Types: []reflect.Type{tValueMarshaler}, Received: val}
}
- fn := val.Convert(tValueMarshaler).MethodByName("MarshalBSONValue")
- returns := fn.Call(nil)
- if !returns[2].IsNil() {
- return returns[2].Interface().(error)
+ m, ok := val.Interface().(ValueMarshaler)
+ if !ok {
+ return vw.WriteNull()
+ }
+ t, data, err := m.MarshalBSONValue()
+ if err != nil {
+ return err
}
- t, data := returns[0].Interface().(bsontype.Type), returns[1].Interface().([]byte)
return bsonrw.Copier{}.CopyValueFromBytes(vw, t, data)
}
@@ -593,12 +595,14 @@ func (dve DefaultValueEncoders) MarshalerEncodeValue(_ EncodeContext, vw bsonrw.
return ValueEncoderError{Name: "MarshalerEncodeValue", Types: []reflect.Type{tMarshaler}, Received: val}
}
- fn := val.Convert(tMarshaler).MethodByName("MarshalBSON")
- returns := fn.Call(nil)
- if !returns[1].IsNil() {
- return returns[1].Interface().(error)
+ m, ok := val.Interface().(Marshaler)
+ if !ok {
+ return vw.WriteNull()
+ }
+ data, err := m.MarshalBSON()
+ if err != nil {
+ return err
}
- data := returns[0].Interface().([]byte)
return bsonrw.Copier{}.CopyValueFromBytes(vw, bsontype.EmbeddedDocument, data)
}
@@ -622,23 +626,31 @@ func (dve DefaultValueEncoders) ProxyEncodeValue(ec EncodeContext, vw bsonrw.Val
return ValueEncoderError{Name: "ProxyEncodeValue", Types: []reflect.Type{tProxy}, Received: val}
}
- fn := val.Convert(tProxy).MethodByName("ProxyBSON")
- returns := fn.Call(nil)
- if !returns[1].IsNil() {
- return returns[1].Interface().(error)
+ m, ok := val.Interface().(Proxy)
+ if !ok {
+ return vw.WriteNull()
+ }
+ v, err := m.ProxyBSON()
+ if err != nil {
+ return err
+ }
+ if v == nil {
+ encoder, err := ec.LookupEncoder(nil)
+ if err != nil {
+ return err
+ }
+ return encoder.EncodeValue(ec, vw, reflect.ValueOf(nil))
}
- data := returns[0]
- var encoder ValueEncoder
- var err error
- if data.Elem().IsValid() {
- encoder, err = ec.LookupEncoder(data.Elem().Type())
- } else {
- encoder, err = ec.LookupEncoder(nil)
+ vv := reflect.ValueOf(v)
+ switch vv.Kind() {
+ case reflect.Ptr, reflect.Interface:
+ vv = vv.Elem()
}
+ encoder, err := ec.LookupEncoder(vv.Type())
if err != nil {
return err
}
- return encoder.EncodeValue(ec, vw, data.Elem())
+ return encoder.EncodeValue(ec, vw, vv)
}
// JavaScriptEncodeValue is the ValueEncoderFunc for the primitive.JavaScript type.
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/empty_interface_codec.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/empty_interface_codec.go
index 94f7dcf1eb21..098368f0711f 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/empty_interface_codec.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/empty_interface_codec.go
@@ -17,13 +17,27 @@ import (
// EmptyInterfaceCodec is the Codec used for interface{} values.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// EmptyInterfaceCodec registered.
+// Deprecated: EmptyInterfaceCodec will not be directly configurable in Go
+// Driver 2.0. To configure the empty interface encode and decode behavior, use
+// the configuration methods on a [go.mongodb.org/mongo-driver/bson.Encoder] or
+// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the empty interface
+// encode and decode behavior for a mongo.Client, use
+// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions].
+//
+// For example, to configure a mongo.Client to unmarshal BSON binary field
+// values as a Go byte slice, use:
+//
+// opt := options.Client().SetBSONOptions(&options.BSONOptions{
+// BinaryAsSlice: true,
+// })
+//
+// See the deprecation notice for each field in EmptyInterfaceCodec for the
+// corresponding settings.
type EmptyInterfaceCodec struct {
// DecodeBinaryAsSlice causes DecodeValue to unmarshal BSON binary field values that are the
// "Generic" or "Old" BSON binary subtype as a Go byte slice instead of a primitive.Binary.
//
- // Deprecated: Use bson.Decoder.BinaryAsSlice instead.
+ // Deprecated: Use bson.Decoder.BinaryAsSlice or options.BSONOptions.BinaryAsSlice instead.
DecodeBinaryAsSlice bool
}
@@ -38,8 +52,8 @@ var (
// NewEmptyInterfaceCodec returns a EmptyInterfaceCodec with options opts.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// EmptyInterfaceCodec registered.
+// Deprecated: NewEmptyInterfaceCodec will not be available in Go Driver 2.0. See
+// [EmptyInterfaceCodec] for more details.
func NewEmptyInterfaceCodec(opts ...*bsonoptions.EmptyInterfaceCodecOptions) *EmptyInterfaceCodec {
interfaceOpt := bsonoptions.MergeEmptyInterfaceCodecOptions(opts...)
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/map_codec.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/map_codec.go
index 325c1738abec..d7e00ffa8d16 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/map_codec.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/map_codec.go
@@ -8,6 +8,7 @@ package bsoncodec
import (
"encoding"
+ "errors"
"fmt"
"reflect"
"strconv"
@@ -21,25 +22,40 @@ var defaultMapCodec = NewMapCodec()
// MapCodec is the Codec used for map values.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// MapCodec registered.
+// Deprecated: MapCodec will not be directly configurable in Go Driver 2.0. To
+// configure the map encode and decode behavior, use the configuration methods
+// on a [go.mongodb.org/mongo-driver/bson.Encoder] or
+// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the map encode and
+// decode behavior for a mongo.Client, use
+// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions].
+//
+// For example, to configure a mongo.Client to marshal nil Go maps as empty BSON
+// documents, use:
+//
+// opt := options.Client().SetBSONOptions(&options.BSONOptions{
+// NilMapAsEmpty: true,
+// })
+//
+// See the deprecation notice for each field in MapCodec for the corresponding
+// settings.
type MapCodec struct {
// DecodeZerosMap causes DecodeValue to delete any existing values from Go maps in the destination
// value passed to Decode before unmarshaling BSON documents into them.
//
- // Deprecated: Use bson.Decoder.ZeroMaps instead.
+ // Deprecated: Use bson.Decoder.ZeroMaps or options.BSONOptions.ZeroMaps instead.
DecodeZerosMap bool
// EncodeNilAsEmpty causes EncodeValue to marshal nil Go maps as empty BSON documents instead of
// BSON null.
//
- // Deprecated: Use bson.Encoder.NilMapAsEmpty instead.
+ // Deprecated: Use bson.Encoder.NilMapAsEmpty or options.BSONOptions.NilMapAsEmpty instead.
EncodeNilAsEmpty bool
// EncodeKeysWithStringer causes the Encoder to convert Go map keys to BSON document field name
// strings using fmt.Sprintf() instead of the default string conversion logic.
//
- // Deprecated: Use bson.Encoder.StringifyMapKeysWithFmt instead.
+ // Deprecated: Use bson.Encoder.StringifyMapKeysWithFmt or
+ // options.BSONOptions.StringifyMapKeysWithFmt instead.
EncodeKeysWithStringer bool
}
@@ -61,8 +77,8 @@ type KeyUnmarshaler interface {
// NewMapCodec returns a MapCodec with options opts.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// MapCodec registered.
+// Deprecated: NewMapCodec will not be available in Go Driver 2.0. See
+// [MapCodec] for more details.
func NewMapCodec(opts ...*bsonoptions.MapCodecOptions) *MapCodec {
mapOpt := bsonoptions.MergeMapCodecOptions(opts...)
@@ -128,7 +144,7 @@ func (mc *MapCodec) mapEncodeValue(ec EncodeContext, dw bsonrw.DocumentWriter, v
}
currEncoder, currVal, lookupErr := defaultValueEncoders.lookupElementEncoder(ec, encoder, val.MapIndex(key))
- if lookupErr != nil && lookupErr != errInvalidValue {
+ if lookupErr != nil && !errors.Is(lookupErr, errInvalidValue) {
return lookupErr
}
@@ -137,7 +153,7 @@ func (mc *MapCodec) mapEncodeValue(ec EncodeContext, dw bsonrw.DocumentWriter, v
return err
}
- if lookupErr == errInvalidValue {
+ if errors.Is(lookupErr, errInvalidValue) {
err = vw.WriteNull()
if err != nil {
return err
@@ -200,7 +216,7 @@ func (mc *MapCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val ref
for {
key, vr, err := dr.ReadElement()
- if err == bsonrw.ErrEOD {
+ if errors.Is(err, bsonrw.ErrEOD) {
break
}
if err != nil {
@@ -313,7 +329,7 @@ func (mc *MapCodec) decodeKey(key string, keyType reflect.Type) (reflect.Value,
if mc.EncodeKeysWithStringer {
parsed, err := strconv.ParseFloat(key, 64)
if err != nil {
- return keyVal, fmt.Errorf("Map key is defined to be a decimal type (%v) but got error %v", keyType.Kind(), err)
+ return keyVal, fmt.Errorf("Map key is defined to be a decimal type (%v) but got error %w", keyType.Kind(), err)
}
keyVal = reflect.ValueOf(parsed)
break
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/pointer_codec.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/pointer_codec.go
index a1bf9c3e2b1c..ddfa4a33e180 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/pointer_codec.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/pointer_codec.go
@@ -8,7 +8,6 @@ package bsoncodec
import (
"reflect"
- "sync"
"go.mongodb.org/mongo-driver/bson/bsonrw"
"go.mongodb.org/mongo-driver/bson/bsontype"
@@ -19,23 +18,27 @@ var _ ValueDecoder = &PointerCodec{}
// PointerCodec is the Codec used for pointers.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// PointerCodec registered.
+// Deprecated: PointerCodec will not be directly accessible in Go Driver 2.0. To
+// override the default pointer encode and decode behavior, create a new registry
+// with [go.mongodb.org/mongo-driver/bson.NewRegistry] and register a new
+// encoder and decoder for pointers.
+//
+// For example,
+//
+// reg := bson.NewRegistry()
+// reg.RegisterKindEncoder(reflect.Ptr, myPointerEncoder)
+// reg.RegisterKindDecoder(reflect.Ptr, myPointerDecoder)
type PointerCodec struct {
- ecache map[reflect.Type]ValueEncoder
- dcache map[reflect.Type]ValueDecoder
- l sync.RWMutex
+ ecache typeEncoderCache
+ dcache typeDecoderCache
}
// NewPointerCodec returns a PointerCodec that has been initialized.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// PointerCodec registered.
+// Deprecated: NewPointerCodec will not be available in Go Driver 2.0. See
+// [PointerCodec] for more details.
func NewPointerCodec() *PointerCodec {
- return &PointerCodec{
- ecache: make(map[reflect.Type]ValueEncoder),
- dcache: make(map[reflect.Type]ValueDecoder),
- }
+ return &PointerCodec{}
}
// EncodeValue handles encoding a pointer by either encoding it to BSON Null if the pointer is nil
@@ -52,24 +55,19 @@ func (pc *PointerCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val
return vw.WriteNull()
}
- pc.l.RLock()
- enc, ok := pc.ecache[val.Type()]
- pc.l.RUnlock()
- if ok {
- if enc == nil {
- return ErrNoEncoder{Type: val.Type()}
+ typ := val.Type()
+ if v, ok := pc.ecache.Load(typ); ok {
+ if v == nil {
+ return ErrNoEncoder{Type: typ}
}
- return enc.EncodeValue(ec, vw, val.Elem())
+ return v.EncodeValue(ec, vw, val.Elem())
}
-
- enc, err := ec.LookupEncoder(val.Type().Elem())
- pc.l.Lock()
- pc.ecache[val.Type()] = enc
- pc.l.Unlock()
+ // TODO(charlie): handle concurrent requests for the same type
+ enc, err := ec.LookupEncoder(typ.Elem())
+ enc = pc.ecache.LoadOrStore(typ, enc)
if err != nil {
return err
}
-
return enc.EncodeValue(ec, vw, val.Elem())
}
@@ -80,36 +78,31 @@ func (pc *PointerCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val
return ValueDecoderError{Name: "PointerCodec.DecodeValue", Kinds: []reflect.Kind{reflect.Ptr}, Received: val}
}
+ typ := val.Type()
if vr.Type() == bsontype.Null {
- val.Set(reflect.Zero(val.Type()))
+ val.Set(reflect.Zero(typ))
return vr.ReadNull()
}
if vr.Type() == bsontype.Undefined {
- val.Set(reflect.Zero(val.Type()))
+ val.Set(reflect.Zero(typ))
return vr.ReadUndefined()
}
if val.IsNil() {
- val.Set(reflect.New(val.Type().Elem()))
+ val.Set(reflect.New(typ.Elem()))
}
- pc.l.RLock()
- dec, ok := pc.dcache[val.Type()]
- pc.l.RUnlock()
- if ok {
- if dec == nil {
- return ErrNoDecoder{Type: val.Type()}
+ if v, ok := pc.dcache.Load(typ); ok {
+ if v == nil {
+ return ErrNoDecoder{Type: typ}
}
- return dec.DecodeValue(dc, vr, val.Elem())
+ return v.DecodeValue(dc, vr, val.Elem())
}
-
- dec, err := dc.LookupDecoder(val.Type().Elem())
- pc.l.Lock()
- pc.dcache[val.Type()] = dec
- pc.l.Unlock()
+ // TODO(charlie): handle concurrent requests for the same type
+ dec, err := dc.LookupDecoder(typ.Elem())
+ dec = pc.dcache.LoadOrStore(typ, dec)
if err != nil {
return err
}
-
return dec.DecodeValue(dc, vr, val.Elem())
}
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go
index 930de28490a4..196c491bbbf1 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go
@@ -216,72 +216,42 @@ func (rb *RegistryBuilder) RegisterTypeMapEntry(bt bsontype.Type, rt reflect.Typ
//
// Deprecated: Use NewRegistry instead.
func (rb *RegistryBuilder) Build() *Registry {
- registry := new(Registry)
-
- registry.typeEncoders = make(map[reflect.Type]ValueEncoder, len(rb.registry.typeEncoders))
- for t, enc := range rb.registry.typeEncoders {
- registry.typeEncoders[t] = enc
- }
-
- registry.typeDecoders = make(map[reflect.Type]ValueDecoder, len(rb.registry.typeDecoders))
- for t, dec := range rb.registry.typeDecoders {
- registry.typeDecoders[t] = dec
- }
-
- registry.interfaceEncoders = make([]interfaceValueEncoder, len(rb.registry.interfaceEncoders))
- copy(registry.interfaceEncoders, rb.registry.interfaceEncoders)
-
- registry.interfaceDecoders = make([]interfaceValueDecoder, len(rb.registry.interfaceDecoders))
- copy(registry.interfaceDecoders, rb.registry.interfaceDecoders)
-
- registry.kindEncoders = make(map[reflect.Kind]ValueEncoder)
- for kind, enc := range rb.registry.kindEncoders {
- registry.kindEncoders[kind] = enc
- }
-
- registry.kindDecoders = make(map[reflect.Kind]ValueDecoder)
- for kind, dec := range rb.registry.kindDecoders {
- registry.kindDecoders[kind] = dec
+ r := &Registry{
+ interfaceEncoders: append([]interfaceValueEncoder(nil), rb.registry.interfaceEncoders...),
+ interfaceDecoders: append([]interfaceValueDecoder(nil), rb.registry.interfaceDecoders...),
+ typeEncoders: rb.registry.typeEncoders.Clone(),
+ typeDecoders: rb.registry.typeDecoders.Clone(),
+ kindEncoders: rb.registry.kindEncoders.Clone(),
+ kindDecoders: rb.registry.kindDecoders.Clone(),
}
-
- registry.typeMap = make(map[bsontype.Type]reflect.Type)
- for bt, rt := range rb.registry.typeMap {
- registry.typeMap[bt] = rt
- }
-
- return registry
+ rb.registry.typeMap.Range(func(k, v interface{}) bool {
+ if k != nil && v != nil {
+ r.typeMap.Store(k, v)
+ }
+ return true
+ })
+ return r
}
// A Registry is used to store and retrieve codecs for types and interfaces. This type is the main
// typed passed around and Encoders and Decoders are constructed from it.
type Registry struct {
- typeEncoders map[reflect.Type]ValueEncoder
- typeDecoders map[reflect.Type]ValueDecoder
-
interfaceEncoders []interfaceValueEncoder
interfaceDecoders []interfaceValueDecoder
-
- kindEncoders map[reflect.Kind]ValueEncoder
- kindDecoders map[reflect.Kind]ValueDecoder
-
- typeMap map[bsontype.Type]reflect.Type
-
- mu sync.RWMutex
+ typeEncoders *typeEncoderCache
+ typeDecoders *typeDecoderCache
+ kindEncoders *kindEncoderCache
+ kindDecoders *kindDecoderCache
+ typeMap sync.Map // map[bsontype.Type]reflect.Type
}
// NewRegistry creates a new empty Registry.
func NewRegistry() *Registry {
return &Registry{
- typeEncoders: make(map[reflect.Type]ValueEncoder),
- typeDecoders: make(map[reflect.Type]ValueDecoder),
-
- interfaceEncoders: make([]interfaceValueEncoder, 0),
- interfaceDecoders: make([]interfaceValueDecoder, 0),
-
- kindEncoders: make(map[reflect.Kind]ValueEncoder),
- kindDecoders: make(map[reflect.Kind]ValueDecoder),
-
- typeMap: make(map[bsontype.Type]reflect.Type),
+ typeEncoders: new(typeEncoderCache),
+ typeDecoders: new(typeDecoderCache),
+ kindEncoders: new(kindEncoderCache),
+ kindDecoders: new(kindDecoderCache),
}
}
@@ -296,7 +266,7 @@ func NewRegistry() *Registry {
//
// RegisterTypeEncoder should not be called concurrently with any other Registry method.
func (r *Registry) RegisterTypeEncoder(valueType reflect.Type, enc ValueEncoder) {
- r.typeEncoders[valueType] = enc
+ r.typeEncoders.Store(valueType, enc)
}
// RegisterTypeDecoder registers the provided ValueDecoder for the provided type.
@@ -310,7 +280,7 @@ func (r *Registry) RegisterTypeEncoder(valueType reflect.Type, enc ValueEncoder)
//
// RegisterTypeDecoder should not be called concurrently with any other Registry method.
func (r *Registry) RegisterTypeDecoder(valueType reflect.Type, dec ValueDecoder) {
- r.typeDecoders[valueType] = dec
+ r.typeDecoders.Store(valueType, dec)
}
// RegisterKindEncoder registers the provided ValueEncoder for the provided kind.
@@ -326,7 +296,7 @@ func (r *Registry) RegisterTypeDecoder(valueType reflect.Type, dec ValueDecoder)
//
// RegisterKindEncoder should not be called concurrently with any other Registry method.
func (r *Registry) RegisterKindEncoder(kind reflect.Kind, enc ValueEncoder) {
- r.kindEncoders[kind] = enc
+ r.kindEncoders.Store(kind, enc)
}
// RegisterKindDecoder registers the provided ValueDecoder for the provided kind.
@@ -342,7 +312,7 @@ func (r *Registry) RegisterKindEncoder(kind reflect.Kind, enc ValueEncoder) {
//
// RegisterKindDecoder should not be called concurrently with any other Registry method.
func (r *Registry) RegisterKindDecoder(kind reflect.Kind, dec ValueDecoder) {
- r.kindDecoders[kind] = dec
+ r.kindDecoders.Store(kind, dec)
}
// RegisterInterfaceEncoder registers an encoder for the provided interface type iface. This encoder will
@@ -401,7 +371,7 @@ func (r *Registry) RegisterInterfaceDecoder(iface reflect.Type, dec ValueDecoder
//
// reg.RegisterTypeMapEntry(bsontype.EmbeddedDocument, reflect.TypeOf(bson.Raw{}))
func (r *Registry) RegisterTypeMapEntry(bt bsontype.Type, rt reflect.Type) {
- r.typeMap[bt] = rt
+ r.typeMap.Store(bt, rt)
}
// LookupEncoder returns the first matching encoder in the Registry. It uses the following lookup
@@ -418,9 +388,10 @@ func (r *Registry) RegisterTypeMapEntry(bt bsontype.Type, rt reflect.Type) {
// If no encoder is found, an error of type ErrNoEncoder is returned. LookupEncoder is safe for
// concurrent use by multiple goroutines after all codecs and encoders are registered.
func (r *Registry) LookupEncoder(valueType reflect.Type) (ValueEncoder, error) {
- r.mu.RLock()
+ if valueType == nil {
+ return nil, ErrNoEncoder{Type: valueType}
+ }
enc, found := r.lookupTypeEncoder(valueType)
- r.mu.RUnlock()
if found {
if enc == nil {
return nil, ErrNoEncoder{Type: valueType}
@@ -430,36 +401,21 @@ func (r *Registry) LookupEncoder(valueType reflect.Type) (ValueEncoder, error) {
enc, found = r.lookupInterfaceEncoder(valueType, true)
if found {
- r.mu.Lock()
- r.typeEncoders[valueType] = enc
- r.mu.Unlock()
- return enc, nil
+ return r.typeEncoders.LoadOrStore(valueType, enc), nil
}
- if valueType == nil {
- r.mu.Lock()
- r.typeEncoders[valueType] = nil
- r.mu.Unlock()
- return nil, ErrNoEncoder{Type: valueType}
- }
-
- enc, found = r.kindEncoders[valueType.Kind()]
- if !found {
- r.mu.Lock()
- r.typeEncoders[valueType] = nil
- r.mu.Unlock()
- return nil, ErrNoEncoder{Type: valueType}
+ if v, ok := r.kindEncoders.Load(valueType.Kind()); ok {
+ return r.storeTypeEncoder(valueType, v), nil
}
+ return nil, ErrNoEncoder{Type: valueType}
+}
- r.mu.Lock()
- r.typeEncoders[valueType] = enc
- r.mu.Unlock()
- return enc, nil
+func (r *Registry) storeTypeEncoder(rt reflect.Type, enc ValueEncoder) ValueEncoder {
+ return r.typeEncoders.LoadOrStore(rt, enc)
}
-func (r *Registry) lookupTypeEncoder(valueType reflect.Type) (ValueEncoder, bool) {
- enc, found := r.typeEncoders[valueType]
- return enc, found
+func (r *Registry) lookupTypeEncoder(rt reflect.Type) (ValueEncoder, bool) {
+ return r.typeEncoders.Load(rt)
}
func (r *Registry) lookupInterfaceEncoder(valueType reflect.Type, allowAddr bool) (ValueEncoder, bool) {
@@ -475,7 +431,7 @@ func (r *Registry) lookupInterfaceEncoder(valueType reflect.Type, allowAddr bool
// ahead in interfaceEncoders
defaultEnc, found := r.lookupInterfaceEncoder(valueType, false)
if !found {
- defaultEnc = r.kindEncoders[valueType.Kind()]
+ defaultEnc, _ = r.kindEncoders.Load(valueType.Kind())
}
return newCondAddrEncoder(ienc.ve, defaultEnc), true
}
@@ -500,10 +456,7 @@ func (r *Registry) LookupDecoder(valueType reflect.Type) (ValueDecoder, error) {
if valueType == nil {
return nil, ErrNilType
}
- decodererr := ErrNoDecoder{Type: valueType}
- r.mu.RLock()
dec, found := r.lookupTypeDecoder(valueType)
- r.mu.RUnlock()
if found {
if dec == nil {
return nil, ErrNoDecoder{Type: valueType}
@@ -513,29 +466,21 @@ func (r *Registry) LookupDecoder(valueType reflect.Type) (ValueDecoder, error) {
dec, found = r.lookupInterfaceDecoder(valueType, true)
if found {
- r.mu.Lock()
- r.typeDecoders[valueType] = dec
- r.mu.Unlock()
- return dec, nil
+ return r.storeTypeDecoder(valueType, dec), nil
}
- dec, found = r.kindDecoders[valueType.Kind()]
- if !found {
- r.mu.Lock()
- r.typeDecoders[valueType] = nil
- r.mu.Unlock()
- return nil, decodererr
+ if v, ok := r.kindDecoders.Load(valueType.Kind()); ok {
+ return r.storeTypeDecoder(valueType, v), nil
}
-
- r.mu.Lock()
- r.typeDecoders[valueType] = dec
- r.mu.Unlock()
- return dec, nil
+ return nil, ErrNoDecoder{Type: valueType}
}
func (r *Registry) lookupTypeDecoder(valueType reflect.Type) (ValueDecoder, bool) {
- dec, found := r.typeDecoders[valueType]
- return dec, found
+ return r.typeDecoders.Load(valueType)
+}
+
+func (r *Registry) storeTypeDecoder(typ reflect.Type, dec ValueDecoder) ValueDecoder {
+ return r.typeDecoders.LoadOrStore(typ, dec)
}
func (r *Registry) lookupInterfaceDecoder(valueType reflect.Type, allowAddr bool) (ValueDecoder, bool) {
@@ -548,7 +493,7 @@ func (r *Registry) lookupInterfaceDecoder(valueType reflect.Type, allowAddr bool
// ahead in interfaceDecoders
defaultDec, found := r.lookupInterfaceDecoder(valueType, false)
if !found {
- defaultDec = r.kindDecoders[valueType.Kind()]
+ defaultDec, _ = r.kindDecoders.Load(valueType.Kind())
}
return newCondAddrDecoder(idec.vd, defaultDec), true
}
@@ -561,11 +506,11 @@ func (r *Registry) lookupInterfaceDecoder(valueType reflect.Type, allowAddr bool
//
// LookupTypeMapEntry should not be called concurrently with any other Registry method.
func (r *Registry) LookupTypeMapEntry(bt bsontype.Type) (reflect.Type, error) {
- t, ok := r.typeMap[bt]
- if !ok || t == nil {
+ v, ok := r.typeMap.Load(bt)
+ if v == nil || !ok {
return nil, ErrNoTypeMapEntry{Type: bt}
}
- return t, nil
+ return v.(reflect.Type), nil
}
type interfaceValueEncoder struct {
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/slice_codec.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/slice_codec.go
index 20c3e7549ca3..14c9fd25646e 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/slice_codec.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/slice_codec.go
@@ -7,6 +7,7 @@
package bsoncodec
import (
+ "errors"
"fmt"
"reflect"
@@ -20,8 +21,22 @@ var defaultSliceCodec = NewSliceCodec()
// SliceCodec is the Codec used for slice values.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// SliceCodec registered.
+// Deprecated: SliceCodec will not be directly configurable in Go Driver 2.0. To
+// configure the slice encode and decode behavior, use the configuration methods
+// on a [go.mongodb.org/mongo-driver/bson.Encoder] or
+// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the slice encode and
+// decode behavior for a mongo.Client, use
+// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions].
+//
+// For example, to configure a mongo.Client to marshal nil Go slices as empty
+// BSON arrays, use:
+//
+// opt := options.Client().SetBSONOptions(&options.BSONOptions{
+// NilSliceAsEmpty: true,
+// })
+//
+// See the deprecation notice for each field in SliceCodec for the corresponding
+// settings.
type SliceCodec struct {
// EncodeNilAsEmpty causes EncodeValue to marshal nil Go slices as empty BSON arrays instead of
// BSON null.
@@ -32,8 +47,8 @@ type SliceCodec struct {
// NewSliceCodec returns a MapCodec with options opts.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// SliceCodec registered.
+// Deprecated: NewSliceCodec will not be available in Go Driver 2.0. See
+// [SliceCodec] for more details.
func NewSliceCodec(opts ...*bsonoptions.SliceCodecOptions) *SliceCodec {
sliceOpt := bsonoptions.MergeSliceCodecOptions(opts...)
@@ -62,7 +77,7 @@ func (sc SliceCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val re
}
// If we have a []primitive.E we want to treat it as a document instead of as an array.
- if val.Type().ConvertibleTo(tD) {
+ if val.Type() == tD || val.Type().ConvertibleTo(tD) {
d := val.Convert(tD).Interface().(primitive.D)
dw, err := vw.WriteDocument()
@@ -93,7 +108,7 @@ func (sc SliceCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val re
for idx := 0; idx < val.Len(); idx++ {
currEncoder, currVal, lookupErr := defaultValueEncoders.lookupElementEncoder(ec, encoder, val.Index(idx))
- if lookupErr != nil && lookupErr != errInvalidValue {
+ if lookupErr != nil && !errors.Is(lookupErr, errInvalidValue) {
return lookupErr
}
@@ -102,7 +117,7 @@ func (sc SliceCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val re
return err
}
- if lookupErr == errInvalidValue {
+ if errors.Is(lookupErr, errInvalidValue) {
err = vw.WriteNull()
if err != nil {
return err
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/string_codec.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/string_codec.go
index ff931b7253bc..a8f885a854f4 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/string_codec.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/string_codec.go
@@ -17,8 +17,16 @@ import (
// StringCodec is the Codec used for string values.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// StringCodec registered.
+// Deprecated: StringCodec will not be directly accessible in Go Driver 2.0. To
+// override the default string encode and decode behavior, create a new registry
+// with [go.mongodb.org/mongo-driver/bson.NewRegistry] and register a new
+// encoder and decoder for strings.
+//
+// For example,
+//
+// reg := bson.NewRegistry()
+// reg.RegisterKindEncoder(reflect.String, myStringEncoder)
+// reg.RegisterKindDecoder(reflect.String, myStringDecoder)
type StringCodec struct {
// DecodeObjectIDAsHex specifies if object IDs should be decoded as their hex representation.
// If false, a string made from the raw object ID bytes will be used. Defaults to true.
@@ -38,8 +46,8 @@ var (
// NewStringCodec returns a StringCodec with options opts.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// StringCodec registered.
+// Deprecated: NewStringCodec will not be available in Go Driver 2.0. See
+// [StringCodec] for more details.
func NewStringCodec(opts ...*bsonoptions.StringCodecOptions) *StringCodec {
stringOpt := bsonoptions.MergeStringCodecOptions(opts...)
return &StringCodec{*stringOpt.DecodeObjectIDAsHex}
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go
index 1dfdd98865b3..f8d9690c139e 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go
@@ -60,17 +60,30 @@ type Zeroer interface {
// StructCodec is the Codec used for struct values.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// StructCodec registered.
+// Deprecated: StructCodec will not be directly configurable in Go Driver 2.0.
+// To configure the struct encode and decode behavior, use the configuration
+// methods on a [go.mongodb.org/mongo-driver/bson.Encoder] or
+// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the struct encode
+// and decode behavior for a mongo.Client, use
+// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions].
+//
+// For example, to configure a mongo.Client to omit zero-value structs when
+// using the "omitempty" struct tag, use:
+//
+// opt := options.Client().SetBSONOptions(&options.BSONOptions{
+// OmitZeroStruct: true,
+// })
+//
+// See the deprecation notice for each field in StructCodec for the corresponding
+// settings.
type StructCodec struct {
- cache map[reflect.Type]*structDescription
- l sync.RWMutex
+ cache sync.Map // map[reflect.Type]*structDescription
parser StructTagParser
// DecodeZeroStruct causes DecodeValue to delete any existing values from Go structs in the
// destination value passed to Decode before unmarshaling BSON documents into them.
//
- // Deprecated: Use bson.Decoder.ZeroStructs instead.
+ // Deprecated: Use bson.Decoder.ZeroStructs or options.BSONOptions.ZeroStructs instead.
DecodeZeroStruct bool
// DecodeDeepZeroInline causes DecodeValue to delete any existing values from Go structs in the
@@ -83,7 +96,7 @@ type StructCodec struct {
// MyStruct{}) as empty and omit it from the marshaled BSON when the "omitempty" struct tag
// option is set.
//
- // Deprecated: Use bson.Encoder.OmitZeroStruct instead.
+ // Deprecated: Use bson.Encoder.OmitZeroStruct or options.BSONOptions.OmitZeroStruct instead.
EncodeOmitDefaultStruct bool
// AllowUnexportedFields allows encoding and decoding values from un-exported struct fields.
@@ -96,7 +109,8 @@ type StructCodec struct {
// a duplicate field in the marshaled BSON when the "inline" struct tag option is set. The
// default value is true.
//
- // Deprecated: Use bson.Encoder.ErrorOnInlineDuplicates instead.
+ // Deprecated: Use bson.Encoder.ErrorOnInlineDuplicates or
+ // options.BSONOptions.ErrorOnInlineDuplicates instead.
OverwriteDuplicatedInlinedFields bool
}
@@ -105,8 +119,8 @@ var _ ValueDecoder = &StructCodec{}
// NewStructCodec returns a StructCodec that uses p for struct tag parsing.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// StructCodec registered.
+// Deprecated: NewStructCodec will not be available in Go Driver 2.0. See
+// [StructCodec] for more details.
func NewStructCodec(p StructTagParser, opts ...*bsonoptions.StructCodecOptions) (*StructCodec, error) {
if p == nil {
return nil, errors.New("a StructTagParser must be provided to NewStructCodec")
@@ -115,7 +129,6 @@ func NewStructCodec(p StructTagParser, opts ...*bsonoptions.StructCodecOptions)
structOpt := bsonoptions.MergeStructCodecOptions(opts...)
codec := &StructCodec{
- cache: make(map[reflect.Type]*structDescription),
parser: p,
}
@@ -166,11 +179,11 @@ func (sc *StructCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val
desc.encoder, rv, err = defaultValueEncoders.lookupElementEncoder(ec, desc.encoder, rv)
- if err != nil && err != errInvalidValue {
+ if err != nil && !errors.Is(err, errInvalidValue) {
return err
}
- if err == errInvalidValue {
+ if errors.Is(err, errInvalidValue) {
if desc.omitEmpty {
continue
}
@@ -191,18 +204,17 @@ func (sc *StructCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val
encoder := desc.encoder
- var zero bool
- rvInterface := rv.Interface()
+ var empty bool
if cz, ok := encoder.(CodecZeroer); ok {
- zero = cz.IsTypeZero(rvInterface)
+ empty = cz.IsTypeZero(rv.Interface())
} else if rv.Kind() == reflect.Interface {
- // isZero will not treat an interface rv as an interface, so we need to check for the
- // zero interface separately.
- zero = rv.IsNil()
+ // isEmpty will not treat an interface rv as an interface, so we need to check for the
+ // nil interface separately.
+ empty = rv.IsNil()
} else {
- zero = isZero(rvInterface, sc.EncodeOmitDefaultStruct || ec.omitZeroStruct)
+ empty = isEmpty(rv, sc.EncodeOmitDefaultStruct || ec.omitZeroStruct)
}
- if desc.omitEmpty && zero {
+ if desc.omitEmpty && empty {
continue
}
@@ -242,8 +254,8 @@ func (sc *StructCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val
}
func newDecodeError(key string, original error) error {
- de, ok := original.(*DecodeError)
- if !ok {
+ var de *DecodeError
+ if !errors.As(original, &de) {
return &DecodeError{
keys: []string{key},
wrapped: original,
@@ -311,7 +323,7 @@ func (sc *StructCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val
for {
name, vr, err := dr.ReadElement()
- if err == bsonrw.ErrEOD {
+ if errors.Is(err, bsonrw.ErrEOD) {
break
}
if err != nil {
@@ -394,56 +406,35 @@ func (sc *StructCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val
return nil
}
-func isZero(i interface{}, omitZeroStruct bool) bool {
- v := reflect.ValueOf(i)
-
- // check the value validity
- if !v.IsValid() {
- return true
- }
-
- if z, ok := v.Interface().(Zeroer); ok && (v.Kind() != reflect.Ptr || !v.IsNil()) {
- return z.IsZero()
+func isEmpty(v reflect.Value, omitZeroStruct bool) bool {
+ kind := v.Kind()
+ if (kind != reflect.Ptr || !v.IsNil()) && v.Type().Implements(tZeroer) {
+ return v.Interface().(Zeroer).IsZero()
}
-
- switch v.Kind() {
+ switch kind {
case reflect.Array, reflect.Map, reflect.Slice, reflect.String:
return v.Len() == 0
- case reflect.Bool:
- return !v.Bool()
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- return v.Int() == 0
- case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
- return v.Uint() == 0
- case reflect.Float32, reflect.Float64:
- return v.Float() == 0
- case reflect.Interface, reflect.Ptr:
- return v.IsNil()
case reflect.Struct:
if !omitZeroStruct {
return false
}
-
- // TODO(GODRIVER-2820): Update the logic to be able to handle private struct fields.
- // TODO Use condition "reflect.Zero(v.Type()).Equal(v)" instead.
-
vt := v.Type()
if vt == tTime {
return v.Interface().(time.Time).IsZero()
}
- for i := 0; i < v.NumField(); i++ {
- if vt.Field(i).PkgPath != "" && !vt.Field(i).Anonymous {
+ numField := vt.NumField()
+ for i := 0; i < numField; i++ {
+ ff := vt.Field(i)
+ if ff.PkgPath != "" && !ff.Anonymous {
continue // Private field
}
- fld := v.Field(i)
- if !isZero(fld.Interface(), omitZeroStruct) {
+ if !isEmpty(v.Field(i), omitZeroStruct) {
return false
}
}
return true
}
-
- return false
+ return !v.IsValid() || v.IsZero()
}
type structDescription struct {
@@ -502,13 +493,27 @@ func (sc *StructCodec) describeStruct(
) (*structDescription, error) {
// We need to analyze the struct, including getting the tags, collecting
// information about inlining, and create a map of the field name to the field.
- sc.l.RLock()
- ds, exists := sc.cache[t]
- sc.l.RUnlock()
- if exists {
- return ds, nil
+ if v, ok := sc.cache.Load(t); ok {
+ return v.(*structDescription), nil
+ }
+ // TODO(charlie): Only describe the struct once when called
+ // concurrently with the same type.
+ ds, err := sc.describeStructSlow(r, t, useJSONStructTags, errorOnDuplicates)
+ if err != nil {
+ return nil, err
}
+ if v, loaded := sc.cache.LoadOrStore(t, ds); loaded {
+ ds = v.(*structDescription)
+ }
+ return ds, nil
+}
+func (sc *StructCodec) describeStructSlow(
+ r *Registry,
+ t reflect.Type,
+ useJSONStructTags bool,
+ errorOnDuplicates bool,
+) (*structDescription, error) {
numFields := t.NumField()
sd := &structDescription{
fm: make(map[string]fieldDescription, numFields),
@@ -639,10 +644,6 @@ func (sc *StructCodec) describeStruct(
sort.Sort(byIndex(sd.fl))
- sc.l.Lock()
- sc.cache[t] = sd
- sc.l.Unlock()
-
return sd, nil
}
@@ -700,21 +701,21 @@ func getInlineField(val reflect.Value, index []int) (reflect.Value, error) {
// DeepZero returns recursive zero object
func deepZero(st reflect.Type) (result reflect.Value) {
- result = reflect.Indirect(reflect.New(st))
-
- if result.Kind() == reflect.Struct {
- for i := 0; i < result.NumField(); i++ {
- if f := result.Field(i); f.Kind() == reflect.Ptr {
- if f.CanInterface() {
- if ft := reflect.TypeOf(f.Interface()); ft.Elem().Kind() == reflect.Struct {
- result.Field(i).Set(recursivePointerTo(deepZero(ft.Elem())))
- }
+ if st.Kind() == reflect.Struct {
+ numField := st.NumField()
+ for i := 0; i < numField; i++ {
+ if result == emptyValue {
+ result = reflect.Indirect(reflect.New(st))
+ }
+ f := result.Field(i)
+ if f.CanInterface() {
+ if f.Type().Kind() == reflect.Struct {
+ result.Field(i).Set(recursivePointerTo(deepZero(f.Type().Elem())))
}
}
}
}
-
- return
+ return result
}
// recursivePointerTo calls reflect.New(v.Type) but recursively for its fields inside
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/time_codec.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/time_codec.go
index 7b005a9958ae..22fb762c4151 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/time_codec.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/time_codec.go
@@ -23,12 +23,26 @@ const (
// TimeCodec is the Codec used for time.Time values.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// TimeCodec registered.
+// Deprecated: TimeCodec will not be directly configurable in Go Driver 2.0.
+// To configure the time.Time encode and decode behavior, use the configuration
+// methods on a [go.mongodb.org/mongo-driver/bson.Encoder] or
+// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the time.Time encode
+// and decode behavior for a mongo.Client, use
+// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions].
+//
+// For example, to configure a mongo.Client to ..., use:
+//
+// opt := options.Client().SetBSONOptions(&options.BSONOptions{
+// UseLocalTimeZone: true,
+// })
+//
+// See the deprecation notice for each field in TimeCodec for the corresponding
+// settings.
type TimeCodec struct {
// UseLocalTimeZone specifies if we should decode into the local time zone. Defaults to false.
//
- // Deprecated: Use bson.Decoder.UseLocalTimeZone instead.
+ // Deprecated: Use bson.Decoder.UseLocalTimeZone or options.BSONOptions.UseLocalTimeZone
+ // instead.
UseLocalTimeZone bool
}
@@ -42,8 +56,8 @@ var (
// NewTimeCodec returns a TimeCodec with options opts.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// TimeCodec registered.
+// Deprecated: NewTimeCodec will not be available in Go Driver 2.0. See
+// [TimeCodec] for more details.
func NewTimeCodec(opts ...*bsonoptions.TimeCodecOptions) *TimeCodec {
timeOpt := bsonoptions.MergeTimeCodecOptions(opts...)
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/types.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/types.go
index 07f4b70e6d54..6ade17b7d3fd 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/types.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/types.go
@@ -34,6 +34,7 @@ var tValueUnmarshaler = reflect.TypeOf((*ValueUnmarshaler)(nil)).Elem()
var tMarshaler = reflect.TypeOf((*Marshaler)(nil)).Elem()
var tUnmarshaler = reflect.TypeOf((*Unmarshaler)(nil)).Elem()
var tProxy = reflect.TypeOf((*Proxy)(nil)).Elem()
+var tZeroer = reflect.TypeOf((*Zeroer)(nil)).Elem()
var tBinary = reflect.TypeOf(primitive.Binary{})
var tUndefined = reflect.TypeOf(primitive.Undefined{})
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/uint_codec.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/uint_codec.go
index 7eb1069050e9..39b07135b182 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/uint_codec.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/uint_codec.go
@@ -18,13 +18,27 @@ import (
// UIntCodec is the Codec used for uint values.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// UIntCodec registered.
+// Deprecated: UIntCodec will not be directly configurable in Go Driver 2.0. To
+// configure the uint encode and decode behavior, use the configuration methods
+// on a [go.mongodb.org/mongo-driver/bson.Encoder] or
+// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the uint encode and
+// decode behavior for a mongo.Client, use
+// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions].
+//
+// For example, to configure a mongo.Client to marshal Go uint values as the
+// minimum BSON int size that can represent the value, use:
+//
+// opt := options.Client().SetBSONOptions(&options.BSONOptions{
+// IntMinSize: true,
+// })
+//
+// See the deprecation notice for each field in UIntCodec for the corresponding
+// settings.
type UIntCodec struct {
// EncodeToMinSize causes EncodeValue to marshal Go uint values (excluding uint64) as the
// minimum BSON int size (either 32-bit or 64-bit) that can represent the integer value.
//
- // Deprecated: Use bson.Encoder.IntMinSize instead.
+ // Deprecated: Use bson.Encoder.IntMinSize or options.BSONOptions.IntMinSize instead.
EncodeToMinSize bool
}
@@ -38,8 +52,8 @@ var (
// NewUIntCodec returns a UIntCodec with options opts.
//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with the
-// UIntCodec registered.
+// Deprecated: NewUIntCodec will not be available in Go Driver 2.0. See
+// [UIntCodec] for more details.
func NewUIntCodec(opts ...*bsonoptions.UIntCodecOptions) *UIntCodec {
uintOpt := bsonoptions.MergeUIntCodecOptions(opts...)
@@ -150,11 +164,15 @@ func (uic *UIntCodec) decodeType(dc DecodeContext, vr bsonrw.ValueReader, t refl
return reflect.ValueOf(uint64(i64)), nil
case reflect.Uint:
- if i64 < 0 || int64(uint(i64)) != i64 { // Can we fit this inside of an uint
+ if i64 < 0 {
+ return emptyValue, fmt.Errorf("%d overflows uint", i64)
+ }
+ v := uint64(i64)
+ if v > math.MaxUint { // Can we fit this inside of an uint
return emptyValue, fmt.Errorf("%d overflows uint", i64)
}
- return reflect.ValueOf(uint(i64)), nil
+ return reflect.ValueOf(uint(v)), nil
default:
return emptyValue, ValueDecoderError{
Name: "UintDecodeValue",
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/copier.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/copier.go
index 33d59bd2585a..1e25570b8556 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/copier.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/copier.go
@@ -7,6 +7,7 @@
package bsonrw
import (
+ "errors"
"fmt"
"io"
@@ -124,7 +125,7 @@ func (c Copier) CopyBytesToDocumentWriter(dst DocumentWriter, src []byte) error
}
func (c Copier) copyBytesToValueWriter(src []byte, wef writeElementFn) error {
- // TODO(skriptble): Create errors types here. Anything thats a tag should be a property.
+ // TODO(skriptble): Create errors types here. Anything that is a tag should be a property.
length, rem, ok := bsoncore.ReadLength(src)
if !ok {
return fmt.Errorf("couldn't read length from src, not enough bytes. length=%d", len(src))
@@ -193,7 +194,7 @@ func (c Copier) AppendDocumentBytes(dst []byte, src ValueReader) ([]byte, error)
}
vw := vwPool.Get().(*valueWriter)
- defer vwPool.Put(vw)
+ defer putValueWriter(vw)
vw.reset(dst)
@@ -213,7 +214,7 @@ func (c Copier) AppendArrayBytes(dst []byte, src ValueReader) ([]byte, error) {
}
vw := vwPool.Get().(*valueWriter)
- defer vwPool.Put(vw)
+ defer putValueWriter(vw)
vw.reset(dst)
@@ -258,7 +259,7 @@ func (c Copier) AppendValueBytes(dst []byte, src ValueReader) (bsontype.Type, []
}
vw := vwPool.Get().(*valueWriter)
- defer vwPool.Put(vw)
+ defer putValueWriter(vw)
start := len(dst)
@@ -442,7 +443,7 @@ func (c Copier) copyArray(dst ValueWriter, src ValueReader) error {
for {
vr, err := ar.ReadValue()
- if err == ErrEOA {
+ if errors.Is(err, ErrEOA) {
break
}
if err != nil {
@@ -466,7 +467,7 @@ func (c Copier) copyArray(dst ValueWriter, src ValueReader) error {
func (c Copier) copyDocumentCore(dw DocumentWriter, dr DocumentReader) error {
for {
key, vr, err := dr.ReadElement()
- if err == ErrEOD {
+ if errors.Is(err, ErrEOD) {
break
}
if err != nil {
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_parser.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_parser.go
index 54c76bf746a7..f0702d9d3025 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_parser.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_parser.go
@@ -305,7 +305,7 @@ func (ejp *extJSONParser) readValue(t bsontype.Type) (*extJSONValue, error) {
}
// remove hyphens
- uuidNoHyphens := strings.Replace(uuid, "-", "", -1)
+ uuidNoHyphens := strings.ReplaceAll(uuid, "-", "")
if len(uuidNoHyphens) != 32 {
return nil, fmt.Errorf("$uuid value does not follow RFC 4122 format regarding length and hyphens")
}
@@ -313,7 +313,7 @@ func (ejp *extJSONParser) readValue(t bsontype.Type) (*extJSONValue, error) {
// convert hex to bytes
bytes, err := hex.DecodeString(uuidNoHyphens)
if err != nil {
- return nil, fmt.Errorf("$uuid value does not follow RFC 4122 format regarding hex bytes: %v", err)
+ return nil, fmt.Errorf("$uuid value does not follow RFC 4122 format regarding hex bytes: %w", err)
}
ejp.advanceState()
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_reader.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_reader.go
index 2aca37a91fcc..59ddfc448583 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_reader.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_reader.go
@@ -7,6 +7,7 @@
package bsonrw
import (
+ "errors"
"fmt"
"io"
"sync"
@@ -613,7 +614,7 @@ func (ejvr *extJSONValueReader) ReadElement() (string, ValueReader, error) {
name, t, err := ejvr.p.readKey()
if err != nil {
- if err == ErrEOD {
+ if errors.Is(err, ErrEOD) {
if ejvr.stack[ejvr.frame].mode == mCodeWithScope {
_, err := ejvr.p.peekType()
if err != nil {
@@ -640,7 +641,7 @@ func (ejvr *extJSONValueReader) ReadValue() (ValueReader, error) {
t, err := ejvr.p.peekType()
if err != nil {
- if err == ErrEOA {
+ if errors.Is(err, ErrEOA) {
ejvr.pop()
}
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go
index 9695704246dd..af6ae7b76bfa 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go
@@ -95,9 +95,9 @@ func (ejv *extJSONValue) parseBinary() (b []byte, subType byte, err error) {
return nil, 0, fmt.Errorf("$binary subType value should be string, but instead is %s", val.t)
}
- i, err := strconv.ParseInt(val.v.(string), 16, 64)
+ i, err := strconv.ParseUint(val.v.(string), 16, 8)
if err != nil {
- return nil, 0, fmt.Errorf("invalid $binary subType string: %s", val.v.(string))
+ return nil, 0, fmt.Errorf("invalid $binary subType string: %q: %w", val.v.(string), err)
}
subType = byte(i)
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_writer.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_writer.go
index bb9303167c37..86a293570f3b 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_writer.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_writer.go
@@ -468,12 +468,13 @@ func (ejvw *extJSONValueWriter) WriteRegex(pattern string, options string) error
return err
}
+ options = sortStringAlphebeticAscending(options)
var buf bytes.Buffer
buf.WriteString(`{"$regularExpression":{"pattern":`)
writeStringWithEscapes(pattern, &buf, ejvw.escapeHTML)
- buf.WriteString(`,"options":"`)
- buf.WriteString(sortStringAlphebeticAscending(options))
- buf.WriteString(`"}},`)
+ buf.WriteString(`,"options":`)
+ writeStringWithEscapes(options, &buf, ejvw.escapeHTML)
+ buf.WriteString(`}},`)
ejvw.buf = append(ejvw.buf, buf.Bytes()...)
@@ -628,13 +629,14 @@ func (ejvw *extJSONValueWriter) WriteArrayEnd() error {
func formatDouble(f float64) string {
var s string
- if math.IsInf(f, 1) {
+ switch {
+ case math.IsInf(f, 1):
s = "Infinity"
- } else if math.IsInf(f, -1) {
+ case math.IsInf(f, -1):
s = "-Infinity"
- } else if math.IsNaN(f) {
+ case math.IsNaN(f):
s = "NaN"
- } else {
+ default:
// Print exactly one decimalType place for integers; otherwise, print as many are necessary to
// perfectly represent it.
s = strconv.FormatFloat(f, 'G', -1, 64)
@@ -739,9 +741,7 @@ func (ss sortableString) Less(i, j int) bool {
}
func (ss sortableString) Swap(i, j int) {
- oldI := ss[i]
- ss[i] = ss[j]
- ss[j] = oldI
+ ss[i], ss[j] = ss[j], ss[i]
}
func sortStringAlphebeticAscending(s string) string {
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/json_scanner.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/json_scanner.go
index cd4843a3a405..978289191648 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/json_scanner.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/json_scanner.go
@@ -58,7 +58,7 @@ func (js *jsonScanner) nextToken() (*jsonToken, error) {
c, err = js.readNextByte()
}
- if err == io.EOF {
+ if errors.Is(err, io.EOF) {
return &jsonToken{t: jttEOF}, nil
} else if err != nil {
return nil, err
@@ -82,12 +82,13 @@ func (js *jsonScanner) nextToken() (*jsonToken, error) {
return js.scanString()
default:
// check if it's a number
- if c == '-' || isDigit(c) {
+ switch {
+ case c == '-' || isDigit(c):
return js.scanNumber(c)
- } else if c == 't' || c == 'f' || c == 'n' {
+ case c == 't' || c == 'f' || c == 'n':
// maybe a literal
return js.scanLiteral(c)
- } else {
+ default:
return nil, fmt.Errorf("invalid JSON input. Position: %d. Character: %c", js.pos-1, c)
}
}
@@ -174,7 +175,7 @@ func getu4(s []byte) rune {
for _, c := range s[:4] {
switch {
case '0' <= c && c <= '9':
- c = c - '0'
+ c -= '0'
case 'a' <= c && c <= 'f':
c = c - 'a' + 10
case 'A' <= c && c <= 'F':
@@ -198,7 +199,7 @@ func (js *jsonScanner) scanString() (*jsonToken, error) {
for {
c, err = js.readNextByte()
if err != nil {
- if err == io.EOF {
+ if errors.Is(err, io.EOF) {
return nil, errors.New("end of input in JSON string")
}
return nil, err
@@ -209,7 +210,7 @@ func (js *jsonScanner) scanString() (*jsonToken, error) {
case '\\':
c, err = js.readNextByte()
if err != nil {
- if err == io.EOF {
+ if errors.Is(err, io.EOF) {
return nil, errors.New("end of input in JSON string")
}
return nil, err
@@ -248,7 +249,7 @@ func (js *jsonScanner) scanString() (*jsonToken, error) {
if utf16.IsSurrogate(rn) {
c, err = js.readNextByte()
if err != nil {
- if err == io.EOF {
+ if errors.Is(err, io.EOF) {
return nil, errors.New("end of input in JSON string")
}
return nil, err
@@ -264,7 +265,7 @@ func (js *jsonScanner) scanString() (*jsonToken, error) {
c, err = js.readNextByte()
if err != nil {
- if err == io.EOF {
+ if errors.Is(err, io.EOF) {
return nil, errors.New("end of input in JSON string")
}
return nil, err
@@ -325,17 +326,18 @@ func (js *jsonScanner) scanLiteral(first byte) (*jsonToken, error) {
c5, err := js.readNextByte()
- if bytes.Equal([]byte("true"), lit) && (isValueTerminator(c5) || err == io.EOF) {
+ switch {
+ case bytes.Equal([]byte("true"), lit) && (isValueTerminator(c5) || errors.Is(err, io.EOF)):
js.pos = int(math.Max(0, float64(js.pos-1)))
return &jsonToken{t: jttBool, v: true, p: p}, nil
- } else if bytes.Equal([]byte("null"), lit) && (isValueTerminator(c5) || err == io.EOF) {
+ case bytes.Equal([]byte("null"), lit) && (isValueTerminator(c5) || errors.Is(err, io.EOF)):
js.pos = int(math.Max(0, float64(js.pos-1)))
return &jsonToken{t: jttNull, v: nil, p: p}, nil
- } else if bytes.Equal([]byte("fals"), lit) {
+ case bytes.Equal([]byte("fals"), lit):
if c5 == 'e' {
c5, err = js.readNextByte()
- if isValueTerminator(c5) || err == io.EOF {
+ if isValueTerminator(c5) || errors.Is(err, io.EOF) {
js.pos = int(math.Max(0, float64(js.pos-1)))
return &jsonToken{t: jttBool, v: false, p: p}, nil
}
@@ -384,7 +386,7 @@ func (js *jsonScanner) scanNumber(first byte) (*jsonToken, error) {
for {
c, err = js.readNextByte()
- if err != nil && err != io.EOF {
+ if err != nil && !errors.Is(err, io.EOF) {
return nil, err
}
@@ -413,7 +415,7 @@ func (js *jsonScanner) scanNumber(first byte) (*jsonToken, error) {
case '}', ']', ',':
s = nssDone
default:
- if isWhiteSpace(c) || err == io.EOF {
+ if isWhiteSpace(c) || errors.Is(err, io.EOF) {
s = nssDone
} else {
s = nssInvalid
@@ -430,12 +432,13 @@ func (js *jsonScanner) scanNumber(first byte) (*jsonToken, error) {
case '}', ']', ',':
s = nssDone
default:
- if isWhiteSpace(c) || err == io.EOF {
+ switch {
+ case isWhiteSpace(c) || errors.Is(err, io.EOF):
s = nssDone
- } else if isDigit(c) {
+ case isDigit(c):
s = nssSawIntegerDigits
b.WriteByte(c)
- } else {
+ default:
s = nssInvalid
}
}
@@ -455,12 +458,13 @@ func (js *jsonScanner) scanNumber(first byte) (*jsonToken, error) {
case '}', ']', ',':
s = nssDone
default:
- if isWhiteSpace(c) || err == io.EOF {
+ switch {
+ case isWhiteSpace(c) || errors.Is(err, io.EOF):
s = nssDone
- } else if isDigit(c) {
+ case isDigit(c):
s = nssSawFractionDigits
b.WriteByte(c)
- } else {
+ default:
s = nssInvalid
}
}
@@ -490,12 +494,13 @@ func (js *jsonScanner) scanNumber(first byte) (*jsonToken, error) {
case '}', ']', ',':
s = nssDone
default:
- if isWhiteSpace(c) || err == io.EOF {
+ switch {
+ case isWhiteSpace(c) || errors.Is(err, io.EOF):
s = nssDone
- } else if isDigit(c) {
+ case isDigit(c):
s = nssSawExponentDigits
b.WriteByte(c)
- } else {
+ default:
s = nssInvalid
}
}
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go
index 9bf24fae0b9e..0e07d505586c 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go
@@ -739,8 +739,7 @@ func (vr *valueReader) ReadValue() (ValueReader, error) {
return nil, ErrEOA
}
- _, err = vr.readCString()
- if err != nil {
+ if err := vr.skipCString(); err != nil {
return nil, err
}
@@ -794,6 +793,15 @@ func (vr *valueReader) readByte() (byte, error) {
return vr.d[vr.offset-1], nil
}
+func (vr *valueReader) skipCString() error {
+ idx := bytes.IndexByte(vr.d[vr.offset:], 0x00)
+ if idx < 0 {
+ return io.EOF
+ }
+ vr.offset += int64(idx) + 1
+ return nil
+}
+
func (vr *valueReader) readCString() (string, error) {
idx := bytes.IndexByte(vr.d[vr.offset:], 0x00)
if idx < 0 {
@@ -834,7 +842,7 @@ func (vr *valueReader) peekLength() (int32, error) {
}
idx := vr.offset
- return (int32(vr.d[idx]) | int32(vr.d[idx+1])<<8 | int32(vr.d[idx+2])<<16 | int32(vr.d[idx+3])<<24), nil
+ return int32(binary.LittleEndian.Uint32(vr.d[idx:])), nil
}
func (vr *valueReader) readLength() (int32, error) { return vr.readi32() }
@@ -846,7 +854,7 @@ func (vr *valueReader) readi32() (int32, error) {
idx := vr.offset
vr.offset += 4
- return (int32(vr.d[idx]) | int32(vr.d[idx+1])<<8 | int32(vr.d[idx+2])<<16 | int32(vr.d[idx+3])<<24), nil
+ return int32(binary.LittleEndian.Uint32(vr.d[idx:])), nil
}
func (vr *valueReader) readu32() (uint32, error) {
@@ -856,7 +864,7 @@ func (vr *valueReader) readu32() (uint32, error) {
idx := vr.offset
vr.offset += 4
- return (uint32(vr.d[idx]) | uint32(vr.d[idx+1])<<8 | uint32(vr.d[idx+2])<<16 | uint32(vr.d[idx+3])<<24), nil
+ return binary.LittleEndian.Uint32(vr.d[idx:]), nil
}
func (vr *valueReader) readi64() (int64, error) {
@@ -866,8 +874,7 @@ func (vr *valueReader) readi64() (int64, error) {
idx := vr.offset
vr.offset += 8
- return int64(vr.d[idx]) | int64(vr.d[idx+1])<<8 | int64(vr.d[idx+2])<<16 | int64(vr.d[idx+3])<<24 |
- int64(vr.d[idx+4])<<32 | int64(vr.d[idx+5])<<40 | int64(vr.d[idx+6])<<48 | int64(vr.d[idx+7])<<56, nil
+ return int64(binary.LittleEndian.Uint64(vr.d[idx:])), nil
}
func (vr *valueReader) readu64() (uint64, error) {
@@ -877,6 +884,5 @@ func (vr *valueReader) readu64() (uint64, error) {
idx := vr.offset
vr.offset += 8
- return uint64(vr.d[idx]) | uint64(vr.d[idx+1])<<8 | uint64(vr.d[idx+2])<<16 | uint64(vr.d[idx+3])<<24 |
- uint64(vr.d[idx+4])<<32 | uint64(vr.d[idx+5])<<40 | uint64(vr.d[idx+6])<<48 | uint64(vr.d[idx+7])<<56, nil
+ return binary.LittleEndian.Uint64(vr.d[idx:]), nil
}
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_writer.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_writer.go
index a6dd8d34f5ea..501c6d7f9794 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_writer.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_writer.go
@@ -28,6 +28,13 @@ var vwPool = sync.Pool{
},
}
+func putValueWriter(vw *valueWriter) {
+ if vw != nil {
+ vw.w = nil // don't leak the writer
+ vwPool.Put(vw)
+ }
+}
+
// BSONValueWriterPool is a pool for BSON ValueWriters.
//
// Deprecated: BSONValueWriterPool will not be supported in Go Driver 2.0.
@@ -149,32 +156,21 @@ type valueWriter struct {
}
func (vw *valueWriter) advanceFrame() {
- if vw.frame+1 >= int64(len(vw.stack)) { // We need to grow the stack
- length := len(vw.stack)
- if length+1 >= cap(vw.stack) {
- // double it
- buf := make([]vwState, 2*cap(vw.stack)+1)
- copy(buf, vw.stack)
- vw.stack = buf
- }
- vw.stack = vw.stack[:length+1]
- }
vw.frame++
+ if vw.frame >= int64(len(vw.stack)) {
+ vw.stack = append(vw.stack, vwState{})
+ }
}
func (vw *valueWriter) push(m mode) {
vw.advanceFrame()
// Clean the stack
- vw.stack[vw.frame].mode = m
- vw.stack[vw.frame].key = ""
- vw.stack[vw.frame].arrkey = 0
- vw.stack[vw.frame].start = 0
+ vw.stack[vw.frame] = vwState{mode: m}
- vw.stack[vw.frame].mode = m
switch m {
case mDocument, mArray, mCodeWithScope:
- vw.reserveLength()
+ vw.reserveLength() // WARN: this is not needed
}
}
@@ -213,6 +209,7 @@ func newValueWriter(w io.Writer) *valueWriter {
return vw
}
+// TODO: only used in tests
func newValueWriterFromSlice(buf []byte) *valueWriter {
vw := new(valueWriter)
stack := make([]vwState, 1, 5)
@@ -249,17 +246,16 @@ func (vw *valueWriter) invalidTransitionError(destination mode, name string, mod
}
func (vw *valueWriter) writeElementHeader(t bsontype.Type, destination mode, callerName string, addmodes ...mode) error {
- switch vw.stack[vw.frame].mode {
+ frame := &vw.stack[vw.frame]
+ switch frame.mode {
case mElement:
- key := vw.stack[vw.frame].key
+ key := frame.key
if !isValidCString(key) {
return errors.New("BSON element key cannot contain null bytes")
}
-
- vw.buf = bsoncore.AppendHeader(vw.buf, t, key)
+ vw.appendHeader(t, key)
case mValue:
- // TODO: Do this with a cache of the first 1000 or so array keys.
- vw.buf = bsoncore.AppendHeader(vw.buf, t, strconv.Itoa(vw.stack[vw.frame].arrkey))
+ vw.appendIntHeader(t, frame.arrkey)
default:
modes := []mode{mElement, mValue}
if addmodes != nil {
@@ -601,9 +597,11 @@ func (vw *valueWriter) writeLength() error {
if length > maxSize {
return errMaxDocumentSizeExceeded{size: int64(len(vw.buf))}
}
- length = length - int(vw.stack[vw.frame].start)
- start := vw.stack[vw.frame].start
+ frame := &vw.stack[vw.frame]
+ length -= int(frame.start)
+ start := frame.start
+ _ = vw.buf[start+3] // BCE
vw.buf[start+0] = byte(length)
vw.buf[start+1] = byte(length >> 8)
vw.buf[start+2] = byte(length >> 16)
@@ -612,5 +610,31 @@ func (vw *valueWriter) writeLength() error {
}
func isValidCString(cs string) bool {
- return !strings.ContainsRune(cs, '\x00')
+ // Disallow the zero byte in a cstring because the zero byte is used as the
+ // terminating character.
+ //
+ // It's safe to check bytes instead of runes because all multibyte UTF-8
+ // code points start with (binary) 11xxxxxx or 10xxxxxx, so 00000000 (i.e.
+ // 0) will never be part of a multibyte UTF-8 code point. This logic is the
+ // same as the "r < utf8.RuneSelf" case in strings.IndexRune but can be
+ // inlined.
+ //
+ // https://cs.opensource.google/go/go/+/refs/tags/go1.21.1:src/strings/strings.go;l=127
+ return strings.IndexByte(cs, 0) == -1
+}
+
+// appendHeader is the same as bsoncore.AppendHeader but does not check if the
+// key is a valid C string since the caller has already checked for that.
+//
+// The caller of this function must check if key is a valid C string.
+func (vw *valueWriter) appendHeader(t bsontype.Type, key string) {
+ vw.buf = bsoncore.AppendType(vw.buf, t)
+ vw.buf = append(vw.buf, key...)
+ vw.buf = append(vw.buf, 0x00)
+}
+
+func (vw *valueWriter) appendIntHeader(t bsontype.Type, key int) {
+ vw.buf = bsoncore.AppendType(vw.buf, t)
+ vw.buf = strconv.AppendInt(vw.buf, int64(key), 10)
+ vw.buf = append(vw.buf, 0x00)
}
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/bsontype/bsontype.go b/api/vendor/go.mongodb.org/mongo-driver/bson/bsontype/bsontype.go
index f38c263a4c0d..255d9909e3d2 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/bsontype/bsontype.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/bsontype/bsontype.go
@@ -47,6 +47,7 @@ const (
BinaryMD5 byte = 0x05
BinaryEncrypted byte = 0x06
BinaryColumn byte = 0x07
+ BinarySensitive byte = 0x08
BinaryUserDefined byte = 0x80
)
@@ -102,3 +103,14 @@ func (bt Type) String() string {
return "invalid"
}
}
+
+// IsValid will return true if the Type is valid.
+func (bt Type) IsValid() bool {
+ switch bt {
+ case Double, String, EmbeddedDocument, Array, Binary, Undefined, ObjectID, Boolean, DateTime, Null, Regex,
+ DBPointer, JavaScript, Symbol, CodeWithScope, Int32, Timestamp, Int64, Decimal128, MinKey, MaxKey:
+ return true
+ default:
+ return false
+ }
+}
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/doc.go b/api/vendor/go.mongodb.org/mongo-driver/bson/doc.go
index 048b5eb99866..fb075b47892f 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/doc.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/doc.go
@@ -6,9 +6,9 @@
// Package bson is a library for reading, writing, and manipulating BSON. BSON is a binary serialization format used to
// store documents and make remote procedure calls in MongoDB. The BSON specification is located at https://bsonspec.org.
-// The BSON library handles marshalling and unmarshalling of values through a configurable codec system. For a description
-// of the codec system and examples of registering custom codecs, see the bsoncodec package. For additional information and
-// usage examples, check out the [Work with BSON] page in the Go Driver docs site.
+// The BSON library handles marshaling and unmarshaling of values through a configurable codec system. For a description
+// of the codec system and examples of registering custom codecs, see the bsoncodec package. For additional information
+// and usage examples, check out the [Work with BSON] page in the Go Driver docs site.
//
// # Raw BSON
//
@@ -38,7 +38,7 @@
// bson.D{{"foo", "bar"}, {"hello", "world"}, {"pi", 3.14159}}
// bson.M{"foo": "bar", "hello": "world", "pi": 3.14159}
//
-// When decoding BSON to a D or M, the following type mappings apply when unmarshalling:
+// When decoding BSON to a D or M, the following type mappings apply when unmarshaling:
//
// 1. BSON int32 unmarshals to an int32.
// 2. BSON int64 unmarshals to an int64.
@@ -62,83 +62,81 @@
// 20. BSON DBPointer unmarshals to a primitive.DBPointer.
// 21. BSON symbol unmarshals to a primitive.Symbol.
//
-// The above mappings also apply when marshalling a D or M to BSON. Some other useful marshalling mappings are:
+// The above mappings also apply when marshaling a D or M to BSON. Some other useful marshaling mappings are:
//
// 1. time.Time marshals to a BSON datetime.
// 2. int8, int16, and int32 marshal to a BSON int32.
// 3. int marshals to a BSON int32 if the value is between math.MinInt32 and math.MaxInt32, inclusive, and a BSON int64
// otherwise.
-// 4. int64 marshals to BSON int64.
+// 4. int64 marshals to BSON int64 (unless [Encoder.IntMinSize] is set).
// 5. uint8 and uint16 marshal to a BSON int32.
-// 6. uint, uint32, and uint64 marshal to a BSON int32 if the value is between math.MinInt32 and math.MaxInt32,
-// inclusive, and BSON int64 otherwise.
-// 7. BSON null and undefined values will unmarshal into the zero value of a field (e.g. unmarshalling a BSON null or
+// 6. uint, uint32, and uint64 marshal to a BSON int64 (unless [Encoder.IntMinSize] is set).
+// 7. BSON null and undefined values will unmarshal into the zero value of a field (e.g. unmarshaling a BSON null or
// undefined value into a string will yield the empty string.).
//
// # Structs
//
-// Structs can be marshalled/unmarshalled to/from BSON or Extended JSON. When transforming structs to/from BSON or Extended
+// Structs can be marshaled/unmarshaled to/from BSON or Extended JSON. When transforming structs to/from BSON or Extended
// JSON, the following rules apply:
//
-// 1. Only exported fields in structs will be marshalled or unmarshalled.
+// 1. Only exported fields in structs will be marshaled or unmarshaled.
//
-// 2. When marshalling a struct, each field will be lowercased to generate the key for the corresponding BSON element.
+// 2. When marshaling a struct, each field will be lowercased to generate the key for the corresponding BSON element.
// For example, a struct field named "Foo" will generate key "foo". This can be overridden via a struct tag (e.g.
// `bson:"fooField"` to generate key "fooField" instead).
//
-// 3. An embedded struct field is marshalled as a subdocument. The key will be the lowercased name of the field's type.
+// 3. An embedded struct field is marshaled as a subdocument. The key will be the lowercased name of the field's type.
//
-// 4. A pointer field is marshalled as the underlying type if the pointer is non-nil. If the pointer is nil, it is
-// marshalled as a BSON null value.
+// 4. A pointer field is marshaled as the underlying type if the pointer is non-nil. If the pointer is nil, it is
+// marshaled as a BSON null value.
//
-// 5. When unmarshalling, a field of type interface{} will follow the D/M type mappings listed above. BSON documents
-// unmarshalled into an interface{} field will be unmarshalled as a D.
+// 5. When unmarshaling, a field of type interface{} will follow the D/M type mappings listed above. BSON documents
+// unmarshaled into an interface{} field will be unmarshaled as a D.
//
// The encoding of each struct field can be customized by the "bson" struct tag.
//
// This tag behavior is configurable, and different struct tag behavior can be configured by initializing a new
-// bsoncodec.StructCodec with the desired tag parser and registering that StructCodec onto the Registry. By default, JSON tags
-// are not honored, but that can be enabled by creating a StructCodec with JSONFallbackStructTagParser, like below:
+// bsoncodec.StructCodec with the desired tag parser and registering that StructCodec onto the Registry. By default, JSON
+// tags are not honored, but that can be enabled by creating a StructCodec with JSONFallbackStructTagParser, like below:
//
// Example:
//
// structcodec, _ := bsoncodec.NewStructCodec(bsoncodec.JSONFallbackStructTagParser)
//
// The bson tag gives the name of the field, possibly followed by a comma-separated list of options.
-// The name may be empty in order to specify options without overriding the default field name. The following options can be used
-// to configure behavior:
-//
-// 1. omitempty: If the omitempty struct tag is specified on a field, the field will not be marshalled if it is set to
-// the zero value. Fields with language primitive types such as integers, booleans, and strings are considered empty if
-// their value is equal to the zero value for the type (i.e. 0 for integers, false for booleans, and "" for strings).
-// Slices, maps, and arrays are considered empty if they are of length zero. Interfaces and pointers are considered
-// empty if their value is nil. By default, structs are only considered empty if the struct type implements the
-// bsoncodec.Zeroer interface and the IsZero method returns true. Struct fields whose types do not implement Zeroer are
-// never considered empty and will be marshalled as embedded documents.
-// NOTE: It is recommended that this tag be used for all slice and map fields.
+// The name may be empty in order to specify options without overriding the default field name. The following options can
+// be used to configure behavior:
+//
+// 1. omitempty: If the "omitempty" struct tag is specified on a field, the field will not be marshaled if it is set to
+// an "empty" value. Numbers, booleans, and strings are considered empty if their value is equal to the zero value for
+// the type (i.e. 0 for numbers, false for booleans, and "" for strings). Slices, maps, and arrays are considered
+// empty if they are of length zero. Interfaces and pointers are considered empty if their value is nil. By default,
+// structs are only considered empty if the struct type implements [bsoncodec.Zeroer] and the IsZero
+// method returns true. Struct types that do not implement [bsoncodec.Zeroer] are never considered empty and will be
+// marshaled as embedded documents. NOTE: It is recommended that this tag be used for all slice and map fields.
//
// 2. minsize: If the minsize struct tag is specified on a field of type int64, uint, uint32, or uint64 and the value of
-// the field can fit in a signed int32, the field will be serialized as a BSON int32 rather than a BSON int64. For other
-// types, this tag is ignored.
+// the field can fit in a signed int32, the field will be serialized as a BSON int32 rather than a BSON int64. For
+// other types, this tag is ignored.
//
-// 3. truncate: If the truncate struct tag is specified on a field with a non-float numeric type, BSON doubles unmarshalled
-// into that field will be truncated at the decimal point. For example, if 3.14 is unmarshalled into a field of type int,
-// it will be unmarshalled as 3. If this tag is not specified, the decoder will throw an error if the value cannot be
-// decoded without losing precision. For float64 or non-numeric types, this tag is ignored.
+// 3. truncate: If the truncate struct tag is specified on a field with a non-float numeric type, BSON doubles
+// unmarshaled into that field will be truncated at the decimal point. For example, if 3.14 is unmarshaled into a
+// field of type int, it will be unmarshaled as 3. If this tag is not specified, the decoder will throw an error if
+// the value cannot be decoded without losing precision. For float64 or non-numeric types, this tag is ignored.
//
// 4. inline: If the inline struct tag is specified for a struct or map field, the field will be "flattened" when
-// marshalling and "un-flattened" when unmarshalling. This means that all of the fields in that struct/map will be
-// pulled up one level and will become top-level fields rather than being fields in a nested document. For example, if a
-// map field named "Map" with value map[string]interface{}{"foo": "bar"} is inlined, the resulting document will be
-// {"foo": "bar"} instead of {"map": {"foo": "bar"}}. There can only be one inlined map field in a struct. If there are
-// duplicated fields in the resulting document when an inlined struct is marshalled, the inlined field will be overwritten.
-// If there are duplicated fields in the resulting document when an inlined map is marshalled, an error will be returned.
-// This tag can be used with fields that are pointers to structs. If an inlined pointer field is nil, it will not be
-// marshalled. For fields that are not maps or structs, this tag is ignored.
-//
-// # Marshalling and Unmarshalling
-//
-// Manually marshalling and unmarshalling can be done with the Marshal and Unmarshal family of functions.
+// marshaling and "un-flattened" when unmarshaling. This means that all of the fields in that struct/map will be
+// pulled up one level and will become top-level fields rather than being fields in a nested document. For example,
+// if a map field named "Map" with value map[string]interface{}{"foo": "bar"} is inlined, the resulting document will
+// be {"foo": "bar"} instead of {"map": {"foo": "bar"}}. There can only be one inlined map field in a struct. If
+// there are duplicated fields in the resulting document when an inlined struct is marshaled, the inlined field will
+// be overwritten. If there are duplicated fields in the resulting document when an inlined map is marshaled, an
+// error will be returned. This tag can be used with fields that are pointers to structs. If an inlined pointer field
+// is nil, it will not be marshaled. For fields that are not maps or structs, this tag is ignored.
+//
+// # Marshaling and Unmarshaling
+//
+// Manually marshaling and unmarshaling can be done with the Marshal and Unmarshal family of functions.
//
// [Work with BSON]: https://www.mongodb.com/docs/drivers/go/current/fundamentals/bson/
package bson
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/marshal.go b/api/vendor/go.mongodb.org/mongo-driver/bson/marshal.go
index f2c48d049ea5..17ce6697e04f 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/marshal.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/marshal.go
@@ -9,6 +9,7 @@ package bson
import (
"bytes"
"encoding/json"
+ "sync"
"go.mongodb.org/mongo-driver/bson/bsoncodec"
"go.mongodb.org/mongo-driver/bson/bsonrw"
@@ -141,6 +142,13 @@ func MarshalAppendWithRegistry(r *bsoncodec.Registry, dst []byte, val interface{
return MarshalAppendWithContext(bsoncodec.EncodeContext{Registry: r}, dst, val)
}
+// Pool of buffers for marshalling BSON.
+var bufPool = sync.Pool{
+ New: func() interface{} {
+ return new(bytes.Buffer)
+ },
+}
+
// MarshalAppendWithContext will encode val as a BSON document using Registry r and EncodeContext ec and append the
// bytes to dst. If dst is not large enough to hold the bytes, it will be grown. If val is not a type that can be
// transformed into a document, MarshalValueAppendWithContext should be used instead.
@@ -162,8 +170,26 @@ func MarshalAppendWithRegistry(r *bsoncodec.Registry, dst []byte, val interface{
//
// See [Encoder] for more examples.
func MarshalAppendWithContext(ec bsoncodec.EncodeContext, dst []byte, val interface{}) ([]byte, error) {
- sw := new(bsonrw.SliceWriter)
- *sw = dst
+ sw := bufPool.Get().(*bytes.Buffer)
+ defer func() {
+ // Proper usage of a sync.Pool requires each entry to have approximately
+ // the same memory cost. To obtain this property when the stored type
+ // contains a variably-sized buffer, we add a hard limit on the maximum
+ // buffer to place back in the pool. We limit the size to 16MiB because
+ // that's the maximum wire message size supported by any current MongoDB
+ // server.
+ //
+ // Comment based on
+ // https://cs.opensource.google/go/go/+/refs/tags/go1.19:src/fmt/print.go;l=147
+ //
+ // Recycle byte slices that are smaller than 16MiB and at least half
+ // occupied.
+ if sw.Cap() < 16*1024*1024 && sw.Cap()/2 < sw.Len() {
+ bufPool.Put(sw)
+ }
+ }()
+
+ sw.Reset()
vw := bvwPool.Get(sw)
defer bvwPool.Put(vw)
@@ -184,7 +210,7 @@ func MarshalAppendWithContext(ec bsoncodec.EncodeContext, dst []byte, val interf
return nil, err
}
- return *sw, nil
+ return append(dst, sw.Bytes()...), nil
}
// MarshalValue returns the BSON encoding of val.
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/primitive/decimal.go b/api/vendor/go.mongodb.org/mongo-driver/bson/primitive/decimal.go
index 24ab58fc49b8..db8be74d8498 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/primitive/decimal.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/primitive/decimal.go
@@ -70,7 +70,6 @@ func (d Decimal128) String() string {
// Bits: 1*sign 2*ignored 14*exponent 111*significand.
// Implicit 0b100 prefix in significand.
exp = int(d.h >> 47 & (1<<14 - 1))
- //high = 4<<47 | d.h&(1<<47-1)
// Spec says all of these values are out of range.
high, low = 0, 0
} else {
@@ -152,21 +151,17 @@ func (d Decimal128) BigInt() (*big.Int, int, error) {
// Bits: 1*sign 2*ignored 14*exponent 111*significand.
// Implicit 0b100 prefix in significand.
exp = int(high >> 47 & (1<<14 - 1))
- //high = 4<<47 | d.h&(1<<47-1)
// Spec says all of these values are out of range.
high, low = 0, 0
} else {
// Bits: 1*sign 14*exponent 113*significand
exp = int(high >> 49 & (1<<14 - 1))
- high = high & (1<<49 - 1)
+ high &= (1<<49 - 1)
}
exp += MinDecimal128Exp
// Would be handled by the logic below, but that's trivial and common.
if high == 0 && low == 0 && exp == 0 {
- if posSign {
- return new(big.Int), 0, nil
- }
return new(big.Int), 0, nil
}
@@ -355,7 +350,7 @@ var (
// ParseDecimal128FromBigInt attempts to parse the given significand and exponent into a valid Decimal128 value.
func ParseDecimal128FromBigInt(bi *big.Int, exp int) (Decimal128, bool) {
- //copy
+ // copy
bi = new(big.Int).Set(bi)
q := new(big.Int)
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/primitive/objectid.go b/api/vendor/go.mongodb.org/mongo-driver/bson/primitive/objectid.go
index 9bbaffac26ed..c130e3ff195a 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/primitive/objectid.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/primitive/objectid.go
@@ -183,7 +183,7 @@ func processUniqueBytes() [5]byte {
var b [5]byte
_, err := io.ReadFull(rand.Reader, b[:])
if err != nil {
- panic(fmt.Errorf("cannot initialize objectid package with crypto.rand.Reader: %v", err))
+ panic(fmt.Errorf("cannot initialize objectid package with crypto.rand.Reader: %w", err))
}
return b
@@ -193,7 +193,7 @@ func readRandomUint32() uint32 {
var b [4]byte
_, err := io.ReadFull(rand.Reader, b[:])
if err != nil {
- panic(fmt.Errorf("cannot initialize objectid package with crypto.rand.Reader: %v", err))
+ panic(fmt.Errorf("cannot initialize objectid package with crypto.rand.Reader: %w", err))
}
return (uint32(b[0]) << 0) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24)
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/primitive_codecs.go b/api/vendor/go.mongodb.org/mongo-driver/bson/primitive_codecs.go
index 6b9602589c8f..ff32a87a7955 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/primitive_codecs.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/primitive_codecs.go
@@ -8,6 +8,7 @@ package bson
import (
"errors"
+ "fmt"
"reflect"
"go.mongodb.org/mongo-driver/bson/bsoncodec"
@@ -45,15 +46,26 @@ func (pc PrimitiveCodecs) RegisterPrimitiveCodecs(rb *bsoncodec.RegistryBuilder)
// RawValueEncodeValue is the ValueEncoderFunc for RawValue.
//
-// Deprecated: Use bson.NewRegistry to get a registry with all primitive encoders and decoders
-// registered.
+// If the RawValue's Type is "invalid" and the RawValue's Value is not empty or
+// nil, then this method will return an error.
+//
+// Deprecated: Use bson.NewRegistry to get a registry with all primitive
+// encoders and decoders registered.
func (PrimitiveCodecs) RawValueEncodeValue(_ bsoncodec.EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
if !val.IsValid() || val.Type() != tRawValue {
- return bsoncodec.ValueEncoderError{Name: "RawValueEncodeValue", Types: []reflect.Type{tRawValue}, Received: val}
+ return bsoncodec.ValueEncoderError{
+ Name: "RawValueEncodeValue",
+ Types: []reflect.Type{tRawValue},
+ Received: val,
+ }
}
rawvalue := val.Interface().(RawValue)
+ if !rawvalue.Type.IsValid() {
+ return fmt.Errorf("the RawValue Type specifies an invalid BSON type: %#x", byte(rawvalue.Type))
+ }
+
return bsonrw.Copier{}.CopyValueFromBytes(vw, rawvalue.Type, rawvalue.Value)
}
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/raw.go b/api/vendor/go.mongodb.org/mongo-driver/bson/raw.go
index fe990a177149..130da61ba054 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/raw.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/raw.go
@@ -60,12 +60,19 @@ func (r Raw) LookupErr(key ...string) (RawValue, error) {
// elements. If the document is not valid, the elements up to the invalid point will be returned
// along with an error.
func (r Raw) Elements() ([]RawElement, error) {
- elems, err := bsoncore.Document(r).Elements()
+ doc := bsoncore.Document(r)
+ if len(doc) == 0 {
+ return nil, nil
+ }
+ elems, err := doc.Elements()
+ if err != nil {
+ return nil, err
+ }
relems := make([]RawElement, 0, len(elems))
for _, elem := range elems {
relems = append(relems, RawElement(elem))
}
- return relems, err
+ return relems, nil
}
// Values returns this document as a slice of values. The returned slice will contain valid values.
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/raw_value.go b/api/vendor/go.mongodb.org/mongo-driver/bson/raw_value.go
index 6627294c4da2..a8088e1e30b7 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/raw_value.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/raw_value.go
@@ -37,6 +37,12 @@ type RawValue struct {
r *bsoncodec.Registry
}
+// IsZero reports whether the RawValue is zero, i.e. no data is present on
+// the RawValue. It returns true if Type is 0 and Value is empty or nil.
+func (rv RawValue) IsZero() bool {
+ return rv.Type == 0x00 && len(rv.Value) == 0
+}
+
// Unmarshal deserializes BSON into the provided val. If RawValue cannot be unmarshaled into val, an
// error is returned. This method will use the registry used to create the RawValue, if the RawValue
// was created from partial BSON processing, or it will use the default registry. Users wishing to
@@ -82,8 +88,12 @@ func (rv RawValue) UnmarshalWithRegistry(r *bsoncodec.Registry, val interface{})
return dec.DecodeValue(bsoncodec.DecodeContext{Registry: r}, vr, rval)
}
-// UnmarshalWithContext performs the same unmarshalling as Unmarshal but uses the provided DecodeContext
-// instead of the one attached or the default registry.
+// UnmarshalWithContext performs the same unmarshalling as Unmarshal but uses
+// the provided DecodeContext instead of the one attached or the default
+// registry.
+//
+// Deprecated: Use [RawValue.UnmarshalWithRegistry] with a custom registry to customize
+// unmarshal behavior instead.
func (rv RawValue) UnmarshalWithContext(dc *bsoncodec.DecodeContext, val interface{}) error {
if dc == nil {
return ErrNilContext
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/registry.go b/api/vendor/go.mongodb.org/mongo-driver/bson/registry.go
index b5b0f3568780..d6afb2850e2e 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/registry.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/registry.go
@@ -10,15 +10,27 @@ import (
"go.mongodb.org/mongo-driver/bson/bsoncodec"
)
-// DefaultRegistry is the default bsoncodec.Registry. It contains the default codecs and the
-// primitive codecs.
+// DefaultRegistry is the default bsoncodec.Registry. It contains the default
+// codecs and the primitive codecs.
+//
+// Deprecated: Use [NewRegistry] to construct a new default registry. To use a
+// custom registry when marshaling or unmarshaling, use the "SetRegistry" method
+// on an [Encoder] or [Decoder] instead:
+//
+// dec, err := bson.NewDecoder(bsonrw.NewBSONDocumentReader(data))
+// if err != nil {
+// panic(err)
+// }
+// dec.SetRegistry(reg)
+//
+// See [Encoder] and [Decoder] for more examples.
var DefaultRegistry = NewRegistry()
// NewRegistryBuilder creates a new RegistryBuilder configured with the default encoders and
// decoders from the bsoncodec.DefaultValueEncoders and bsoncodec.DefaultValueDecoders types and the
// PrimitiveCodecs type in this package.
//
-// Deprecated: Use NewRegistry instead.
+// Deprecated: Use [NewRegistry] instead.
func NewRegistryBuilder() *bsoncodec.RegistryBuilder {
rb := bsoncodec.NewRegistryBuilder()
bsoncodec.DefaultValueEncoders{}.RegisterDefaultEncoders(rb)
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/types.go b/api/vendor/go.mongodb.org/mongo-driver/bson/types.go
index e201ac37eb83..ef398124672e 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/types.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/types.go
@@ -45,5 +45,6 @@ const (
TypeBinaryMD5 = bsontype.BinaryMD5
TypeBinaryEncrypted = bsontype.BinaryEncrypted
TypeBinaryColumn = bsontype.BinaryColumn
+ TypeBinarySensitive = bsontype.BinarySensitive
TypeBinaryUserDefined = bsontype.BinaryUserDefined
)
diff --git a/api/vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go b/api/vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go
index 66da17ee0172..d749ba373b59 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go
@@ -41,6 +41,9 @@ type ValueUnmarshaler interface {
// Unmarshal parses the BSON-encoded data and stores the result in the value
// pointed to by val. If val is nil or not a pointer, Unmarshal returns
// InvalidUnmarshalError.
+//
+// When unmarshaling BSON, if the BSON value is null and the Go value is a
+// pointer, the pointer is set to nil without calling UnmarshalBSONValue.
func Unmarshal(data []byte, val interface{}) error {
return UnmarshalWithRegistry(DefaultRegistry, data, val)
}
diff --git a/api/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go b/api/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go
index 94d479428f4d..03925d7ada13 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go
@@ -8,6 +8,7 @@ package bsoncore // import "go.mongodb.org/mongo-driver/x/bsonx/bsoncore"
import (
"bytes"
+ "encoding/binary"
"fmt"
"math"
"strconv"
@@ -235,7 +236,7 @@ func BuildDocumentValue(elems ...[]byte) Value {
return Value{Type: bsontype.EmbeddedDocument, Data: BuildDocument(nil, elems...)}
}
-// BuildDocumentElement will append a BSON embedded document elemnt using key and the provided
+// BuildDocumentElement will append a BSON embedded document element using key and the provided
// elements and return the extended buffer.
func BuildDocumentElement(dst []byte, key string, elems ...[]byte) []byte {
return BuildDocument(AppendHeader(dst, bsontype.EmbeddedDocument, key), elems...)
@@ -706,17 +707,16 @@ func ReserveLength(dst []byte) (int32, []byte) {
// UpdateLength updates the length at index with length and returns the []byte.
func UpdateLength(dst []byte, index, length int32) []byte {
- dst[index] = byte(length)
- dst[index+1] = byte(length >> 8)
- dst[index+2] = byte(length >> 16)
- dst[index+3] = byte(length >> 24)
+ binary.LittleEndian.PutUint32(dst[index:], uint32(length))
return dst
}
func appendLength(dst []byte, l int32) []byte { return appendi32(dst, l) }
func appendi32(dst []byte, i32 int32) []byte {
- return append(dst, byte(i32), byte(i32>>8), byte(i32>>16), byte(i32>>24))
+ b := []byte{0, 0, 0, 0}
+ binary.LittleEndian.PutUint32(b, uint32(i32))
+ return append(dst, b...)
}
// ReadLength reads an int32 length from src and returns the length and the remaining bytes. If
@@ -734,27 +734,26 @@ func readi32(src []byte) (int32, []byte, bool) {
if len(src) < 4 {
return 0, src, false
}
- return (int32(src[0]) | int32(src[1])<<8 | int32(src[2])<<16 | int32(src[3])<<24), src[4:], true
+ return int32(binary.LittleEndian.Uint32(src)), src[4:], true
}
func appendi64(dst []byte, i64 int64) []byte {
- return append(dst,
- byte(i64), byte(i64>>8), byte(i64>>16), byte(i64>>24),
- byte(i64>>32), byte(i64>>40), byte(i64>>48), byte(i64>>56),
- )
+ b := []byte{0, 0, 0, 0, 0, 0, 0, 0}
+ binary.LittleEndian.PutUint64(b, uint64(i64))
+ return append(dst, b...)
}
func readi64(src []byte) (int64, []byte, bool) {
if len(src) < 8 {
return 0, src, false
}
- i64 := (int64(src[0]) | int64(src[1])<<8 | int64(src[2])<<16 | int64(src[3])<<24 |
- int64(src[4])<<32 | int64(src[5])<<40 | int64(src[6])<<48 | int64(src[7])<<56)
- return i64, src[8:], true
+ return int64(binary.LittleEndian.Uint64(src)), src[8:], true
}
func appendu32(dst []byte, u32 uint32) []byte {
- return append(dst, byte(u32), byte(u32>>8), byte(u32>>16), byte(u32>>24))
+ b := []byte{0, 0, 0, 0}
+ binary.LittleEndian.PutUint32(b, u32)
+ return append(dst, b...)
}
func readu32(src []byte) (uint32, []byte, bool) {
@@ -762,23 +761,20 @@ func readu32(src []byte) (uint32, []byte, bool) {
return 0, src, false
}
- return (uint32(src[0]) | uint32(src[1])<<8 | uint32(src[2])<<16 | uint32(src[3])<<24), src[4:], true
+ return binary.LittleEndian.Uint32(src), src[4:], true
}
func appendu64(dst []byte, u64 uint64) []byte {
- return append(dst,
- byte(u64), byte(u64>>8), byte(u64>>16), byte(u64>>24),
- byte(u64>>32), byte(u64>>40), byte(u64>>48), byte(u64>>56),
- )
+ b := []byte{0, 0, 0, 0, 0, 0, 0, 0}
+ binary.LittleEndian.PutUint64(b, u64)
+ return append(dst, b...)
}
func readu64(src []byte) (uint64, []byte, bool) {
if len(src) < 8 {
return 0, src, false
}
- u64 := (uint64(src[0]) | uint64(src[1])<<8 | uint64(src[2])<<16 | uint64(src[3])<<24 |
- uint64(src[4])<<32 | uint64(src[5])<<40 | uint64(src[6])<<48 | uint64(src[7])<<56)
- return u64, src[8:], true
+ return binary.LittleEndian.Uint64(src), src[8:], true
}
// keep in sync with readcstringbytes
@@ -825,6 +821,9 @@ func readLengthBytes(src []byte) ([]byte, []byte, bool) {
if !ok {
return nil, src, false
}
+ if l < 4 {
+ return nil, src, false
+ }
if len(src) < int(l) {
return nil, src, false
}
diff --git a/api/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/doc.go b/api/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/doc.go
index 6837b53fc5b4..f68e1da1a09d 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/doc.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/doc.go
@@ -4,10 +4,18 @@
// not use this file except in compliance with the License. You may obtain
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-// Package bsoncore contains functions that can be used to encode and decode BSON
-// elements and values to or from a slice of bytes. These functions are aimed at
-// allowing low level manipulation of BSON and can be used to build a higher
-// level BSON library.
+// Package bsoncore is intended for internal use only. It is made available to
+// facilitate use cases that require access to internal MongoDB driver
+// functionality and state. The API of this package is not stable and there is
+// no backward compatibility guarantee.
+//
+// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT
+// NOTICE! USE WITH EXTREME CAUTION!
+//
+// Package bsoncore contains functions that can be used to encode and decode
+// BSON elements and values to or from a slice of bytes. These functions are
+// aimed at allowing low level manipulation of BSON and can be used to build a
+// higher level BSON library.
//
// The Read* functions within this package return the values of the element and
// a boolean indicating if the values are valid. A boolean was used instead of
@@ -15,15 +23,12 @@
// enough bytes. This library attempts to do no validation, it will only return
// false if there are not enough bytes for an item to be read. For example, the
// ReadDocument function checks the length, if that length is larger than the
-// number of bytes available, it will return false, if there are enough bytes, it
-// will return those bytes and true. It is the consumers responsibility to
+// number of bytes available, it will return false, if there are enough bytes,
+// it will return those bytes and true. It is the consumers responsibility to
// validate those bytes.
//
// The Append* functions within this package will append the type value to the
// given dst slice. If the slice has enough capacity, it will not grow the
// slice. The Append*Element functions within this package operate in the same
// way, but additionally append the BSON type and the key before the value.
-//
-// Warning: Package bsoncore is unstable and there is no backward compatibility
-// guarantee. It is experimental and subject to change.
package bsoncore
diff --git a/api/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/element.go b/api/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/element.go
index 1fe0897c9143..9c1ab2ae964c 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/element.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/element.go
@@ -51,7 +51,7 @@ func (e Element) KeyErr() (string, error) {
// KeyBytesErr returns the key for this element as a []byte, returning an error if the element is
// not valid.
func (e Element) KeyBytesErr() ([]byte, error) {
- if len(e) <= 0 {
+ if len(e) == 0 {
return nil, ErrElementMissingType
}
idx := bytes.IndexByte(e[1:], 0x00)
@@ -99,7 +99,7 @@ func (e Element) Value() Value {
// ValueErr returns the value for this element, returning an error if the element is not valid.
func (e Element) ValueErr() (Value, error) {
- if len(e) <= 0 {
+ if len(e) == 0 {
return Value{}, ErrElementMissingType
}
idx := bytes.IndexByte(e[1:], 0x00)
@@ -116,7 +116,7 @@ func (e Element) ValueErr() (Value, error) {
// String implements the fmt.String interface. The output will be in extended JSON format.
func (e Element) String() string {
- if len(e) <= 0 {
+ if len(e) == 0 {
return ""
}
t := bsontype.Type(e[0])
@@ -135,7 +135,7 @@ func (e Element) String() string {
// DebugString outputs a human readable version of RawElement. It will attempt to stringify the
// valid components of the element even if the entire element is not valid.
func (e Element) DebugString() string {
- if len(e) <= 0 {
+ if len(e) == 0 {
return ""
}
t := bsontype.Type(e[0])
diff --git a/api/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/value.go b/api/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/value.go
index 69c1f9edbb29..fcb0428bbd30 100644
--- a/api/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/value.go
+++ b/api/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/value.go
@@ -924,13 +924,14 @@ func escapeString(s string) string {
func formatDouble(f float64) string {
var s string
- if math.IsInf(f, 1) {
+ switch {
+ case math.IsInf(f, 1):
s = "Infinity"
- } else if math.IsInf(f, -1) {
+ case math.IsInf(f, -1):
s = "-Infinity"
- } else if math.IsNaN(f) {
+ case math.IsNaN(f):
s = "NaN"
- } else {
+ default:
// Print exactly one decimalType place for integers; otherwise, print as many are necessary to
// perfectly represent it.
s = strconv.FormatFloat(f, 'G', -1, 64)
@@ -953,9 +954,7 @@ func (ss sortableString) Less(i, j int) bool {
}
func (ss sortableString) Swap(i, j int) {
- oldI := ss[i]
- ss[i] = ss[j]
- ss[j] = oldI
+ ss[i], ss[j] = ss[j], ss[i]
}
func sortStringAlphebeticAscending(s string) string {
diff --git a/api/vendor/k8s.io/api/authorization/v1/doc.go b/api/vendor/k8s.io/api/authorization/v1/doc.go
index 40bf8006e06c..0a0cbf91becf 100644
--- a/api/vendor/k8s.io/api/authorization/v1/doc.go
+++ b/api/vendor/k8s.io/api/authorization/v1/doc.go
@@ -18,6 +18,8 @@ limitations under the License.
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=true
// +k8s:prerelease-lifecycle-gen=true
+// +k8s:openapi-model-package=io.k8s.api.authorization.v1
+
// +groupName=authorization.k8s.io
package v1
diff --git a/api/vendor/k8s.io/api/authorization/v1/generated.pb.go b/api/vendor/k8s.io/api/authorization/v1/generated.pb.go
index aed9a3a47616..f389c4c05f24 100644
--- a/api/vendor/k8s.io/api/authorization/v1/generated.pb.go
+++ b/api/vendor/k8s.io/api/authorization/v1/generated.pb.go
@@ -23,581 +23,46 @@ import (
fmt "fmt"
io "io"
+ "sort"
- 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"
reflect "reflect"
strings "strings"
)
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
+func (m *ExtraValue) Reset() { *m = ExtraValue{} }
-// 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 *FieldSelectorAttributes) Reset() { *m = FieldSelectorAttributes{} }
-func (m *ExtraValue) Reset() { *m = ExtraValue{} }
-func (*ExtraValue) ProtoMessage() {}
-func (*ExtraValue) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{0}
-}
-func (m *ExtraValue) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ExtraValue) 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 *ExtraValue) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ExtraValue.Merge(m, src)
-}
-func (m *ExtraValue) XXX_Size() int {
- return m.Size()
-}
-func (m *ExtraValue) XXX_DiscardUnknown() {
- xxx_messageInfo_ExtraValue.DiscardUnknown(m)
-}
-
-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{3}
-}
-func (m *LocalSubjectAccessReview) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *LocalSubjectAccessReview) 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 *LocalSubjectAccessReview) XXX_Merge(src proto.Message) {
- xxx_messageInfo_LocalSubjectAccessReview.Merge(m, src)
-}
-func (m *LocalSubjectAccessReview) XXX_Size() int {
- return m.Size()
-}
-func (m *LocalSubjectAccessReview) XXX_DiscardUnknown() {
- xxx_messageInfo_LocalSubjectAccessReview.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_LocalSubjectAccessReview proto.InternalMessageInfo
-
-func (m *NonResourceAttributes) Reset() { *m = NonResourceAttributes{} }
-func (*NonResourceAttributes) ProtoMessage() {}
-func (*NonResourceAttributes) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{4}
-}
-func (m *NonResourceAttributes) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NonResourceAttributes) 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 *NonResourceAttributes) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NonResourceAttributes.Merge(m, src)
-}
-func (m *NonResourceAttributes) XXX_Size() int {
- return m.Size()
-}
-func (m *NonResourceAttributes) XXX_DiscardUnknown() {
- xxx_messageInfo_NonResourceAttributes.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NonResourceAttributes proto.InternalMessageInfo
-
-func (m *NonResourceRule) Reset() { *m = NonResourceRule{} }
-func (*NonResourceRule) ProtoMessage() {}
-func (*NonResourceRule) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{5}
-}
-func (m *NonResourceRule) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NonResourceRule) 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 *NonResourceRule) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NonResourceRule.Merge(m, src)
-}
-func (m *NonResourceRule) XXX_Size() int {
- return m.Size()
-}
-func (m *NonResourceRule) XXX_DiscardUnknown() {
- xxx_messageInfo_NonResourceRule.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NonResourceRule proto.InternalMessageInfo
-
-func (m *ResourceAttributes) Reset() { *m = ResourceAttributes{} }
-func (*ResourceAttributes) ProtoMessage() {}
-func (*ResourceAttributes) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{6}
-}
-func (m *ResourceAttributes) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResourceAttributes) 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 *ResourceAttributes) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceAttributes.Merge(m, src)
-}
-func (m *ResourceAttributes) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceAttributes) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceAttributes.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ResourceAttributes proto.InternalMessageInfo
-
-func (m *ResourceRule) Reset() { *m = ResourceRule{} }
-func (*ResourceRule) ProtoMessage() {}
-func (*ResourceRule) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{7}
-}
-func (m *ResourceRule) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResourceRule) 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 *ResourceRule) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceRule.Merge(m, src)
-}
-func (m *ResourceRule) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceRule) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceRule.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ResourceRule proto.InternalMessageInfo
-
-func (m *SelfSubjectAccessReview) Reset() { *m = SelfSubjectAccessReview{} }
-func (*SelfSubjectAccessReview) ProtoMessage() {}
-func (*SelfSubjectAccessReview) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{8}
-}
-func (m *SelfSubjectAccessReview) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SelfSubjectAccessReview) 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 *SelfSubjectAccessReview) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SelfSubjectAccessReview.Merge(m, src)
-}
-func (m *SelfSubjectAccessReview) XXX_Size() int {
- return m.Size()
-}
-func (m *SelfSubjectAccessReview) XXX_DiscardUnknown() {
- xxx_messageInfo_SelfSubjectAccessReview.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SelfSubjectAccessReview proto.InternalMessageInfo
-
-func (m *SelfSubjectAccessReviewSpec) Reset() { *m = SelfSubjectAccessReviewSpec{} }
-func (*SelfSubjectAccessReviewSpec) ProtoMessage() {}
-func (*SelfSubjectAccessReviewSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{9}
-}
-func (m *SelfSubjectAccessReviewSpec) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SelfSubjectAccessReviewSpec) 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 *SelfSubjectAccessReviewSpec) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SelfSubjectAccessReviewSpec.Merge(m, src)
-}
-func (m *SelfSubjectAccessReviewSpec) XXX_Size() int {
- return m.Size()
-}
-func (m *SelfSubjectAccessReviewSpec) XXX_DiscardUnknown() {
- xxx_messageInfo_SelfSubjectAccessReviewSpec.DiscardUnknown(m)
-}
+func (m *LabelSelectorAttributes) Reset() { *m = LabelSelectorAttributes{} }
-var xxx_messageInfo_SelfSubjectAccessReviewSpec proto.InternalMessageInfo
-
-func (m *SelfSubjectRulesReview) Reset() { *m = SelfSubjectRulesReview{} }
-func (*SelfSubjectRulesReview) ProtoMessage() {}
-func (*SelfSubjectRulesReview) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{10}
-}
-func (m *SelfSubjectRulesReview) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SelfSubjectRulesReview) 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 *SelfSubjectRulesReview) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SelfSubjectRulesReview.Merge(m, src)
-}
-func (m *SelfSubjectRulesReview) XXX_Size() int {
- return m.Size()
-}
-func (m *SelfSubjectRulesReview) XXX_DiscardUnknown() {
- xxx_messageInfo_SelfSubjectRulesReview.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SelfSubjectRulesReview proto.InternalMessageInfo
-
-func (m *SelfSubjectRulesReviewSpec) Reset() { *m = SelfSubjectRulesReviewSpec{} }
-func (*SelfSubjectRulesReviewSpec) ProtoMessage() {}
-func (*SelfSubjectRulesReviewSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{11}
-}
-func (m *SelfSubjectRulesReviewSpec) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SelfSubjectRulesReviewSpec) 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 *SelfSubjectRulesReviewSpec) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SelfSubjectRulesReviewSpec.Merge(m, src)
-}
-func (m *SelfSubjectRulesReviewSpec) XXX_Size() int {
- return m.Size()
-}
-func (m *SelfSubjectRulesReviewSpec) XXX_DiscardUnknown() {
- xxx_messageInfo_SelfSubjectRulesReviewSpec.DiscardUnknown(m)
-}
+func (m *LocalSubjectAccessReview) Reset() { *m = LocalSubjectAccessReview{} }
-var xxx_messageInfo_SelfSubjectRulesReviewSpec proto.InternalMessageInfo
+func (m *NonResourceAttributes) Reset() { *m = NonResourceAttributes{} }
-func (m *SubjectAccessReview) Reset() { *m = SubjectAccessReview{} }
-func (*SubjectAccessReview) ProtoMessage() {}
-func (*SubjectAccessReview) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{12}
-}
-func (m *SubjectAccessReview) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SubjectAccessReview) 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 *SubjectAccessReview) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SubjectAccessReview.Merge(m, src)
-}
-func (m *SubjectAccessReview) XXX_Size() int {
- return m.Size()
-}
-func (m *SubjectAccessReview) XXX_DiscardUnknown() {
- xxx_messageInfo_SubjectAccessReview.DiscardUnknown(m)
-}
+func (m *NonResourceRule) Reset() { *m = NonResourceRule{} }
-var xxx_messageInfo_SubjectAccessReview proto.InternalMessageInfo
+func (m *ResourceAttributes) Reset() { *m = ResourceAttributes{} }
-func (m *SubjectAccessReviewSpec) Reset() { *m = SubjectAccessReviewSpec{} }
-func (*SubjectAccessReviewSpec) ProtoMessage() {}
-func (*SubjectAccessReviewSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{13}
-}
-func (m *SubjectAccessReviewSpec) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SubjectAccessReviewSpec) 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 *SubjectAccessReviewSpec) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SubjectAccessReviewSpec.Merge(m, src)
-}
-func (m *SubjectAccessReviewSpec) XXX_Size() int {
- return m.Size()
-}
-func (m *SubjectAccessReviewSpec) XXX_DiscardUnknown() {
- xxx_messageInfo_SubjectAccessReviewSpec.DiscardUnknown(m)
-}
+func (m *ResourceRule) Reset() { *m = ResourceRule{} }
-var xxx_messageInfo_SubjectAccessReviewSpec proto.InternalMessageInfo
+func (m *SelfSubjectAccessReview) Reset() { *m = SelfSubjectAccessReview{} }
-func (m *SubjectAccessReviewStatus) Reset() { *m = SubjectAccessReviewStatus{} }
-func (*SubjectAccessReviewStatus) ProtoMessage() {}
-func (*SubjectAccessReviewStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{14}
-}
-func (m *SubjectAccessReviewStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SubjectAccessReviewStatus) 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 *SubjectAccessReviewStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SubjectAccessReviewStatus.Merge(m, src)
-}
-func (m *SubjectAccessReviewStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *SubjectAccessReviewStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_SubjectAccessReviewStatus.DiscardUnknown(m)
-}
+func (m *SelfSubjectAccessReviewSpec) Reset() { *m = SelfSubjectAccessReviewSpec{} }
-var xxx_messageInfo_SubjectAccessReviewStatus proto.InternalMessageInfo
+func (m *SelfSubjectRulesReview) Reset() { *m = SelfSubjectRulesReview{} }
-func (m *SubjectRulesReviewStatus) Reset() { *m = SubjectRulesReviewStatus{} }
-func (*SubjectRulesReviewStatus) ProtoMessage() {}
-func (*SubjectRulesReviewStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_aafd0e5e70cec678, []int{15}
-}
-func (m *SubjectRulesReviewStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SubjectRulesReviewStatus) 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 *SubjectRulesReviewStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SubjectRulesReviewStatus.Merge(m, src)
-}
-func (m *SubjectRulesReviewStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *SubjectRulesReviewStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_SubjectRulesReviewStatus.DiscardUnknown(m)
-}
+func (m *SelfSubjectRulesReviewSpec) Reset() { *m = SelfSubjectRulesReviewSpec{} }
-var xxx_messageInfo_SubjectRulesReviewStatus proto.InternalMessageInfo
+func (m *SubjectAccessReview) Reset() { *m = SubjectAccessReview{} }
-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")
- proto.RegisterType((*ResourceAttributes)(nil), "k8s.io.api.authorization.v1.ResourceAttributes")
- proto.RegisterType((*ResourceRule)(nil), "k8s.io.api.authorization.v1.ResourceRule")
- proto.RegisterType((*SelfSubjectAccessReview)(nil), "k8s.io.api.authorization.v1.SelfSubjectAccessReview")
- proto.RegisterType((*SelfSubjectAccessReviewSpec)(nil), "k8s.io.api.authorization.v1.SelfSubjectAccessReviewSpec")
- proto.RegisterType((*SelfSubjectRulesReview)(nil), "k8s.io.api.authorization.v1.SelfSubjectRulesReview")
- proto.RegisterType((*SelfSubjectRulesReviewSpec)(nil), "k8s.io.api.authorization.v1.SelfSubjectRulesReviewSpec")
- proto.RegisterType((*SubjectAccessReview)(nil), "k8s.io.api.authorization.v1.SubjectAccessReview")
- proto.RegisterType((*SubjectAccessReviewSpec)(nil), "k8s.io.api.authorization.v1.SubjectAccessReviewSpec")
- proto.RegisterMapType((map[string]ExtraValue)(nil), "k8s.io.api.authorization.v1.SubjectAccessReviewSpec.ExtraEntry")
- proto.RegisterType((*SubjectAccessReviewStatus)(nil), "k8s.io.api.authorization.v1.SubjectAccessReviewStatus")
- proto.RegisterType((*SubjectRulesReviewStatus)(nil), "k8s.io.api.authorization.v1.SubjectRulesReviewStatus")
-}
+func (m *SubjectAccessReviewSpec) Reset() { *m = SubjectAccessReviewSpec{} }
-func init() {
- proto.RegisterFile("k8s.io/api/authorization/v1/generated.proto", fileDescriptor_aafd0e5e70cec678)
-}
+func (m *SubjectAccessReviewStatus) Reset() { *m = SubjectAccessReviewStatus{} }
-var fileDescriptor_aafd0e5e70cec678 = []byte{
- // 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 *SubjectRulesReviewStatus) Reset() { *m = SubjectRulesReviewStatus{} }
func (m ExtraValue) Marshal() (dAtA []byte, err error) {
size := m.Size()
@@ -1247,7 +712,7 @@ func (m *SubjectAccessReviewSpec) MarshalToSizedBuffer(dAtA []byte) (int, error)
for k := range m.Extra {
keysForExtra = append(keysForExtra, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForExtra)
+ sort.Strings(keysForExtra)
for iNdEx := len(keysForExtra) - 1; iNdEx >= 0; iNdEx-- {
v := m.Extra[string(keysForExtra[iNdEx])]
baseI := i
@@ -1914,7 +1379,7 @@ func (this *SubjectAccessReviewSpec) String() string {
for k := range this.Extra {
keysForExtra = append(keysForExtra, k)
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForExtra)
+ sort.Strings(keysForExtra)
mapStringForExtra := "map[string]ExtraValue{"
for _, k := range keysForExtra {
mapStringForExtra += fmt.Sprintf("%v: %v,", k, this.Extra[k])
diff --git a/api/vendor/k8s.io/api/authorization/v1/generated.protomessage.pb.go b/api/vendor/k8s.io/api/authorization/v1/generated.protomessage.pb.go
new file mode 100644
index 000000000000..dc1e1028c00c
--- /dev/null
+++ b/api/vendor/k8s.io/api/authorization/v1/generated.protomessage.pb.go
@@ -0,0 +1,54 @@
+//go:build kubernetes_protomessage_one_more_release
+// +build kubernetes_protomessage_one_more_release
+
+/*
+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 go-to-protobuf. DO NOT EDIT.
+
+package v1
+
+func (*ExtraValue) ProtoMessage() {}
+
+func (*FieldSelectorAttributes) ProtoMessage() {}
+
+func (*LabelSelectorAttributes) ProtoMessage() {}
+
+func (*LocalSubjectAccessReview) ProtoMessage() {}
+
+func (*NonResourceAttributes) ProtoMessage() {}
+
+func (*NonResourceRule) ProtoMessage() {}
+
+func (*ResourceAttributes) ProtoMessage() {}
+
+func (*ResourceRule) ProtoMessage() {}
+
+func (*SelfSubjectAccessReview) ProtoMessage() {}
+
+func (*SelfSubjectAccessReviewSpec) ProtoMessage() {}
+
+func (*SelfSubjectRulesReview) ProtoMessage() {}
+
+func (*SelfSubjectRulesReviewSpec) ProtoMessage() {}
+
+func (*SubjectAccessReview) ProtoMessage() {}
+
+func (*SubjectAccessReviewSpec) ProtoMessage() {}
+
+func (*SubjectAccessReviewStatus) ProtoMessage() {}
+
+func (*SubjectRulesReviewStatus) ProtoMessage() {}
diff --git a/api/vendor/k8s.io/api/authorization/v1/zz_generated.model_name.go b/api/vendor/k8s.io/api/authorization/v1/zz_generated.model_name.go
new file mode 100644
index 000000000000..43e3b62eb087
--- /dev/null
+++ b/api/vendor/k8s.io/api/authorization/v1/zz_generated.model_name.go
@@ -0,0 +1,97 @@
+//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 openapi-gen. DO NOT EDIT.
+
+package v1
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in FieldSelectorAttributes) OpenAPIModelName() string {
+ return "io.k8s.api.authorization.v1.FieldSelectorAttributes"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in LabelSelectorAttributes) OpenAPIModelName() string {
+ return "io.k8s.api.authorization.v1.LabelSelectorAttributes"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in LocalSubjectAccessReview) OpenAPIModelName() string {
+ return "io.k8s.api.authorization.v1.LocalSubjectAccessReview"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NonResourceAttributes) OpenAPIModelName() string {
+ return "io.k8s.api.authorization.v1.NonResourceAttributes"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NonResourceRule) OpenAPIModelName() string {
+ return "io.k8s.api.authorization.v1.NonResourceRule"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ResourceAttributes) OpenAPIModelName() string {
+ return "io.k8s.api.authorization.v1.ResourceAttributes"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ResourceRule) OpenAPIModelName() string {
+ return "io.k8s.api.authorization.v1.ResourceRule"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SelfSubjectAccessReview) OpenAPIModelName() string {
+ return "io.k8s.api.authorization.v1.SelfSubjectAccessReview"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SelfSubjectAccessReviewSpec) OpenAPIModelName() string {
+ return "io.k8s.api.authorization.v1.SelfSubjectAccessReviewSpec"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SelfSubjectRulesReview) OpenAPIModelName() string {
+ return "io.k8s.api.authorization.v1.SelfSubjectRulesReview"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SelfSubjectRulesReviewSpec) OpenAPIModelName() string {
+ return "io.k8s.api.authorization.v1.SelfSubjectRulesReviewSpec"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SubjectAccessReview) OpenAPIModelName() string {
+ return "io.k8s.api.authorization.v1.SubjectAccessReview"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SubjectAccessReviewSpec) OpenAPIModelName() string {
+ return "io.k8s.api.authorization.v1.SubjectAccessReviewSpec"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SubjectAccessReviewStatus) OpenAPIModelName() string {
+ return "io.k8s.api.authorization.v1.SubjectAccessReviewStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SubjectRulesReviewStatus) OpenAPIModelName() string {
+ return "io.k8s.api.authorization.v1.SubjectRulesReviewStatus"
+}
diff --git a/api/vendor/k8s.io/api/core/v1/doc.go b/api/vendor/k8s.io/api/core/v1/doc.go
index e4e9196aebcb..a41f2ce1f6ce 100644
--- a/api/vendor/k8s.io/api/core/v1/doc.go
+++ b/api/vendor/k8s.io/api/core/v1/doc.go
@@ -18,6 +18,8 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
// +k8s:prerelease-lifecycle-gen=true
+// +k8s:openapi-model-package=io.k8s.api.core.v1
+
// +groupName=
// Package v1 is the v1 version of the core API.
diff --git a/api/vendor/k8s.io/api/core/v1/generated.pb.go b/api/vendor/k8s.io/api/core/v1/generated.pb.go
index e1a297b98547..b7de1bea54d3 100644
--- a/api/vendor/k8s.io/api/core/v1/generated.pb.go
+++ b/api/vendor/k8s.io/api/core/v1/generated.pb.go
@@ -23,14 +23,12 @@ import (
fmt "fmt"
io "io"
+ "sort"
- proto "github.com/gogo/protobuf/proto"
- github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
resource "k8s.io/apimachinery/pkg/api/resource"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
- math "math"
math_bits "math/bits"
reflect "reflect"
strings "strings"
@@ -38,7973 +36,481 @@ import (
k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types"
)
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
+func (m *AWSElasticBlockStoreVolumeSource) Reset() { *m = AWSElasticBlockStoreVolumeSource{} }
-// 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 *Affinity) Reset() { *m = Affinity{} }
-func (m *AWSElasticBlockStoreVolumeSource) Reset() { *m = AWSElasticBlockStoreVolumeSource{} }
-func (*AWSElasticBlockStoreVolumeSource) ProtoMessage() {}
-func (*AWSElasticBlockStoreVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{0}
-}
-func (m *AWSElasticBlockStoreVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *AWSElasticBlockStoreVolumeSource) 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 *AWSElasticBlockStoreVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_AWSElasticBlockStoreVolumeSource.Merge(m, src)
-}
-func (m *AWSElasticBlockStoreVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *AWSElasticBlockStoreVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_AWSElasticBlockStoreVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_AWSElasticBlockStoreVolumeSource proto.InternalMessageInfo
-
-func (m *Affinity) Reset() { *m = Affinity{} }
-func (*Affinity) ProtoMessage() {}
-func (*Affinity) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{1}
-}
-func (m *Affinity) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Affinity) 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 *Affinity) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Affinity.Merge(m, src)
-}
-func (m *Affinity) XXX_Size() int {
- return m.Size()
-}
-func (m *Affinity) XXX_DiscardUnknown() {
- xxx_messageInfo_Affinity.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Affinity proto.InternalMessageInfo
-
-func (m *AppArmorProfile) Reset() { *m = AppArmorProfile{} }
-func (*AppArmorProfile) ProtoMessage() {}
-func (*AppArmorProfile) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{2}
-}
-func (m *AppArmorProfile) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *AppArmorProfile) 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 *AppArmorProfile) XXX_Merge(src proto.Message) {
- xxx_messageInfo_AppArmorProfile.Merge(m, src)
-}
-func (m *AppArmorProfile) XXX_Size() int {
- return m.Size()
-}
-func (m *AppArmorProfile) XXX_DiscardUnknown() {
- xxx_messageInfo_AppArmorProfile.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_AppArmorProfile proto.InternalMessageInfo
-
-func (m *AttachedVolume) Reset() { *m = AttachedVolume{} }
-func (*AttachedVolume) ProtoMessage() {}
-func (*AttachedVolume) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{3}
-}
-func (m *AttachedVolume) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *AttachedVolume) 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 *AttachedVolume) XXX_Merge(src proto.Message) {
- xxx_messageInfo_AttachedVolume.Merge(m, src)
-}
-func (m *AttachedVolume) XXX_Size() int {
- return m.Size()
-}
-func (m *AttachedVolume) XXX_DiscardUnknown() {
- xxx_messageInfo_AttachedVolume.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_AttachedVolume proto.InternalMessageInfo
-
-func (m *AvoidPods) Reset() { *m = AvoidPods{} }
-func (*AvoidPods) ProtoMessage() {}
-func (*AvoidPods) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{4}
-}
-func (m *AvoidPods) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *AvoidPods) 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 *AvoidPods) XXX_Merge(src proto.Message) {
- xxx_messageInfo_AvoidPods.Merge(m, src)
-}
-func (m *AvoidPods) XXX_Size() int {
- return m.Size()
-}
-func (m *AvoidPods) XXX_DiscardUnknown() {
- xxx_messageInfo_AvoidPods.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_AvoidPods proto.InternalMessageInfo
-
-func (m *AzureDiskVolumeSource) Reset() { *m = AzureDiskVolumeSource{} }
-func (*AzureDiskVolumeSource) ProtoMessage() {}
-func (*AzureDiskVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{5}
-}
-func (m *AzureDiskVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *AzureDiskVolumeSource) 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 *AzureDiskVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_AzureDiskVolumeSource.Merge(m, src)
-}
-func (m *AzureDiskVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *AzureDiskVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_AzureDiskVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_AzureDiskVolumeSource proto.InternalMessageInfo
-
-func (m *AzureFilePersistentVolumeSource) Reset() { *m = AzureFilePersistentVolumeSource{} }
-func (*AzureFilePersistentVolumeSource) ProtoMessage() {}
-func (*AzureFilePersistentVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{6}
-}
-func (m *AzureFilePersistentVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *AzureFilePersistentVolumeSource) 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 *AzureFilePersistentVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_AzureFilePersistentVolumeSource.Merge(m, src)
-}
-func (m *AzureFilePersistentVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *AzureFilePersistentVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_AzureFilePersistentVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_AzureFilePersistentVolumeSource proto.InternalMessageInfo
-
-func (m *AzureFileVolumeSource) Reset() { *m = AzureFileVolumeSource{} }
-func (*AzureFileVolumeSource) ProtoMessage() {}
-func (*AzureFileVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{7}
-}
-func (m *AzureFileVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *AzureFileVolumeSource) 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 *AzureFileVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_AzureFileVolumeSource.Merge(m, src)
-}
-func (m *AzureFileVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *AzureFileVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_AzureFileVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_AzureFileVolumeSource proto.InternalMessageInfo
-
-func (m *Binding) Reset() { *m = Binding{} }
-func (*Binding) ProtoMessage() {}
-func (*Binding) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{8}
-}
-func (m *Binding) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Binding) 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 *Binding) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Binding.Merge(m, src)
-}
-func (m *Binding) XXX_Size() int {
- return m.Size()
-}
-func (m *Binding) XXX_DiscardUnknown() {
- xxx_messageInfo_Binding.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Binding proto.InternalMessageInfo
-
-func (m *CSIPersistentVolumeSource) Reset() { *m = CSIPersistentVolumeSource{} }
-func (*CSIPersistentVolumeSource) ProtoMessage() {}
-func (*CSIPersistentVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{9}
-}
-func (m *CSIPersistentVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CSIPersistentVolumeSource) 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 *CSIPersistentVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CSIPersistentVolumeSource.Merge(m, src)
-}
-func (m *CSIPersistentVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *CSIPersistentVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_CSIPersistentVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CSIPersistentVolumeSource proto.InternalMessageInfo
-
-func (m *CSIVolumeSource) Reset() { *m = CSIVolumeSource{} }
-func (*CSIVolumeSource) ProtoMessage() {}
-func (*CSIVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{10}
-}
-func (m *CSIVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CSIVolumeSource) 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 *CSIVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CSIVolumeSource.Merge(m, src)
-}
-func (m *CSIVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *CSIVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_CSIVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CSIVolumeSource proto.InternalMessageInfo
-
-func (m *Capabilities) Reset() { *m = Capabilities{} }
-func (*Capabilities) ProtoMessage() {}
-func (*Capabilities) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{11}
-}
-func (m *Capabilities) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Capabilities) 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 *Capabilities) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Capabilities.Merge(m, src)
-}
-func (m *Capabilities) XXX_Size() int {
- return m.Size()
-}
-func (m *Capabilities) XXX_DiscardUnknown() {
- xxx_messageInfo_Capabilities.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Capabilities proto.InternalMessageInfo
-
-func (m *CephFSPersistentVolumeSource) Reset() { *m = CephFSPersistentVolumeSource{} }
-func (*CephFSPersistentVolumeSource) ProtoMessage() {}
-func (*CephFSPersistentVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{12}
-}
-func (m *CephFSPersistentVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CephFSPersistentVolumeSource) 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 *CephFSPersistentVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CephFSPersistentVolumeSource.Merge(m, src)
-}
-func (m *CephFSPersistentVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *CephFSPersistentVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_CephFSPersistentVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CephFSPersistentVolumeSource proto.InternalMessageInfo
-
-func (m *CephFSVolumeSource) Reset() { *m = CephFSVolumeSource{} }
-func (*CephFSVolumeSource) ProtoMessage() {}
-func (*CephFSVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{13}
-}
-func (m *CephFSVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CephFSVolumeSource) 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 *CephFSVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CephFSVolumeSource.Merge(m, src)
-}
-func (m *CephFSVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *CephFSVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_CephFSVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CephFSVolumeSource proto.InternalMessageInfo
-
-func (m *CinderPersistentVolumeSource) Reset() { *m = CinderPersistentVolumeSource{} }
-func (*CinderPersistentVolumeSource) ProtoMessage() {}
-func (*CinderPersistentVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{14}
-}
-func (m *CinderPersistentVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CinderPersistentVolumeSource) 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 *CinderPersistentVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CinderPersistentVolumeSource.Merge(m, src)
-}
-func (m *CinderPersistentVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *CinderPersistentVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_CinderPersistentVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CinderPersistentVolumeSource proto.InternalMessageInfo
-
-func (m *CinderVolumeSource) Reset() { *m = CinderVolumeSource{} }
-func (*CinderVolumeSource) ProtoMessage() {}
-func (*CinderVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{15}
-}
-func (m *CinderVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CinderVolumeSource) 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 *CinderVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CinderVolumeSource.Merge(m, src)
-}
-func (m *CinderVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *CinderVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_CinderVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CinderVolumeSource proto.InternalMessageInfo
-
-func (m *ClientIPConfig) Reset() { *m = ClientIPConfig{} }
-func (*ClientIPConfig) ProtoMessage() {}
-func (*ClientIPConfig) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{16}
-}
-func (m *ClientIPConfig) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ClientIPConfig) 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 *ClientIPConfig) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ClientIPConfig.Merge(m, src)
-}
-func (m *ClientIPConfig) XXX_Size() int {
- return m.Size()
-}
-func (m *ClientIPConfig) XXX_DiscardUnknown() {
- xxx_messageInfo_ClientIPConfig.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ClientIPConfig proto.InternalMessageInfo
-
-func (m *ClusterTrustBundleProjection) Reset() { *m = ClusterTrustBundleProjection{} }
-func (*ClusterTrustBundleProjection) ProtoMessage() {}
-func (*ClusterTrustBundleProjection) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{17}
-}
-func (m *ClusterTrustBundleProjection) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ClusterTrustBundleProjection) 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 *ClusterTrustBundleProjection) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ClusterTrustBundleProjection.Merge(m, src)
-}
-func (m *ClusterTrustBundleProjection) XXX_Size() int {
- return m.Size()
-}
-func (m *ClusterTrustBundleProjection) XXX_DiscardUnknown() {
- xxx_messageInfo_ClusterTrustBundleProjection.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ClusterTrustBundleProjection proto.InternalMessageInfo
-
-func (m *ComponentCondition) Reset() { *m = ComponentCondition{} }
-func (*ComponentCondition) ProtoMessage() {}
-func (*ComponentCondition) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{18}
-}
-func (m *ComponentCondition) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ComponentCondition) 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 *ComponentCondition) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ComponentCondition.Merge(m, src)
-}
-func (m *ComponentCondition) XXX_Size() int {
- return m.Size()
-}
-func (m *ComponentCondition) XXX_DiscardUnknown() {
- xxx_messageInfo_ComponentCondition.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ComponentCondition proto.InternalMessageInfo
-
-func (m *ComponentStatus) Reset() { *m = ComponentStatus{} }
-func (*ComponentStatus) ProtoMessage() {}
-func (*ComponentStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{19}
-}
-func (m *ComponentStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ComponentStatus) 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 *ComponentStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ComponentStatus.Merge(m, src)
-}
-func (m *ComponentStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *ComponentStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_ComponentStatus.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ComponentStatus proto.InternalMessageInfo
-
-func (m *ComponentStatusList) Reset() { *m = ComponentStatusList{} }
-func (*ComponentStatusList) ProtoMessage() {}
-func (*ComponentStatusList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{20}
-}
-func (m *ComponentStatusList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ComponentStatusList) 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 *ComponentStatusList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ComponentStatusList.Merge(m, src)
-}
-func (m *ComponentStatusList) XXX_Size() int {
- return m.Size()
-}
-func (m *ComponentStatusList) XXX_DiscardUnknown() {
- xxx_messageInfo_ComponentStatusList.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ComponentStatusList proto.InternalMessageInfo
-
-func (m *ConfigMap) Reset() { *m = ConfigMap{} }
-func (*ConfigMap) ProtoMessage() {}
-func (*ConfigMap) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{21}
-}
-func (m *ConfigMap) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ConfigMap) 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 *ConfigMap) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ConfigMap.Merge(m, src)
-}
-func (m *ConfigMap) XXX_Size() int {
- return m.Size()
-}
-func (m *ConfigMap) XXX_DiscardUnknown() {
- xxx_messageInfo_ConfigMap.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ConfigMap proto.InternalMessageInfo
-
-func (m *ConfigMapEnvSource) Reset() { *m = ConfigMapEnvSource{} }
-func (*ConfigMapEnvSource) ProtoMessage() {}
-func (*ConfigMapEnvSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{22}
-}
-func (m *ConfigMapEnvSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ConfigMapEnvSource) 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 *ConfigMapEnvSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ConfigMapEnvSource.Merge(m, src)
-}
-func (m *ConfigMapEnvSource) XXX_Size() int {
- return m.Size()
-}
-func (m *ConfigMapEnvSource) XXX_DiscardUnknown() {
- xxx_messageInfo_ConfigMapEnvSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ConfigMapEnvSource proto.InternalMessageInfo
-
-func (m *ConfigMapKeySelector) Reset() { *m = ConfigMapKeySelector{} }
-func (*ConfigMapKeySelector) ProtoMessage() {}
-func (*ConfigMapKeySelector) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{23}
-}
-func (m *ConfigMapKeySelector) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ConfigMapKeySelector) 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 *ConfigMapKeySelector) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ConfigMapKeySelector.Merge(m, src)
-}
-func (m *ConfigMapKeySelector) XXX_Size() int {
- return m.Size()
-}
-func (m *ConfigMapKeySelector) XXX_DiscardUnknown() {
- xxx_messageInfo_ConfigMapKeySelector.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ConfigMapKeySelector proto.InternalMessageInfo
-
-func (m *ConfigMapList) Reset() { *m = ConfigMapList{} }
-func (*ConfigMapList) ProtoMessage() {}
-func (*ConfigMapList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{24}
-}
-func (m *ConfigMapList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ConfigMapList) 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 *ConfigMapList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ConfigMapList.Merge(m, src)
-}
-func (m *ConfigMapList) XXX_Size() int {
- return m.Size()
-}
-func (m *ConfigMapList) XXX_DiscardUnknown() {
- xxx_messageInfo_ConfigMapList.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ConfigMapList proto.InternalMessageInfo
-
-func (m *ConfigMapNodeConfigSource) Reset() { *m = ConfigMapNodeConfigSource{} }
-func (*ConfigMapNodeConfigSource) ProtoMessage() {}
-func (*ConfigMapNodeConfigSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{25}
-}
-func (m *ConfigMapNodeConfigSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ConfigMapNodeConfigSource) 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 *ConfigMapNodeConfigSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ConfigMapNodeConfigSource.Merge(m, src)
-}
-func (m *ConfigMapNodeConfigSource) XXX_Size() int {
- return m.Size()
-}
-func (m *ConfigMapNodeConfigSource) XXX_DiscardUnknown() {
- xxx_messageInfo_ConfigMapNodeConfigSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ConfigMapNodeConfigSource proto.InternalMessageInfo
-
-func (m *ConfigMapProjection) Reset() { *m = ConfigMapProjection{} }
-func (*ConfigMapProjection) ProtoMessage() {}
-func (*ConfigMapProjection) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{26}
-}
-func (m *ConfigMapProjection) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ConfigMapProjection) 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 *ConfigMapProjection) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ConfigMapProjection.Merge(m, src)
-}
-func (m *ConfigMapProjection) XXX_Size() int {
- return m.Size()
-}
-func (m *ConfigMapProjection) XXX_DiscardUnknown() {
- xxx_messageInfo_ConfigMapProjection.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ConfigMapProjection proto.InternalMessageInfo
-
-func (m *ConfigMapVolumeSource) Reset() { *m = ConfigMapVolumeSource{} }
-func (*ConfigMapVolumeSource) ProtoMessage() {}
-func (*ConfigMapVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{27}
-}
-func (m *ConfigMapVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ConfigMapVolumeSource) 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 *ConfigMapVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ConfigMapVolumeSource.Merge(m, src)
-}
-func (m *ConfigMapVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *ConfigMapVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_ConfigMapVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ConfigMapVolumeSource proto.InternalMessageInfo
-
-func (m *Container) Reset() { *m = Container{} }
-func (*Container) ProtoMessage() {}
-func (*Container) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{28}
-}
-func (m *Container) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Container) 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 *Container) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Container.Merge(m, src)
-}
-func (m *Container) XXX_Size() int {
- return m.Size()
-}
-func (m *Container) XXX_DiscardUnknown() {
- xxx_messageInfo_Container.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Container proto.InternalMessageInfo
-
-func (m *ContainerExtendedResourceRequest) Reset() { *m = ContainerExtendedResourceRequest{} }
-func (*ContainerExtendedResourceRequest) ProtoMessage() {}
-func (*ContainerExtendedResourceRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{29}
-}
-func (m *ContainerExtendedResourceRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ContainerExtendedResourceRequest) 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 *ContainerExtendedResourceRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ContainerExtendedResourceRequest.Merge(m, src)
-}
-func (m *ContainerExtendedResourceRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ContainerExtendedResourceRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ContainerExtendedResourceRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ContainerExtendedResourceRequest proto.InternalMessageInfo
-
-func (m *ContainerImage) Reset() { *m = ContainerImage{} }
-func (*ContainerImage) ProtoMessage() {}
-func (*ContainerImage) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{30}
-}
-func (m *ContainerImage) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ContainerImage) 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 *ContainerImage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ContainerImage.Merge(m, src)
-}
-func (m *ContainerImage) XXX_Size() int {
- return m.Size()
-}
-func (m *ContainerImage) XXX_DiscardUnknown() {
- xxx_messageInfo_ContainerImage.DiscardUnknown(m)
-}
-
-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}
-}
-func (m *ContainerPort) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ContainerPort) 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 *ContainerPort) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ContainerPort.Merge(m, src)
-}
-func (m *ContainerPort) XXX_Size() int {
- return m.Size()
-}
-func (m *ContainerPort) XXX_DiscardUnknown() {
- xxx_messageInfo_ContainerPort.DiscardUnknown(m)
-}
-
-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}
-}
-func (m *ContainerResizePolicy) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ContainerResizePolicy) 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 *ContainerResizePolicy) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ContainerResizePolicy.Merge(m, src)
-}
-func (m *ContainerResizePolicy) XXX_Size() int {
- return m.Size()
-}
-func (m *ContainerResizePolicy) XXX_DiscardUnknown() {
- xxx_messageInfo_ContainerResizePolicy.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ContainerResizePolicy proto.InternalMessageInfo
-
-func (m *ContainerRestartRule) Reset() { *m = ContainerRestartRule{} }
-func (*ContainerRestartRule) ProtoMessage() {}
-func (*ContainerRestartRule) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{33}
-}
-func (m *ContainerRestartRule) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ContainerRestartRule) 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 *ContainerRestartRule) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ContainerRestartRule.Merge(m, src)
-}
-func (m *ContainerRestartRule) XXX_Size() int {
- return m.Size()
-}
-func (m *ContainerRestartRule) XXX_DiscardUnknown() {
- xxx_messageInfo_ContainerRestartRule.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ContainerRestartRule proto.InternalMessageInfo
-
-func (m *ContainerRestartRuleOnExitCodes) Reset() { *m = ContainerRestartRuleOnExitCodes{} }
-func (*ContainerRestartRuleOnExitCodes) ProtoMessage() {}
-func (*ContainerRestartRuleOnExitCodes) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{34}
-}
-func (m *ContainerRestartRuleOnExitCodes) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ContainerRestartRuleOnExitCodes) 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 *ContainerRestartRuleOnExitCodes) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ContainerRestartRuleOnExitCodes.Merge(m, src)
-}
-func (m *ContainerRestartRuleOnExitCodes) XXX_Size() int {
- return m.Size()
-}
-func (m *ContainerRestartRuleOnExitCodes) XXX_DiscardUnknown() {
- xxx_messageInfo_ContainerRestartRuleOnExitCodes.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ContainerRestartRuleOnExitCodes proto.InternalMessageInfo
-
-func (m *ContainerState) Reset() { *m = ContainerState{} }
-func (*ContainerState) ProtoMessage() {}
-func (*ContainerState) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{35}
-}
-func (m *ContainerState) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ContainerState) 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 *ContainerState) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ContainerState.Merge(m, src)
-}
-func (m *ContainerState) XXX_Size() int {
- return m.Size()
-}
-func (m *ContainerState) XXX_DiscardUnknown() {
- xxx_messageInfo_ContainerState.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ContainerState proto.InternalMessageInfo
-
-func (m *ContainerStateRunning) Reset() { *m = ContainerStateRunning{} }
-func (*ContainerStateRunning) ProtoMessage() {}
-func (*ContainerStateRunning) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{36}
-}
-func (m *ContainerStateRunning) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ContainerStateRunning) 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 *ContainerStateRunning) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ContainerStateRunning.Merge(m, src)
-}
-func (m *ContainerStateRunning) XXX_Size() int {
- return m.Size()
-}
-func (m *ContainerStateRunning) XXX_DiscardUnknown() {
- xxx_messageInfo_ContainerStateRunning.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ContainerStateRunning proto.InternalMessageInfo
-
-func (m *ContainerStateTerminated) Reset() { *m = ContainerStateTerminated{} }
-func (*ContainerStateTerminated) ProtoMessage() {}
-func (*ContainerStateTerminated) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{37}
-}
-func (m *ContainerStateTerminated) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ContainerStateTerminated) 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 *ContainerStateTerminated) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ContainerStateTerminated.Merge(m, src)
-}
-func (m *ContainerStateTerminated) XXX_Size() int {
- return m.Size()
-}
-func (m *ContainerStateTerminated) XXX_DiscardUnknown() {
- xxx_messageInfo_ContainerStateTerminated.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ContainerStateTerminated proto.InternalMessageInfo
-
-func (m *ContainerStateWaiting) Reset() { *m = ContainerStateWaiting{} }
-func (*ContainerStateWaiting) ProtoMessage() {}
-func (*ContainerStateWaiting) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{38}
-}
-func (m *ContainerStateWaiting) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ContainerStateWaiting) 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 *ContainerStateWaiting) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ContainerStateWaiting.Merge(m, src)
-}
-func (m *ContainerStateWaiting) XXX_Size() int {
- return m.Size()
-}
-func (m *ContainerStateWaiting) XXX_DiscardUnknown() {
- xxx_messageInfo_ContainerStateWaiting.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ContainerStateWaiting proto.InternalMessageInfo
-
-func (m *ContainerStatus) Reset() { *m = ContainerStatus{} }
-func (*ContainerStatus) ProtoMessage() {}
-func (*ContainerStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{39}
-}
-func (m *ContainerStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ContainerStatus) 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 *ContainerStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ContainerStatus.Merge(m, src)
-}
-func (m *ContainerStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *ContainerStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_ContainerStatus.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ContainerStatus proto.InternalMessageInfo
-
-func (m *ContainerUser) Reset() { *m = ContainerUser{} }
-func (*ContainerUser) ProtoMessage() {}
-func (*ContainerUser) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{40}
-}
-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) {
- return fileDescriptor_6c07b07c062484ab, []int{41}
-}
-func (m *DaemonEndpoint) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *DaemonEndpoint) 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 *DaemonEndpoint) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DaemonEndpoint.Merge(m, src)
-}
-func (m *DaemonEndpoint) XXX_Size() int {
- return m.Size()
-}
-func (m *DaemonEndpoint) XXX_DiscardUnknown() {
- xxx_messageInfo_DaemonEndpoint.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DaemonEndpoint proto.InternalMessageInfo
-
-func (m *DownwardAPIProjection) Reset() { *m = DownwardAPIProjection{} }
-func (*DownwardAPIProjection) ProtoMessage() {}
-func (*DownwardAPIProjection) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{42}
-}
-func (m *DownwardAPIProjection) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *DownwardAPIProjection) 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 *DownwardAPIProjection) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DownwardAPIProjection.Merge(m, src)
-}
-func (m *DownwardAPIProjection) XXX_Size() int {
- return m.Size()
-}
-func (m *DownwardAPIProjection) XXX_DiscardUnknown() {
- xxx_messageInfo_DownwardAPIProjection.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DownwardAPIProjection proto.InternalMessageInfo
-
-func (m *DownwardAPIVolumeFile) Reset() { *m = DownwardAPIVolumeFile{} }
-func (*DownwardAPIVolumeFile) ProtoMessage() {}
-func (*DownwardAPIVolumeFile) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{43}
-}
-func (m *DownwardAPIVolumeFile) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *DownwardAPIVolumeFile) 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 *DownwardAPIVolumeFile) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DownwardAPIVolumeFile.Merge(m, src)
-}
-func (m *DownwardAPIVolumeFile) XXX_Size() int {
- return m.Size()
-}
-func (m *DownwardAPIVolumeFile) XXX_DiscardUnknown() {
- xxx_messageInfo_DownwardAPIVolumeFile.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DownwardAPIVolumeFile proto.InternalMessageInfo
-
-func (m *DownwardAPIVolumeSource) Reset() { *m = DownwardAPIVolumeSource{} }
-func (*DownwardAPIVolumeSource) ProtoMessage() {}
-func (*DownwardAPIVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{44}
-}
-func (m *DownwardAPIVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *DownwardAPIVolumeSource) 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 *DownwardAPIVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DownwardAPIVolumeSource.Merge(m, src)
-}
-func (m *DownwardAPIVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *DownwardAPIVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_DownwardAPIVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DownwardAPIVolumeSource proto.InternalMessageInfo
-
-func (m *EmptyDirVolumeSource) Reset() { *m = EmptyDirVolumeSource{} }
-func (*EmptyDirVolumeSource) ProtoMessage() {}
-func (*EmptyDirVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{45}
-}
-func (m *EmptyDirVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *EmptyDirVolumeSource) 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 *EmptyDirVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EmptyDirVolumeSource.Merge(m, src)
-}
-func (m *EmptyDirVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *EmptyDirVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_EmptyDirVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EmptyDirVolumeSource proto.InternalMessageInfo
-
-func (m *EndpointAddress) Reset() { *m = EndpointAddress{} }
-func (*EndpointAddress) ProtoMessage() {}
-func (*EndpointAddress) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{46}
-}
-func (m *EndpointAddress) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *EndpointAddress) 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 *EndpointAddress) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EndpointAddress.Merge(m, src)
-}
-func (m *EndpointAddress) XXX_Size() int {
- return m.Size()
-}
-func (m *EndpointAddress) XXX_DiscardUnknown() {
- xxx_messageInfo_EndpointAddress.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EndpointAddress proto.InternalMessageInfo
-
-func (m *EndpointPort) Reset() { *m = EndpointPort{} }
-func (*EndpointPort) ProtoMessage() {}
-func (*EndpointPort) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{47}
-}
-func (m *EndpointPort) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *EndpointPort) 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 *EndpointPort) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EndpointPort.Merge(m, src)
-}
-func (m *EndpointPort) XXX_Size() int {
- return m.Size()
-}
-func (m *EndpointPort) XXX_DiscardUnknown() {
- xxx_messageInfo_EndpointPort.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EndpointPort proto.InternalMessageInfo
-
-func (m *EndpointSubset) Reset() { *m = EndpointSubset{} }
-func (*EndpointSubset) ProtoMessage() {}
-func (*EndpointSubset) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{48}
-}
-func (m *EndpointSubset) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *EndpointSubset) 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 *EndpointSubset) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EndpointSubset.Merge(m, src)
-}
-func (m *EndpointSubset) XXX_Size() int {
- return m.Size()
-}
-func (m *EndpointSubset) XXX_DiscardUnknown() {
- xxx_messageInfo_EndpointSubset.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EndpointSubset proto.InternalMessageInfo
-
-func (m *Endpoints) Reset() { *m = Endpoints{} }
-func (*Endpoints) ProtoMessage() {}
-func (*Endpoints) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{49}
-}
-func (m *Endpoints) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Endpoints) 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 *Endpoints) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Endpoints.Merge(m, src)
-}
-func (m *Endpoints) XXX_Size() int {
- return m.Size()
-}
-func (m *Endpoints) XXX_DiscardUnknown() {
- xxx_messageInfo_Endpoints.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Endpoints proto.InternalMessageInfo
-
-func (m *EndpointsList) Reset() { *m = EndpointsList{} }
-func (*EndpointsList) ProtoMessage() {}
-func (*EndpointsList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{50}
-}
-func (m *EndpointsList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *EndpointsList) 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 *EndpointsList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EndpointsList.Merge(m, src)
-}
-func (m *EndpointsList) XXX_Size() int {
- return m.Size()
-}
-func (m *EndpointsList) XXX_DiscardUnknown() {
- xxx_messageInfo_EndpointsList.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EndpointsList proto.InternalMessageInfo
-
-func (m *EnvFromSource) Reset() { *m = EnvFromSource{} }
-func (*EnvFromSource) ProtoMessage() {}
-func (*EnvFromSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{51}
-}
-func (m *EnvFromSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *EnvFromSource) 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 *EnvFromSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EnvFromSource.Merge(m, src)
-}
-func (m *EnvFromSource) XXX_Size() int {
- return m.Size()
-}
-func (m *EnvFromSource) XXX_DiscardUnknown() {
- xxx_messageInfo_EnvFromSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EnvFromSource proto.InternalMessageInfo
-
-func (m *EnvVar) Reset() { *m = EnvVar{} }
-func (*EnvVar) ProtoMessage() {}
-func (*EnvVar) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{52}
-}
-func (m *EnvVar) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *EnvVar) 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 *EnvVar) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EnvVar.Merge(m, src)
-}
-func (m *EnvVar) XXX_Size() int {
- return m.Size()
-}
-func (m *EnvVar) XXX_DiscardUnknown() {
- xxx_messageInfo_EnvVar.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EnvVar proto.InternalMessageInfo
-
-func (m *EnvVarSource) Reset() { *m = EnvVarSource{} }
-func (*EnvVarSource) ProtoMessage() {}
-func (*EnvVarSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{53}
-}
-func (m *EnvVarSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *EnvVarSource) 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 *EnvVarSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EnvVarSource.Merge(m, src)
-}
-func (m *EnvVarSource) XXX_Size() int {
- return m.Size()
-}
-func (m *EnvVarSource) XXX_DiscardUnknown() {
- xxx_messageInfo_EnvVarSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EnvVarSource proto.InternalMessageInfo
-
-func (m *EphemeralContainer) Reset() { *m = EphemeralContainer{} }
-func (*EphemeralContainer) ProtoMessage() {}
-func (*EphemeralContainer) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{54}
-}
-func (m *EphemeralContainer) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *EphemeralContainer) 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 *EphemeralContainer) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EphemeralContainer.Merge(m, src)
-}
-func (m *EphemeralContainer) XXX_Size() int {
- return m.Size()
-}
-func (m *EphemeralContainer) XXX_DiscardUnknown() {
- xxx_messageInfo_EphemeralContainer.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EphemeralContainer proto.InternalMessageInfo
-
-func (m *EphemeralContainerCommon) Reset() { *m = EphemeralContainerCommon{} }
-func (*EphemeralContainerCommon) ProtoMessage() {}
-func (*EphemeralContainerCommon) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{55}
-}
-func (m *EphemeralContainerCommon) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *EphemeralContainerCommon) 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 *EphemeralContainerCommon) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EphemeralContainerCommon.Merge(m, src)
-}
-func (m *EphemeralContainerCommon) XXX_Size() int {
- return m.Size()
-}
-func (m *EphemeralContainerCommon) XXX_DiscardUnknown() {
- xxx_messageInfo_EphemeralContainerCommon.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EphemeralContainerCommon proto.InternalMessageInfo
-
-func (m *EphemeralVolumeSource) Reset() { *m = EphemeralVolumeSource{} }
-func (*EphemeralVolumeSource) ProtoMessage() {}
-func (*EphemeralVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{56}
-}
-func (m *EphemeralVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *EphemeralVolumeSource) 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 *EphemeralVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EphemeralVolumeSource.Merge(m, src)
-}
-func (m *EphemeralVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *EphemeralVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_EphemeralVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EphemeralVolumeSource proto.InternalMessageInfo
-
-func (m *Event) Reset() { *m = Event{} }
-func (*Event) ProtoMessage() {}
-func (*Event) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{57}
-}
-func (m *Event) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Event) 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 *Event) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Event.Merge(m, src)
-}
-func (m *Event) XXX_Size() int {
- return m.Size()
-}
-func (m *Event) XXX_DiscardUnknown() {
- xxx_messageInfo_Event.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Event proto.InternalMessageInfo
-
-func (m *EventList) Reset() { *m = EventList{} }
-func (*EventList) ProtoMessage() {}
-func (*EventList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{58}
-}
-func (m *EventList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *EventList) 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 *EventList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EventList.Merge(m, src)
-}
-func (m *EventList) XXX_Size() int {
- return m.Size()
-}
-func (m *EventList) XXX_DiscardUnknown() {
- xxx_messageInfo_EventList.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EventList proto.InternalMessageInfo
-
-func (m *EventSeries) Reset() { *m = EventSeries{} }
-func (*EventSeries) ProtoMessage() {}
-func (*EventSeries) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{59}
-}
-func (m *EventSeries) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *EventSeries) 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 *EventSeries) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EventSeries.Merge(m, src)
-}
-func (m *EventSeries) XXX_Size() int {
- return m.Size()
-}
-func (m *EventSeries) XXX_DiscardUnknown() {
- xxx_messageInfo_EventSeries.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EventSeries proto.InternalMessageInfo
-
-func (m *EventSource) Reset() { *m = EventSource{} }
-func (*EventSource) ProtoMessage() {}
-func (*EventSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{60}
-}
-func (m *EventSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *EventSource) 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 *EventSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_EventSource.Merge(m, src)
-}
-func (m *EventSource) XXX_Size() int {
- return m.Size()
-}
-func (m *EventSource) XXX_DiscardUnknown() {
- xxx_messageInfo_EventSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_EventSource proto.InternalMessageInfo
-
-func (m *ExecAction) Reset() { *m = ExecAction{} }
-func (*ExecAction) ProtoMessage() {}
-func (*ExecAction) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{61}
-}
-func (m *ExecAction) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ExecAction) 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 *ExecAction) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ExecAction.Merge(m, src)
-}
-func (m *ExecAction) XXX_Size() int {
- return m.Size()
-}
-func (m *ExecAction) XXX_DiscardUnknown() {
- xxx_messageInfo_ExecAction.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ExecAction proto.InternalMessageInfo
-
-func (m *FCVolumeSource) Reset() { *m = FCVolumeSource{} }
-func (*FCVolumeSource) ProtoMessage() {}
-func (*FCVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{62}
-}
-func (m *FCVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *FCVolumeSource) 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 *FCVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FCVolumeSource.Merge(m, src)
-}
-func (m *FCVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *FCVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_FCVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FCVolumeSource proto.InternalMessageInfo
-
-func (m *FileKeySelector) Reset() { *m = FileKeySelector{} }
-func (*FileKeySelector) ProtoMessage() {}
-func (*FileKeySelector) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{63}
-}
-func (m *FileKeySelector) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *FileKeySelector) 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 *FileKeySelector) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FileKeySelector.Merge(m, src)
-}
-func (m *FileKeySelector) XXX_Size() int {
- return m.Size()
-}
-func (m *FileKeySelector) XXX_DiscardUnknown() {
- xxx_messageInfo_FileKeySelector.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FileKeySelector proto.InternalMessageInfo
-
-func (m *FlexPersistentVolumeSource) Reset() { *m = FlexPersistentVolumeSource{} }
-func (*FlexPersistentVolumeSource) ProtoMessage() {}
-func (*FlexPersistentVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{64}
-}
-func (m *FlexPersistentVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *FlexPersistentVolumeSource) 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 *FlexPersistentVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FlexPersistentVolumeSource.Merge(m, src)
-}
-func (m *FlexPersistentVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *FlexPersistentVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_FlexPersistentVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FlexPersistentVolumeSource proto.InternalMessageInfo
-
-func (m *FlexVolumeSource) Reset() { *m = FlexVolumeSource{} }
-func (*FlexVolumeSource) ProtoMessage() {}
-func (*FlexVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{65}
-}
-func (m *FlexVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *FlexVolumeSource) 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 *FlexVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FlexVolumeSource.Merge(m, src)
-}
-func (m *FlexVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *FlexVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_FlexVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FlexVolumeSource proto.InternalMessageInfo
-
-func (m *FlockerVolumeSource) Reset() { *m = FlockerVolumeSource{} }
-func (*FlockerVolumeSource) ProtoMessage() {}
-func (*FlockerVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{66}
-}
-func (m *FlockerVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *FlockerVolumeSource) 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 *FlockerVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FlockerVolumeSource.Merge(m, src)
-}
-func (m *FlockerVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *FlockerVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_FlockerVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FlockerVolumeSource proto.InternalMessageInfo
-
-func (m *GCEPersistentDiskVolumeSource) Reset() { *m = GCEPersistentDiskVolumeSource{} }
-func (*GCEPersistentDiskVolumeSource) ProtoMessage() {}
-func (*GCEPersistentDiskVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{67}
-}
-func (m *GCEPersistentDiskVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *GCEPersistentDiskVolumeSource) 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 *GCEPersistentDiskVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GCEPersistentDiskVolumeSource.Merge(m, src)
-}
-func (m *GCEPersistentDiskVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *GCEPersistentDiskVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_GCEPersistentDiskVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GCEPersistentDiskVolumeSource proto.InternalMessageInfo
-
-func (m *GRPCAction) Reset() { *m = GRPCAction{} }
-func (*GRPCAction) ProtoMessage() {}
-func (*GRPCAction) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{68}
-}
-func (m *GRPCAction) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *GRPCAction) 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 *GRPCAction) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GRPCAction.Merge(m, src)
-}
-func (m *GRPCAction) XXX_Size() int {
- return m.Size()
-}
-func (m *GRPCAction) XXX_DiscardUnknown() {
- xxx_messageInfo_GRPCAction.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GRPCAction proto.InternalMessageInfo
-
-func (m *GitRepoVolumeSource) Reset() { *m = GitRepoVolumeSource{} }
-func (*GitRepoVolumeSource) ProtoMessage() {}
-func (*GitRepoVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{69}
-}
-func (m *GitRepoVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *GitRepoVolumeSource) 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 *GitRepoVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GitRepoVolumeSource.Merge(m, src)
-}
-func (m *GitRepoVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *GitRepoVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_GitRepoVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GitRepoVolumeSource proto.InternalMessageInfo
-
-func (m *GlusterfsPersistentVolumeSource) Reset() { *m = GlusterfsPersistentVolumeSource{} }
-func (*GlusterfsPersistentVolumeSource) ProtoMessage() {}
-func (*GlusterfsPersistentVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{70}
-}
-func (m *GlusterfsPersistentVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *GlusterfsPersistentVolumeSource) 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 *GlusterfsPersistentVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GlusterfsPersistentVolumeSource.Merge(m, src)
-}
-func (m *GlusterfsPersistentVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *GlusterfsPersistentVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_GlusterfsPersistentVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GlusterfsPersistentVolumeSource proto.InternalMessageInfo
-
-func (m *GlusterfsVolumeSource) Reset() { *m = GlusterfsVolumeSource{} }
-func (*GlusterfsVolumeSource) ProtoMessage() {}
-func (*GlusterfsVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{71}
-}
-func (m *GlusterfsVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *GlusterfsVolumeSource) 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 *GlusterfsVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GlusterfsVolumeSource.Merge(m, src)
-}
-func (m *GlusterfsVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *GlusterfsVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_GlusterfsVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GlusterfsVolumeSource proto.InternalMessageInfo
-
-func (m *HTTPGetAction) Reset() { *m = HTTPGetAction{} }
-func (*HTTPGetAction) ProtoMessage() {}
-func (*HTTPGetAction) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{72}
-}
-func (m *HTTPGetAction) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *HTTPGetAction) 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 *HTTPGetAction) XXX_Merge(src proto.Message) {
- xxx_messageInfo_HTTPGetAction.Merge(m, src)
-}
-func (m *HTTPGetAction) XXX_Size() int {
- return m.Size()
-}
-func (m *HTTPGetAction) XXX_DiscardUnknown() {
- xxx_messageInfo_HTTPGetAction.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_HTTPGetAction proto.InternalMessageInfo
-
-func (m *HTTPHeader) Reset() { *m = HTTPHeader{} }
-func (*HTTPHeader) ProtoMessage() {}
-func (*HTTPHeader) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{73}
-}
-func (m *HTTPHeader) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *HTTPHeader) 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 *HTTPHeader) XXX_Merge(src proto.Message) {
- xxx_messageInfo_HTTPHeader.Merge(m, src)
-}
-func (m *HTTPHeader) XXX_Size() int {
- return m.Size()
-}
-func (m *HTTPHeader) XXX_DiscardUnknown() {
- xxx_messageInfo_HTTPHeader.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_HTTPHeader proto.InternalMessageInfo
-
-func (m *HostAlias) Reset() { *m = HostAlias{} }
-func (*HostAlias) ProtoMessage() {}
-func (*HostAlias) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{74}
-}
-func (m *HostAlias) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *HostAlias) 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 *HostAlias) XXX_Merge(src proto.Message) {
- xxx_messageInfo_HostAlias.Merge(m, src)
-}
-func (m *HostAlias) XXX_Size() int {
- return m.Size()
-}
-func (m *HostAlias) XXX_DiscardUnknown() {
- xxx_messageInfo_HostAlias.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_HostAlias proto.InternalMessageInfo
-
-func (m *HostIP) Reset() { *m = HostIP{} }
-func (*HostIP) ProtoMessage() {}
-func (*HostIP) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{75}
-}
-func (m *HostIP) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *HostIP) 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 *HostIP) XXX_Merge(src proto.Message) {
- xxx_messageInfo_HostIP.Merge(m, src)
-}
-func (m *HostIP) XXX_Size() int {
- return m.Size()
-}
-func (m *HostIP) XXX_DiscardUnknown() {
- xxx_messageInfo_HostIP.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_HostIP proto.InternalMessageInfo
-
-func (m *HostPathVolumeSource) Reset() { *m = HostPathVolumeSource{} }
-func (*HostPathVolumeSource) ProtoMessage() {}
-func (*HostPathVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{76}
-}
-func (m *HostPathVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *HostPathVolumeSource) 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 *HostPathVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_HostPathVolumeSource.Merge(m, src)
-}
-func (m *HostPathVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *HostPathVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_HostPathVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_HostPathVolumeSource proto.InternalMessageInfo
-
-func (m *ISCSIPersistentVolumeSource) Reset() { *m = ISCSIPersistentVolumeSource{} }
-func (*ISCSIPersistentVolumeSource) ProtoMessage() {}
-func (*ISCSIPersistentVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{77}
-}
-func (m *ISCSIPersistentVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ISCSIPersistentVolumeSource) 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 *ISCSIPersistentVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ISCSIPersistentVolumeSource.Merge(m, src)
-}
-func (m *ISCSIPersistentVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *ISCSIPersistentVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_ISCSIPersistentVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ISCSIPersistentVolumeSource proto.InternalMessageInfo
-
-func (m *ISCSIVolumeSource) Reset() { *m = ISCSIVolumeSource{} }
-func (*ISCSIVolumeSource) ProtoMessage() {}
-func (*ISCSIVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{78}
-}
-func (m *ISCSIVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ISCSIVolumeSource) 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 *ISCSIVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ISCSIVolumeSource.Merge(m, src)
-}
-func (m *ISCSIVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *ISCSIVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_ISCSIVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ISCSIVolumeSource proto.InternalMessageInfo
-
-func (m *ImageVolumeSource) Reset() { *m = ImageVolumeSource{} }
-func (*ImageVolumeSource) ProtoMessage() {}
-func (*ImageVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{79}
-}
-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{80}
-}
-func (m *KeyToPath) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *KeyToPath) 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 *KeyToPath) XXX_Merge(src proto.Message) {
- xxx_messageInfo_KeyToPath.Merge(m, src)
-}
-func (m *KeyToPath) XXX_Size() int {
- return m.Size()
-}
-func (m *KeyToPath) XXX_DiscardUnknown() {
- xxx_messageInfo_KeyToPath.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_KeyToPath proto.InternalMessageInfo
-
-func (m *Lifecycle) Reset() { *m = Lifecycle{} }
-func (*Lifecycle) ProtoMessage() {}
-func (*Lifecycle) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{81}
-}
-func (m *Lifecycle) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Lifecycle) 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 *Lifecycle) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Lifecycle.Merge(m, src)
-}
-func (m *Lifecycle) XXX_Size() int {
- return m.Size()
-}
-func (m *Lifecycle) XXX_DiscardUnknown() {
- xxx_messageInfo_Lifecycle.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Lifecycle proto.InternalMessageInfo
-
-func (m *LifecycleHandler) Reset() { *m = LifecycleHandler{} }
-func (*LifecycleHandler) ProtoMessage() {}
-func (*LifecycleHandler) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{82}
-}
-func (m *LifecycleHandler) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *LifecycleHandler) 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 *LifecycleHandler) XXX_Merge(src proto.Message) {
- xxx_messageInfo_LifecycleHandler.Merge(m, src)
-}
-func (m *LifecycleHandler) XXX_Size() int {
- return m.Size()
-}
-func (m *LifecycleHandler) XXX_DiscardUnknown() {
- xxx_messageInfo_LifecycleHandler.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_LifecycleHandler proto.InternalMessageInfo
-
-func (m *LimitRange) Reset() { *m = LimitRange{} }
-func (*LimitRange) ProtoMessage() {}
-func (*LimitRange) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{83}
-}
-func (m *LimitRange) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *LimitRange) 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 *LimitRange) XXX_Merge(src proto.Message) {
- xxx_messageInfo_LimitRange.Merge(m, src)
-}
-func (m *LimitRange) XXX_Size() int {
- return m.Size()
-}
-func (m *LimitRange) XXX_DiscardUnknown() {
- xxx_messageInfo_LimitRange.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_LimitRange proto.InternalMessageInfo
-
-func (m *LimitRangeItem) Reset() { *m = LimitRangeItem{} }
-func (*LimitRangeItem) ProtoMessage() {}
-func (*LimitRangeItem) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{84}
-}
-func (m *LimitRangeItem) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *LimitRangeItem) 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 *LimitRangeItem) XXX_Merge(src proto.Message) {
- xxx_messageInfo_LimitRangeItem.Merge(m, src)
-}
-func (m *LimitRangeItem) XXX_Size() int {
- return m.Size()
-}
-func (m *LimitRangeItem) XXX_DiscardUnknown() {
- xxx_messageInfo_LimitRangeItem.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_LimitRangeItem proto.InternalMessageInfo
-
-func (m *LimitRangeList) Reset() { *m = LimitRangeList{} }
-func (*LimitRangeList) ProtoMessage() {}
-func (*LimitRangeList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{85}
-}
-func (m *LimitRangeList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *LimitRangeList) 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 *LimitRangeList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_LimitRangeList.Merge(m, src)
-}
-func (m *LimitRangeList) XXX_Size() int {
- return m.Size()
-}
-func (m *LimitRangeList) XXX_DiscardUnknown() {
- xxx_messageInfo_LimitRangeList.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_LimitRangeList proto.InternalMessageInfo
-
-func (m *LimitRangeSpec) Reset() { *m = LimitRangeSpec{} }
-func (*LimitRangeSpec) ProtoMessage() {}
-func (*LimitRangeSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{86}
-}
-func (m *LimitRangeSpec) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *LimitRangeSpec) 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 *LimitRangeSpec) XXX_Merge(src proto.Message) {
- xxx_messageInfo_LimitRangeSpec.Merge(m, src)
-}
-func (m *LimitRangeSpec) XXX_Size() int {
- return m.Size()
-}
-func (m *LimitRangeSpec) XXX_DiscardUnknown() {
- xxx_messageInfo_LimitRangeSpec.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_LimitRangeSpec proto.InternalMessageInfo
-
-func (m *LinuxContainerUser) Reset() { *m = LinuxContainerUser{} }
-func (*LinuxContainerUser) ProtoMessage() {}
-func (*LinuxContainerUser) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{87}
-}
-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{88}
-}
-func (m *List) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *List) 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 *List) XXX_Merge(src proto.Message) {
- xxx_messageInfo_List.Merge(m, src)
-}
-func (m *List) XXX_Size() int {
- return m.Size()
-}
-func (m *List) XXX_DiscardUnknown() {
- xxx_messageInfo_List.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_List proto.InternalMessageInfo
-
-func (m *LoadBalancerIngress) Reset() { *m = LoadBalancerIngress{} }
-func (*LoadBalancerIngress) ProtoMessage() {}
-func (*LoadBalancerIngress) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{89}
-}
-func (m *LoadBalancerIngress) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *LoadBalancerIngress) 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 *LoadBalancerIngress) XXX_Merge(src proto.Message) {
- xxx_messageInfo_LoadBalancerIngress.Merge(m, src)
-}
-func (m *LoadBalancerIngress) XXX_Size() int {
- return m.Size()
-}
-func (m *LoadBalancerIngress) XXX_DiscardUnknown() {
- xxx_messageInfo_LoadBalancerIngress.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_LoadBalancerIngress proto.InternalMessageInfo
-
-func (m *LoadBalancerStatus) Reset() { *m = LoadBalancerStatus{} }
-func (*LoadBalancerStatus) ProtoMessage() {}
-func (*LoadBalancerStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{90}
-}
-func (m *LoadBalancerStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *LoadBalancerStatus) 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 *LoadBalancerStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_LoadBalancerStatus.Merge(m, src)
-}
-func (m *LoadBalancerStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *LoadBalancerStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_LoadBalancerStatus.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_LoadBalancerStatus proto.InternalMessageInfo
-
-func (m *LocalObjectReference) Reset() { *m = LocalObjectReference{} }
-func (*LocalObjectReference) ProtoMessage() {}
-func (*LocalObjectReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{91}
-}
-func (m *LocalObjectReference) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *LocalObjectReference) 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 *LocalObjectReference) XXX_Merge(src proto.Message) {
- xxx_messageInfo_LocalObjectReference.Merge(m, src)
-}
-func (m *LocalObjectReference) XXX_Size() int {
- return m.Size()
-}
-func (m *LocalObjectReference) XXX_DiscardUnknown() {
- xxx_messageInfo_LocalObjectReference.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_LocalObjectReference proto.InternalMessageInfo
-
-func (m *LocalVolumeSource) Reset() { *m = LocalVolumeSource{} }
-func (*LocalVolumeSource) ProtoMessage() {}
-func (*LocalVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{92}
-}
-func (m *LocalVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *LocalVolumeSource) 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 *LocalVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_LocalVolumeSource.Merge(m, src)
-}
-func (m *LocalVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *LocalVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_LocalVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_LocalVolumeSource proto.InternalMessageInfo
-
-func (m *ModifyVolumeStatus) Reset() { *m = ModifyVolumeStatus{} }
-func (*ModifyVolumeStatus) ProtoMessage() {}
-func (*ModifyVolumeStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{93}
-}
-func (m *ModifyVolumeStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ModifyVolumeStatus) 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 *ModifyVolumeStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ModifyVolumeStatus.Merge(m, src)
-}
-func (m *ModifyVolumeStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *ModifyVolumeStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_ModifyVolumeStatus.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ModifyVolumeStatus proto.InternalMessageInfo
-
-func (m *NFSVolumeSource) Reset() { *m = NFSVolumeSource{} }
-func (*NFSVolumeSource) ProtoMessage() {}
-func (*NFSVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{94}
-}
-func (m *NFSVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NFSVolumeSource) 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 *NFSVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NFSVolumeSource.Merge(m, src)
-}
-func (m *NFSVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *NFSVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_NFSVolumeSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NFSVolumeSource proto.InternalMessageInfo
-
-func (m *Namespace) Reset() { *m = Namespace{} }
-func (*Namespace) ProtoMessage() {}
-func (*Namespace) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{95}
-}
-func (m *Namespace) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Namespace) 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 *Namespace) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Namespace.Merge(m, src)
-}
-func (m *Namespace) XXX_Size() int {
- return m.Size()
-}
-func (m *Namespace) XXX_DiscardUnknown() {
- xxx_messageInfo_Namespace.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Namespace proto.InternalMessageInfo
-
-func (m *NamespaceCondition) Reset() { *m = NamespaceCondition{} }
-func (*NamespaceCondition) ProtoMessage() {}
-func (*NamespaceCondition) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{96}
-}
-func (m *NamespaceCondition) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NamespaceCondition) 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 *NamespaceCondition) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamespaceCondition.Merge(m, src)
-}
-func (m *NamespaceCondition) XXX_Size() int {
- return m.Size()
-}
-func (m *NamespaceCondition) XXX_DiscardUnknown() {
- xxx_messageInfo_NamespaceCondition.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NamespaceCondition proto.InternalMessageInfo
-
-func (m *NamespaceList) Reset() { *m = NamespaceList{} }
-func (*NamespaceList) ProtoMessage() {}
-func (*NamespaceList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{97}
-}
-func (m *NamespaceList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NamespaceList) 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 *NamespaceList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamespaceList.Merge(m, src)
-}
-func (m *NamespaceList) XXX_Size() int {
- return m.Size()
-}
-func (m *NamespaceList) XXX_DiscardUnknown() {
- xxx_messageInfo_NamespaceList.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NamespaceList proto.InternalMessageInfo
-
-func (m *NamespaceSpec) Reset() { *m = NamespaceSpec{} }
-func (*NamespaceSpec) ProtoMessage() {}
-func (*NamespaceSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{98}
-}
-func (m *NamespaceSpec) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NamespaceSpec) 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 *NamespaceSpec) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamespaceSpec.Merge(m, src)
-}
-func (m *NamespaceSpec) XXX_Size() int {
- return m.Size()
-}
-func (m *NamespaceSpec) XXX_DiscardUnknown() {
- xxx_messageInfo_NamespaceSpec.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NamespaceSpec proto.InternalMessageInfo
-
-func (m *NamespaceStatus) Reset() { *m = NamespaceStatus{} }
-func (*NamespaceStatus) ProtoMessage() {}
-func (*NamespaceStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{99}
-}
-func (m *NamespaceStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NamespaceStatus) 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 *NamespaceStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamespaceStatus.Merge(m, src)
-}
-func (m *NamespaceStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *NamespaceStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_NamespaceStatus.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NamespaceStatus proto.InternalMessageInfo
-
-func (m *Node) Reset() { *m = Node{} }
-func (*Node) ProtoMessage() {}
-func (*Node) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{100}
-}
-func (m *Node) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Node) 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 *Node) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Node.Merge(m, src)
-}
-func (m *Node) XXX_Size() int {
- return m.Size()
-}
-func (m *Node) XXX_DiscardUnknown() {
- xxx_messageInfo_Node.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Node proto.InternalMessageInfo
-
-func (m *NodeAddress) Reset() { *m = NodeAddress{} }
-func (*NodeAddress) ProtoMessage() {}
-func (*NodeAddress) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{101}
-}
-func (m *NodeAddress) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NodeAddress) 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 *NodeAddress) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NodeAddress.Merge(m, src)
-}
-func (m *NodeAddress) XXX_Size() int {
- return m.Size()
-}
-func (m *NodeAddress) XXX_DiscardUnknown() {
- xxx_messageInfo_NodeAddress.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NodeAddress proto.InternalMessageInfo
-
-func (m *NodeAffinity) Reset() { *m = NodeAffinity{} }
-func (*NodeAffinity) ProtoMessage() {}
-func (*NodeAffinity) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{102}
-}
-func (m *NodeAffinity) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NodeAffinity) 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 *NodeAffinity) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NodeAffinity.Merge(m, src)
-}
-func (m *NodeAffinity) XXX_Size() int {
- return m.Size()
-}
-func (m *NodeAffinity) XXX_DiscardUnknown() {
- xxx_messageInfo_NodeAffinity.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NodeAffinity proto.InternalMessageInfo
-
-func (m *NodeCondition) Reset() { *m = NodeCondition{} }
-func (*NodeCondition) ProtoMessage() {}
-func (*NodeCondition) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{103}
-}
-func (m *NodeCondition) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NodeCondition) 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 *NodeCondition) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NodeCondition.Merge(m, src)
-}
-func (m *NodeCondition) XXX_Size() int {
- return m.Size()
-}
-func (m *NodeCondition) XXX_DiscardUnknown() {
- xxx_messageInfo_NodeCondition.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NodeCondition proto.InternalMessageInfo
-
-func (m *NodeConfigSource) Reset() { *m = NodeConfigSource{} }
-func (*NodeConfigSource) ProtoMessage() {}
-func (*NodeConfigSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{104}
-}
-func (m *NodeConfigSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NodeConfigSource) 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 *NodeConfigSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NodeConfigSource.Merge(m, src)
-}
-func (m *NodeConfigSource) XXX_Size() int {
- return m.Size()
-}
-func (m *NodeConfigSource) XXX_DiscardUnknown() {
- xxx_messageInfo_NodeConfigSource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NodeConfigSource proto.InternalMessageInfo
-
-func (m *NodeConfigStatus) Reset() { *m = NodeConfigStatus{} }
-func (*NodeConfigStatus) ProtoMessage() {}
-func (*NodeConfigStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{105}
-}
-func (m *NodeConfigStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NodeConfigStatus) 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 *NodeConfigStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NodeConfigStatus.Merge(m, src)
-}
-func (m *NodeConfigStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *NodeConfigStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_NodeConfigStatus.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NodeConfigStatus proto.InternalMessageInfo
-
-func (m *NodeDaemonEndpoints) Reset() { *m = NodeDaemonEndpoints{} }
-func (*NodeDaemonEndpoints) ProtoMessage() {}
-func (*NodeDaemonEndpoints) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{106}
-}
-func (m *NodeDaemonEndpoints) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NodeDaemonEndpoints) 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 *NodeDaemonEndpoints) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NodeDaemonEndpoints.Merge(m, src)
-}
-func (m *NodeDaemonEndpoints) XXX_Size() int {
- return m.Size()
-}
-func (m *NodeDaemonEndpoints) XXX_DiscardUnknown() {
- xxx_messageInfo_NodeDaemonEndpoints.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NodeDaemonEndpoints proto.InternalMessageInfo
-
-func (m *NodeFeatures) Reset() { *m = NodeFeatures{} }
-func (*NodeFeatures) ProtoMessage() {}
-func (*NodeFeatures) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{107}
-}
-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{108}
-}
-func (m *NodeList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NodeList) 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 *NodeList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NodeList.Merge(m, src)
-}
-func (m *NodeList) XXX_Size() int {
- return m.Size()
-}
-func (m *NodeList) XXX_DiscardUnknown() {
- xxx_messageInfo_NodeList.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NodeList proto.InternalMessageInfo
-
-func (m *NodeProxyOptions) Reset() { *m = NodeProxyOptions{} }
-func (*NodeProxyOptions) ProtoMessage() {}
-func (*NodeProxyOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{109}
-}
-func (m *NodeProxyOptions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NodeProxyOptions) 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 *NodeProxyOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NodeProxyOptions.Merge(m, src)
-}
-func (m *NodeProxyOptions) XXX_Size() int {
- return m.Size()
-}
-func (m *NodeProxyOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_NodeProxyOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NodeProxyOptions proto.InternalMessageInfo
-
-func (m *NodeRuntimeHandler) Reset() { *m = NodeRuntimeHandler{} }
-func (*NodeRuntimeHandler) ProtoMessage() {}
-func (*NodeRuntimeHandler) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{110}
-}
-func (m *NodeRuntimeHandler) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NodeRuntimeHandler) 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 *NodeRuntimeHandler) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NodeRuntimeHandler.Merge(m, src)
-}
-func (m *NodeRuntimeHandler) XXX_Size() int {
- return m.Size()
-}
-func (m *NodeRuntimeHandler) XXX_DiscardUnknown() {
- xxx_messageInfo_NodeRuntimeHandler.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NodeRuntimeHandler proto.InternalMessageInfo
-
-func (m *NodeRuntimeHandlerFeatures) Reset() { *m = NodeRuntimeHandlerFeatures{} }
-func (*NodeRuntimeHandlerFeatures) ProtoMessage() {}
-func (*NodeRuntimeHandlerFeatures) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{111}
-}
-func (m *NodeRuntimeHandlerFeatures) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NodeRuntimeHandlerFeatures) 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 *NodeRuntimeHandlerFeatures) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NodeRuntimeHandlerFeatures.Merge(m, src)
-}
-func (m *NodeRuntimeHandlerFeatures) XXX_Size() int {
- return m.Size()
-}
-func (m *NodeRuntimeHandlerFeatures) XXX_DiscardUnknown() {
- xxx_messageInfo_NodeRuntimeHandlerFeatures.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NodeRuntimeHandlerFeatures proto.InternalMessageInfo
-
-func (m *NodeSelector) Reset() { *m = NodeSelector{} }
-func (*NodeSelector) ProtoMessage() {}
-func (*NodeSelector) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{112}
-}
-func (m *NodeSelector) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NodeSelector) 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 *NodeSelector) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NodeSelector.Merge(m, src)
-}
-func (m *NodeSelector) XXX_Size() int {
- return m.Size()
-}
-func (m *NodeSelector) XXX_DiscardUnknown() {
- xxx_messageInfo_NodeSelector.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NodeSelector proto.InternalMessageInfo
-
-func (m *NodeSelectorRequirement) Reset() { *m = NodeSelectorRequirement{} }
-func (*NodeSelectorRequirement) ProtoMessage() {}
-func (*NodeSelectorRequirement) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{113}
-}
-func (m *NodeSelectorRequirement) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NodeSelectorRequirement) 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 *NodeSelectorRequirement) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NodeSelectorRequirement.Merge(m, src)
-}
-func (m *NodeSelectorRequirement) XXX_Size() int {
- return m.Size()
-}
-func (m *NodeSelectorRequirement) XXX_DiscardUnknown() {
- xxx_messageInfo_NodeSelectorRequirement.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NodeSelectorRequirement proto.InternalMessageInfo
-
-func (m *NodeSelectorTerm) Reset() { *m = NodeSelectorTerm{} }
-func (*NodeSelectorTerm) ProtoMessage() {}
-func (*NodeSelectorTerm) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{114}
-}
-func (m *NodeSelectorTerm) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NodeSelectorTerm) 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 *NodeSelectorTerm) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NodeSelectorTerm.Merge(m, src)
-}
-func (m *NodeSelectorTerm) XXX_Size() int {
- return m.Size()
-}
-func (m *NodeSelectorTerm) XXX_DiscardUnknown() {
- xxx_messageInfo_NodeSelectorTerm.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NodeSelectorTerm proto.InternalMessageInfo
-
-func (m *NodeSpec) Reset() { *m = NodeSpec{} }
-func (*NodeSpec) ProtoMessage() {}
-func (*NodeSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{115}
-}
-func (m *NodeSpec) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NodeSpec) 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 *NodeSpec) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NodeSpec.Merge(m, src)
-}
-func (m *NodeSpec) XXX_Size() int {
- return m.Size()
-}
-func (m *NodeSpec) XXX_DiscardUnknown() {
- xxx_messageInfo_NodeSpec.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NodeSpec proto.InternalMessageInfo
-
-func (m *NodeStatus) Reset() { *m = NodeStatus{} }
-func (*NodeStatus) ProtoMessage() {}
-func (*NodeStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{116}
-}
-func (m *NodeStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NodeStatus) 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 *NodeStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NodeStatus.Merge(m, src)
-}
-func (m *NodeStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *NodeStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_NodeStatus.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NodeStatus proto.InternalMessageInfo
-
-func (m *NodeSwapStatus) Reset() { *m = NodeSwapStatus{} }
-func (*NodeSwapStatus) ProtoMessage() {}
-func (*NodeSwapStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{117}
-}
-func (m *NodeSwapStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NodeSwapStatus) 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 *NodeSwapStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NodeSwapStatus.Merge(m, src)
-}
-func (m *NodeSwapStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *NodeSwapStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_NodeSwapStatus.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NodeSwapStatus proto.InternalMessageInfo
-
-func (m *NodeSystemInfo) Reset() { *m = NodeSystemInfo{} }
-func (*NodeSystemInfo) ProtoMessage() {}
-func (*NodeSystemInfo) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{118}
-}
-func (m *NodeSystemInfo) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NodeSystemInfo) 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 *NodeSystemInfo) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NodeSystemInfo.Merge(m, src)
-}
-func (m *NodeSystemInfo) XXX_Size() int {
- return m.Size()
-}
-func (m *NodeSystemInfo) XXX_DiscardUnknown() {
- xxx_messageInfo_NodeSystemInfo.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NodeSystemInfo proto.InternalMessageInfo
-
-func (m *ObjectFieldSelector) Reset() { *m = ObjectFieldSelector{} }
-func (*ObjectFieldSelector) ProtoMessage() {}
-func (*ObjectFieldSelector) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{119}
-}
-func (m *ObjectFieldSelector) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ObjectFieldSelector) 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 *ObjectFieldSelector) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ObjectFieldSelector.Merge(m, src)
-}
-func (m *ObjectFieldSelector) XXX_Size() int {
- return m.Size()
-}
-func (m *ObjectFieldSelector) XXX_DiscardUnknown() {
- xxx_messageInfo_ObjectFieldSelector.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ObjectFieldSelector proto.InternalMessageInfo
-
-func (m *ObjectReference) Reset() { *m = ObjectReference{} }
-func (*ObjectReference) ProtoMessage() {}
-func (*ObjectReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{120}
-}
-func (m *ObjectReference) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ObjectReference) 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 *ObjectReference) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ObjectReference.Merge(m, src)
-}
-func (m *ObjectReference) XXX_Size() int {
- return m.Size()
-}
-func (m *ObjectReference) XXX_DiscardUnknown() {
- xxx_messageInfo_ObjectReference.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ObjectReference proto.InternalMessageInfo
-
-func (m *PersistentVolume) Reset() { *m = PersistentVolume{} }
-func (*PersistentVolume) ProtoMessage() {}
-func (*PersistentVolume) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{121}
-}
-func (m *PersistentVolume) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PersistentVolume) 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 *PersistentVolume) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PersistentVolume.Merge(m, src)
-}
-func (m *PersistentVolume) XXX_Size() int {
- return m.Size()
-}
-func (m *PersistentVolume) XXX_DiscardUnknown() {
- xxx_messageInfo_PersistentVolume.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_PersistentVolume proto.InternalMessageInfo
-
-func (m *PersistentVolumeClaim) Reset() { *m = PersistentVolumeClaim{} }
-func (*PersistentVolumeClaim) ProtoMessage() {}
-func (*PersistentVolumeClaim) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{122}
-}
-func (m *PersistentVolumeClaim) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PersistentVolumeClaim) 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 *PersistentVolumeClaim) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PersistentVolumeClaim.Merge(m, src)
-}
-func (m *PersistentVolumeClaim) XXX_Size() int {
- return m.Size()
-}
-func (m *PersistentVolumeClaim) XXX_DiscardUnknown() {
- xxx_messageInfo_PersistentVolumeClaim.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_PersistentVolumeClaim proto.InternalMessageInfo
-
-func (m *PersistentVolumeClaimCondition) Reset() { *m = PersistentVolumeClaimCondition{} }
-func (*PersistentVolumeClaimCondition) ProtoMessage() {}
-func (*PersistentVolumeClaimCondition) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{123}
-}
-func (m *PersistentVolumeClaimCondition) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PersistentVolumeClaimCondition) 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 *PersistentVolumeClaimCondition) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PersistentVolumeClaimCondition.Merge(m, src)
-}
-func (m *PersistentVolumeClaimCondition) XXX_Size() int {
- return m.Size()
-}
-func (m *PersistentVolumeClaimCondition) XXX_DiscardUnknown() {
- xxx_messageInfo_PersistentVolumeClaimCondition.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_PersistentVolumeClaimCondition proto.InternalMessageInfo
-
-func (m *PersistentVolumeClaimList) Reset() { *m = PersistentVolumeClaimList{} }
-func (*PersistentVolumeClaimList) ProtoMessage() {}
-func (*PersistentVolumeClaimList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{124}
-}
-func (m *PersistentVolumeClaimList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PersistentVolumeClaimList) 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 *PersistentVolumeClaimList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PersistentVolumeClaimList.Merge(m, src)
-}
-func (m *PersistentVolumeClaimList) XXX_Size() int {
- return m.Size()
-}
-func (m *PersistentVolumeClaimList) XXX_DiscardUnknown() {
- xxx_messageInfo_PersistentVolumeClaimList.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_PersistentVolumeClaimList proto.InternalMessageInfo
-
-func (m *PersistentVolumeClaimSpec) Reset() { *m = PersistentVolumeClaimSpec{} }
-func (*PersistentVolumeClaimSpec) ProtoMessage() {}
-func (*PersistentVolumeClaimSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{125}
-}
-func (m *PersistentVolumeClaimSpec) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PersistentVolumeClaimSpec) 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 *PersistentVolumeClaimSpec) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PersistentVolumeClaimSpec.Merge(m, src)
-}
-func (m *PersistentVolumeClaimSpec) XXX_Size() int {
- return m.Size()
-}
-func (m *PersistentVolumeClaimSpec) XXX_DiscardUnknown() {
- xxx_messageInfo_PersistentVolumeClaimSpec.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_PersistentVolumeClaimSpec proto.InternalMessageInfo
-
-func (m *PersistentVolumeClaimStatus) Reset() { *m = PersistentVolumeClaimStatus{} }
-func (*PersistentVolumeClaimStatus) ProtoMessage() {}
-func (*PersistentVolumeClaimStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{126}
-}
-func (m *PersistentVolumeClaimStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PersistentVolumeClaimStatus) 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 *PersistentVolumeClaimStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PersistentVolumeClaimStatus.Merge(m, src)
-}
-func (m *PersistentVolumeClaimStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *PersistentVolumeClaimStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_PersistentVolumeClaimStatus.DiscardUnknown(m)
-}
+func (m *AppArmorProfile) Reset() { *m = AppArmorProfile{} }
-var xxx_messageInfo_PersistentVolumeClaimStatus proto.InternalMessageInfo
-
-func (m *PersistentVolumeClaimTemplate) Reset() { *m = PersistentVolumeClaimTemplate{} }
-func (*PersistentVolumeClaimTemplate) ProtoMessage() {}
-func (*PersistentVolumeClaimTemplate) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{127}
-}
-func (m *PersistentVolumeClaimTemplate) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PersistentVolumeClaimTemplate) 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 *PersistentVolumeClaimTemplate) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PersistentVolumeClaimTemplate.Merge(m, src)
-}
-func (m *PersistentVolumeClaimTemplate) XXX_Size() int {
- return m.Size()
-}
-func (m *PersistentVolumeClaimTemplate) XXX_DiscardUnknown() {
- xxx_messageInfo_PersistentVolumeClaimTemplate.DiscardUnknown(m)
-}
+func (m *AttachedVolume) Reset() { *m = AttachedVolume{} }
-var xxx_messageInfo_PersistentVolumeClaimTemplate proto.InternalMessageInfo
+func (m *AvoidPods) Reset() { *m = AvoidPods{} }
-func (m *PersistentVolumeClaimVolumeSource) Reset() { *m = PersistentVolumeClaimVolumeSource{} }
-func (*PersistentVolumeClaimVolumeSource) ProtoMessage() {}
-func (*PersistentVolumeClaimVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{128}
-}
-func (m *PersistentVolumeClaimVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PersistentVolumeClaimVolumeSource) 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 *PersistentVolumeClaimVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PersistentVolumeClaimVolumeSource.Merge(m, src)
-}
-func (m *PersistentVolumeClaimVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *PersistentVolumeClaimVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_PersistentVolumeClaimVolumeSource.DiscardUnknown(m)
-}
+func (m *AzureDiskVolumeSource) Reset() { *m = AzureDiskVolumeSource{} }
-var xxx_messageInfo_PersistentVolumeClaimVolumeSource proto.InternalMessageInfo
+func (m *AzureFilePersistentVolumeSource) Reset() { *m = AzureFilePersistentVolumeSource{} }
-func (m *PersistentVolumeList) Reset() { *m = PersistentVolumeList{} }
-func (*PersistentVolumeList) ProtoMessage() {}
-func (*PersistentVolumeList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{129}
-}
-func (m *PersistentVolumeList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PersistentVolumeList) 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 *PersistentVolumeList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PersistentVolumeList.Merge(m, src)
-}
-func (m *PersistentVolumeList) XXX_Size() int {
- return m.Size()
-}
-func (m *PersistentVolumeList) XXX_DiscardUnknown() {
- xxx_messageInfo_PersistentVolumeList.DiscardUnknown(m)
-}
+func (m *AzureFileVolumeSource) Reset() { *m = AzureFileVolumeSource{} }
-var xxx_messageInfo_PersistentVolumeList proto.InternalMessageInfo
+func (m *Binding) Reset() { *m = Binding{} }
-func (m *PersistentVolumeSource) Reset() { *m = PersistentVolumeSource{} }
-func (*PersistentVolumeSource) ProtoMessage() {}
-func (*PersistentVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{130}
-}
-func (m *PersistentVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PersistentVolumeSource) 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 *PersistentVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PersistentVolumeSource.Merge(m, src)
-}
-func (m *PersistentVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *PersistentVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_PersistentVolumeSource.DiscardUnknown(m)
-}
+func (m *CSIPersistentVolumeSource) Reset() { *m = CSIPersistentVolumeSource{} }
-var xxx_messageInfo_PersistentVolumeSource proto.InternalMessageInfo
+func (m *CSIVolumeSource) Reset() { *m = CSIVolumeSource{} }
-func (m *PersistentVolumeSpec) Reset() { *m = PersistentVolumeSpec{} }
-func (*PersistentVolumeSpec) ProtoMessage() {}
-func (*PersistentVolumeSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{131}
-}
-func (m *PersistentVolumeSpec) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PersistentVolumeSpec) 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 *PersistentVolumeSpec) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PersistentVolumeSpec.Merge(m, src)
-}
-func (m *PersistentVolumeSpec) XXX_Size() int {
- return m.Size()
-}
-func (m *PersistentVolumeSpec) XXX_DiscardUnknown() {
- xxx_messageInfo_PersistentVolumeSpec.DiscardUnknown(m)
-}
+func (m *Capabilities) Reset() { *m = Capabilities{} }
-var xxx_messageInfo_PersistentVolumeSpec proto.InternalMessageInfo
+func (m *CephFSPersistentVolumeSource) Reset() { *m = CephFSPersistentVolumeSource{} }
-func (m *PersistentVolumeStatus) Reset() { *m = PersistentVolumeStatus{} }
-func (*PersistentVolumeStatus) ProtoMessage() {}
-func (*PersistentVolumeStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{132}
-}
-func (m *PersistentVolumeStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PersistentVolumeStatus) 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 *PersistentVolumeStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PersistentVolumeStatus.Merge(m, src)
-}
-func (m *PersistentVolumeStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *PersistentVolumeStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_PersistentVolumeStatus.DiscardUnknown(m)
-}
+func (m *CephFSVolumeSource) Reset() { *m = CephFSVolumeSource{} }
-var xxx_messageInfo_PersistentVolumeStatus proto.InternalMessageInfo
+func (m *CinderPersistentVolumeSource) Reset() { *m = CinderPersistentVolumeSource{} }
-func (m *PhotonPersistentDiskVolumeSource) Reset() { *m = PhotonPersistentDiskVolumeSource{} }
-func (*PhotonPersistentDiskVolumeSource) ProtoMessage() {}
-func (*PhotonPersistentDiskVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{133}
-}
-func (m *PhotonPersistentDiskVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PhotonPersistentDiskVolumeSource) 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 *PhotonPersistentDiskVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PhotonPersistentDiskVolumeSource.Merge(m, src)
-}
-func (m *PhotonPersistentDiskVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *PhotonPersistentDiskVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_PhotonPersistentDiskVolumeSource.DiscardUnknown(m)
-}
+func (m *CinderVolumeSource) Reset() { *m = CinderVolumeSource{} }
-var xxx_messageInfo_PhotonPersistentDiskVolumeSource proto.InternalMessageInfo
+func (m *ClientIPConfig) Reset() { *m = ClientIPConfig{} }
-func (m *Pod) Reset() { *m = Pod{} }
-func (*Pod) ProtoMessage() {}
-func (*Pod) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{134}
-}
-func (m *Pod) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Pod) 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 *Pod) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Pod.Merge(m, src)
-}
-func (m *Pod) XXX_Size() int {
- return m.Size()
-}
-func (m *Pod) XXX_DiscardUnknown() {
- xxx_messageInfo_Pod.DiscardUnknown(m)
-}
+func (m *ClusterTrustBundleProjection) Reset() { *m = ClusterTrustBundleProjection{} }
-var xxx_messageInfo_Pod proto.InternalMessageInfo
+func (m *ComponentCondition) Reset() { *m = ComponentCondition{} }
-func (m *PodAffinity) Reset() { *m = PodAffinity{} }
-func (*PodAffinity) ProtoMessage() {}
-func (*PodAffinity) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{135}
-}
-func (m *PodAffinity) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodAffinity) 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 *PodAffinity) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodAffinity.Merge(m, src)
-}
-func (m *PodAffinity) XXX_Size() int {
- return m.Size()
-}
-func (m *PodAffinity) XXX_DiscardUnknown() {
- xxx_messageInfo_PodAffinity.DiscardUnknown(m)
-}
+func (m *ComponentStatus) Reset() { *m = ComponentStatus{} }
-var xxx_messageInfo_PodAffinity proto.InternalMessageInfo
+func (m *ComponentStatusList) Reset() { *m = ComponentStatusList{} }
-func (m *PodAffinityTerm) Reset() { *m = PodAffinityTerm{} }
-func (*PodAffinityTerm) ProtoMessage() {}
-func (*PodAffinityTerm) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{136}
-}
-func (m *PodAffinityTerm) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodAffinityTerm) 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 *PodAffinityTerm) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodAffinityTerm.Merge(m, src)
-}
-func (m *PodAffinityTerm) XXX_Size() int {
- return m.Size()
-}
-func (m *PodAffinityTerm) XXX_DiscardUnknown() {
- xxx_messageInfo_PodAffinityTerm.DiscardUnknown(m)
-}
+func (m *ConfigMap) Reset() { *m = ConfigMap{} }
-var xxx_messageInfo_PodAffinityTerm proto.InternalMessageInfo
+func (m *ConfigMapEnvSource) Reset() { *m = ConfigMapEnvSource{} }
-func (m *PodAntiAffinity) Reset() { *m = PodAntiAffinity{} }
-func (*PodAntiAffinity) ProtoMessage() {}
-func (*PodAntiAffinity) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{137}
-}
-func (m *PodAntiAffinity) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodAntiAffinity) 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 *PodAntiAffinity) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodAntiAffinity.Merge(m, src)
-}
-func (m *PodAntiAffinity) XXX_Size() int {
- return m.Size()
-}
-func (m *PodAntiAffinity) XXX_DiscardUnknown() {
- xxx_messageInfo_PodAntiAffinity.DiscardUnknown(m)
-}
+func (m *ConfigMapKeySelector) Reset() { *m = ConfigMapKeySelector{} }
-var xxx_messageInfo_PodAntiAffinity proto.InternalMessageInfo
+func (m *ConfigMapList) Reset() { *m = ConfigMapList{} }
-func (m *PodAttachOptions) Reset() { *m = PodAttachOptions{} }
-func (*PodAttachOptions) ProtoMessage() {}
-func (*PodAttachOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{138}
-}
-func (m *PodAttachOptions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodAttachOptions) 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 *PodAttachOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodAttachOptions.Merge(m, src)
-}
-func (m *PodAttachOptions) XXX_Size() int {
- return m.Size()
-}
-func (m *PodAttachOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_PodAttachOptions.DiscardUnknown(m)
-}
+func (m *ConfigMapNodeConfigSource) Reset() { *m = ConfigMapNodeConfigSource{} }
-var xxx_messageInfo_PodAttachOptions proto.InternalMessageInfo
+func (m *ConfigMapProjection) Reset() { *m = ConfigMapProjection{} }
-func (m *PodCertificateProjection) Reset() { *m = PodCertificateProjection{} }
-func (*PodCertificateProjection) ProtoMessage() {}
-func (*PodCertificateProjection) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{139}
-}
-func (m *PodCertificateProjection) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodCertificateProjection) 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 *PodCertificateProjection) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodCertificateProjection.Merge(m, src)
-}
-func (m *PodCertificateProjection) XXX_Size() int {
- return m.Size()
-}
-func (m *PodCertificateProjection) XXX_DiscardUnknown() {
- xxx_messageInfo_PodCertificateProjection.DiscardUnknown(m)
-}
+func (m *ConfigMapVolumeSource) Reset() { *m = ConfigMapVolumeSource{} }
-var xxx_messageInfo_PodCertificateProjection proto.InternalMessageInfo
+func (m *Container) Reset() { *m = Container{} }
-func (m *PodCondition) Reset() { *m = PodCondition{} }
-func (*PodCondition) ProtoMessage() {}
-func (*PodCondition) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{140}
-}
-func (m *PodCondition) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodCondition) 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 *PodCondition) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodCondition.Merge(m, src)
-}
-func (m *PodCondition) XXX_Size() int {
- return m.Size()
-}
-func (m *PodCondition) XXX_DiscardUnknown() {
- xxx_messageInfo_PodCondition.DiscardUnknown(m)
-}
+func (m *ContainerExtendedResourceRequest) Reset() { *m = ContainerExtendedResourceRequest{} }
-var xxx_messageInfo_PodCondition proto.InternalMessageInfo
+func (m *ContainerImage) Reset() { *m = ContainerImage{} }
-func (m *PodDNSConfig) Reset() { *m = PodDNSConfig{} }
-func (*PodDNSConfig) ProtoMessage() {}
-func (*PodDNSConfig) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{141}
-}
-func (m *PodDNSConfig) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodDNSConfig) 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 *PodDNSConfig) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodDNSConfig.Merge(m, src)
-}
-func (m *PodDNSConfig) XXX_Size() int {
- return m.Size()
-}
-func (m *PodDNSConfig) XXX_DiscardUnknown() {
- xxx_messageInfo_PodDNSConfig.DiscardUnknown(m)
-}
+func (m *ContainerPort) Reset() { *m = ContainerPort{} }
-var xxx_messageInfo_PodDNSConfig proto.InternalMessageInfo
+func (m *ContainerResizePolicy) Reset() { *m = ContainerResizePolicy{} }
-func (m *PodDNSConfigOption) Reset() { *m = PodDNSConfigOption{} }
-func (*PodDNSConfigOption) ProtoMessage() {}
-func (*PodDNSConfigOption) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{142}
-}
-func (m *PodDNSConfigOption) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodDNSConfigOption) 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 *PodDNSConfigOption) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodDNSConfigOption.Merge(m, src)
-}
-func (m *PodDNSConfigOption) XXX_Size() int {
- return m.Size()
-}
-func (m *PodDNSConfigOption) XXX_DiscardUnknown() {
- xxx_messageInfo_PodDNSConfigOption.DiscardUnknown(m)
-}
+func (m *ContainerRestartRule) Reset() { *m = ContainerRestartRule{} }
-var xxx_messageInfo_PodDNSConfigOption proto.InternalMessageInfo
+func (m *ContainerRestartRuleOnExitCodes) Reset() { *m = ContainerRestartRuleOnExitCodes{} }
-func (m *PodExecOptions) Reset() { *m = PodExecOptions{} }
-func (*PodExecOptions) ProtoMessage() {}
-func (*PodExecOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{143}
-}
-func (m *PodExecOptions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodExecOptions) 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 *PodExecOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodExecOptions.Merge(m, src)
-}
-func (m *PodExecOptions) XXX_Size() int {
- return m.Size()
-}
-func (m *PodExecOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_PodExecOptions.DiscardUnknown(m)
-}
+func (m *ContainerState) Reset() { *m = ContainerState{} }
-var xxx_messageInfo_PodExecOptions proto.InternalMessageInfo
+func (m *ContainerStateRunning) Reset() { *m = ContainerStateRunning{} }
-func (m *PodExtendedResourceClaimStatus) Reset() { *m = PodExtendedResourceClaimStatus{} }
-func (*PodExtendedResourceClaimStatus) ProtoMessage() {}
-func (*PodExtendedResourceClaimStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{144}
-}
-func (m *PodExtendedResourceClaimStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodExtendedResourceClaimStatus) 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 *PodExtendedResourceClaimStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodExtendedResourceClaimStatus.Merge(m, src)
-}
-func (m *PodExtendedResourceClaimStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *PodExtendedResourceClaimStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_PodExtendedResourceClaimStatus.DiscardUnknown(m)
-}
+func (m *ContainerStateTerminated) Reset() { *m = ContainerStateTerminated{} }
-var xxx_messageInfo_PodExtendedResourceClaimStatus proto.InternalMessageInfo
+func (m *ContainerStateWaiting) Reset() { *m = ContainerStateWaiting{} }
-func (m *PodIP) Reset() { *m = PodIP{} }
-func (*PodIP) ProtoMessage() {}
-func (*PodIP) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{145}
-}
-func (m *PodIP) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodIP) 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 *PodIP) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodIP.Merge(m, src)
-}
-func (m *PodIP) XXX_Size() int {
- return m.Size()
-}
-func (m *PodIP) XXX_DiscardUnknown() {
- xxx_messageInfo_PodIP.DiscardUnknown(m)
-}
+func (m *ContainerStatus) Reset() { *m = ContainerStatus{} }
-var xxx_messageInfo_PodIP proto.InternalMessageInfo
+func (m *ContainerUser) Reset() { *m = ContainerUser{} }
-func (m *PodList) Reset() { *m = PodList{} }
-func (*PodList) ProtoMessage() {}
-func (*PodList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{146}
-}
-func (m *PodList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodList) 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 *PodList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodList.Merge(m, src)
-}
-func (m *PodList) XXX_Size() int {
- return m.Size()
-}
-func (m *PodList) XXX_DiscardUnknown() {
- xxx_messageInfo_PodList.DiscardUnknown(m)
-}
+func (m *DaemonEndpoint) Reset() { *m = DaemonEndpoint{} }
-var xxx_messageInfo_PodList proto.InternalMessageInfo
+func (m *DownwardAPIProjection) Reset() { *m = DownwardAPIProjection{} }
-func (m *PodLogOptions) Reset() { *m = PodLogOptions{} }
-func (*PodLogOptions) ProtoMessage() {}
-func (*PodLogOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{147}
-}
-func (m *PodLogOptions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodLogOptions) 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 *PodLogOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodLogOptions.Merge(m, src)
-}
-func (m *PodLogOptions) XXX_Size() int {
- return m.Size()
-}
-func (m *PodLogOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_PodLogOptions.DiscardUnknown(m)
-}
+func (m *DownwardAPIVolumeFile) Reset() { *m = DownwardAPIVolumeFile{} }
-var xxx_messageInfo_PodLogOptions proto.InternalMessageInfo
+func (m *DownwardAPIVolumeSource) Reset() { *m = DownwardAPIVolumeSource{} }
-func (m *PodOS) Reset() { *m = PodOS{} }
-func (*PodOS) ProtoMessage() {}
-func (*PodOS) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{148}
-}
-func (m *PodOS) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodOS) 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 *PodOS) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodOS.Merge(m, src)
-}
-func (m *PodOS) XXX_Size() int {
- return m.Size()
-}
-func (m *PodOS) XXX_DiscardUnknown() {
- xxx_messageInfo_PodOS.DiscardUnknown(m)
-}
+func (m *EmptyDirVolumeSource) Reset() { *m = EmptyDirVolumeSource{} }
-var xxx_messageInfo_PodOS proto.InternalMessageInfo
+func (m *EndpointAddress) Reset() { *m = EndpointAddress{} }
-func (m *PodPortForwardOptions) Reset() { *m = PodPortForwardOptions{} }
-func (*PodPortForwardOptions) ProtoMessage() {}
-func (*PodPortForwardOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{149}
-}
-func (m *PodPortForwardOptions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodPortForwardOptions) 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 *PodPortForwardOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodPortForwardOptions.Merge(m, src)
-}
-func (m *PodPortForwardOptions) XXX_Size() int {
- return m.Size()
-}
-func (m *PodPortForwardOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_PodPortForwardOptions.DiscardUnknown(m)
-}
+func (m *EndpointPort) Reset() { *m = EndpointPort{} }
-var xxx_messageInfo_PodPortForwardOptions proto.InternalMessageInfo
+func (m *EndpointSubset) Reset() { *m = EndpointSubset{} }
-func (m *PodProxyOptions) Reset() { *m = PodProxyOptions{} }
-func (*PodProxyOptions) ProtoMessage() {}
-func (*PodProxyOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{150}
-}
-func (m *PodProxyOptions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodProxyOptions) 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 *PodProxyOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodProxyOptions.Merge(m, src)
-}
-func (m *PodProxyOptions) XXX_Size() int {
- return m.Size()
-}
-func (m *PodProxyOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_PodProxyOptions.DiscardUnknown(m)
-}
+func (m *Endpoints) Reset() { *m = Endpoints{} }
-var xxx_messageInfo_PodProxyOptions proto.InternalMessageInfo
+func (m *EndpointsList) Reset() { *m = EndpointsList{} }
-func (m *PodReadinessGate) Reset() { *m = PodReadinessGate{} }
-func (*PodReadinessGate) ProtoMessage() {}
-func (*PodReadinessGate) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{151}
-}
-func (m *PodReadinessGate) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodReadinessGate) 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 *PodReadinessGate) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodReadinessGate.Merge(m, src)
-}
-func (m *PodReadinessGate) XXX_Size() int {
- return m.Size()
-}
-func (m *PodReadinessGate) XXX_DiscardUnknown() {
- xxx_messageInfo_PodReadinessGate.DiscardUnknown(m)
-}
+func (m *EnvFromSource) Reset() { *m = EnvFromSource{} }
-var xxx_messageInfo_PodReadinessGate proto.InternalMessageInfo
+func (m *EnvVar) Reset() { *m = EnvVar{} }
-func (m *PodResourceClaim) Reset() { *m = PodResourceClaim{} }
-func (*PodResourceClaim) ProtoMessage() {}
-func (*PodResourceClaim) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{152}
-}
-func (m *PodResourceClaim) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodResourceClaim) 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 *PodResourceClaim) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodResourceClaim.Merge(m, src)
-}
-func (m *PodResourceClaim) XXX_Size() int {
- return m.Size()
-}
-func (m *PodResourceClaim) XXX_DiscardUnknown() {
- xxx_messageInfo_PodResourceClaim.DiscardUnknown(m)
-}
+func (m *EnvVarSource) Reset() { *m = EnvVarSource{} }
-var xxx_messageInfo_PodResourceClaim proto.InternalMessageInfo
+func (m *EphemeralContainer) Reset() { *m = EphemeralContainer{} }
-func (m *PodResourceClaimStatus) Reset() { *m = PodResourceClaimStatus{} }
-func (*PodResourceClaimStatus) ProtoMessage() {}
-func (*PodResourceClaimStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{153}
-}
-func (m *PodResourceClaimStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodResourceClaimStatus) 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 *PodResourceClaimStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodResourceClaimStatus.Merge(m, src)
-}
-func (m *PodResourceClaimStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *PodResourceClaimStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_PodResourceClaimStatus.DiscardUnknown(m)
-}
+func (m *EphemeralContainerCommon) Reset() { *m = EphemeralContainerCommon{} }
-var xxx_messageInfo_PodResourceClaimStatus proto.InternalMessageInfo
+func (m *EphemeralVolumeSource) Reset() { *m = EphemeralVolumeSource{} }
-func (m *PodSchedulingGate) Reset() { *m = PodSchedulingGate{} }
-func (*PodSchedulingGate) ProtoMessage() {}
-func (*PodSchedulingGate) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{154}
-}
-func (m *PodSchedulingGate) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodSchedulingGate) 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 *PodSchedulingGate) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodSchedulingGate.Merge(m, src)
-}
-func (m *PodSchedulingGate) XXX_Size() int {
- return m.Size()
-}
-func (m *PodSchedulingGate) XXX_DiscardUnknown() {
- xxx_messageInfo_PodSchedulingGate.DiscardUnknown(m)
-}
+func (m *Event) Reset() { *m = Event{} }
-var xxx_messageInfo_PodSchedulingGate proto.InternalMessageInfo
+func (m *EventList) Reset() { *m = EventList{} }
-func (m *PodSecurityContext) Reset() { *m = PodSecurityContext{} }
-func (*PodSecurityContext) ProtoMessage() {}
-func (*PodSecurityContext) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{155}
-}
-func (m *PodSecurityContext) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodSecurityContext) 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 *PodSecurityContext) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodSecurityContext.Merge(m, src)
-}
-func (m *PodSecurityContext) XXX_Size() int {
- return m.Size()
-}
-func (m *PodSecurityContext) XXX_DiscardUnknown() {
- xxx_messageInfo_PodSecurityContext.DiscardUnknown(m)
-}
+func (m *EventSeries) Reset() { *m = EventSeries{} }
-var xxx_messageInfo_PodSecurityContext proto.InternalMessageInfo
+func (m *EventSource) Reset() { *m = EventSource{} }
-func (m *PodSignature) Reset() { *m = PodSignature{} }
-func (*PodSignature) ProtoMessage() {}
-func (*PodSignature) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{156}
-}
-func (m *PodSignature) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodSignature) 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 *PodSignature) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodSignature.Merge(m, src)
-}
-func (m *PodSignature) XXX_Size() int {
- return m.Size()
-}
-func (m *PodSignature) XXX_DiscardUnknown() {
- xxx_messageInfo_PodSignature.DiscardUnknown(m)
-}
+func (m *ExecAction) Reset() { *m = ExecAction{} }
-var xxx_messageInfo_PodSignature proto.InternalMessageInfo
+func (m *FCVolumeSource) Reset() { *m = FCVolumeSource{} }
-func (m *PodSpec) Reset() { *m = PodSpec{} }
-func (*PodSpec) ProtoMessage() {}
-func (*PodSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{157}
-}
-func (m *PodSpec) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodSpec) 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 *PodSpec) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodSpec.Merge(m, src)
-}
-func (m *PodSpec) XXX_Size() int {
- return m.Size()
-}
-func (m *PodSpec) XXX_DiscardUnknown() {
- xxx_messageInfo_PodSpec.DiscardUnknown(m)
-}
+func (m *FileKeySelector) Reset() { *m = FileKeySelector{} }
-var xxx_messageInfo_PodSpec proto.InternalMessageInfo
+func (m *FlexPersistentVolumeSource) Reset() { *m = FlexPersistentVolumeSource{} }
-func (m *PodStatus) Reset() { *m = PodStatus{} }
-func (*PodStatus) ProtoMessage() {}
-func (*PodStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{158}
-}
-func (m *PodStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodStatus) 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 *PodStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodStatus.Merge(m, src)
-}
-func (m *PodStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *PodStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_PodStatus.DiscardUnknown(m)
-}
+func (m *FlexVolumeSource) Reset() { *m = FlexVolumeSource{} }
-var xxx_messageInfo_PodStatus proto.InternalMessageInfo
+func (m *FlockerVolumeSource) Reset() { *m = FlockerVolumeSource{} }
-func (m *PodStatusResult) Reset() { *m = PodStatusResult{} }
-func (*PodStatusResult) ProtoMessage() {}
-func (*PodStatusResult) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{159}
-}
-func (m *PodStatusResult) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodStatusResult) 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 *PodStatusResult) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodStatusResult.Merge(m, src)
-}
-func (m *PodStatusResult) XXX_Size() int {
- return m.Size()
-}
-func (m *PodStatusResult) XXX_DiscardUnknown() {
- xxx_messageInfo_PodStatusResult.DiscardUnknown(m)
-}
+func (m *GCEPersistentDiskVolumeSource) Reset() { *m = GCEPersistentDiskVolumeSource{} }
-var xxx_messageInfo_PodStatusResult proto.InternalMessageInfo
+func (m *GRPCAction) Reset() { *m = GRPCAction{} }
-func (m *PodTemplate) Reset() { *m = PodTemplate{} }
-func (*PodTemplate) ProtoMessage() {}
-func (*PodTemplate) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{160}
-}
-func (m *PodTemplate) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodTemplate) 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 *PodTemplate) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodTemplate.Merge(m, src)
-}
-func (m *PodTemplate) XXX_Size() int {
- return m.Size()
-}
-func (m *PodTemplate) XXX_DiscardUnknown() {
- xxx_messageInfo_PodTemplate.DiscardUnknown(m)
-}
+func (m *GitRepoVolumeSource) Reset() { *m = GitRepoVolumeSource{} }
-var xxx_messageInfo_PodTemplate proto.InternalMessageInfo
+func (m *GlusterfsPersistentVolumeSource) Reset() { *m = GlusterfsPersistentVolumeSource{} }
-func (m *PodTemplateList) Reset() { *m = PodTemplateList{} }
-func (*PodTemplateList) ProtoMessage() {}
-func (*PodTemplateList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{161}
-}
-func (m *PodTemplateList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodTemplateList) 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 *PodTemplateList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodTemplateList.Merge(m, src)
-}
-func (m *PodTemplateList) XXX_Size() int {
- return m.Size()
-}
-func (m *PodTemplateList) XXX_DiscardUnknown() {
- xxx_messageInfo_PodTemplateList.DiscardUnknown(m)
-}
+func (m *GlusterfsVolumeSource) Reset() { *m = GlusterfsVolumeSource{} }
-var xxx_messageInfo_PodTemplateList proto.InternalMessageInfo
+func (m *HTTPGetAction) Reset() { *m = HTTPGetAction{} }
-func (m *PodTemplateSpec) Reset() { *m = PodTemplateSpec{} }
-func (*PodTemplateSpec) ProtoMessage() {}
-func (*PodTemplateSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{162}
-}
-func (m *PodTemplateSpec) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PodTemplateSpec) 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 *PodTemplateSpec) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PodTemplateSpec.Merge(m, src)
-}
-func (m *PodTemplateSpec) XXX_Size() int {
- return m.Size()
-}
-func (m *PodTemplateSpec) XXX_DiscardUnknown() {
- xxx_messageInfo_PodTemplateSpec.DiscardUnknown(m)
-}
+func (m *HTTPHeader) Reset() { *m = HTTPHeader{} }
-var xxx_messageInfo_PodTemplateSpec proto.InternalMessageInfo
+func (m *HostAlias) Reset() { *m = HostAlias{} }
-func (m *PortStatus) Reset() { *m = PortStatus{} }
-func (*PortStatus) ProtoMessage() {}
-func (*PortStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{163}
-}
-func (m *PortStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PortStatus) 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 *PortStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PortStatus.Merge(m, src)
-}
-func (m *PortStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *PortStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_PortStatus.DiscardUnknown(m)
-}
+func (m *HostIP) Reset() { *m = HostIP{} }
-var xxx_messageInfo_PortStatus proto.InternalMessageInfo
+func (m *HostPathVolumeSource) Reset() { *m = HostPathVolumeSource{} }
-func (m *PortworxVolumeSource) Reset() { *m = PortworxVolumeSource{} }
-func (*PortworxVolumeSource) ProtoMessage() {}
-func (*PortworxVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{164}
-}
-func (m *PortworxVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PortworxVolumeSource) 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 *PortworxVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PortworxVolumeSource.Merge(m, src)
-}
-func (m *PortworxVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *PortworxVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_PortworxVolumeSource.DiscardUnknown(m)
-}
+func (m *ISCSIPersistentVolumeSource) Reset() { *m = ISCSIPersistentVolumeSource{} }
-var xxx_messageInfo_PortworxVolumeSource proto.InternalMessageInfo
+func (m *ISCSIVolumeSource) Reset() { *m = ISCSIVolumeSource{} }
-func (m *Preconditions) Reset() { *m = Preconditions{} }
-func (*Preconditions) ProtoMessage() {}
-func (*Preconditions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{165}
-}
-func (m *Preconditions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Preconditions) 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 *Preconditions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Preconditions.Merge(m, src)
-}
-func (m *Preconditions) XXX_Size() int {
- return m.Size()
-}
-func (m *Preconditions) XXX_DiscardUnknown() {
- xxx_messageInfo_Preconditions.DiscardUnknown(m)
-}
+func (m *ImageVolumeSource) Reset() { *m = ImageVolumeSource{} }
-var xxx_messageInfo_Preconditions proto.InternalMessageInfo
+func (m *KeyToPath) Reset() { *m = KeyToPath{} }
-func (m *PreferAvoidPodsEntry) Reset() { *m = PreferAvoidPodsEntry{} }
-func (*PreferAvoidPodsEntry) ProtoMessage() {}
-func (*PreferAvoidPodsEntry) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{166}
-}
-func (m *PreferAvoidPodsEntry) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PreferAvoidPodsEntry) 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 *PreferAvoidPodsEntry) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PreferAvoidPodsEntry.Merge(m, src)
-}
-func (m *PreferAvoidPodsEntry) XXX_Size() int {
- return m.Size()
-}
-func (m *PreferAvoidPodsEntry) XXX_DiscardUnknown() {
- xxx_messageInfo_PreferAvoidPodsEntry.DiscardUnknown(m)
-}
+func (m *Lifecycle) Reset() { *m = Lifecycle{} }
-var xxx_messageInfo_PreferAvoidPodsEntry proto.InternalMessageInfo
+func (m *LifecycleHandler) Reset() { *m = LifecycleHandler{} }
-func (m *PreferredSchedulingTerm) Reset() { *m = PreferredSchedulingTerm{} }
-func (*PreferredSchedulingTerm) ProtoMessage() {}
-func (*PreferredSchedulingTerm) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{167}
-}
-func (m *PreferredSchedulingTerm) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PreferredSchedulingTerm) 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 *PreferredSchedulingTerm) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PreferredSchedulingTerm.Merge(m, src)
-}
-func (m *PreferredSchedulingTerm) XXX_Size() int {
- return m.Size()
-}
-func (m *PreferredSchedulingTerm) XXX_DiscardUnknown() {
- xxx_messageInfo_PreferredSchedulingTerm.DiscardUnknown(m)
-}
+func (m *LimitRange) Reset() { *m = LimitRange{} }
-var xxx_messageInfo_PreferredSchedulingTerm proto.InternalMessageInfo
+func (m *LimitRangeItem) Reset() { *m = LimitRangeItem{} }
-func (m *Probe) Reset() { *m = Probe{} }
-func (*Probe) ProtoMessage() {}
-func (*Probe) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{168}
-}
-func (m *Probe) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Probe) 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 *Probe) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Probe.Merge(m, src)
-}
-func (m *Probe) XXX_Size() int {
- return m.Size()
-}
-func (m *Probe) XXX_DiscardUnknown() {
- xxx_messageInfo_Probe.DiscardUnknown(m)
-}
+func (m *LimitRangeList) Reset() { *m = LimitRangeList{} }
-var xxx_messageInfo_Probe proto.InternalMessageInfo
+func (m *LimitRangeSpec) Reset() { *m = LimitRangeSpec{} }
-func (m *ProbeHandler) Reset() { *m = ProbeHandler{} }
-func (*ProbeHandler) ProtoMessage() {}
-func (*ProbeHandler) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{169}
-}
-func (m *ProbeHandler) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ProbeHandler) 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 *ProbeHandler) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ProbeHandler.Merge(m, src)
-}
-func (m *ProbeHandler) XXX_Size() int {
- return m.Size()
-}
-func (m *ProbeHandler) XXX_DiscardUnknown() {
- xxx_messageInfo_ProbeHandler.DiscardUnknown(m)
-}
+func (m *LinuxContainerUser) Reset() { *m = LinuxContainerUser{} }
-var xxx_messageInfo_ProbeHandler proto.InternalMessageInfo
+func (m *List) Reset() { *m = List{} }
-func (m *ProjectedVolumeSource) Reset() { *m = ProjectedVolumeSource{} }
-func (*ProjectedVolumeSource) ProtoMessage() {}
-func (*ProjectedVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{170}
-}
-func (m *ProjectedVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ProjectedVolumeSource) 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 *ProjectedVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ProjectedVolumeSource.Merge(m, src)
-}
-func (m *ProjectedVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *ProjectedVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_ProjectedVolumeSource.DiscardUnknown(m)
-}
+func (m *LoadBalancerIngress) Reset() { *m = LoadBalancerIngress{} }
-var xxx_messageInfo_ProjectedVolumeSource proto.InternalMessageInfo
+func (m *LoadBalancerStatus) Reset() { *m = LoadBalancerStatus{} }
-func (m *QuobyteVolumeSource) Reset() { *m = QuobyteVolumeSource{} }
-func (*QuobyteVolumeSource) ProtoMessage() {}
-func (*QuobyteVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{171}
-}
-func (m *QuobyteVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *QuobyteVolumeSource) 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 *QuobyteVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_QuobyteVolumeSource.Merge(m, src)
-}
-func (m *QuobyteVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *QuobyteVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_QuobyteVolumeSource.DiscardUnknown(m)
-}
+func (m *LocalObjectReference) Reset() { *m = LocalObjectReference{} }
-var xxx_messageInfo_QuobyteVolumeSource proto.InternalMessageInfo
+func (m *LocalVolumeSource) Reset() { *m = LocalVolumeSource{} }
-func (m *RBDPersistentVolumeSource) Reset() { *m = RBDPersistentVolumeSource{} }
-func (*RBDPersistentVolumeSource) ProtoMessage() {}
-func (*RBDPersistentVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{172}
-}
-func (m *RBDPersistentVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *RBDPersistentVolumeSource) 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 *RBDPersistentVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RBDPersistentVolumeSource.Merge(m, src)
-}
-func (m *RBDPersistentVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *RBDPersistentVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_RBDPersistentVolumeSource.DiscardUnknown(m)
-}
+func (m *ModifyVolumeStatus) Reset() { *m = ModifyVolumeStatus{} }
-var xxx_messageInfo_RBDPersistentVolumeSource proto.InternalMessageInfo
+func (m *NFSVolumeSource) Reset() { *m = NFSVolumeSource{} }
-func (m *RBDVolumeSource) Reset() { *m = RBDVolumeSource{} }
-func (*RBDVolumeSource) ProtoMessage() {}
-func (*RBDVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{173}
-}
-func (m *RBDVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *RBDVolumeSource) 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 *RBDVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RBDVolumeSource.Merge(m, src)
-}
-func (m *RBDVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *RBDVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_RBDVolumeSource.DiscardUnknown(m)
-}
+func (m *Namespace) Reset() { *m = Namespace{} }
-var xxx_messageInfo_RBDVolumeSource proto.InternalMessageInfo
+func (m *NamespaceCondition) Reset() { *m = NamespaceCondition{} }
-func (m *RangeAllocation) Reset() { *m = RangeAllocation{} }
-func (*RangeAllocation) ProtoMessage() {}
-func (*RangeAllocation) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{174}
-}
-func (m *RangeAllocation) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *RangeAllocation) 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 *RangeAllocation) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RangeAllocation.Merge(m, src)
-}
-func (m *RangeAllocation) XXX_Size() int {
- return m.Size()
-}
-func (m *RangeAllocation) XXX_DiscardUnknown() {
- xxx_messageInfo_RangeAllocation.DiscardUnknown(m)
-}
+func (m *NamespaceList) Reset() { *m = NamespaceList{} }
-var xxx_messageInfo_RangeAllocation proto.InternalMessageInfo
+func (m *NamespaceSpec) Reset() { *m = NamespaceSpec{} }
-func (m *ReplicationController) Reset() { *m = ReplicationController{} }
-func (*ReplicationController) ProtoMessage() {}
-func (*ReplicationController) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{175}
-}
-func (m *ReplicationController) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ReplicationController) 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 *ReplicationController) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ReplicationController.Merge(m, src)
-}
-func (m *ReplicationController) XXX_Size() int {
- return m.Size()
-}
-func (m *ReplicationController) XXX_DiscardUnknown() {
- xxx_messageInfo_ReplicationController.DiscardUnknown(m)
-}
+func (m *NamespaceStatus) Reset() { *m = NamespaceStatus{} }
-var xxx_messageInfo_ReplicationController proto.InternalMessageInfo
+func (m *Node) Reset() { *m = Node{} }
-func (m *ReplicationControllerCondition) Reset() { *m = ReplicationControllerCondition{} }
-func (*ReplicationControllerCondition) ProtoMessage() {}
-func (*ReplicationControllerCondition) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{176}
-}
-func (m *ReplicationControllerCondition) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ReplicationControllerCondition) 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 *ReplicationControllerCondition) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ReplicationControllerCondition.Merge(m, src)
-}
-func (m *ReplicationControllerCondition) XXX_Size() int {
- return m.Size()
-}
-func (m *ReplicationControllerCondition) XXX_DiscardUnknown() {
- xxx_messageInfo_ReplicationControllerCondition.DiscardUnknown(m)
-}
+func (m *NodeAddress) Reset() { *m = NodeAddress{} }
-var xxx_messageInfo_ReplicationControllerCondition proto.InternalMessageInfo
+func (m *NodeAffinity) Reset() { *m = NodeAffinity{} }
-func (m *ReplicationControllerList) Reset() { *m = ReplicationControllerList{} }
-func (*ReplicationControllerList) ProtoMessage() {}
-func (*ReplicationControllerList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{177}
-}
-func (m *ReplicationControllerList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ReplicationControllerList) 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 *ReplicationControllerList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ReplicationControllerList.Merge(m, src)
-}
-func (m *ReplicationControllerList) XXX_Size() int {
- return m.Size()
-}
-func (m *ReplicationControllerList) XXX_DiscardUnknown() {
- xxx_messageInfo_ReplicationControllerList.DiscardUnknown(m)
-}
+func (m *NodeCondition) Reset() { *m = NodeCondition{} }
-var xxx_messageInfo_ReplicationControllerList proto.InternalMessageInfo
+func (m *NodeConfigSource) Reset() { *m = NodeConfigSource{} }
-func (m *ReplicationControllerSpec) Reset() { *m = ReplicationControllerSpec{} }
-func (*ReplicationControllerSpec) ProtoMessage() {}
-func (*ReplicationControllerSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{178}
-}
-func (m *ReplicationControllerSpec) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ReplicationControllerSpec) 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 *ReplicationControllerSpec) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ReplicationControllerSpec.Merge(m, src)
-}
-func (m *ReplicationControllerSpec) XXX_Size() int {
- return m.Size()
-}
-func (m *ReplicationControllerSpec) XXX_DiscardUnknown() {
- xxx_messageInfo_ReplicationControllerSpec.DiscardUnknown(m)
-}
+func (m *NodeConfigStatus) Reset() { *m = NodeConfigStatus{} }
-var xxx_messageInfo_ReplicationControllerSpec proto.InternalMessageInfo
+func (m *NodeDaemonEndpoints) Reset() { *m = NodeDaemonEndpoints{} }
-func (m *ReplicationControllerStatus) Reset() { *m = ReplicationControllerStatus{} }
-func (*ReplicationControllerStatus) ProtoMessage() {}
-func (*ReplicationControllerStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{179}
-}
-func (m *ReplicationControllerStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ReplicationControllerStatus) 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 *ReplicationControllerStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ReplicationControllerStatus.Merge(m, src)
-}
-func (m *ReplicationControllerStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *ReplicationControllerStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_ReplicationControllerStatus.DiscardUnknown(m)
-}
+func (m *NodeFeatures) Reset() { *m = NodeFeatures{} }
-var xxx_messageInfo_ReplicationControllerStatus proto.InternalMessageInfo
+func (m *NodeList) Reset() { *m = NodeList{} }
-func (m *ResourceClaim) Reset() { *m = ResourceClaim{} }
-func (*ResourceClaim) ProtoMessage() {}
-func (*ResourceClaim) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{180}
-}
-func (m *ResourceClaim) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResourceClaim) 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 *ResourceClaim) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceClaim.Merge(m, src)
-}
-func (m *ResourceClaim) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceClaim) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceClaim.DiscardUnknown(m)
-}
+func (m *NodeProxyOptions) Reset() { *m = NodeProxyOptions{} }
-var xxx_messageInfo_ResourceClaim proto.InternalMessageInfo
+func (m *NodeRuntimeHandler) Reset() { *m = NodeRuntimeHandler{} }
-func (m *ResourceFieldSelector) Reset() { *m = ResourceFieldSelector{} }
-func (*ResourceFieldSelector) ProtoMessage() {}
-func (*ResourceFieldSelector) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{181}
-}
-func (m *ResourceFieldSelector) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResourceFieldSelector) 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 *ResourceFieldSelector) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceFieldSelector.Merge(m, src)
-}
-func (m *ResourceFieldSelector) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceFieldSelector) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceFieldSelector.DiscardUnknown(m)
-}
+func (m *NodeRuntimeHandlerFeatures) Reset() { *m = NodeRuntimeHandlerFeatures{} }
-var xxx_messageInfo_ResourceFieldSelector proto.InternalMessageInfo
+func (m *NodeSelector) Reset() { *m = NodeSelector{} }
-func (m *ResourceHealth) Reset() { *m = ResourceHealth{} }
-func (*ResourceHealth) ProtoMessage() {}
-func (*ResourceHealth) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{182}
-}
-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)
-}
+func (m *NodeSelectorRequirement) Reset() { *m = NodeSelectorRequirement{} }
-var xxx_messageInfo_ResourceHealth proto.InternalMessageInfo
+func (m *NodeSelectorTerm) Reset() { *m = NodeSelectorTerm{} }
-func (m *ResourceQuota) Reset() { *m = ResourceQuota{} }
-func (*ResourceQuota) ProtoMessage() {}
-func (*ResourceQuota) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{183}
-}
-func (m *ResourceQuota) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResourceQuota) 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 *ResourceQuota) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceQuota.Merge(m, src)
-}
-func (m *ResourceQuota) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceQuota) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceQuota.DiscardUnknown(m)
-}
+func (m *NodeSpec) Reset() { *m = NodeSpec{} }
-var xxx_messageInfo_ResourceQuota proto.InternalMessageInfo
+func (m *NodeStatus) Reset() { *m = NodeStatus{} }
-func (m *ResourceQuotaList) Reset() { *m = ResourceQuotaList{} }
-func (*ResourceQuotaList) ProtoMessage() {}
-func (*ResourceQuotaList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{184}
-}
-func (m *ResourceQuotaList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResourceQuotaList) 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 *ResourceQuotaList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceQuotaList.Merge(m, src)
-}
-func (m *ResourceQuotaList) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceQuotaList) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceQuotaList.DiscardUnknown(m)
-}
+func (m *NodeSwapStatus) Reset() { *m = NodeSwapStatus{} }
-var xxx_messageInfo_ResourceQuotaList proto.InternalMessageInfo
+func (m *NodeSystemInfo) Reset() { *m = NodeSystemInfo{} }
-func (m *ResourceQuotaSpec) Reset() { *m = ResourceQuotaSpec{} }
-func (*ResourceQuotaSpec) ProtoMessage() {}
-func (*ResourceQuotaSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{185}
-}
-func (m *ResourceQuotaSpec) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResourceQuotaSpec) 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 *ResourceQuotaSpec) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceQuotaSpec.Merge(m, src)
-}
-func (m *ResourceQuotaSpec) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceQuotaSpec) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceQuotaSpec.DiscardUnknown(m)
-}
+func (m *ObjectFieldSelector) Reset() { *m = ObjectFieldSelector{} }
-var xxx_messageInfo_ResourceQuotaSpec proto.InternalMessageInfo
+func (m *ObjectReference) Reset() { *m = ObjectReference{} }
-func (m *ResourceQuotaStatus) Reset() { *m = ResourceQuotaStatus{} }
-func (*ResourceQuotaStatus) ProtoMessage() {}
-func (*ResourceQuotaStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{186}
-}
-func (m *ResourceQuotaStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResourceQuotaStatus) 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 *ResourceQuotaStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceQuotaStatus.Merge(m, src)
-}
-func (m *ResourceQuotaStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceQuotaStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceQuotaStatus.DiscardUnknown(m)
-}
+func (m *PersistentVolume) Reset() { *m = PersistentVolume{} }
-var xxx_messageInfo_ResourceQuotaStatus proto.InternalMessageInfo
+func (m *PersistentVolumeClaim) Reset() { *m = PersistentVolumeClaim{} }
-func (m *ResourceRequirements) Reset() { *m = ResourceRequirements{} }
-func (*ResourceRequirements) ProtoMessage() {}
-func (*ResourceRequirements) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{187}
-}
-func (m *ResourceRequirements) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResourceRequirements) 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 *ResourceRequirements) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResourceRequirements.Merge(m, src)
-}
-func (m *ResourceRequirements) XXX_Size() int {
- return m.Size()
-}
-func (m *ResourceRequirements) XXX_DiscardUnknown() {
- xxx_messageInfo_ResourceRequirements.DiscardUnknown(m)
-}
+func (m *PersistentVolumeClaimCondition) Reset() { *m = PersistentVolumeClaimCondition{} }
-var xxx_messageInfo_ResourceRequirements proto.InternalMessageInfo
+func (m *PersistentVolumeClaimList) Reset() { *m = PersistentVolumeClaimList{} }
-func (m *ResourceStatus) Reset() { *m = ResourceStatus{} }
-func (*ResourceStatus) ProtoMessage() {}
-func (*ResourceStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{188}
-}
-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)
-}
+func (m *PersistentVolumeClaimSpec) Reset() { *m = PersistentVolumeClaimSpec{} }
-var xxx_messageInfo_ResourceStatus proto.InternalMessageInfo
+func (m *PersistentVolumeClaimStatus) Reset() { *m = PersistentVolumeClaimStatus{} }
-func (m *SELinuxOptions) Reset() { *m = SELinuxOptions{} }
-func (*SELinuxOptions) ProtoMessage() {}
-func (*SELinuxOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{189}
-}
-func (m *SELinuxOptions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SELinuxOptions) 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 *SELinuxOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SELinuxOptions.Merge(m, src)
-}
-func (m *SELinuxOptions) XXX_Size() int {
- return m.Size()
-}
-func (m *SELinuxOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_SELinuxOptions.DiscardUnknown(m)
-}
+func (m *PersistentVolumeClaimTemplate) Reset() { *m = PersistentVolumeClaimTemplate{} }
-var xxx_messageInfo_SELinuxOptions proto.InternalMessageInfo
+func (m *PersistentVolumeClaimVolumeSource) Reset() { *m = PersistentVolumeClaimVolumeSource{} }
-func (m *ScaleIOPersistentVolumeSource) Reset() { *m = ScaleIOPersistentVolumeSource{} }
-func (*ScaleIOPersistentVolumeSource) ProtoMessage() {}
-func (*ScaleIOPersistentVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{190}
-}
-func (m *ScaleIOPersistentVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ScaleIOPersistentVolumeSource) 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 *ScaleIOPersistentVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ScaleIOPersistentVolumeSource.Merge(m, src)
-}
-func (m *ScaleIOPersistentVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *ScaleIOPersistentVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_ScaleIOPersistentVolumeSource.DiscardUnknown(m)
-}
+func (m *PersistentVolumeList) Reset() { *m = PersistentVolumeList{} }
-var xxx_messageInfo_ScaleIOPersistentVolumeSource proto.InternalMessageInfo
+func (m *PersistentVolumeSource) Reset() { *m = PersistentVolumeSource{} }
-func (m *ScaleIOVolumeSource) Reset() { *m = ScaleIOVolumeSource{} }
-func (*ScaleIOVolumeSource) ProtoMessage() {}
-func (*ScaleIOVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{191}
-}
-func (m *ScaleIOVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ScaleIOVolumeSource) 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 *ScaleIOVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ScaleIOVolumeSource.Merge(m, src)
-}
-func (m *ScaleIOVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *ScaleIOVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_ScaleIOVolumeSource.DiscardUnknown(m)
-}
+func (m *PersistentVolumeSpec) Reset() { *m = PersistentVolumeSpec{} }
+
+func (m *PersistentVolumeStatus) Reset() { *m = PersistentVolumeStatus{} }
+
+func (m *PhotonPersistentDiskVolumeSource) Reset() { *m = PhotonPersistentDiskVolumeSource{} }
+
+func (m *Pod) Reset() { *m = Pod{} }
+
+func (m *PodAffinity) Reset() { *m = PodAffinity{} }
+
+func (m *PodAffinityTerm) Reset() { *m = PodAffinityTerm{} }
+
+func (m *PodAntiAffinity) Reset() { *m = PodAntiAffinity{} }
+
+func (m *PodAttachOptions) Reset() { *m = PodAttachOptions{} }
+
+func (m *PodCertificateProjection) Reset() { *m = PodCertificateProjection{} }
-var xxx_messageInfo_ScaleIOVolumeSource proto.InternalMessageInfo
+func (m *PodCondition) Reset() { *m = PodCondition{} }
-func (m *ScopeSelector) Reset() { *m = ScopeSelector{} }
-func (*ScopeSelector) ProtoMessage() {}
-func (*ScopeSelector) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{192}
-}
-func (m *ScopeSelector) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ScopeSelector) 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 *ScopeSelector) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ScopeSelector.Merge(m, src)
-}
-func (m *ScopeSelector) XXX_Size() int {
- return m.Size()
-}
-func (m *ScopeSelector) XXX_DiscardUnknown() {
- xxx_messageInfo_ScopeSelector.DiscardUnknown(m)
-}
+func (m *PodDNSConfig) Reset() { *m = PodDNSConfig{} }
-var xxx_messageInfo_ScopeSelector proto.InternalMessageInfo
+func (m *PodDNSConfigOption) Reset() { *m = PodDNSConfigOption{} }
-func (m *ScopedResourceSelectorRequirement) Reset() { *m = ScopedResourceSelectorRequirement{} }
-func (*ScopedResourceSelectorRequirement) ProtoMessage() {}
-func (*ScopedResourceSelectorRequirement) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{193}
-}
-func (m *ScopedResourceSelectorRequirement) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ScopedResourceSelectorRequirement) 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 *ScopedResourceSelectorRequirement) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ScopedResourceSelectorRequirement.Merge(m, src)
-}
-func (m *ScopedResourceSelectorRequirement) XXX_Size() int {
- return m.Size()
-}
-func (m *ScopedResourceSelectorRequirement) XXX_DiscardUnknown() {
- xxx_messageInfo_ScopedResourceSelectorRequirement.DiscardUnknown(m)
-}
+func (m *PodExecOptions) Reset() { *m = PodExecOptions{} }
-var xxx_messageInfo_ScopedResourceSelectorRequirement proto.InternalMessageInfo
+func (m *PodExtendedResourceClaimStatus) Reset() { *m = PodExtendedResourceClaimStatus{} }
-func (m *SeccompProfile) Reset() { *m = SeccompProfile{} }
-func (*SeccompProfile) ProtoMessage() {}
-func (*SeccompProfile) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{194}
-}
-func (m *SeccompProfile) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SeccompProfile) 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 *SeccompProfile) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SeccompProfile.Merge(m, src)
-}
-func (m *SeccompProfile) XXX_Size() int {
- return m.Size()
-}
-func (m *SeccompProfile) XXX_DiscardUnknown() {
- xxx_messageInfo_SeccompProfile.DiscardUnknown(m)
-}
+func (m *PodIP) Reset() { *m = PodIP{} }
-var xxx_messageInfo_SeccompProfile proto.InternalMessageInfo
+func (m *PodList) Reset() { *m = PodList{} }
-func (m *Secret) Reset() { *m = Secret{} }
-func (*Secret) ProtoMessage() {}
-func (*Secret) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{195}
-}
-func (m *Secret) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Secret) 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 *Secret) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Secret.Merge(m, src)
-}
-func (m *Secret) XXX_Size() int {
- return m.Size()
-}
-func (m *Secret) XXX_DiscardUnknown() {
- xxx_messageInfo_Secret.DiscardUnknown(m)
-}
+func (m *PodLogOptions) Reset() { *m = PodLogOptions{} }
-var xxx_messageInfo_Secret proto.InternalMessageInfo
+func (m *PodOS) Reset() { *m = PodOS{} }
-func (m *SecretEnvSource) Reset() { *m = SecretEnvSource{} }
-func (*SecretEnvSource) ProtoMessage() {}
-func (*SecretEnvSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{196}
-}
-func (m *SecretEnvSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SecretEnvSource) 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 *SecretEnvSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SecretEnvSource.Merge(m, src)
-}
-func (m *SecretEnvSource) XXX_Size() int {
- return m.Size()
-}
-func (m *SecretEnvSource) XXX_DiscardUnknown() {
- xxx_messageInfo_SecretEnvSource.DiscardUnknown(m)
-}
+func (m *PodPortForwardOptions) Reset() { *m = PodPortForwardOptions{} }
-var xxx_messageInfo_SecretEnvSource proto.InternalMessageInfo
+func (m *PodProxyOptions) Reset() { *m = PodProxyOptions{} }
-func (m *SecretKeySelector) Reset() { *m = SecretKeySelector{} }
-func (*SecretKeySelector) ProtoMessage() {}
-func (*SecretKeySelector) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{197}
-}
-func (m *SecretKeySelector) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SecretKeySelector) 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 *SecretKeySelector) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SecretKeySelector.Merge(m, src)
-}
-func (m *SecretKeySelector) XXX_Size() int {
- return m.Size()
-}
-func (m *SecretKeySelector) XXX_DiscardUnknown() {
- xxx_messageInfo_SecretKeySelector.DiscardUnknown(m)
-}
+func (m *PodReadinessGate) Reset() { *m = PodReadinessGate{} }
-var xxx_messageInfo_SecretKeySelector proto.InternalMessageInfo
+func (m *PodResourceClaim) Reset() { *m = PodResourceClaim{} }
-func (m *SecretList) Reset() { *m = SecretList{} }
-func (*SecretList) ProtoMessage() {}
-func (*SecretList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{198}
-}
-func (m *SecretList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SecretList) 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 *SecretList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SecretList.Merge(m, src)
-}
-func (m *SecretList) XXX_Size() int {
- return m.Size()
-}
-func (m *SecretList) XXX_DiscardUnknown() {
- xxx_messageInfo_SecretList.DiscardUnknown(m)
-}
+func (m *PodResourceClaimStatus) Reset() { *m = PodResourceClaimStatus{} }
-var xxx_messageInfo_SecretList proto.InternalMessageInfo
+func (m *PodSchedulingGate) Reset() { *m = PodSchedulingGate{} }
-func (m *SecretProjection) Reset() { *m = SecretProjection{} }
-func (*SecretProjection) ProtoMessage() {}
-func (*SecretProjection) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{199}
-}
-func (m *SecretProjection) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SecretProjection) 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 *SecretProjection) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SecretProjection.Merge(m, src)
-}
-func (m *SecretProjection) XXX_Size() int {
- return m.Size()
-}
-func (m *SecretProjection) XXX_DiscardUnknown() {
- xxx_messageInfo_SecretProjection.DiscardUnknown(m)
-}
+func (m *PodSecurityContext) Reset() { *m = PodSecurityContext{} }
-var xxx_messageInfo_SecretProjection proto.InternalMessageInfo
+func (m *PodSignature) Reset() { *m = PodSignature{} }
-func (m *SecretReference) Reset() { *m = SecretReference{} }
-func (*SecretReference) ProtoMessage() {}
-func (*SecretReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{200}
-}
-func (m *SecretReference) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SecretReference) 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 *SecretReference) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SecretReference.Merge(m, src)
-}
-func (m *SecretReference) XXX_Size() int {
- return m.Size()
-}
-func (m *SecretReference) XXX_DiscardUnknown() {
- xxx_messageInfo_SecretReference.DiscardUnknown(m)
-}
+func (m *PodSpec) Reset() { *m = PodSpec{} }
-var xxx_messageInfo_SecretReference proto.InternalMessageInfo
+func (m *PodStatus) Reset() { *m = PodStatus{} }
-func (m *SecretVolumeSource) Reset() { *m = SecretVolumeSource{} }
-func (*SecretVolumeSource) ProtoMessage() {}
-func (*SecretVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{201}
-}
-func (m *SecretVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SecretVolumeSource) 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 *SecretVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SecretVolumeSource.Merge(m, src)
-}
-func (m *SecretVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *SecretVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_SecretVolumeSource.DiscardUnknown(m)
-}
+func (m *PodStatusResult) Reset() { *m = PodStatusResult{} }
-var xxx_messageInfo_SecretVolumeSource proto.InternalMessageInfo
+func (m *PodTemplate) Reset() { *m = PodTemplate{} }
-func (m *SecurityContext) Reset() { *m = SecurityContext{} }
-func (*SecurityContext) ProtoMessage() {}
-func (*SecurityContext) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{202}
-}
-func (m *SecurityContext) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SecurityContext) 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 *SecurityContext) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SecurityContext.Merge(m, src)
-}
-func (m *SecurityContext) XXX_Size() int {
- return m.Size()
-}
-func (m *SecurityContext) XXX_DiscardUnknown() {
- xxx_messageInfo_SecurityContext.DiscardUnknown(m)
-}
+func (m *PodTemplateList) Reset() { *m = PodTemplateList{} }
-var xxx_messageInfo_SecurityContext proto.InternalMessageInfo
+func (m *PodTemplateSpec) Reset() { *m = PodTemplateSpec{} }
-func (m *SerializedReference) Reset() { *m = SerializedReference{} }
-func (*SerializedReference) ProtoMessage() {}
-func (*SerializedReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{203}
-}
-func (m *SerializedReference) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SerializedReference) 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 *SerializedReference) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SerializedReference.Merge(m, src)
-}
-func (m *SerializedReference) XXX_Size() int {
- return m.Size()
-}
-func (m *SerializedReference) XXX_DiscardUnknown() {
- xxx_messageInfo_SerializedReference.DiscardUnknown(m)
-}
+func (m *PortStatus) Reset() { *m = PortStatus{} }
-var xxx_messageInfo_SerializedReference proto.InternalMessageInfo
+func (m *PortworxVolumeSource) Reset() { *m = PortworxVolumeSource{} }
-func (m *Service) Reset() { *m = Service{} }
-func (*Service) ProtoMessage() {}
-func (*Service) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{204}
-}
-func (m *Service) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Service) 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 *Service) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Service.Merge(m, src)
-}
-func (m *Service) XXX_Size() int {
- return m.Size()
-}
-func (m *Service) XXX_DiscardUnknown() {
- xxx_messageInfo_Service.DiscardUnknown(m)
-}
+func (m *Preconditions) Reset() { *m = Preconditions{} }
-var xxx_messageInfo_Service proto.InternalMessageInfo
+func (m *PreferAvoidPodsEntry) Reset() { *m = PreferAvoidPodsEntry{} }
-func (m *ServiceAccount) Reset() { *m = ServiceAccount{} }
-func (*ServiceAccount) ProtoMessage() {}
-func (*ServiceAccount) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{205}
-}
-func (m *ServiceAccount) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ServiceAccount) 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 *ServiceAccount) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ServiceAccount.Merge(m, src)
-}
-func (m *ServiceAccount) XXX_Size() int {
- return m.Size()
-}
-func (m *ServiceAccount) XXX_DiscardUnknown() {
- xxx_messageInfo_ServiceAccount.DiscardUnknown(m)
-}
+func (m *PreferredSchedulingTerm) Reset() { *m = PreferredSchedulingTerm{} }
-var xxx_messageInfo_ServiceAccount proto.InternalMessageInfo
+func (m *Probe) Reset() { *m = Probe{} }
-func (m *ServiceAccountList) Reset() { *m = ServiceAccountList{} }
-func (*ServiceAccountList) ProtoMessage() {}
-func (*ServiceAccountList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{206}
-}
-func (m *ServiceAccountList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ServiceAccountList) 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 *ServiceAccountList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ServiceAccountList.Merge(m, src)
-}
-func (m *ServiceAccountList) XXX_Size() int {
- return m.Size()
-}
-func (m *ServiceAccountList) XXX_DiscardUnknown() {
- xxx_messageInfo_ServiceAccountList.DiscardUnknown(m)
-}
+func (m *ProbeHandler) Reset() { *m = ProbeHandler{} }
-var xxx_messageInfo_ServiceAccountList proto.InternalMessageInfo
+func (m *ProjectedVolumeSource) Reset() { *m = ProjectedVolumeSource{} }
-func (m *ServiceAccountTokenProjection) Reset() { *m = ServiceAccountTokenProjection{} }
-func (*ServiceAccountTokenProjection) ProtoMessage() {}
-func (*ServiceAccountTokenProjection) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{207}
-}
-func (m *ServiceAccountTokenProjection) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ServiceAccountTokenProjection) 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 *ServiceAccountTokenProjection) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ServiceAccountTokenProjection.Merge(m, src)
-}
-func (m *ServiceAccountTokenProjection) XXX_Size() int {
- return m.Size()
-}
-func (m *ServiceAccountTokenProjection) XXX_DiscardUnknown() {
- xxx_messageInfo_ServiceAccountTokenProjection.DiscardUnknown(m)
-}
+func (m *QuobyteVolumeSource) Reset() { *m = QuobyteVolumeSource{} }
-var xxx_messageInfo_ServiceAccountTokenProjection proto.InternalMessageInfo
+func (m *RBDPersistentVolumeSource) Reset() { *m = RBDPersistentVolumeSource{} }
-func (m *ServiceList) Reset() { *m = ServiceList{} }
-func (*ServiceList) ProtoMessage() {}
-func (*ServiceList) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{208}
-}
-func (m *ServiceList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ServiceList) 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 *ServiceList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ServiceList.Merge(m, src)
-}
-func (m *ServiceList) XXX_Size() int {
- return m.Size()
-}
-func (m *ServiceList) XXX_DiscardUnknown() {
- xxx_messageInfo_ServiceList.DiscardUnknown(m)
-}
+func (m *RBDVolumeSource) Reset() { *m = RBDVolumeSource{} }
-var xxx_messageInfo_ServiceList proto.InternalMessageInfo
+func (m *RangeAllocation) Reset() { *m = RangeAllocation{} }
-func (m *ServicePort) Reset() { *m = ServicePort{} }
-func (*ServicePort) ProtoMessage() {}
-func (*ServicePort) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{209}
-}
-func (m *ServicePort) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ServicePort) 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 *ServicePort) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ServicePort.Merge(m, src)
-}
-func (m *ServicePort) XXX_Size() int {
- return m.Size()
-}
-func (m *ServicePort) XXX_DiscardUnknown() {
- xxx_messageInfo_ServicePort.DiscardUnknown(m)
-}
+func (m *ReplicationController) Reset() { *m = ReplicationController{} }
-var xxx_messageInfo_ServicePort proto.InternalMessageInfo
+func (m *ReplicationControllerCondition) Reset() { *m = ReplicationControllerCondition{} }
-func (m *ServiceProxyOptions) Reset() { *m = ServiceProxyOptions{} }
-func (*ServiceProxyOptions) ProtoMessage() {}
-func (*ServiceProxyOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{210}
-}
-func (m *ServiceProxyOptions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ServiceProxyOptions) 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 *ServiceProxyOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ServiceProxyOptions.Merge(m, src)
-}
-func (m *ServiceProxyOptions) XXX_Size() int {
- return m.Size()
-}
-func (m *ServiceProxyOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_ServiceProxyOptions.DiscardUnknown(m)
-}
+func (m *ReplicationControllerList) Reset() { *m = ReplicationControllerList{} }
-var xxx_messageInfo_ServiceProxyOptions proto.InternalMessageInfo
+func (m *ReplicationControllerSpec) Reset() { *m = ReplicationControllerSpec{} }
-func (m *ServiceSpec) Reset() { *m = ServiceSpec{} }
-func (*ServiceSpec) ProtoMessage() {}
-func (*ServiceSpec) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{211}
-}
-func (m *ServiceSpec) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ServiceSpec) 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 *ServiceSpec) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ServiceSpec.Merge(m, src)
-}
-func (m *ServiceSpec) XXX_Size() int {
- return m.Size()
-}
-func (m *ServiceSpec) XXX_DiscardUnknown() {
- xxx_messageInfo_ServiceSpec.DiscardUnknown(m)
-}
+func (m *ReplicationControllerStatus) Reset() { *m = ReplicationControllerStatus{} }
-var xxx_messageInfo_ServiceSpec proto.InternalMessageInfo
+func (m *ResourceClaim) Reset() { *m = ResourceClaim{} }
-func (m *ServiceStatus) Reset() { *m = ServiceStatus{} }
-func (*ServiceStatus) ProtoMessage() {}
-func (*ServiceStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{212}
-}
-func (m *ServiceStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ServiceStatus) 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 *ServiceStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ServiceStatus.Merge(m, src)
-}
-func (m *ServiceStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *ServiceStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_ServiceStatus.DiscardUnknown(m)
-}
+func (m *ResourceFieldSelector) Reset() { *m = ResourceFieldSelector{} }
-var xxx_messageInfo_ServiceStatus proto.InternalMessageInfo
+func (m *ResourceHealth) Reset() { *m = ResourceHealth{} }
-func (m *SessionAffinityConfig) Reset() { *m = SessionAffinityConfig{} }
-func (*SessionAffinityConfig) ProtoMessage() {}
-func (*SessionAffinityConfig) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{213}
-}
-func (m *SessionAffinityConfig) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SessionAffinityConfig) 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 *SessionAffinityConfig) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SessionAffinityConfig.Merge(m, src)
-}
-func (m *SessionAffinityConfig) XXX_Size() int {
- return m.Size()
-}
-func (m *SessionAffinityConfig) XXX_DiscardUnknown() {
- xxx_messageInfo_SessionAffinityConfig.DiscardUnknown(m)
-}
+func (m *ResourceQuota) Reset() { *m = ResourceQuota{} }
-var xxx_messageInfo_SessionAffinityConfig proto.InternalMessageInfo
+func (m *ResourceQuotaList) Reset() { *m = ResourceQuotaList{} }
-func (m *SleepAction) Reset() { *m = SleepAction{} }
-func (*SleepAction) ProtoMessage() {}
-func (*SleepAction) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{214}
-}
-func (m *SleepAction) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SleepAction) 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 *SleepAction) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SleepAction.Merge(m, src)
-}
-func (m *SleepAction) XXX_Size() int {
- return m.Size()
-}
-func (m *SleepAction) XXX_DiscardUnknown() {
- xxx_messageInfo_SleepAction.DiscardUnknown(m)
-}
+func (m *ResourceQuotaSpec) Reset() { *m = ResourceQuotaSpec{} }
-var xxx_messageInfo_SleepAction proto.InternalMessageInfo
+func (m *ResourceQuotaStatus) Reset() { *m = ResourceQuotaStatus{} }
-func (m *StorageOSPersistentVolumeSource) Reset() { *m = StorageOSPersistentVolumeSource{} }
-func (*StorageOSPersistentVolumeSource) ProtoMessage() {}
-func (*StorageOSPersistentVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{215}
-}
-func (m *StorageOSPersistentVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *StorageOSPersistentVolumeSource) 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 *StorageOSPersistentVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_StorageOSPersistentVolumeSource.Merge(m, src)
-}
-func (m *StorageOSPersistentVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *StorageOSPersistentVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_StorageOSPersistentVolumeSource.DiscardUnknown(m)
-}
+func (m *ResourceRequirements) Reset() { *m = ResourceRequirements{} }
-var xxx_messageInfo_StorageOSPersistentVolumeSource proto.InternalMessageInfo
+func (m *ResourceStatus) Reset() { *m = ResourceStatus{} }
-func (m *StorageOSVolumeSource) Reset() { *m = StorageOSVolumeSource{} }
-func (*StorageOSVolumeSource) ProtoMessage() {}
-func (*StorageOSVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{216}
-}
-func (m *StorageOSVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *StorageOSVolumeSource) 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 *StorageOSVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_StorageOSVolumeSource.Merge(m, src)
-}
-func (m *StorageOSVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *StorageOSVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_StorageOSVolumeSource.DiscardUnknown(m)
-}
+func (m *SELinuxOptions) Reset() { *m = SELinuxOptions{} }
-var xxx_messageInfo_StorageOSVolumeSource proto.InternalMessageInfo
+func (m *ScaleIOPersistentVolumeSource) Reset() { *m = ScaleIOPersistentVolumeSource{} }
-func (m *Sysctl) Reset() { *m = Sysctl{} }
-func (*Sysctl) ProtoMessage() {}
-func (*Sysctl) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{217}
-}
-func (m *Sysctl) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Sysctl) 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 *Sysctl) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Sysctl.Merge(m, src)
-}
-func (m *Sysctl) XXX_Size() int {
- return m.Size()
-}
-func (m *Sysctl) XXX_DiscardUnknown() {
- xxx_messageInfo_Sysctl.DiscardUnknown(m)
-}
+func (m *ScaleIOVolumeSource) Reset() { *m = ScaleIOVolumeSource{} }
-var xxx_messageInfo_Sysctl proto.InternalMessageInfo
+func (m *ScopeSelector) Reset() { *m = ScopeSelector{} }
-func (m *TCPSocketAction) Reset() { *m = TCPSocketAction{} }
-func (*TCPSocketAction) ProtoMessage() {}
-func (*TCPSocketAction) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{218}
-}
-func (m *TCPSocketAction) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TCPSocketAction) 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 *TCPSocketAction) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TCPSocketAction.Merge(m, src)
-}
-func (m *TCPSocketAction) XXX_Size() int {
- return m.Size()
-}
-func (m *TCPSocketAction) XXX_DiscardUnknown() {
- xxx_messageInfo_TCPSocketAction.DiscardUnknown(m)
-}
+func (m *ScopedResourceSelectorRequirement) Reset() { *m = ScopedResourceSelectorRequirement{} }
-var xxx_messageInfo_TCPSocketAction proto.InternalMessageInfo
+func (m *SeccompProfile) Reset() { *m = SeccompProfile{} }
-func (m *Taint) Reset() { *m = Taint{} }
-func (*Taint) ProtoMessage() {}
-func (*Taint) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{219}
-}
-func (m *Taint) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Taint) 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 *Taint) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Taint.Merge(m, src)
-}
-func (m *Taint) XXX_Size() int {
- return m.Size()
-}
-func (m *Taint) XXX_DiscardUnknown() {
- xxx_messageInfo_Taint.DiscardUnknown(m)
-}
+func (m *Secret) Reset() { *m = Secret{} }
-var xxx_messageInfo_Taint proto.InternalMessageInfo
+func (m *SecretEnvSource) Reset() { *m = SecretEnvSource{} }
-func (m *Toleration) Reset() { *m = Toleration{} }
-func (*Toleration) ProtoMessage() {}
-func (*Toleration) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{220}
-}
-func (m *Toleration) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Toleration) 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 *Toleration) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Toleration.Merge(m, src)
-}
-func (m *Toleration) XXX_Size() int {
- return m.Size()
-}
-func (m *Toleration) XXX_DiscardUnknown() {
- xxx_messageInfo_Toleration.DiscardUnknown(m)
-}
+func (m *SecretKeySelector) Reset() { *m = SecretKeySelector{} }
-var xxx_messageInfo_Toleration proto.InternalMessageInfo
+func (m *SecretList) Reset() { *m = SecretList{} }
-func (m *TopologySelectorLabelRequirement) Reset() { *m = TopologySelectorLabelRequirement{} }
-func (*TopologySelectorLabelRequirement) ProtoMessage() {}
-func (*TopologySelectorLabelRequirement) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{221}
-}
-func (m *TopologySelectorLabelRequirement) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TopologySelectorLabelRequirement) 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 *TopologySelectorLabelRequirement) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TopologySelectorLabelRequirement.Merge(m, src)
-}
-func (m *TopologySelectorLabelRequirement) XXX_Size() int {
- return m.Size()
-}
-func (m *TopologySelectorLabelRequirement) XXX_DiscardUnknown() {
- xxx_messageInfo_TopologySelectorLabelRequirement.DiscardUnknown(m)
-}
+func (m *SecretProjection) Reset() { *m = SecretProjection{} }
-var xxx_messageInfo_TopologySelectorLabelRequirement proto.InternalMessageInfo
+func (m *SecretReference) Reset() { *m = SecretReference{} }
-func (m *TopologySelectorTerm) Reset() { *m = TopologySelectorTerm{} }
-func (*TopologySelectorTerm) ProtoMessage() {}
-func (*TopologySelectorTerm) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{222}
-}
-func (m *TopologySelectorTerm) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TopologySelectorTerm) 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 *TopologySelectorTerm) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TopologySelectorTerm.Merge(m, src)
-}
-func (m *TopologySelectorTerm) XXX_Size() int {
- return m.Size()
-}
-func (m *TopologySelectorTerm) XXX_DiscardUnknown() {
- xxx_messageInfo_TopologySelectorTerm.DiscardUnknown(m)
-}
+func (m *SecretVolumeSource) Reset() { *m = SecretVolumeSource{} }
-var xxx_messageInfo_TopologySelectorTerm proto.InternalMessageInfo
+func (m *SecurityContext) Reset() { *m = SecurityContext{} }
-func (m *TopologySpreadConstraint) Reset() { *m = TopologySpreadConstraint{} }
-func (*TopologySpreadConstraint) ProtoMessage() {}
-func (*TopologySpreadConstraint) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{223}
-}
-func (m *TopologySpreadConstraint) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TopologySpreadConstraint) 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 *TopologySpreadConstraint) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TopologySpreadConstraint.Merge(m, src)
-}
-func (m *TopologySpreadConstraint) XXX_Size() int {
- return m.Size()
-}
-func (m *TopologySpreadConstraint) XXX_DiscardUnknown() {
- xxx_messageInfo_TopologySpreadConstraint.DiscardUnknown(m)
-}
+func (m *SerializedReference) Reset() { *m = SerializedReference{} }
-var xxx_messageInfo_TopologySpreadConstraint proto.InternalMessageInfo
+func (m *Service) Reset() { *m = Service{} }
-func (m *TypedLocalObjectReference) Reset() { *m = TypedLocalObjectReference{} }
-func (*TypedLocalObjectReference) ProtoMessage() {}
-func (*TypedLocalObjectReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{224}
-}
-func (m *TypedLocalObjectReference) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TypedLocalObjectReference) 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 *TypedLocalObjectReference) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TypedLocalObjectReference.Merge(m, src)
-}
-func (m *TypedLocalObjectReference) XXX_Size() int {
- return m.Size()
-}
-func (m *TypedLocalObjectReference) XXX_DiscardUnknown() {
- xxx_messageInfo_TypedLocalObjectReference.DiscardUnknown(m)
-}
+func (m *ServiceAccount) Reset() { *m = ServiceAccount{} }
-var xxx_messageInfo_TypedLocalObjectReference proto.InternalMessageInfo
+func (m *ServiceAccountList) Reset() { *m = ServiceAccountList{} }
-func (m *TypedObjectReference) Reset() { *m = TypedObjectReference{} }
-func (*TypedObjectReference) ProtoMessage() {}
-func (*TypedObjectReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{225}
-}
-func (m *TypedObjectReference) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TypedObjectReference) 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 *TypedObjectReference) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TypedObjectReference.Merge(m, src)
-}
-func (m *TypedObjectReference) XXX_Size() int {
- return m.Size()
-}
-func (m *TypedObjectReference) XXX_DiscardUnknown() {
- xxx_messageInfo_TypedObjectReference.DiscardUnknown(m)
-}
+func (m *ServiceAccountTokenProjection) Reset() { *m = ServiceAccountTokenProjection{} }
-var xxx_messageInfo_TypedObjectReference proto.InternalMessageInfo
+func (m *ServiceList) Reset() { *m = ServiceList{} }
-func (m *Volume) Reset() { *m = Volume{} }
-func (*Volume) ProtoMessage() {}
-func (*Volume) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{226}
-}
-func (m *Volume) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Volume) 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 *Volume) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Volume.Merge(m, src)
-}
-func (m *Volume) XXX_Size() int {
- return m.Size()
-}
-func (m *Volume) XXX_DiscardUnknown() {
- xxx_messageInfo_Volume.DiscardUnknown(m)
-}
+func (m *ServicePort) Reset() { *m = ServicePort{} }
-var xxx_messageInfo_Volume proto.InternalMessageInfo
+func (m *ServiceProxyOptions) Reset() { *m = ServiceProxyOptions{} }
-func (m *VolumeDevice) Reset() { *m = VolumeDevice{} }
-func (*VolumeDevice) ProtoMessage() {}
-func (*VolumeDevice) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{227}
-}
-func (m *VolumeDevice) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *VolumeDevice) 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 *VolumeDevice) XXX_Merge(src proto.Message) {
- xxx_messageInfo_VolumeDevice.Merge(m, src)
-}
-func (m *VolumeDevice) XXX_Size() int {
- return m.Size()
-}
-func (m *VolumeDevice) XXX_DiscardUnknown() {
- xxx_messageInfo_VolumeDevice.DiscardUnknown(m)
-}
+func (m *ServiceSpec) Reset() { *m = ServiceSpec{} }
-var xxx_messageInfo_VolumeDevice proto.InternalMessageInfo
+func (m *ServiceStatus) Reset() { *m = ServiceStatus{} }
-func (m *VolumeMount) Reset() { *m = VolumeMount{} }
-func (*VolumeMount) ProtoMessage() {}
-func (*VolumeMount) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{228}
-}
-func (m *VolumeMount) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *VolumeMount) 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 *VolumeMount) XXX_Merge(src proto.Message) {
- xxx_messageInfo_VolumeMount.Merge(m, src)
-}
-func (m *VolumeMount) XXX_Size() int {
- return m.Size()
-}
-func (m *VolumeMount) XXX_DiscardUnknown() {
- xxx_messageInfo_VolumeMount.DiscardUnknown(m)
-}
+func (m *SessionAffinityConfig) Reset() { *m = SessionAffinityConfig{} }
-var xxx_messageInfo_VolumeMount proto.InternalMessageInfo
+func (m *SleepAction) Reset() { *m = SleepAction{} }
-func (m *VolumeMountStatus) Reset() { *m = VolumeMountStatus{} }
-func (*VolumeMountStatus) ProtoMessage() {}
-func (*VolumeMountStatus) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{229}
-}
-func (m *VolumeMountStatus) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *VolumeMountStatus) 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 *VolumeMountStatus) XXX_Merge(src proto.Message) {
- xxx_messageInfo_VolumeMountStatus.Merge(m, src)
-}
-func (m *VolumeMountStatus) XXX_Size() int {
- return m.Size()
-}
-func (m *VolumeMountStatus) XXX_DiscardUnknown() {
- xxx_messageInfo_VolumeMountStatus.DiscardUnknown(m)
-}
+func (m *StorageOSPersistentVolumeSource) Reset() { *m = StorageOSPersistentVolumeSource{} }
-var xxx_messageInfo_VolumeMountStatus proto.InternalMessageInfo
+func (m *StorageOSVolumeSource) Reset() { *m = StorageOSVolumeSource{} }
-func (m *VolumeNodeAffinity) Reset() { *m = VolumeNodeAffinity{} }
-func (*VolumeNodeAffinity) ProtoMessage() {}
-func (*VolumeNodeAffinity) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{230}
-}
-func (m *VolumeNodeAffinity) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *VolumeNodeAffinity) 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 *VolumeNodeAffinity) XXX_Merge(src proto.Message) {
- xxx_messageInfo_VolumeNodeAffinity.Merge(m, src)
-}
-func (m *VolumeNodeAffinity) XXX_Size() int {
- return m.Size()
-}
-func (m *VolumeNodeAffinity) XXX_DiscardUnknown() {
- xxx_messageInfo_VolumeNodeAffinity.DiscardUnknown(m)
-}
+func (m *Sysctl) Reset() { *m = Sysctl{} }
-var xxx_messageInfo_VolumeNodeAffinity proto.InternalMessageInfo
+func (m *TCPSocketAction) Reset() { *m = TCPSocketAction{} }
-func (m *VolumeProjection) Reset() { *m = VolumeProjection{} }
-func (*VolumeProjection) ProtoMessage() {}
-func (*VolumeProjection) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{231}
-}
-func (m *VolumeProjection) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *VolumeProjection) 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 *VolumeProjection) XXX_Merge(src proto.Message) {
- xxx_messageInfo_VolumeProjection.Merge(m, src)
-}
-func (m *VolumeProjection) XXX_Size() int {
- return m.Size()
-}
-func (m *VolumeProjection) XXX_DiscardUnknown() {
- xxx_messageInfo_VolumeProjection.DiscardUnknown(m)
-}
+func (m *Taint) Reset() { *m = Taint{} }
-var xxx_messageInfo_VolumeProjection proto.InternalMessageInfo
+func (m *Toleration) Reset() { *m = Toleration{} }
-func (m *VolumeResourceRequirements) Reset() { *m = VolumeResourceRequirements{} }
-func (*VolumeResourceRequirements) ProtoMessage() {}
-func (*VolumeResourceRequirements) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{232}
-}
-func (m *VolumeResourceRequirements) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *VolumeResourceRequirements) 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 *VolumeResourceRequirements) XXX_Merge(src proto.Message) {
- xxx_messageInfo_VolumeResourceRequirements.Merge(m, src)
-}
-func (m *VolumeResourceRequirements) XXX_Size() int {
- return m.Size()
-}
-func (m *VolumeResourceRequirements) XXX_DiscardUnknown() {
- xxx_messageInfo_VolumeResourceRequirements.DiscardUnknown(m)
-}
+func (m *TopologySelectorLabelRequirement) Reset() { *m = TopologySelectorLabelRequirement{} }
-var xxx_messageInfo_VolumeResourceRequirements proto.InternalMessageInfo
+func (m *TopologySelectorTerm) Reset() { *m = TopologySelectorTerm{} }
-func (m *VolumeSource) Reset() { *m = VolumeSource{} }
-func (*VolumeSource) ProtoMessage() {}
-func (*VolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{233}
-}
-func (m *VolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *VolumeSource) 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 *VolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_VolumeSource.Merge(m, src)
-}
-func (m *VolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *VolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_VolumeSource.DiscardUnknown(m)
-}
+func (m *TopologySpreadConstraint) Reset() { *m = TopologySpreadConstraint{} }
-var xxx_messageInfo_VolumeSource proto.InternalMessageInfo
+func (m *TypedLocalObjectReference) Reset() { *m = TypedLocalObjectReference{} }
-func (m *VsphereVirtualDiskVolumeSource) Reset() { *m = VsphereVirtualDiskVolumeSource{} }
-func (*VsphereVirtualDiskVolumeSource) ProtoMessage() {}
-func (*VsphereVirtualDiskVolumeSource) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{234}
-}
-func (m *VsphereVirtualDiskVolumeSource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *VsphereVirtualDiskVolumeSource) 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 *VsphereVirtualDiskVolumeSource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_VsphereVirtualDiskVolumeSource.Merge(m, src)
-}
-func (m *VsphereVirtualDiskVolumeSource) XXX_Size() int {
- return m.Size()
-}
-func (m *VsphereVirtualDiskVolumeSource) XXX_DiscardUnknown() {
- xxx_messageInfo_VsphereVirtualDiskVolumeSource.DiscardUnknown(m)
-}
+func (m *TypedObjectReference) Reset() { *m = TypedObjectReference{} }
-var xxx_messageInfo_VsphereVirtualDiskVolumeSource proto.InternalMessageInfo
+func (m *Volume) Reset() { *m = Volume{} }
-func (m *WeightedPodAffinityTerm) Reset() { *m = WeightedPodAffinityTerm{} }
-func (*WeightedPodAffinityTerm) ProtoMessage() {}
-func (*WeightedPodAffinityTerm) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{235}
-}
-func (m *WeightedPodAffinityTerm) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *WeightedPodAffinityTerm) 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 *WeightedPodAffinityTerm) XXX_Merge(src proto.Message) {
- xxx_messageInfo_WeightedPodAffinityTerm.Merge(m, src)
-}
-func (m *WeightedPodAffinityTerm) XXX_Size() int {
- return m.Size()
-}
-func (m *WeightedPodAffinityTerm) XXX_DiscardUnknown() {
- xxx_messageInfo_WeightedPodAffinityTerm.DiscardUnknown(m)
-}
+func (m *VolumeDevice) Reset() { *m = VolumeDevice{} }
-var xxx_messageInfo_WeightedPodAffinityTerm proto.InternalMessageInfo
+func (m *VolumeMount) Reset() { *m = VolumeMount{} }
-func (m *WindowsSecurityContextOptions) Reset() { *m = WindowsSecurityContextOptions{} }
-func (*WindowsSecurityContextOptions) ProtoMessage() {}
-func (*WindowsSecurityContextOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_6c07b07c062484ab, []int{236}
-}
-func (m *WindowsSecurityContextOptions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *WindowsSecurityContextOptions) 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 *WindowsSecurityContextOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_WindowsSecurityContextOptions.Merge(m, src)
-}
-func (m *WindowsSecurityContextOptions) XXX_Size() int {
- return m.Size()
-}
-func (m *WindowsSecurityContextOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_WindowsSecurityContextOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_WindowsSecurityContextOptions proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*AWSElasticBlockStoreVolumeSource)(nil), "k8s.io.api.core.v1.AWSElasticBlockStoreVolumeSource")
- proto.RegisterType((*Affinity)(nil), "k8s.io.api.core.v1.Affinity")
- proto.RegisterType((*AppArmorProfile)(nil), "k8s.io.api.core.v1.AppArmorProfile")
- proto.RegisterType((*AttachedVolume)(nil), "k8s.io.api.core.v1.AttachedVolume")
- proto.RegisterType((*AvoidPods)(nil), "k8s.io.api.core.v1.AvoidPods")
- proto.RegisterType((*AzureDiskVolumeSource)(nil), "k8s.io.api.core.v1.AzureDiskVolumeSource")
- proto.RegisterType((*AzureFilePersistentVolumeSource)(nil), "k8s.io.api.core.v1.AzureFilePersistentVolumeSource")
- proto.RegisterType((*AzureFileVolumeSource)(nil), "k8s.io.api.core.v1.AzureFileVolumeSource")
- proto.RegisterType((*Binding)(nil), "k8s.io.api.core.v1.Binding")
- proto.RegisterType((*CSIPersistentVolumeSource)(nil), "k8s.io.api.core.v1.CSIPersistentVolumeSource")
- proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.core.v1.CSIPersistentVolumeSource.VolumeAttributesEntry")
- proto.RegisterType((*CSIVolumeSource)(nil), "k8s.io.api.core.v1.CSIVolumeSource")
- proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.core.v1.CSIVolumeSource.VolumeAttributesEntry")
- proto.RegisterType((*Capabilities)(nil), "k8s.io.api.core.v1.Capabilities")
- proto.RegisterType((*CephFSPersistentVolumeSource)(nil), "k8s.io.api.core.v1.CephFSPersistentVolumeSource")
- 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((*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")
- proto.RegisterType((*ComponentStatus)(nil), "k8s.io.api.core.v1.ComponentStatus")
- proto.RegisterType((*ComponentStatusList)(nil), "k8s.io.api.core.v1.ComponentStatusList")
- proto.RegisterType((*ConfigMap)(nil), "k8s.io.api.core.v1.ConfigMap")
- proto.RegisterMapType((map[string][]byte)(nil), "k8s.io.api.core.v1.ConfigMap.BinaryDataEntry")
- proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.core.v1.ConfigMap.DataEntry")
- proto.RegisterType((*ConfigMapEnvSource)(nil), "k8s.io.api.core.v1.ConfigMapEnvSource")
- proto.RegisterType((*ConfigMapKeySelector)(nil), "k8s.io.api.core.v1.ConfigMapKeySelector")
- proto.RegisterType((*ConfigMapList)(nil), "k8s.io.api.core.v1.ConfigMapList")
- proto.RegisterType((*ConfigMapNodeConfigSource)(nil), "k8s.io.api.core.v1.ConfigMapNodeConfigSource")
- proto.RegisterType((*ConfigMapProjection)(nil), "k8s.io.api.core.v1.ConfigMapProjection")
- proto.RegisterType((*ConfigMapVolumeSource)(nil), "k8s.io.api.core.v1.ConfigMapVolumeSource")
- proto.RegisterType((*Container)(nil), "k8s.io.api.core.v1.Container")
- proto.RegisterType((*ContainerExtendedResourceRequest)(nil), "k8s.io.api.core.v1.ContainerExtendedResourceRequest")
- proto.RegisterType((*ContainerImage)(nil), "k8s.io.api.core.v1.ContainerImage")
- proto.RegisterType((*ContainerPort)(nil), "k8s.io.api.core.v1.ContainerPort")
- proto.RegisterType((*ContainerResizePolicy)(nil), "k8s.io.api.core.v1.ContainerResizePolicy")
- proto.RegisterType((*ContainerRestartRule)(nil), "k8s.io.api.core.v1.ContainerRestartRule")
- proto.RegisterType((*ContainerRestartRuleOnExitCodes)(nil), "k8s.io.api.core.v1.ContainerRestartRuleOnExitCodes")
- proto.RegisterType((*ContainerState)(nil), "k8s.io.api.core.v1.ContainerState")
- proto.RegisterType((*ContainerStateRunning)(nil), "k8s.io.api.core.v1.ContainerStateRunning")
- proto.RegisterType((*ContainerStateTerminated)(nil), "k8s.io.api.core.v1.ContainerStateTerminated")
- 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")
- proto.RegisterType((*DownwardAPIVolumeSource)(nil), "k8s.io.api.core.v1.DownwardAPIVolumeSource")
- proto.RegisterType((*EmptyDirVolumeSource)(nil), "k8s.io.api.core.v1.EmptyDirVolumeSource")
- proto.RegisterType((*EndpointAddress)(nil), "k8s.io.api.core.v1.EndpointAddress")
- proto.RegisterType((*EndpointPort)(nil), "k8s.io.api.core.v1.EndpointPort")
- proto.RegisterType((*EndpointSubset)(nil), "k8s.io.api.core.v1.EndpointSubset")
- proto.RegisterType((*Endpoints)(nil), "k8s.io.api.core.v1.Endpoints")
- proto.RegisterType((*EndpointsList)(nil), "k8s.io.api.core.v1.EndpointsList")
- proto.RegisterType((*EnvFromSource)(nil), "k8s.io.api.core.v1.EnvFromSource")
- proto.RegisterType((*EnvVar)(nil), "k8s.io.api.core.v1.EnvVar")
- proto.RegisterType((*EnvVarSource)(nil), "k8s.io.api.core.v1.EnvVarSource")
- proto.RegisterType((*EphemeralContainer)(nil), "k8s.io.api.core.v1.EphemeralContainer")
- proto.RegisterType((*EphemeralContainerCommon)(nil), "k8s.io.api.core.v1.EphemeralContainerCommon")
- proto.RegisterType((*EphemeralVolumeSource)(nil), "k8s.io.api.core.v1.EphemeralVolumeSource")
- proto.RegisterType((*Event)(nil), "k8s.io.api.core.v1.Event")
- proto.RegisterType((*EventList)(nil), "k8s.io.api.core.v1.EventList")
- proto.RegisterType((*EventSeries)(nil), "k8s.io.api.core.v1.EventSeries")
- proto.RegisterType((*EventSource)(nil), "k8s.io.api.core.v1.EventSource")
- proto.RegisterType((*ExecAction)(nil), "k8s.io.api.core.v1.ExecAction")
- proto.RegisterType((*FCVolumeSource)(nil), "k8s.io.api.core.v1.FCVolumeSource")
- proto.RegisterType((*FileKeySelector)(nil), "k8s.io.api.core.v1.FileKeySelector")
- proto.RegisterType((*FlexPersistentVolumeSource)(nil), "k8s.io.api.core.v1.FlexPersistentVolumeSource")
- proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.core.v1.FlexPersistentVolumeSource.OptionsEntry")
- proto.RegisterType((*FlexVolumeSource)(nil), "k8s.io.api.core.v1.FlexVolumeSource")
- proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.core.v1.FlexVolumeSource.OptionsEntry")
- proto.RegisterType((*FlockerVolumeSource)(nil), "k8s.io.api.core.v1.FlockerVolumeSource")
- proto.RegisterType((*GCEPersistentDiskVolumeSource)(nil), "k8s.io.api.core.v1.GCEPersistentDiskVolumeSource")
- proto.RegisterType((*GRPCAction)(nil), "k8s.io.api.core.v1.GRPCAction")
- proto.RegisterType((*GitRepoVolumeSource)(nil), "k8s.io.api.core.v1.GitRepoVolumeSource")
- proto.RegisterType((*GlusterfsPersistentVolumeSource)(nil), "k8s.io.api.core.v1.GlusterfsPersistentVolumeSource")
- proto.RegisterType((*GlusterfsVolumeSource)(nil), "k8s.io.api.core.v1.GlusterfsVolumeSource")
- proto.RegisterType((*HTTPGetAction)(nil), "k8s.io.api.core.v1.HTTPGetAction")
- proto.RegisterType((*HTTPHeader)(nil), "k8s.io.api.core.v1.HTTPHeader")
- proto.RegisterType((*HostAlias)(nil), "k8s.io.api.core.v1.HostAlias")
- proto.RegisterType((*HostIP)(nil), "k8s.io.api.core.v1.HostIP")
- 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")
- proto.RegisterType((*LimitRange)(nil), "k8s.io.api.core.v1.LimitRange")
- proto.RegisterType((*LimitRangeItem)(nil), "k8s.io.api.core.v1.LimitRangeItem")
- proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.LimitRangeItem.DefaultEntry")
- proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.LimitRangeItem.DefaultRequestEntry")
- proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.LimitRangeItem.MaxEntry")
- proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.LimitRangeItem.MaxLimitRequestRatioEntry")
- 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")
- proto.RegisterType((*LocalObjectReference)(nil), "k8s.io.api.core.v1.LocalObjectReference")
- proto.RegisterType((*LocalVolumeSource)(nil), "k8s.io.api.core.v1.LocalVolumeSource")
- proto.RegisterType((*ModifyVolumeStatus)(nil), "k8s.io.api.core.v1.ModifyVolumeStatus")
- proto.RegisterType((*NFSVolumeSource)(nil), "k8s.io.api.core.v1.NFSVolumeSource")
- proto.RegisterType((*Namespace)(nil), "k8s.io.api.core.v1.Namespace")
- proto.RegisterType((*NamespaceCondition)(nil), "k8s.io.api.core.v1.NamespaceCondition")
- proto.RegisterType((*NamespaceList)(nil), "k8s.io.api.core.v1.NamespaceList")
- proto.RegisterType((*NamespaceSpec)(nil), "k8s.io.api.core.v1.NamespaceSpec")
- proto.RegisterType((*NamespaceStatus)(nil), "k8s.io.api.core.v1.NamespaceStatus")
- proto.RegisterType((*Node)(nil), "k8s.io.api.core.v1.Node")
- proto.RegisterType((*NodeAddress)(nil), "k8s.io.api.core.v1.NodeAddress")
- proto.RegisterType((*NodeAffinity)(nil), "k8s.io.api.core.v1.NodeAffinity")
- proto.RegisterType((*NodeCondition)(nil), "k8s.io.api.core.v1.NodeCondition")
- 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")
- proto.RegisterType((*NodeRuntimeHandlerFeatures)(nil), "k8s.io.api.core.v1.NodeRuntimeHandlerFeatures")
- proto.RegisterType((*NodeSelector)(nil), "k8s.io.api.core.v1.NodeSelector")
- proto.RegisterType((*NodeSelectorRequirement)(nil), "k8s.io.api.core.v1.NodeSelectorRequirement")
- proto.RegisterType((*NodeSelectorTerm)(nil), "k8s.io.api.core.v1.NodeSelectorTerm")
- proto.RegisterType((*NodeSpec)(nil), "k8s.io.api.core.v1.NodeSpec")
- proto.RegisterType((*NodeStatus)(nil), "k8s.io.api.core.v1.NodeStatus")
- proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.NodeStatus.AllocatableEntry")
- proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.NodeStatus.CapacityEntry")
- proto.RegisterType((*NodeSwapStatus)(nil), "k8s.io.api.core.v1.NodeSwapStatus")
- proto.RegisterType((*NodeSystemInfo)(nil), "k8s.io.api.core.v1.NodeSystemInfo")
- proto.RegisterType((*ObjectFieldSelector)(nil), "k8s.io.api.core.v1.ObjectFieldSelector")
- proto.RegisterType((*ObjectReference)(nil), "k8s.io.api.core.v1.ObjectReference")
- proto.RegisterType((*PersistentVolume)(nil), "k8s.io.api.core.v1.PersistentVolume")
- proto.RegisterType((*PersistentVolumeClaim)(nil), "k8s.io.api.core.v1.PersistentVolumeClaim")
- proto.RegisterType((*PersistentVolumeClaimCondition)(nil), "k8s.io.api.core.v1.PersistentVolumeClaimCondition")
- proto.RegisterType((*PersistentVolumeClaimList)(nil), "k8s.io.api.core.v1.PersistentVolumeClaimList")
- proto.RegisterType((*PersistentVolumeClaimSpec)(nil), "k8s.io.api.core.v1.PersistentVolumeClaimSpec")
- proto.RegisterType((*PersistentVolumeClaimStatus)(nil), "k8s.io.api.core.v1.PersistentVolumeClaimStatus")
- proto.RegisterMapType((map[ResourceName]ClaimResourceStatus)(nil), "k8s.io.api.core.v1.PersistentVolumeClaimStatus.AllocatedResourceStatusesEntry")
- proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.PersistentVolumeClaimStatus.AllocatedResourcesEntry")
- proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.PersistentVolumeClaimStatus.CapacityEntry")
- proto.RegisterType((*PersistentVolumeClaimTemplate)(nil), "k8s.io.api.core.v1.PersistentVolumeClaimTemplate")
- proto.RegisterType((*PersistentVolumeClaimVolumeSource)(nil), "k8s.io.api.core.v1.PersistentVolumeClaimVolumeSource")
- proto.RegisterType((*PersistentVolumeList)(nil), "k8s.io.api.core.v1.PersistentVolumeList")
- proto.RegisterType((*PersistentVolumeSource)(nil), "k8s.io.api.core.v1.PersistentVolumeSource")
- proto.RegisterType((*PersistentVolumeSpec)(nil), "k8s.io.api.core.v1.PersistentVolumeSpec")
- proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.PersistentVolumeSpec.CapacityEntry")
- proto.RegisterType((*PersistentVolumeStatus)(nil), "k8s.io.api.core.v1.PersistentVolumeStatus")
- proto.RegisterType((*PhotonPersistentDiskVolumeSource)(nil), "k8s.io.api.core.v1.PhotonPersistentDiskVolumeSource")
- proto.RegisterType((*Pod)(nil), "k8s.io.api.core.v1.Pod")
- proto.RegisterType((*PodAffinity)(nil), "k8s.io.api.core.v1.PodAffinity")
- proto.RegisterType((*PodAffinityTerm)(nil), "k8s.io.api.core.v1.PodAffinityTerm")
- proto.RegisterType((*PodAntiAffinity)(nil), "k8s.io.api.core.v1.PodAntiAffinity")
- proto.RegisterType((*PodAttachOptions)(nil), "k8s.io.api.core.v1.PodAttachOptions")
- proto.RegisterType((*PodCertificateProjection)(nil), "k8s.io.api.core.v1.PodCertificateProjection")
- proto.RegisterType((*PodCondition)(nil), "k8s.io.api.core.v1.PodCondition")
- proto.RegisterType((*PodDNSConfig)(nil), "k8s.io.api.core.v1.PodDNSConfig")
- proto.RegisterType((*PodDNSConfigOption)(nil), "k8s.io.api.core.v1.PodDNSConfigOption")
- proto.RegisterType((*PodExecOptions)(nil), "k8s.io.api.core.v1.PodExecOptions")
- proto.RegisterType((*PodExtendedResourceClaimStatus)(nil), "k8s.io.api.core.v1.PodExtendedResourceClaimStatus")
- proto.RegisterType((*PodIP)(nil), "k8s.io.api.core.v1.PodIP")
- proto.RegisterType((*PodList)(nil), "k8s.io.api.core.v1.PodList")
- proto.RegisterType((*PodLogOptions)(nil), "k8s.io.api.core.v1.PodLogOptions")
- proto.RegisterType((*PodOS)(nil), "k8s.io.api.core.v1.PodOS")
- proto.RegisterType((*PodPortForwardOptions)(nil), "k8s.io.api.core.v1.PodPortForwardOptions")
- proto.RegisterType((*PodProxyOptions)(nil), "k8s.io.api.core.v1.PodProxyOptions")
- proto.RegisterType((*PodReadinessGate)(nil), "k8s.io.api.core.v1.PodReadinessGate")
- proto.RegisterType((*PodResourceClaim)(nil), "k8s.io.api.core.v1.PodResourceClaim")
- proto.RegisterType((*PodResourceClaimStatus)(nil), "k8s.io.api.core.v1.PodResourceClaimStatus")
- proto.RegisterType((*PodSchedulingGate)(nil), "k8s.io.api.core.v1.PodSchedulingGate")
- proto.RegisterType((*PodSecurityContext)(nil), "k8s.io.api.core.v1.PodSecurityContext")
- proto.RegisterType((*PodSignature)(nil), "k8s.io.api.core.v1.PodSignature")
- proto.RegisterType((*PodSpec)(nil), "k8s.io.api.core.v1.PodSpec")
- proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.core.v1.PodSpec.NodeSelectorEntry")
- proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.PodSpec.OverheadEntry")
- proto.RegisterType((*PodStatus)(nil), "k8s.io.api.core.v1.PodStatus")
- proto.RegisterType((*PodStatusResult)(nil), "k8s.io.api.core.v1.PodStatusResult")
- proto.RegisterType((*PodTemplate)(nil), "k8s.io.api.core.v1.PodTemplate")
- proto.RegisterType((*PodTemplateList)(nil), "k8s.io.api.core.v1.PodTemplateList")
- proto.RegisterType((*PodTemplateSpec)(nil), "k8s.io.api.core.v1.PodTemplateSpec")
- proto.RegisterType((*PortStatus)(nil), "k8s.io.api.core.v1.PortStatus")
- proto.RegisterType((*PortworxVolumeSource)(nil), "k8s.io.api.core.v1.PortworxVolumeSource")
- proto.RegisterType((*Preconditions)(nil), "k8s.io.api.core.v1.Preconditions")
- proto.RegisterType((*PreferAvoidPodsEntry)(nil), "k8s.io.api.core.v1.PreferAvoidPodsEntry")
- proto.RegisterType((*PreferredSchedulingTerm)(nil), "k8s.io.api.core.v1.PreferredSchedulingTerm")
- proto.RegisterType((*Probe)(nil), "k8s.io.api.core.v1.Probe")
- proto.RegisterType((*ProbeHandler)(nil), "k8s.io.api.core.v1.ProbeHandler")
- proto.RegisterType((*ProjectedVolumeSource)(nil), "k8s.io.api.core.v1.ProjectedVolumeSource")
- proto.RegisterType((*QuobyteVolumeSource)(nil), "k8s.io.api.core.v1.QuobyteVolumeSource")
- proto.RegisterType((*RBDPersistentVolumeSource)(nil), "k8s.io.api.core.v1.RBDPersistentVolumeSource")
- proto.RegisterType((*RBDVolumeSource)(nil), "k8s.io.api.core.v1.RBDVolumeSource")
- proto.RegisterType((*RangeAllocation)(nil), "k8s.io.api.core.v1.RangeAllocation")
- proto.RegisterType((*ReplicationController)(nil), "k8s.io.api.core.v1.ReplicationController")
- proto.RegisterType((*ReplicationControllerCondition)(nil), "k8s.io.api.core.v1.ReplicationControllerCondition")
- proto.RegisterType((*ReplicationControllerList)(nil), "k8s.io.api.core.v1.ReplicationControllerList")
- proto.RegisterType((*ReplicationControllerSpec)(nil), "k8s.io.api.core.v1.ReplicationControllerSpec")
- proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.core.v1.ReplicationControllerSpec.SelectorEntry")
- 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")
- proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.ResourceQuotaSpec.HardEntry")
- proto.RegisterType((*ResourceQuotaStatus)(nil), "k8s.io.api.core.v1.ResourceQuotaStatus")
- proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.ResourceQuotaStatus.HardEntry")
- proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.ResourceQuotaStatus.UsedEntry")
- 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")
- proto.RegisterType((*ScopeSelector)(nil), "k8s.io.api.core.v1.ScopeSelector")
- proto.RegisterType((*ScopedResourceSelectorRequirement)(nil), "k8s.io.api.core.v1.ScopedResourceSelectorRequirement")
- proto.RegisterType((*SeccompProfile)(nil), "k8s.io.api.core.v1.SeccompProfile")
- proto.RegisterType((*Secret)(nil), "k8s.io.api.core.v1.Secret")
- proto.RegisterMapType((map[string][]byte)(nil), "k8s.io.api.core.v1.Secret.DataEntry")
- proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.core.v1.Secret.StringDataEntry")
- proto.RegisterType((*SecretEnvSource)(nil), "k8s.io.api.core.v1.SecretEnvSource")
- proto.RegisterType((*SecretKeySelector)(nil), "k8s.io.api.core.v1.SecretKeySelector")
- proto.RegisterType((*SecretList)(nil), "k8s.io.api.core.v1.SecretList")
- proto.RegisterType((*SecretProjection)(nil), "k8s.io.api.core.v1.SecretProjection")
- proto.RegisterType((*SecretReference)(nil), "k8s.io.api.core.v1.SecretReference")
- proto.RegisterType((*SecretVolumeSource)(nil), "k8s.io.api.core.v1.SecretVolumeSource")
- proto.RegisterType((*SecurityContext)(nil), "k8s.io.api.core.v1.SecurityContext")
- proto.RegisterType((*SerializedReference)(nil), "k8s.io.api.core.v1.SerializedReference")
- proto.RegisterType((*Service)(nil), "k8s.io.api.core.v1.Service")
- proto.RegisterType((*ServiceAccount)(nil), "k8s.io.api.core.v1.ServiceAccount")
- proto.RegisterType((*ServiceAccountList)(nil), "k8s.io.api.core.v1.ServiceAccountList")
- proto.RegisterType((*ServiceAccountTokenProjection)(nil), "k8s.io.api.core.v1.ServiceAccountTokenProjection")
- proto.RegisterType((*ServiceList)(nil), "k8s.io.api.core.v1.ServiceList")
- proto.RegisterType((*ServicePort)(nil), "k8s.io.api.core.v1.ServicePort")
- proto.RegisterType((*ServiceProxyOptions)(nil), "k8s.io.api.core.v1.ServiceProxyOptions")
- proto.RegisterType((*ServiceSpec)(nil), "k8s.io.api.core.v1.ServiceSpec")
- proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.core.v1.ServiceSpec.SelectorEntry")
- proto.RegisterType((*ServiceStatus)(nil), "k8s.io.api.core.v1.ServiceStatus")
- proto.RegisterType((*SessionAffinityConfig)(nil), "k8s.io.api.core.v1.SessionAffinityConfig")
- proto.RegisterType((*SleepAction)(nil), "k8s.io.api.core.v1.SleepAction")
- proto.RegisterType((*StorageOSPersistentVolumeSource)(nil), "k8s.io.api.core.v1.StorageOSPersistentVolumeSource")
- proto.RegisterType((*StorageOSVolumeSource)(nil), "k8s.io.api.core.v1.StorageOSVolumeSource")
- proto.RegisterType((*Sysctl)(nil), "k8s.io.api.core.v1.Sysctl")
- proto.RegisterType((*TCPSocketAction)(nil), "k8s.io.api.core.v1.TCPSocketAction")
- proto.RegisterType((*Taint)(nil), "k8s.io.api.core.v1.Taint")
- proto.RegisterType((*Toleration)(nil), "k8s.io.api.core.v1.Toleration")
- proto.RegisterType((*TopologySelectorLabelRequirement)(nil), "k8s.io.api.core.v1.TopologySelectorLabelRequirement")
- proto.RegisterType((*TopologySelectorTerm)(nil), "k8s.io.api.core.v1.TopologySelectorTerm")
- proto.RegisterType((*TopologySpreadConstraint)(nil), "k8s.io.api.core.v1.TopologySpreadConstraint")
- proto.RegisterType((*TypedLocalObjectReference)(nil), "k8s.io.api.core.v1.TypedLocalObjectReference")
- proto.RegisterType((*TypedObjectReference)(nil), "k8s.io.api.core.v1.TypedObjectReference")
- proto.RegisterType((*Volume)(nil), "k8s.io.api.core.v1.Volume")
- proto.RegisterType((*VolumeDevice)(nil), "k8s.io.api.core.v1.VolumeDevice")
- proto.RegisterType((*VolumeMount)(nil), "k8s.io.api.core.v1.VolumeMount")
- proto.RegisterType((*VolumeMountStatus)(nil), "k8s.io.api.core.v1.VolumeMountStatus")
- proto.RegisterType((*VolumeNodeAffinity)(nil), "k8s.io.api.core.v1.VolumeNodeAffinity")
- proto.RegisterType((*VolumeProjection)(nil), "k8s.io.api.core.v1.VolumeProjection")
- proto.RegisterType((*VolumeResourceRequirements)(nil), "k8s.io.api.core.v1.VolumeResourceRequirements")
- proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.VolumeResourceRequirements.LimitsEntry")
- proto.RegisterMapType((ResourceList)(nil), "k8s.io.api.core.v1.VolumeResourceRequirements.RequestsEntry")
- proto.RegisterType((*VolumeSource)(nil), "k8s.io.api.core.v1.VolumeSource")
- proto.RegisterType((*VsphereVirtualDiskVolumeSource)(nil), "k8s.io.api.core.v1.VsphereVirtualDiskVolumeSource")
- proto.RegisterType((*WeightedPodAffinityTerm)(nil), "k8s.io.api.core.v1.WeightedPodAffinityTerm")
- proto.RegisterType((*WindowsSecurityContextOptions)(nil), "k8s.io.api.core.v1.WindowsSecurityContextOptions")
-}
-
-func init() {
- proto.RegisterFile("k8s.io/api/core/v1/generated.proto", fileDescriptor_6c07b07c062484ab)
-}
-
-var fileDescriptor_6c07b07c062484ab = []byte{
- // 16665 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x5b, 0x90, 0x5c, 0x49,
- 0x76, 0x18, 0xb6, 0xb7, 0xaa, 0x9f, 0xa7, 0xdf, 0x89, 0x57, 0xa1, 0x07, 0x40, 0x61, 0xee, 0xcc,
- 0x60, 0x30, 0x3b, 0x33, 0x8d, 0xc5, 0x3c, 0x76, 0xb1, 0x33, 0xb3, 0xc3, 0xe9, 0x27, 0xd0, 0x03,
- 0x74, 0xa3, 0x26, 0xab, 0x01, 0xec, 0x63, 0x76, 0xb5, 0x17, 0x55, 0xd9, 0xdd, 0x77, 0xbb, 0xea,
- 0xde, 0x9a, 0x7b, 0x6f, 0x35, 0xd0, 0x30, 0x15, 0xa4, 0x56, 0xe6, 0x4a, 0x4b, 0xd2, 0x11, 0x1b,
- 0x0a, 0x4b, 0x72, 0x90, 0x0a, 0x7e, 0xe8, 0x45, 0xd2, 0xb4, 0x64, 0x52, 0xa4, 0x45, 0x59, 0x14,
- 0x29, 0xda, 0x96, 0x23, 0x68, 0x7f, 0xc8, 0x14, 0x23, 0xcc, 0x65, 0x58, 0xe1, 0x96, 0xd9, 0xb6,
- 0x42, 0xc1, 0x0f, 0x53, 0x0a, 0xda, 0x1f, 0x76, 0x87, 0x6c, 0x2a, 0xf2, 0x79, 0x33, 0xef, 0xab,
- 0xaa, 0x31, 0x40, 0xef, 0x70, 0x63, 0xfe, 0xaa, 0xf2, 0x9c, 0x3c, 0x99, 0x37, 0x1f, 0x27, 0x4f,
- 0x9e, 0x73, 0xf2, 0x1c, 0xb0, 0x77, 0xae, 0x85, 0x73, 0xae, 0x7f, 0xc5, 0xe9, 0xb8, 0x57, 0x1a,
- 0x7e, 0x40, 0xae, 0xec, 0x5e, 0xbd, 0xb2, 0x45, 0x3c, 0x12, 0x38, 0x11, 0x69, 0xce, 0x75, 0x02,
- 0x3f, 0xf2, 0x11, 0xe2, 0x38, 0x73, 0x4e, 0xc7, 0x9d, 0xa3, 0x38, 0x73, 0xbb, 0x57, 0x67, 0x5f,
- 0xdd, 0x72, 0xa3, 0xed, 0xee, 0xfd, 0xb9, 0x86, 0xdf, 0xbe, 0xb2, 0xe5, 0x6f, 0xf9, 0x57, 0x18,
- 0xea, 0xfd, 0xee, 0x26, 0xfb, 0xc7, 0xfe, 0xb0, 0x5f, 0x9c, 0xc4, 0xec, 0x1b, 0x71, 0x33, 0x6d,
- 0xa7, 0xb1, 0xed, 0x7a, 0x24, 0xd8, 0xbb, 0xd2, 0xd9, 0xd9, 0x62, 0xed, 0x06, 0x24, 0xf4, 0xbb,
- 0x41, 0x83, 0x24, 0x1b, 0x2e, 0xac, 0x15, 0x5e, 0x69, 0x93, 0xc8, 0xc9, 0xe8, 0xee, 0xec, 0x95,
- 0xbc, 0x5a, 0x41, 0xd7, 0x8b, 0xdc, 0x76, 0xba, 0x99, 0xcf, 0xf7, 0xaa, 0x10, 0x36, 0xb6, 0x49,
- 0xdb, 0x49, 0xd5, 0x7b, 0x3d, 0xaf, 0x5e, 0x37, 0x72, 0x5b, 0x57, 0x5c, 0x2f, 0x0a, 0xa3, 0x20,
- 0x59, 0xc9, 0xfe, 0xbe, 0x05, 0x17, 0xe7, 0xef, 0xd5, 0x97, 0x5b, 0x4e, 0x18, 0xb9, 0x8d, 0x85,
- 0x96, 0xdf, 0xd8, 0xa9, 0x47, 0x7e, 0x40, 0xee, 0xfa, 0xad, 0x6e, 0x9b, 0xd4, 0xd9, 0x40, 0xa0,
- 0x57, 0x60, 0x64, 0x97, 0xfd, 0x5f, 0x5d, 0xaa, 0x58, 0x17, 0xad, 0xcb, 0xa3, 0x0b, 0xd3, 0xbf,
- 0xb3, 0x5f, 0xfd, 0xcc, 0xc1, 0x7e, 0x75, 0xe4, 0xae, 0x28, 0xc7, 0x0a, 0x03, 0x5d, 0x82, 0xa1,
- 0xcd, 0x70, 0x63, 0xaf, 0x43, 0x2a, 0x25, 0x86, 0x3b, 0x29, 0x70, 0x87, 0x56, 0xea, 0xb4, 0x14,
- 0x0b, 0x28, 0xba, 0x02, 0xa3, 0x1d, 0x27, 0x88, 0xdc, 0xc8, 0xf5, 0xbd, 0x4a, 0xf9, 0xa2, 0x75,
- 0x79, 0x70, 0x61, 0x46, 0xa0, 0x8e, 0xd6, 0x24, 0x00, 0xc7, 0x38, 0xb4, 0x1b, 0x01, 0x71, 0x9a,
- 0xb7, 0xbd, 0xd6, 0x5e, 0x65, 0xe0, 0xa2, 0x75, 0x79, 0x24, 0xee, 0x06, 0x16, 0xe5, 0x58, 0x61,
- 0xd8, 0x3f, 0x53, 0x82, 0x91, 0xf9, 0xcd, 0x4d, 0xd7, 0x73, 0xa3, 0x3d, 0x74, 0x17, 0xc6, 0x3d,
- 0xbf, 0x49, 0xe4, 0x7f, 0xf6, 0x15, 0x63, 0xaf, 0x5d, 0x9c, 0x4b, 0x2f, 0xa5, 0xb9, 0x75, 0x0d,
- 0x6f, 0x61, 0xfa, 0x60, 0xbf, 0x3a, 0xae, 0x97, 0x60, 0x83, 0x0e, 0xc2, 0x30, 0xd6, 0xf1, 0x9b,
- 0x8a, 0x6c, 0x89, 0x91, 0xad, 0x66, 0x91, 0xad, 0xc5, 0x68, 0x0b, 0x53, 0x07, 0xfb, 0xd5, 0x31,
- 0xad, 0x00, 0xeb, 0x44, 0xd0, 0x7d, 0x98, 0xa2, 0x7f, 0xbd, 0xc8, 0x55, 0x74, 0xcb, 0x8c, 0xee,
- 0x73, 0x79, 0x74, 0x35, 0xd4, 0x85, 0x13, 0x07, 0xfb, 0xd5, 0xa9, 0x44, 0x21, 0x4e, 0x12, 0xb4,
- 0x7f, 0xda, 0x82, 0xa9, 0xf9, 0x4e, 0x67, 0x3e, 0x68, 0xfb, 0x41, 0x2d, 0xf0, 0x37, 0xdd, 0x16,
- 0x41, 0x5f, 0x80, 0x81, 0x88, 0xce, 0x1a, 0x9f, 0xe1, 0xe7, 0xc4, 0xd0, 0x0e, 0xd0, 0xb9, 0x3a,
- 0xdc, 0xaf, 0x9e, 0x48, 0xa0, 0xb3, 0xa9, 0x64, 0x15, 0xd0, 0x7b, 0x30, 0xdd, 0xf2, 0x1b, 0x4e,
- 0x6b, 0xdb, 0x0f, 0x23, 0x01, 0x15, 0x53, 0x7f, 0xf2, 0x60, 0xbf, 0x3a, 0x7d, 0x2b, 0x01, 0xc3,
- 0x29, 0x6c, 0xfb, 0x11, 0x4c, 0xce, 0x47, 0x91, 0xd3, 0xd8, 0x26, 0x4d, 0xbe, 0xa0, 0xd0, 0x1b,
- 0x30, 0xe0, 0x39, 0x6d, 0xd9, 0x99, 0x8b, 0xb2, 0x33, 0xeb, 0x4e, 0x9b, 0x76, 0x66, 0xfa, 0x8e,
- 0xe7, 0x7e, 0xd4, 0x15, 0x8b, 0x94, 0x96, 0x61, 0x86, 0x8d, 0x5e, 0x03, 0x68, 0x92, 0x5d, 0xb7,
- 0x41, 0x6a, 0x4e, 0xb4, 0x2d, 0xfa, 0x80, 0x44, 0x5d, 0x58, 0x52, 0x10, 0xac, 0x61, 0xd9, 0x0f,
- 0x61, 0x74, 0x7e, 0xd7, 0x77, 0x9b, 0x35, 0xbf, 0x19, 0xa2, 0x1d, 0x98, 0xea, 0x04, 0x64, 0x93,
- 0x04, 0xaa, 0xa8, 0x62, 0x5d, 0x2c, 0x5f, 0x1e, 0x7b, 0xed, 0x72, 0xe6, 0xd8, 0x9b, 0xa8, 0xcb,
- 0x5e, 0x14, 0xec, 0x2d, 0x9c, 0x11, 0xed, 0x4d, 0x25, 0xa0, 0x38, 0x49, 0xd9, 0xfe, 0x67, 0x25,
- 0x38, 0x35, 0xff, 0xa8, 0x1b, 0x90, 0x25, 0x37, 0xdc, 0x49, 0x6e, 0xb8, 0xa6, 0x1b, 0xee, 0xac,
- 0xc7, 0x23, 0xa0, 0x56, 0xfa, 0x92, 0x28, 0xc7, 0x0a, 0x03, 0xbd, 0x0a, 0xc3, 0xf4, 0xf7, 0x1d,
- 0xbc, 0x2a, 0x3e, 0xf9, 0x84, 0x40, 0x1e, 0x5b, 0x72, 0x22, 0x67, 0x89, 0x83, 0xb0, 0xc4, 0x41,
- 0x6b, 0x30, 0xd6, 0x60, 0xfc, 0x61, 0x6b, 0xcd, 0x6f, 0x12, 0xb6, 0xb6, 0x46, 0x17, 0x5e, 0xa6,
- 0xe8, 0x8b, 0x71, 0xf1, 0xe1, 0x7e, 0xb5, 0xc2, 0xfb, 0x26, 0x48, 0x68, 0x30, 0xac, 0xd7, 0x47,
- 0xb6, 0xda, 0xee, 0x03, 0x8c, 0x12, 0x64, 0x6c, 0xf5, 0xcb, 0xda, 0xce, 0x1d, 0x64, 0x3b, 0x77,
- 0x3c, 0x7b, 0xd7, 0xa2, 0xab, 0x30, 0xb0, 0xe3, 0x7a, 0xcd, 0xca, 0x10, 0xa3, 0x75, 0x9e, 0xce,
- 0xf9, 0x4d, 0xd7, 0x6b, 0x1e, 0xee, 0x57, 0x67, 0x8c, 0xee, 0xd0, 0x42, 0xcc, 0x50, 0xed, 0xff,
- 0xcb, 0x82, 0x2a, 0x83, 0xad, 0xb8, 0x2d, 0x52, 0x23, 0x41, 0xe8, 0x86, 0x11, 0xf1, 0x22, 0x63,
- 0x40, 0x5f, 0x03, 0x08, 0x49, 0x23, 0x20, 0x91, 0x36, 0xa4, 0x6a, 0x61, 0xd4, 0x15, 0x04, 0x6b,
- 0x58, 0x94, 0x3f, 0x85, 0xdb, 0x4e, 0xc0, 0xd6, 0x97, 0x18, 0x58, 0xc5, 0x9f, 0xea, 0x12, 0x80,
- 0x63, 0x1c, 0x83, 0x3f, 0x95, 0x7b, 0xf1, 0x27, 0xf4, 0x25, 0x98, 0x8a, 0x1b, 0x0b, 0x3b, 0x4e,
- 0x43, 0x0e, 0x20, 0xdb, 0xc1, 0x75, 0x13, 0x84, 0x93, 0xb8, 0xf6, 0x7f, 0x6e, 0x89, 0xc5, 0x43,
- 0xbf, 0xfa, 0x13, 0xfe, 0xad, 0xf6, 0x3f, 0xb2, 0x60, 0x78, 0xc1, 0xf5, 0x9a, 0xae, 0xb7, 0x85,
- 0xbe, 0x09, 0x23, 0xf4, 0xa8, 0x6c, 0x3a, 0x91, 0x23, 0xd8, 0xf0, 0xe7, 0xb4, 0xbd, 0xa5, 0x4e,
- 0xae, 0xb9, 0xce, 0xce, 0x16, 0x2d, 0x08, 0xe7, 0x28, 0x36, 0xdd, 0x6d, 0xb7, 0xef, 0x7f, 0x8b,
- 0x34, 0xa2, 0x35, 0x12, 0x39, 0xf1, 0xe7, 0xc4, 0x65, 0x58, 0x51, 0x45, 0x37, 0x61, 0x28, 0x72,
- 0x82, 0x2d, 0x12, 0x09, 0x7e, 0x9c, 0xc9, 0x37, 0x79, 0x4d, 0x4c, 0x77, 0x24, 0xf1, 0x1a, 0x24,
- 0x3e, 0xa5, 0x36, 0x58, 0x55, 0x2c, 0x48, 0xd8, 0xff, 0xdf, 0x30, 0x9c, 0x5d, 0xac, 0xaf, 0xe6,
- 0xac, 0xab, 0x4b, 0x30, 0xd4, 0x0c, 0xdc, 0x5d, 0x12, 0x88, 0x71, 0x56, 0x54, 0x96, 0x58, 0x29,
- 0x16, 0x50, 0x74, 0x0d, 0xc6, 0xf9, 0xf9, 0x78, 0xc3, 0xf1, 0x9a, 0x31, 0x7b, 0x14, 0xd8, 0xe3,
- 0x77, 0x35, 0x18, 0x36, 0x30, 0x8f, 0xb8, 0xa8, 0x2e, 0x25, 0x36, 0x63, 0xde, 0xd9, 0xfb, 0x5d,
- 0x0b, 0xa6, 0x79, 0x33, 0xf3, 0x51, 0x14, 0xb8, 0xf7, 0xbb, 0x11, 0x09, 0x2b, 0x83, 0x8c, 0xd3,
- 0x2d, 0x66, 0x8d, 0x56, 0xee, 0x08, 0xcc, 0xdd, 0x4d, 0x50, 0xe1, 0x4c, 0xb0, 0x22, 0xda, 0x9d,
- 0x4e, 0x82, 0x71, 0xaa, 0x59, 0xf4, 0x17, 0x2d, 0x98, 0x6d, 0xf8, 0x5e, 0x14, 0xf8, 0xad, 0x16,
- 0x09, 0x6a, 0xdd, 0xfb, 0x2d, 0x37, 0xdc, 0xe6, 0xeb, 0x14, 0x93, 0x4d, 0xc6, 0x09, 0x72, 0xe6,
- 0x50, 0x21, 0x89, 0x39, 0xbc, 0x70, 0xb0, 0x5f, 0x9d, 0x5d, 0xcc, 0x25, 0x85, 0x0b, 0x9a, 0x41,
- 0x3b, 0x80, 0xe8, 0xc9, 0x5e, 0x8f, 0x9c, 0x2d, 0x12, 0x37, 0x3e, 0xdc, 0x7f, 0xe3, 0xa7, 0x0f,
- 0xf6, 0xab, 0x68, 0x3d, 0x45, 0x02, 0x67, 0x90, 0x45, 0x1f, 0xc1, 0x49, 0x5a, 0x9a, 0xfa, 0xd6,
- 0x91, 0xfe, 0x9b, 0xab, 0x1c, 0xec, 0x57, 0x4f, 0xae, 0x67, 0x10, 0xc1, 0x99, 0xa4, 0xd1, 0x8f,
- 0x5b, 0x70, 0x36, 0xfe, 0xfc, 0xe5, 0x87, 0x1d, 0xc7, 0x6b, 0xc6, 0x0d, 0x8f, 0xf6, 0xdf, 0x30,
- 0xe5, 0xc9, 0x67, 0x17, 0xf3, 0x28, 0xe1, 0xfc, 0x46, 0x90, 0x07, 0x27, 0x68, 0xd7, 0x92, 0x6d,
- 0x43, 0xff, 0x6d, 0x9f, 0x39, 0xd8, 0xaf, 0x9e, 0x58, 0x4f, 0xd3, 0xc0, 0x59, 0x84, 0x67, 0x17,
- 0xe1, 0x54, 0xe6, 0xea, 0x44, 0xd3, 0x50, 0xde, 0x21, 0x5c, 0x08, 0x1c, 0xc5, 0xf4, 0x27, 0x3a,
- 0x09, 0x83, 0xbb, 0x4e, 0xab, 0x2b, 0x36, 0x26, 0xe6, 0x7f, 0xde, 0x2a, 0x5d, 0xb3, 0xec, 0xff,
- 0xbe, 0x0c, 0x53, 0x8b, 0xf5, 0xd5, 0xc7, 0xda, 0xf5, 0xfa, 0xb1, 0x57, 0x2a, 0x3c, 0xf6, 0xe2,
- 0x43, 0xb4, 0x9c, 0x7b, 0x88, 0xfe, 0x58, 0xc6, 0x96, 0x1d, 0x60, 0x5b, 0xf6, 0x8b, 0x39, 0x5b,
- 0xf6, 0x09, 0x6f, 0xd4, 0xdd, 0x9c, 0x55, 0x3b, 0xc8, 0x26, 0x30, 0x53, 0x42, 0x62, 0xb2, 0x5f,
- 0x92, 0xd5, 0x1e, 0x71, 0xe9, 0x3e, 0x99, 0x79, 0x6c, 0xc0, 0xf8, 0xa2, 0xd3, 0x71, 0xee, 0xbb,
- 0x2d, 0x37, 0x72, 0x49, 0x88, 0x5e, 0x84, 0xb2, 0xd3, 0x6c, 0x32, 0xe9, 0x6e, 0x74, 0xe1, 0xd4,
- 0xc1, 0x7e, 0xb5, 0x3c, 0xdf, 0xa4, 0x62, 0x06, 0x28, 0xac, 0x3d, 0x4c, 0x31, 0xd0, 0x67, 0x61,
- 0xa0, 0x19, 0xf8, 0x9d, 0x4a, 0x89, 0x61, 0xd2, 0x5d, 0x3e, 0xb0, 0x14, 0xf8, 0x9d, 0x04, 0x2a,
- 0xc3, 0xb1, 0x7f, 0xbb, 0x04, 0xe7, 0x16, 0x49, 0x67, 0x7b, 0xa5, 0x9e, 0x73, 0x5e, 0x5c, 0x86,
- 0x91, 0xb6, 0xef, 0xb9, 0x91, 0x1f, 0x84, 0xa2, 0x69, 0xb6, 0x22, 0xd6, 0x44, 0x19, 0x56, 0x50,
- 0x74, 0x11, 0x06, 0x3a, 0xb1, 0x10, 0x3b, 0x2e, 0x05, 0x60, 0x26, 0xbe, 0x32, 0x08, 0xc5, 0xe8,
- 0x86, 0x24, 0x10, 0x2b, 0x46, 0x61, 0xdc, 0x09, 0x49, 0x80, 0x19, 0x24, 0x96, 0x04, 0xa8, 0x8c,
- 0x20, 0x4e, 0x84, 0x84, 0x24, 0x40, 0x21, 0x58, 0xc3, 0x42, 0x35, 0x18, 0x0d, 0x13, 0x33, 0xdb,
- 0xd7, 0xd6, 0x9c, 0x60, 0xa2, 0x82, 0x9a, 0xc9, 0x98, 0x88, 0x71, 0x82, 0x0d, 0xf5, 0x14, 0x15,
- 0x7e, 0xa3, 0x04, 0x88, 0x0f, 0xe1, 0x9f, 0xb1, 0x81, 0xbb, 0x93, 0x1e, 0xb8, 0xfe, 0xb7, 0xc4,
- 0x93, 0x1a, 0xbd, 0xff, 0xdb, 0x82, 0x73, 0x8b, 0xae, 0xd7, 0x24, 0x41, 0xce, 0x02, 0x7c, 0x3a,
- 0x57, 0xf9, 0xa3, 0x09, 0x29, 0xc6, 0x12, 0x1b, 0x78, 0x02, 0x4b, 0xcc, 0xfe, 0xb7, 0x16, 0x20,
- 0xfe, 0xd9, 0x9f, 0xb8, 0x8f, 0xbd, 0x93, 0xfe, 0xd8, 0x27, 0xb0, 0x2c, 0xec, 0x5b, 0x30, 0xb9,
- 0xd8, 0x72, 0x89, 0x17, 0xad, 0xd6, 0x16, 0x7d, 0x6f, 0xd3, 0xdd, 0x42, 0x6f, 0xc1, 0x64, 0xe4,
- 0xb6, 0x89, 0xdf, 0x8d, 0xea, 0xa4, 0xe1, 0x7b, 0xec, 0xe6, 0x6a, 0x5d, 0x1e, 0x5c, 0x40, 0x07,
- 0xfb, 0xd5, 0xc9, 0x0d, 0x03, 0x82, 0x13, 0x98, 0xf6, 0xdf, 0xa5, 0x7c, 0xab, 0xd5, 0x0d, 0x23,
- 0x12, 0x6c, 0x04, 0xdd, 0x30, 0x5a, 0xe8, 0x52, 0xd9, 0xb3, 0x16, 0xf8, 0xb4, 0x3b, 0xae, 0xef,
- 0xa1, 0x73, 0xc6, 0x75, 0x7c, 0x44, 0x5e, 0xc5, 0xc5, 0xb5, 0x7b, 0x0e, 0x20, 0x74, 0xb7, 0x3c,
- 0x12, 0x68, 0xd7, 0x87, 0x49, 0xb6, 0x55, 0x54, 0x29, 0xd6, 0x30, 0x50, 0x0b, 0x26, 0x5a, 0xce,
- 0x7d, 0xd2, 0xaa, 0x93, 0x16, 0x69, 0x44, 0x7e, 0x20, 0xf4, 0x1b, 0xaf, 0xf7, 0x77, 0x0f, 0xb8,
- 0xa5, 0x57, 0x5d, 0x98, 0x39, 0xd8, 0xaf, 0x4e, 0x18, 0x45, 0xd8, 0x24, 0x4e, 0x59, 0x87, 0xdf,
- 0xa1, 0x5f, 0xe1, 0xb4, 0xf4, 0xcb, 0xe7, 0x6d, 0x51, 0x86, 0x15, 0x54, 0xb1, 0x8e, 0x81, 0x3c,
- 0xd6, 0x61, 0xff, 0x4b, 0xba, 0xd0, 0xfc, 0x76, 0xc7, 0xf7, 0x88, 0x17, 0x2d, 0xfa, 0x5e, 0x93,
- 0x6b, 0xa6, 0xde, 0x32, 0x54, 0x27, 0x97, 0x12, 0xaa, 0x93, 0xd3, 0xe9, 0x1a, 0x9a, 0xf6, 0xe4,
- 0x8b, 0x30, 0x14, 0x46, 0x4e, 0xd4, 0x0d, 0xc5, 0xc0, 0x3d, 0x2b, 0x97, 0x5d, 0x9d, 0x95, 0x1e,
- 0xee, 0x57, 0xa7, 0x54, 0x35, 0x5e, 0x84, 0x45, 0x05, 0xf4, 0x12, 0x0c, 0xb7, 0x49, 0x18, 0x3a,
- 0x5b, 0x52, 0x6c, 0x98, 0x12, 0x75, 0x87, 0xd7, 0x78, 0x31, 0x96, 0x70, 0xf4, 0x1c, 0x0c, 0x92,
- 0x20, 0xf0, 0x03, 0xf1, 0x6d, 0x13, 0x02, 0x71, 0x70, 0x99, 0x16, 0x62, 0x0e, 0xb3, 0xff, 0x27,
- 0x0b, 0xa6, 0x54, 0x5f, 0x79, 0x5b, 0xc7, 0x70, 0x5d, 0xfb, 0x2a, 0x40, 0x43, 0x7e, 0x60, 0xc8,
- 0x8e, 0xd9, 0xb1, 0xd7, 0x2e, 0x65, 0x4a, 0x34, 0xa9, 0x61, 0x8c, 0x29, 0xab, 0xa2, 0x10, 0x6b,
- 0xd4, 0xec, 0xdf, 0xb4, 0xe0, 0x44, 0xe2, 0x8b, 0x6e, 0xb9, 0x61, 0x84, 0x3e, 0x4c, 0x7d, 0xd5,
- 0x5c, 0x9f, 0x8b, 0xcf, 0x0d, 0xf9, 0x37, 0xa9, 0x3d, 0x2f, 0x4b, 0xb4, 0x2f, 0xba, 0x01, 0x83,
- 0x6e, 0x44, 0xda, 0xf2, 0x63, 0x9e, 0x2b, 0xfc, 0x18, 0xde, 0xab, 0x78, 0x46, 0x56, 0x69, 0x4d,
- 0xcc, 0x09, 0xd8, 0xbf, 0x5d, 0x86, 0x51, 0xbe, 0xbf, 0xd7, 0x9c, 0xce, 0x31, 0xcc, 0xc5, 0xcb,
- 0x30, 0xea, 0xb6, 0xdb, 0xdd, 0xc8, 0xb9, 0x2f, 0xce, 0xbd, 0x11, 0xce, 0x83, 0x56, 0x65, 0x21,
- 0x8e, 0xe1, 0x68, 0x15, 0x06, 0x58, 0x57, 0xf8, 0x57, 0xbe, 0x98, 0xfd, 0x95, 0xa2, 0xef, 0x73,
- 0x4b, 0x4e, 0xe4, 0x70, 0x91, 0x53, 0xed, 0x2b, 0x5a, 0x84, 0x19, 0x09, 0xe4, 0x00, 0xdc, 0x77,
- 0x3d, 0x27, 0xd8, 0xa3, 0x65, 0x95, 0x32, 0x23, 0xf8, 0x6a, 0x31, 0xc1, 0x05, 0x85, 0xcf, 0xc9,
- 0xaa, 0x0f, 0x8b, 0x01, 0x58, 0x23, 0x3a, 0xfb, 0x05, 0x18, 0x55, 0xc8, 0x47, 0x91, 0x1c, 0x67,
- 0xbf, 0x04, 0x53, 0x89, 0xb6, 0x7a, 0x55, 0x1f, 0xd7, 0x05, 0xcf, 0x7f, 0xcc, 0x58, 0x86, 0xe8,
- 0xf5, 0xb2, 0xb7, 0x2b, 0xce, 0xa6, 0x47, 0x70, 0xb2, 0x95, 0xc1, 0xf2, 0xc5, 0xbc, 0xf6, 0x7f,
- 0x44, 0x9c, 0x13, 0x9f, 0x7d, 0x32, 0x0b, 0x8a, 0x33, 0xdb, 0x30, 0x38, 0x62, 0xa9, 0x88, 0x23,
- 0x52, 0x7e, 0x77, 0x52, 0x75, 0xfe, 0x26, 0xd9, 0x53, 0x4c, 0xf5, 0x07, 0xd9, 0xfd, 0xf3, 0x7c,
- 0xf4, 0x39, 0xbb, 0x1c, 0x13, 0x04, 0xca, 0x37, 0xc9, 0x1e, 0x9f, 0x0a, 0xfd, 0xeb, 0xca, 0x85,
- 0x5f, 0xf7, 0x2b, 0x16, 0x4c, 0xa8, 0xaf, 0x3b, 0x06, 0xbe, 0xb0, 0x60, 0xf2, 0x85, 0xf3, 0x85,
- 0x0b, 0x3c, 0x87, 0x23, 0xfc, 0x46, 0x09, 0xce, 0x2a, 0x1c, 0x7a, 0x89, 0xe2, 0x7f, 0xc4, 0xaa,
- 0xba, 0x02, 0xa3, 0x9e, 0x52, 0x27, 0x5a, 0xa6, 0x1e, 0x2f, 0x56, 0x26, 0xc6, 0x38, 0xf4, 0xc8,
- 0xf3, 0xe2, 0x43, 0x7b, 0x5c, 0xd7, 0xb3, 0x8b, 0xc3, 0x7d, 0x01, 0xca, 0x5d, 0xb7, 0x29, 0x0e,
- 0x98, 0xcf, 0xc9, 0xd1, 0xbe, 0xb3, 0xba, 0x74, 0xb8, 0x5f, 0x7d, 0x36, 0xcf, 0xe4, 0x44, 0x4f,
- 0xb6, 0x70, 0xee, 0xce, 0xea, 0x12, 0xa6, 0x95, 0xd1, 0x3c, 0x4c, 0x49, 0xab, 0xda, 0x5d, 0x2a,
- 0x97, 0xfa, 0x9e, 0x38, 0x87, 0x94, 0xb2, 0x1c, 0x9b, 0x60, 0x9c, 0xc4, 0x47, 0x4b, 0x30, 0xbd,
- 0xd3, 0xbd, 0x4f, 0x5a, 0x24, 0xe2, 0x1f, 0x7c, 0x93, 0x70, 0x55, 0xf2, 0x68, 0x7c, 0x85, 0xbd,
- 0x99, 0x80, 0xe3, 0x54, 0x0d, 0xfb, 0x4f, 0xd9, 0x79, 0x20, 0x46, 0x4f, 0x93, 0x6f, 0x7e, 0x90,
- 0xcb, 0xb9, 0x9f, 0x55, 0x71, 0x93, 0xec, 0x6d, 0xf8, 0x54, 0x0e, 0xc9, 0x5e, 0x15, 0xc6, 0x9a,
- 0x1f, 0x28, 0x5c, 0xf3, 0xbf, 0x56, 0x82, 0x53, 0x6a, 0x04, 0x0c, 0x69, 0xf9, 0xcf, 0xfa, 0x18,
- 0x5c, 0x85, 0xb1, 0x26, 0xd9, 0x74, 0xba, 0xad, 0x48, 0xd9, 0x35, 0x06, 0xb9, 0xa9, 0x6d, 0x29,
- 0x2e, 0xc6, 0x3a, 0xce, 0x11, 0x86, 0xed, 0x6f, 0x4d, 0xb2, 0x83, 0x38, 0x72, 0xe8, 0x1a, 0x57,
- 0xbb, 0xc6, 0xca, 0xdd, 0x35, 0xcf, 0xc1, 0xa0, 0xdb, 0xa6, 0x82, 0x59, 0xc9, 0x94, 0xb7, 0x56,
- 0x69, 0x21, 0xe6, 0x30, 0xf4, 0x02, 0x0c, 0x37, 0xfc, 0x76, 0xdb, 0xf1, 0x9a, 0xec, 0xc8, 0x1b,
- 0x5d, 0x18, 0xa3, 0xb2, 0xdb, 0x22, 0x2f, 0xc2, 0x12, 0x46, 0x85, 0x6f, 0x27, 0xd8, 0xe2, 0xca,
- 0x1e, 0x21, 0x7c, 0xcf, 0x07, 0x5b, 0x21, 0x66, 0xa5, 0xf4, 0xae, 0xfa, 0xc0, 0x0f, 0x76, 0x5c,
- 0x6f, 0x6b, 0xc9, 0x0d, 0xc4, 0x96, 0x50, 0x67, 0xe1, 0x3d, 0x05, 0xc1, 0x1a, 0x16, 0x5a, 0x81,
- 0xc1, 0x8e, 0x1f, 0x44, 0x61, 0x65, 0x88, 0x0d, 0xf7, 0xb3, 0x39, 0x8c, 0x88, 0x7f, 0x6d, 0xcd,
- 0x0f, 0xa2, 0xf8, 0x03, 0xe8, 0xbf, 0x10, 0xf3, 0xea, 0xe8, 0x16, 0x0c, 0x13, 0x6f, 0x77, 0x25,
- 0xf0, 0xdb, 0x95, 0x13, 0xf9, 0x94, 0x96, 0x39, 0x0a, 0x5f, 0x66, 0xb1, 0x8c, 0x2a, 0x8a, 0xb1,
- 0x24, 0x81, 0xbe, 0x08, 0x65, 0xe2, 0xed, 0x56, 0x86, 0x19, 0xa5, 0xd9, 0x1c, 0x4a, 0x77, 0x9d,
- 0x20, 0xe6, 0xf9, 0xcb, 0xde, 0x2e, 0xa6, 0x75, 0xd0, 0x57, 0x60, 0x54, 0x32, 0x8c, 0x50, 0x68,
- 0x51, 0x33, 0x17, 0xac, 0x64, 0x33, 0x98, 0x7c, 0xd4, 0x75, 0x03, 0xd2, 0x26, 0x5e, 0x14, 0xc6,
- 0x1c, 0x52, 0x42, 0x43, 0x1c, 0x53, 0x43, 0x0d, 0x18, 0x0f, 0x48, 0xe8, 0x3e, 0x22, 0x35, 0xbf,
- 0xe5, 0x36, 0xf6, 0x2a, 0x67, 0x58, 0xf7, 0x5e, 0x2a, 0x1c, 0x32, 0xac, 0x55, 0x88, 0xb5, 0xfc,
- 0x7a, 0x29, 0x36, 0x88, 0xa2, 0x0f, 0x60, 0x22, 0x20, 0x61, 0xe4, 0x04, 0x91, 0x68, 0xa5, 0xa2,
- 0xac, 0x72, 0x13, 0x58, 0x07, 0xf0, 0xeb, 0x44, 0xdc, 0x4c, 0x0c, 0xc1, 0x26, 0x05, 0x14, 0x01,
- 0x32, 0x0a, 0x70, 0xb7, 0x45, 0xc2, 0xca, 0xd9, 0x7c, 0x6b, 0x66, 0x92, 0x2c, 0xad, 0xb0, 0x30,
- 0x2b, 0x3a, 0x8f, 0x70, 0x8a, 0x16, 0xce, 0xa0, 0x8f, 0xbe, 0x22, 0x0d, 0x1d, 0x6b, 0x7e, 0xd7,
- 0x8b, 0xc2, 0xca, 0x28, 0x6b, 0x2f, 0xd3, 0x22, 0x7e, 0x37, 0xc6, 0x4b, 0x5a, 0x42, 0x78, 0x65,
- 0x6c, 0x90, 0x42, 0x5f, 0x87, 0x09, 0xfe, 0x9f, 0x1b, 0x72, 0xc3, 0xca, 0x29, 0x46, 0xfb, 0x62,
- 0x3e, 0x6d, 0x8e, 0xb8, 0x70, 0x4a, 0x10, 0x9f, 0xd0, 0x4b, 0x43, 0x6c, 0x52, 0x43, 0x18, 0x26,
- 0x5a, 0xee, 0x2e, 0xf1, 0x48, 0x18, 0xd6, 0x02, 0xff, 0x3e, 0x11, 0x7a, 0xe9, 0xb3, 0xd9, 0x86,
- 0x5f, 0xff, 0x3e, 0x11, 0x57, 0x4f, 0xbd, 0x0e, 0x36, 0x49, 0xa0, 0x3b, 0x30, 0x19, 0x10, 0xa7,
- 0xe9, 0xc6, 0x44, 0xc7, 0x7a, 0x11, 0x65, 0xd7, 0x75, 0x6c, 0x54, 0xc2, 0x09, 0x22, 0xe8, 0x36,
- 0x8c, 0xb3, 0x81, 0xef, 0x76, 0x38, 0xd1, 0xd3, 0xbd, 0x88, 0x32, 0x37, 0x86, 0xba, 0x56, 0x05,
- 0x1b, 0x04, 0xd0, 0xfb, 0x30, 0xda, 0x72, 0x37, 0x49, 0x63, 0xaf, 0xd1, 0x22, 0x95, 0x71, 0x46,
- 0x2d, 0x93, 0x05, 0xdf, 0x92, 0x48, 0xfc, 0x56, 0xa0, 0xfe, 0xe2, 0xb8, 0x3a, 0xba, 0x0b, 0xa7,
- 0x23, 0x12, 0xb4, 0x5d, 0xcf, 0xa1, 0xac, 0x53, 0x5c, 0x44, 0x99, 0x3d, 0x7e, 0x82, 0xad, 0xe9,
- 0x0b, 0x62, 0x36, 0x4e, 0x6f, 0x64, 0x62, 0xe1, 0x9c, 0xda, 0xe8, 0x21, 0x54, 0x32, 0x20, 0x7c,
- 0xb7, 0x9c, 0x64, 0x94, 0xdf, 0x11, 0x94, 0x2b, 0x1b, 0x39, 0x78, 0x87, 0x05, 0x30, 0x9c, 0x4b,
- 0x1d, 0xdd, 0x86, 0x29, 0xc6, 0xaf, 0x6b, 0xdd, 0x56, 0x4b, 0x34, 0x38, 0xc9, 0x1a, 0x7c, 0x41,
- 0x4a, 0x2f, 0xab, 0x26, 0xf8, 0x70, 0xbf, 0x0a, 0xf1, 0x3f, 0x9c, 0xac, 0x8d, 0xee, 0x33, 0xd3,
- 0x6f, 0x37, 0x70, 0xa3, 0x3d, 0xba, 0xe9, 0xc8, 0xc3, 0xa8, 0x32, 0x55, 0xa8, 0x06, 0xd3, 0x51,
- 0x95, 0x7d, 0x58, 0x2f, 0xc4, 0x49, 0x82, 0xf4, 0x00, 0x0a, 0xa3, 0xa6, 0xeb, 0x55, 0xa6, 0xf9,
- 0x2d, 0x4e, 0xf2, 0xef, 0x3a, 0x2d, 0xc4, 0x1c, 0xc6, 0xcc, 0xbe, 0xf4, 0xc7, 0x6d, 0x7a, 0xce,
- 0xcf, 0x30, 0xc4, 0xd8, 0xec, 0x2b, 0x01, 0x38, 0xc6, 0xa1, 0xa2, 0x77, 0x14, 0xed, 0x55, 0x10,
- 0x43, 0x55, 0x6c, 0x78, 0x63, 0xe3, 0x2b, 0x98, 0x96, 0xdb, 0xbf, 0x6b, 0xc1, 0x45, 0xc5, 0x46,
- 0x96, 0x1f, 0x46, 0xc4, 0x6b, 0x92, 0xa6, 0xce, 0x73, 0x49, 0x18, 0xa1, 0xb7, 0x61, 0xa2, 0x21,
- 0x71, 0x34, 0x13, 0xb5, 0xda, 0xa5, 0x8b, 0x3a, 0x10, 0x9b, 0xb8, 0xe8, 0x1a, 0xe3, 0xc6, 0x8c,
- 0x9e, 0xa6, 0x6c, 0xd2, 0x59, 0xac, 0x82, 0x61, 0x03, 0x13, 0xbd, 0x09, 0x63, 0x01, 0xef, 0x01,
- 0xab, 0x58, 0x36, 0x3d, 0x25, 0x70, 0x0c, 0xc2, 0x3a, 0x9e, 0x7d, 0x1f, 0x26, 0x55, 0x87, 0xd8,
- 0x34, 0xa3, 0x2a, 0x0c, 0x32, 0xf9, 0x59, 0xe8, 0xa1, 0x47, 0xe9, 0xa8, 0x32, 0xd9, 0x1a, 0xf3,
- 0x72, 0x36, 0xaa, 0xee, 0x23, 0xb2, 0xb0, 0x17, 0x11, 0xae, 0xd4, 0x29, 0x6b, 0xa3, 0x2a, 0x01,
- 0x38, 0xc6, 0xb1, 0xff, 0x7f, 0x7e, 0x0f, 0x89, 0x8f, 0xdb, 0x3e, 0x04, 0x8c, 0x57, 0x60, 0x84,
- 0x79, 0xd0, 0xf8, 0x01, 0x37, 0x73, 0x0f, 0xc6, 0x37, 0x8f, 0x1b, 0xa2, 0x1c, 0x2b, 0x0c, 0x63,
- 0xcc, 0x59, 0x15, 0x2e, 0x1d, 0xa5, 0xc7, 0x9c, 0xd5, 0x33, 0x71, 0xd1, 0x35, 0x18, 0x61, 0xce,
- 0x62, 0x0d, 0xbf, 0x25, 0xc4, 0x76, 0x29, 0xe2, 0x8d, 0xd4, 0x44, 0xf9, 0xa1, 0xf6, 0x1b, 0x2b,
- 0x6c, 0x74, 0x09, 0x86, 0x68, 0x17, 0x56, 0x6b, 0x42, 0x2e, 0x51, 0x2a, 0xd5, 0x1b, 0xac, 0x14,
- 0x0b, 0xa8, 0xfd, 0x9b, 0x16, 0x13, 0x4a, 0xd3, 0x87, 0x27, 0xba, 0x91, 0x98, 0x6f, 0x3e, 0x20,
- 0xcf, 0x67, 0xcd, 0xf7, 0x61, 0xf1, 0xfc, 0x7f, 0x35, 0x79, 0xc4, 0xf2, 0xa5, 0xf3, 0x86, 0x1c,
- 0x82, 0xe4, 0x31, 0xfb, 0x4c, 0xbc, 0x6e, 0x69, 0x7f, 0x8a, 0xce, 0x5a, 0xfb, 0xb7, 0xf8, 0x35,
- 0x39, 0x75, 0x7c, 0xa2, 0x25, 0x18, 0x72, 0xd8, 0x0d, 0x43, 0x74, 0xfc, 0x15, 0x39, 0x00, 0xf3,
- 0xac, 0xf4, 0x50, 0xd8, 0xab, 0x93, 0xf5, 0x38, 0x14, 0x8b, 0xba, 0xe8, 0x9b, 0x30, 0x4a, 0x1e,
- 0xba, 0xd1, 0xa2, 0xdf, 0x14, 0x0b, 0xca, 0xd4, 0x95, 0x16, 0x9e, 0xe0, 0xb7, 0xbd, 0x65, 0x59,
- 0x95, 0x33, 0x6d, 0xf5, 0x17, 0xc7, 0x44, 0xed, 0x9f, 0xb3, 0xa0, 0xda, 0xa3, 0x36, 0xba, 0x47,
- 0x85, 0x65, 0x12, 0x38, 0x91, 0x2f, 0xed, 0x9e, 0x6f, 0xcb, 0x65, 0x70, 0x5b, 0x94, 0x1f, 0xee,
- 0x57, 0x5f, 0xec, 0x41, 0x46, 0xa2, 0x62, 0x45, 0x0c, 0xd9, 0x30, 0xc4, 0xd4, 0x25, 0x5c, 0xfa,
- 0x1f, 0xe4, 0xc6, 0xcf, 0xbb, 0xac, 0x04, 0x0b, 0x88, 0xfd, 0x57, 0x4a, 0xda, 0x3e, 0xac, 0x47,
- 0x4e, 0x44, 0x50, 0x0d, 0x86, 0x1f, 0x38, 0x6e, 0xe4, 0x7a, 0x5b, 0xe2, 0x8a, 0x52, 0x2c, 0x93,
- 0xb1, 0x4a, 0xf7, 0x78, 0x05, 0x2e, 0x68, 0x8b, 0x3f, 0x58, 0x92, 0xa1, 0x14, 0x83, 0xae, 0xe7,
- 0x51, 0x8a, 0xa5, 0x7e, 0x29, 0x62, 0x5e, 0x81, 0x53, 0x14, 0x7f, 0xb0, 0x24, 0x83, 0x3e, 0x04,
- 0x90, 0xc7, 0x0a, 0x69, 0x0a, 0x35, 0xf7, 0x2b, 0xbd, 0x89, 0x6e, 0xa8, 0x3a, 0x5c, 0x8f, 0x1e,
- 0xff, 0xc7, 0x1a, 0x3d, 0x3b, 0xd2, 0x76, 0x8d, 0xde, 0x19, 0xf4, 0x35, 0xca, 0xd7, 0x9d, 0x20,
- 0x22, 0xcd, 0xf9, 0x48, 0x0c, 0xce, 0x67, 0xfb, 0xd3, 0x63, 0x6c, 0xb8, 0x6d, 0xa2, 0x9f, 0x01,
- 0x82, 0x08, 0x8e, 0xe9, 0xd9, 0xbf, 0x5e, 0x86, 0x4a, 0x5e, 0x77, 0x29, 0x5b, 0x92, 0xab, 0x4a,
- 0xd8, 0x1f, 0x14, 0x5b, 0x92, 0x4b, 0x00, 0x2b, 0x0c, 0xca, 0x1f, 0x42, 0x77, 0x4b, 0xaa, 0xa1,
- 0x06, 0x63, 0xfe, 0x50, 0x67, 0xa5, 0x58, 0x40, 0x29, 0x5e, 0x40, 0x9c, 0x50, 0xf8, 0x89, 0x6a,
- 0x7c, 0x04, 0xb3, 0x52, 0x2c, 0xa0, 0xba, 0x42, 0x7c, 0xa0, 0x87, 0x42, 0xdc, 0x18, 0xa2, 0xc1,
- 0x27, 0x3b, 0x44, 0xe8, 0x1b, 0x00, 0x9b, 0xae, 0xe7, 0x86, 0xdb, 0x8c, 0xfa, 0xd0, 0x91, 0xa9,
- 0xab, 0xfb, 0xdb, 0x8a, 0xa2, 0x82, 0x35, 0x8a, 0xf4, 0x2c, 0x53, 0x2c, 0x7a, 0x75, 0x89, 0x79,
- 0xa9, 0x68, 0x67, 0x59, 0x7c, 0x5e, 0x2d, 0x61, 0x1d, 0xcf, 0xfe, 0x56, 0x72, 0xbd, 0x88, 0x1d,
- 0xa0, 0x8d, 0xaf, 0xd5, 0xef, 0xf8, 0x96, 0x8a, 0xc7, 0xd7, 0xfe, 0x17, 0xa3, 0x30, 0x65, 0x34,
- 0xd6, 0x0d, 0xfb, 0x38, 0xd5, 0xae, 0x53, 0xa9, 0xc5, 0x89, 0x88, 0xd8, 0x7f, 0x76, 0xef, 0xad,
- 0xa2, 0x4b, 0x36, 0x74, 0x07, 0xf0, 0xfa, 0xe8, 0x1b, 0x30, 0xda, 0x72, 0x42, 0xa6, 0x5c, 0x27,
- 0x62, 0xdf, 0xf5, 0x43, 0x2c, 0xd6, 0x5d, 0x38, 0x61, 0xa4, 0x89, 0x8a, 0x9c, 0x76, 0x4c, 0x92,
- 0x8a, 0x57, 0x54, 0x28, 0x97, 0x8e, 0xc8, 0xaa, 0x13, 0x54, 0x72, 0xdf, 0xc3, 0x1c, 0x26, 0x84,
- 0x15, 0xba, 0x2a, 0x16, 0xe9, 0x15, 0x86, 0x2d, 0xb3, 0x41, 0x43, 0x58, 0x51, 0x30, 0x6c, 0x60,
- 0xc6, 0xea, 0x83, 0xa1, 0x02, 0xf5, 0xc1, 0x4b, 0x30, 0xcc, 0x7e, 0xa8, 0x15, 0xa0, 0x66, 0x63,
- 0x95, 0x17, 0x63, 0x09, 0x4f, 0x2e, 0x98, 0x91, 0xfe, 0x16, 0x0c, 0x7a, 0x01, 0x86, 0xc5, 0xa2,
- 0x66, 0x1e, 0x42, 0x23, 0x9c, 0xcb, 0x89, 0x25, 0x8f, 0x25, 0x0c, 0xfd, 0xbc, 0x05, 0xc8, 0x69,
- 0xb5, 0xfc, 0x06, 0xe3, 0x50, 0xea, 0x1e, 0x0e, 0xec, 0x7e, 0xf6, 0x76, 0xcf, 0x61, 0xef, 0x86,
- 0x73, 0xf3, 0xa9, 0xda, 0x5c, 0xa9, 0xff, 0x96, 0xbc, 0x7e, 0xa6, 0x11, 0xf4, 0xe3, 0xfe, 0x96,
- 0x1b, 0x46, 0xdf, 0xfe, 0x57, 0x89, 0xe3, 0x3f, 0xa3, 0x4b, 0xe8, 0x8e, 0xae, 0x27, 0x18, 0x3b,
- 0xa2, 0x9e, 0x60, 0x22, 0x57, 0x47, 0xf0, 0xe7, 0x12, 0xb7, 0xde, 0x71, 0xf6, 0xe5, 0x2f, 0xf4,
- 0xb8, 0xf5, 0x0a, 0xcb, 0x4f, 0x3f, 0x77, 0xdf, 0x9a, 0x70, 0x59, 0x98, 0x60, 0x5d, 0x2e, 0xd6,
- 0xd7, 0xdc, 0x09, 0x49, 0xb0, 0x70, 0x56, 0x7a, 0x34, 0x1c, 0xea, 0xd2, 0x9d, 0xe6, 0xe2, 0xf0,
- 0xe3, 0x16, 0x54, 0xd2, 0x03, 0xc4, 0xbb, 0x54, 0x99, 0x64, 0xfd, 0xb7, 0x8b, 0x46, 0x46, 0x74,
- 0x5e, 0x7a, 0x66, 0x57, 0xe6, 0x73, 0x68, 0xe1, 0xdc, 0x56, 0xd0, 0x35, 0x80, 0x30, 0xf2, 0x3b,
- 0x9c, 0xd7, 0xb3, 0x1b, 0xd0, 0x28, 0xf3, 0x0d, 0x82, 0xba, 0x2a, 0x3d, 0x8c, 0xcf, 0x02, 0x0d,
- 0x77, 0xb6, 0x0b, 0x67, 0x72, 0x56, 0x4c, 0x86, 0x69, 0x66, 0x49, 0x37, 0xcd, 0xf4, 0x50, 0xe8,
- 0xcf, 0xc9, 0x39, 0x9d, 0xfb, 0xa0, 0xeb, 0x78, 0x91, 0x1b, 0xed, 0xe9, 0xa6, 0x1c, 0x0f, 0xcc,
- 0xa1, 0x44, 0x5f, 0x87, 0xc1, 0x96, 0xeb, 0x75, 0x1f, 0x8a, 0x33, 0xf6, 0x52, 0xf6, 0x9d, 0xd9,
- 0xeb, 0x3e, 0x34, 0x27, 0xa7, 0x4a, 0xb7, 0x32, 0x2b, 0x3f, 0xdc, 0xaf, 0xa2, 0x34, 0x02, 0xe6,
- 0x54, 0xed, 0xcf, 0xc2, 0xe4, 0x92, 0x43, 0xda, 0xbe, 0xb7, 0xec, 0x35, 0x3b, 0xbe, 0xeb, 0x45,
- 0xa8, 0x02, 0x03, 0x4c, 0x7c, 0xe7, 0x47, 0xeb, 0x00, 0x1d, 0x7c, 0xcc, 0x4a, 0xec, 0x2d, 0x38,
- 0xb5, 0xe4, 0x3f, 0xf0, 0x1e, 0x38, 0x41, 0x73, 0xbe, 0xb6, 0xaa, 0xa9, 0xb6, 0xd7, 0xa5, 0x6a,
- 0xd5, 0xca, 0x57, 0x5c, 0x69, 0x35, 0xf9, 0x22, 0x5c, 0x71, 0x5b, 0x24, 0xc7, 0x00, 0xf1, 0xd7,
- 0x4b, 0x46, 0x4b, 0x31, 0xbe, 0x32, 0x9f, 0x5b, 0xb9, 0x9e, 0x37, 0x1f, 0xc0, 0xc8, 0xa6, 0x4b,
- 0x5a, 0x4d, 0x4c, 0x36, 0xc5, 0x6c, 0xbc, 0x98, 0xef, 0x9b, 0xbb, 0x42, 0x31, 0x95, 0x9d, 0x9f,
- 0x29, 0x66, 0x57, 0x44, 0x65, 0xac, 0xc8, 0xa0, 0x1d, 0x98, 0x96, 0x73, 0x26, 0xa1, 0x82, 0xdf,
- 0xbf, 0x54, 0xb4, 0x7c, 0x4d, 0xe2, 0xec, 0x9d, 0x02, 0x4e, 0x90, 0xc1, 0x29, 0xc2, 0xe8, 0x1c,
- 0x0c, 0xb4, 0xa9, 0x64, 0x33, 0xc0, 0x86, 0x9f, 0x69, 0x62, 0x99, 0x52, 0x99, 0x95, 0xda, 0x7f,
- 0xc3, 0x82, 0x33, 0xa9, 0x91, 0x11, 0xca, 0xf5, 0x27, 0x3c, 0x0b, 0x49, 0x65, 0x77, 0xa9, 0xb7,
- 0xb2, 0xdb, 0xfe, 0x2f, 0x2c, 0x38, 0xb9, 0xdc, 0xee, 0x44, 0x7b, 0x4b, 0xae, 0xe9, 0x26, 0xf3,
- 0x05, 0x18, 0x6a, 0x93, 0xa6, 0xdb, 0x6d, 0x8b, 0x99, 0xab, 0xca, 0xd3, 0x7f, 0x8d, 0x95, 0x52,
- 0x0e, 0x52, 0x8f, 0xfc, 0xc0, 0xd9, 0x22, 0xbc, 0x00, 0x0b, 0x74, 0x26, 0x43, 0xb9, 0x8f, 0xc8,
- 0x2d, 0xb7, 0xed, 0x46, 0x8f, 0xb7, 0xbb, 0x84, 0x87, 0x8b, 0x24, 0x82, 0x63, 0x7a, 0xf6, 0xf7,
- 0x2d, 0x98, 0x92, 0xeb, 0x7e, 0xbe, 0xd9, 0x0c, 0x48, 0x18, 0xa2, 0x59, 0x28, 0xb9, 0x1d, 0xd1,
- 0x4b, 0x10, 0xbd, 0x2c, 0xad, 0xd6, 0x70, 0xc9, 0xed, 0xc8, 0x0b, 0xb1, 0x17, 0x5f, 0xee, 0x8d,
- 0x0b, 0xb1, 0xc7, 0xde, 0x4c, 0x48, 0x0c, 0x74, 0x19, 0x46, 0x3c, 0xbf, 0xc9, 0xef, 0x94, 0xc2,
- 0xdd, 0x83, 0x62, 0xae, 0x8b, 0x32, 0xac, 0xa0, 0xa8, 0x06, 0xa3, 0xdc, 0x15, 0x3c, 0x5e, 0xb4,
- 0x7d, 0x39, 0x94, 0xb3, 0x2f, 0xdb, 0x90, 0x35, 0x71, 0x4c, 0xc4, 0xfe, 0xa7, 0x16, 0x8c, 0xcb,
- 0x2f, 0xeb, 0xf3, 0xb6, 0x4f, 0xb7, 0x56, 0x7c, 0xd3, 0x8f, 0xb7, 0x16, 0xbd, 0xad, 0x33, 0x88,
- 0x71, 0x49, 0x2f, 0x1f, 0xe9, 0x92, 0x7e, 0x15, 0xc6, 0x9c, 0x4e, 0xa7, 0x66, 0xde, 0xf0, 0xd9,
- 0x52, 0x9a, 0x8f, 0x8b, 0xb1, 0x8e, 0x63, 0xff, 0x6c, 0x09, 0x26, 0xe5, 0x17, 0xd4, 0xbb, 0xf7,
- 0x43, 0x12, 0xa1, 0x0d, 0x18, 0x75, 0xf8, 0x2c, 0x11, 0xb9, 0xc8, 0x9f, 0xcb, 0x56, 0xe1, 0x1b,
- 0x53, 0x1a, 0x0b, 0xd2, 0xf3, 0xb2, 0x36, 0x8e, 0x09, 0xa1, 0x16, 0xcc, 0x78, 0x7e, 0xc4, 0x84,
- 0x2a, 0x05, 0x2f, 0xf2, 0xaa, 0x48, 0x52, 0x3f, 0x2b, 0xa8, 0xcf, 0xac, 0x27, 0xa9, 0xe0, 0x34,
- 0x61, 0xb4, 0x2c, 0xcd, 0x22, 0xe5, 0x7c, 0xcd, 0xb2, 0x3e, 0x71, 0xd9, 0x56, 0x11, 0xfb, 0x9f,
- 0x58, 0x30, 0x2a, 0xd1, 0x8e, 0xc3, 0x81, 0x66, 0x0d, 0x86, 0x43, 0x36, 0x09, 0x72, 0x68, 0xec,
- 0xa2, 0x8e, 0xf3, 0xf9, 0x8a, 0x65, 0x45, 0xfe, 0x3f, 0xc4, 0x92, 0x06, 0xb3, 0x8a, 0xab, 0xee,
- 0x7f, 0x42, 0xac, 0xe2, 0xaa, 0x3f, 0x39, 0x87, 0xd2, 0xbf, 0x61, 0x7d, 0xd6, 0xcc, 0x4c, 0xf4,
- 0x4a, 0xd3, 0x09, 0xc8, 0xa6, 0xfb, 0x30, 0x79, 0xa5, 0xa9, 0xb1, 0x52, 0x2c, 0xa0, 0xe8, 0x43,
- 0x18, 0x6f, 0x48, 0x73, 0x68, 0xbc, 0xc3, 0x2f, 0x15, 0x9a, 0xe6, 0x95, 0x17, 0x07, 0x57, 0xac,
- 0x2f, 0x6a, 0xf5, 0xb1, 0x41, 0xcd, 0x74, 0x75, 0x2c, 0xf7, 0x72, 0x75, 0x8c, 0xe9, 0xe6, 0x3b,
- 0xfe, 0xfd, 0x9c, 0x05, 0x43, 0xdc, 0x0c, 0xd6, 0x9f, 0x15, 0x52, 0x73, 0x6a, 0x89, 0xc7, 0x8e,
- 0x29, 0x57, 0x84, 0x64, 0x83, 0xd6, 0x60, 0x94, 0xfd, 0x60, 0x66, 0xbc, 0x72, 0xfe, 0xc3, 0x48,
- 0xde, 0xaa, 0xde, 0xc1, 0xbb, 0xb2, 0x1a, 0x8e, 0x29, 0xd8, 0x7f, 0x54, 0xa6, 0xdc, 0x2d, 0x46,
- 0x35, 0x0e, 0x7d, 0xeb, 0xe9, 0x1d, 0xfa, 0xa5, 0xa7, 0x75, 0xe8, 0x6f, 0xc1, 0x54, 0x43, 0x73,
- 0x81, 0x89, 0x67, 0xf2, 0x72, 0xe1, 0x22, 0xd1, 0xbc, 0x65, 0xb8, 0xca, 0x7e, 0xd1, 0x24, 0x82,
- 0x93, 0x54, 0xd1, 0xd7, 0x60, 0x9c, 0xcf, 0xb3, 0x68, 0x85, 0x7b, 0x8b, 0xbe, 0x90, 0xbf, 0x5e,
- 0xf4, 0x26, 0xb8, 0x89, 0x47, 0xab, 0x8e, 0x0d, 0x62, 0xa8, 0x0e, 0xb0, 0xe9, 0xb6, 0x88, 0x20,
- 0x5d, 0xe0, 0xd8, 0xbd, 0xc2, 0xb1, 0x14, 0xe1, 0x49, 0xae, 0x87, 0x90, 0x55, 0xb1, 0x46, 0xc6,
- 0xfe, 0x77, 0x16, 0xa0, 0xe5, 0xce, 0x36, 0x69, 0x93, 0xc0, 0x69, 0xc5, 0xe6, 0xf1, 0x9f, 0xb4,
- 0xa0, 0x42, 0x52, 0xc5, 0x8b, 0x7e, 0xbb, 0x2d, 0x34, 0x0c, 0x39, 0x4a, 0xb0, 0xe5, 0x9c, 0x3a,
- 0xf1, 0x2d, 0x23, 0x0f, 0x03, 0xe7, 0xb6, 0x87, 0xd6, 0xe0, 0x04, 0x3f, 0x7a, 0x0d, 0xbb, 0x82,
- 0xd8, 0x11, 0xcf, 0x08, 0xc2, 0x27, 0x36, 0xd2, 0x28, 0x38, 0xab, 0x9e, 0xfd, 0x0f, 0x26, 0x21,
- 0xb7, 0x17, 0x9f, 0xfa, 0x05, 0x7c, 0xea, 0x17, 0xf0, 0xa9, 0x5f, 0xc0, 0xa7, 0x7e, 0x01, 0x9f,
- 0xfa, 0x05, 0x7c, 0xea, 0x17, 0xf0, 0xa9, 0x5f, 0x80, 0xe6, 0x17, 0xf0, 0x57, 0x2d, 0x38, 0xa5,
- 0x0e, 0x4d, 0x43, 0xf7, 0xf0, 0xa3, 0x70, 0x82, 0x6f, 0xb7, 0xc5, 0x96, 0xe3, 0xb6, 0x37, 0x48,
- 0xbb, 0xd3, 0x72, 0x22, 0xe9, 0x73, 0x78, 0x35, 0x73, 0xe5, 0x26, 0x1e, 0x36, 0x19, 0x15, 0xf9,
- 0x0b, 0xd1, 0x0c, 0x00, 0xce, 0x6a, 0xc6, 0xfe, 0xf5, 0x11, 0x18, 0x5c, 0xde, 0x25, 0x5e, 0x74,
- 0x0c, 0xb7, 0xb4, 0x06, 0x4c, 0xba, 0xde, 0xae, 0xdf, 0xda, 0x25, 0x4d, 0x0e, 0x3f, 0x8a, 0x32,
- 0xe1, 0xb4, 0x20, 0x3d, 0xb9, 0x6a, 0x90, 0xc0, 0x09, 0x92, 0x4f, 0xc3, 0x50, 0x76, 0x1d, 0x86,
- 0xf8, 0x91, 0x27, 0x84, 0xc6, 0x4c, 0x9e, 0xcd, 0x06, 0x51, 0x1c, 0xe4, 0xb1, 0x11, 0x8f, 0x1f,
- 0xa9, 0xa2, 0x3a, 0xfa, 0x16, 0x4c, 0x6e, 0xba, 0x41, 0x18, 0x6d, 0xb8, 0x6d, 0x7a, 0x3e, 0xb4,
- 0x3b, 0x8f, 0x61, 0x18, 0x53, 0xe3, 0xb0, 0x62, 0x50, 0xc2, 0x09, 0xca, 0x68, 0x0b, 0x26, 0x5a,
- 0x8e, 0xde, 0xd4, 0xf0, 0x91, 0x9b, 0x52, 0xa7, 0xc3, 0x2d, 0x9d, 0x10, 0x36, 0xe9, 0xd2, 0xed,
- 0xd4, 0x60, 0xb6, 0x9d, 0x11, 0xa6, 0x99, 0x51, 0xdb, 0x89, 0x1b, 0x75, 0x38, 0x8c, 0x8a, 0x85,
- 0xec, 0x79, 0xd0, 0xa8, 0x29, 0x16, 0x6a, 0x8f, 0x80, 0xbe, 0x09, 0xa3, 0x84, 0x0e, 0x21, 0x25,
- 0x2c, 0x0e, 0x98, 0x2b, 0xfd, 0xf5, 0x75, 0xcd, 0x6d, 0x04, 0xbe, 0x69, 0x92, 0x5c, 0x96, 0x94,
- 0x70, 0x4c, 0x14, 0x2d, 0xc2, 0x50, 0x48, 0x02, 0x57, 0x99, 0x3d, 0x0a, 0xa6, 0x91, 0xa1, 0x71,
- 0x2b, 0x3c, 0xff, 0x8d, 0x45, 0x55, 0xba, 0xbc, 0x84, 0x3b, 0xc3, 0xb8, 0xb9, 0xbc, 0x12, 0x0e,
- 0x0b, 0xef, 0xc3, 0x70, 0x40, 0x5a, 0xcc, 0xe6, 0x3d, 0xd1, 0xff, 0x22, 0xe7, 0x26, 0x74, 0x5e,
- 0x0f, 0x4b, 0x02, 0xe8, 0x26, 0x95, 0x57, 0xa8, 0x58, 0xe9, 0x7a, 0x5b, 0xea, 0xd1, 0x8c, 0x60,
- 0xb4, 0x4a, 0x7c, 0xc7, 0x31, 0x86, 0x7c, 0x7d, 0x8e, 0x33, 0xaa, 0xa1, 0xeb, 0x30, 0xa3, 0x4a,
- 0x57, 0xbd, 0x30, 0x72, 0x28, 0x83, 0xe3, 0x96, 0x07, 0xa5, 0x2a, 0xc2, 0x49, 0x04, 0x9c, 0xae,
- 0x63, 0xff, 0xa2, 0x05, 0x7c, 0x9c, 0x8f, 0x41, 0x41, 0xf2, 0xae, 0xa9, 0x20, 0x39, 0x9b, 0x3b,
- 0x73, 0x39, 0xca, 0x91, 0x5f, 0xb4, 0x60, 0x4c, 0x9b, 0xd9, 0x78, 0xcd, 0x5a, 0x05, 0x6b, 0xb6,
- 0x0b, 0xd3, 0x74, 0xa5, 0xdf, 0xbe, 0x1f, 0x92, 0x60, 0x97, 0x34, 0xd9, 0xc2, 0x2c, 0x3d, 0xde,
- 0xc2, 0x54, 0x0e, 0xfa, 0xb7, 0x12, 0x04, 0x71, 0xaa, 0x09, 0xfb, 0x9b, 0xb2, 0xab, 0xea, 0x3d,
- 0x43, 0x43, 0xcd, 0x79, 0xe2, 0x3d, 0x83, 0x9a, 0x55, 0x1c, 0xe3, 0xd0, 0xad, 0xb6, 0xed, 0x87,
- 0x51, 0xf2, 0x3d, 0xc3, 0x0d, 0x3f, 0x8c, 0x30, 0x83, 0xd8, 0xaf, 0x03, 0x2c, 0x3f, 0x24, 0x0d,
- 0xbe, 0x62, 0xf5, 0xab, 0x96, 0x95, 0x7f, 0xd5, 0xb2, 0x7f, 0xcf, 0x82, 0xc9, 0x95, 0x45, 0xe3,
- 0xe4, 0x9a, 0x03, 0xe0, 0xf7, 0xc3, 0x7b, 0xf7, 0xd6, 0xa5, 0x2f, 0x18, 0x77, 0xd6, 0x50, 0xa5,
- 0x58, 0xc3, 0x40, 0x67, 0xa1, 0xdc, 0xea, 0x7a, 0x42, 0x83, 0x3b, 0x4c, 0x8f, 0xc7, 0x5b, 0x5d,
- 0x0f, 0xd3, 0x32, 0xed, 0xe5, 0x69, 0xb9, 0xef, 0x97, 0xa7, 0x3d, 0x03, 0x60, 0xa1, 0x2a, 0x0c,
- 0x3e, 0x78, 0xe0, 0x36, 0x79, 0x5c, 0x0f, 0xe1, 0xa7, 0x76, 0xef, 0xde, 0xea, 0x52, 0x88, 0x79,
- 0xb9, 0xfd, 0xcb, 0x16, 0x4c, 0x25, 0x6e, 0xfb, 0xf4, 0xd6, 0xb8, 0xab, 0xa2, 0x2a, 0x25, 0x83,
- 0xc7, 0x68, 0xf1, 0x96, 0x34, 0xac, 0x3e, 0x5e, 0x5c, 0x8b, 0x17, 0x3b, 0xe5, 0x3e, 0x5e, 0xec,
- 0x14, 0xbb, 0xe1, 0x7f, 0xaf, 0x0c, 0xb3, 0x2b, 0x2d, 0xf2, 0xf0, 0x63, 0x86, 0x63, 0xe9, 0xf7,
- 0xa9, 0xef, 0xd1, 0xd4, 0x77, 0x47, 0x7d, 0xce, 0xdd, 0x7b, 0x0a, 0x37, 0x61, 0x98, 0x7f, 0xba,
- 0x0c, 0xce, 0x92, 0x69, 0x4c, 0xcf, 0x1f, 0x90, 0x39, 0x3e, 0x84, 0xc2, 0x98, 0xae, 0xce, 0x78,
- 0x51, 0x8a, 0x25, 0xf1, 0xd9, 0xb7, 0x60, 0x5c, 0xc7, 0x3c, 0x52, 0x60, 0x85, 0xbf, 0x50, 0x86,
- 0x69, 0xda, 0x83, 0xa7, 0x3a, 0x11, 0x77, 0xd2, 0x13, 0xf1, 0xa4, 0x1f, 0xd7, 0xf7, 0x9e, 0x8d,
- 0x0f, 0x93, 0xb3, 0x71, 0x35, 0x6f, 0x36, 0x8e, 0x7b, 0x0e, 0xfe, 0xa2, 0x05, 0x27, 0x56, 0x5a,
- 0x7e, 0x63, 0x27, 0xf1, 0x00, 0xfe, 0x4d, 0x18, 0xa3, 0x27, 0x48, 0x68, 0xc4, 0x82, 0x32, 0xa2,
- 0x83, 0x09, 0x10, 0xd6, 0xf1, 0xb4, 0x6a, 0x77, 0xee, 0xac, 0x2e, 0x65, 0x05, 0x15, 0x13, 0x20,
- 0xac, 0xe3, 0xd9, 0xff, 0xdc, 0x82, 0xf3, 0xd7, 0x17, 0x97, 0xe3, 0xa5, 0x98, 0x8a, 0x6b, 0x76,
- 0x09, 0x86, 0x3a, 0x4d, 0xad, 0x2b, 0xb1, 0x52, 0x7e, 0x89, 0xf5, 0x42, 0x40, 0x3f, 0x29, 0x21,
- 0x04, 0xef, 0x00, 0x5c, 0xc7, 0xb5, 0x45, 0x71, 0x54, 0x48, 0x1b, 0x9c, 0x95, 0x6b, 0x83, 0x7b,
- 0x01, 0x86, 0xe9, 0x51, 0xe6, 0x36, 0x64, 0xbf, 0xb9, 0xbb, 0x0c, 0x2f, 0xc2, 0x12, 0x66, 0xff,
- 0x82, 0x05, 0x27, 0xae, 0xbb, 0x11, 0x95, 0x33, 0x92, 0x81, 0xbb, 0xa8, 0xa0, 0x11, 0xba, 0x91,
- 0x1f, 0xec, 0x25, 0x79, 0x2f, 0x56, 0x10, 0xac, 0x61, 0xf1, 0x0f, 0xda, 0x75, 0xd9, 0x93, 0xba,
- 0x92, 0x69, 0xf5, 0xc4, 0xa2, 0x1c, 0x2b, 0x0c, 0x3a, 0x5e, 0x4d, 0x37, 0x60, 0x9c, 0x5e, 0x72,
- 0x63, 0x35, 0x5e, 0x4b, 0x12, 0x80, 0x63, 0x1c, 0xfb, 0x8f, 0x2d, 0xa8, 0x5e, 0xe7, 0x81, 0x01,
- 0x36, 0xc3, 0x1c, 0xa6, 0xfb, 0x3a, 0x8c, 0x12, 0x69, 0x9e, 0x49, 0xfa, 0x72, 0x2b, 0xbb, 0x0d,
- 0x8f, 0x1f, 0xa6, 0xf0, 0xfa, 0x38, 0x33, 0x8e, 0x16, 0x66, 0x61, 0x05, 0x10, 0xd1, 0xdb, 0xd2,
- 0x03, 0xaa, 0xb1, 0xc8, 0x4c, 0xcb, 0x29, 0x28, 0xce, 0xa8, 0x61, 0xff, 0x0d, 0x0b, 0x4e, 0xa9,
- 0x0f, 0xfe, 0xc4, 0x7d, 0xa6, 0xfd, 0xab, 0x25, 0x98, 0xb8, 0xb1, 0xb1, 0x51, 0xbb, 0x4e, 0x22,
- 0x6d, 0x55, 0x16, 0x3b, 0x5d, 0x60, 0xcd, 0x76, 0x5c, 0x74, 0xad, 0xed, 0x46, 0x6e, 0x6b, 0x8e,
- 0x87, 0x09, 0x9d, 0x5b, 0xf5, 0xa2, 0xdb, 0x41, 0x3d, 0x0a, 0x5c, 0x6f, 0x2b, 0x73, 0xa5, 0x4b,
- 0x31, 0xab, 0x9c, 0x27, 0x66, 0xa1, 0xd7, 0x61, 0x88, 0xc5, 0x29, 0x95, 0x93, 0xf0, 0x8c, 0xba,
- 0x15, 0xb2, 0xd2, 0xc3, 0xfd, 0xea, 0xe8, 0x1d, 0xbc, 0xca, 0xff, 0x60, 0x81, 0x8a, 0xee, 0xc0,
- 0xd8, 0x76, 0x14, 0x75, 0x6e, 0x10, 0xa7, 0x49, 0x02, 0xc9, 0x65, 0x2f, 0x64, 0x71, 0x59, 0x3a,
- 0x08, 0x1c, 0x2d, 0x66, 0x4c, 0x71, 0x59, 0x88, 0x75, 0x3a, 0x76, 0x1d, 0x20, 0x86, 0x3d, 0x21,
- 0xb3, 0x99, 0xbd, 0x01, 0xa3, 0xf4, 0x73, 0xe7, 0x5b, 0xae, 0x53, 0xec, 0x98, 0xf0, 0x32, 0x8c,
- 0x4a, 0xb7, 0x83, 0x50, 0x44, 0x11, 0x62, 0x27, 0x92, 0xf4, 0x4a, 0x08, 0x71, 0x0c, 0xb7, 0x9f,
- 0x07, 0xe1, 0x1b, 0x5f, 0x44, 0xd2, 0xde, 0x84, 0x93, 0xcc, 0xc9, 0xdf, 0x89, 0xb6, 0x8d, 0x35,
- 0xda, 0x7b, 0x31, 0xbc, 0x22, 0xae, 0xa2, 0x25, 0xe5, 0x6d, 0x25, 0xa3, 0x54, 0x8c, 0x4b, 0x8a,
- 0xf1, 0xb5, 0xd4, 0xfe, 0xa3, 0x01, 0x78, 0x66, 0xb5, 0x9e, 0x1f, 0xfe, 0xee, 0x1a, 0x8c, 0x73,
- 0x09, 0x97, 0x2e, 0x0d, 0xa7, 0x25, 0xda, 0x55, 0x4a, 0xdb, 0x0d, 0x0d, 0x86, 0x0d, 0x4c, 0x2a,
- 0x11, 0xba, 0x1f, 0x79, 0xc9, 0x37, 0xdc, 0xab, 0x1f, 0xac, 0x63, 0x5a, 0x4e, 0xc1, 0x54, 0x58,
- 0xe6, 0x2c, 0x5d, 0x81, 0x95, 0xc0, 0xfc, 0x2e, 0x4c, 0xba, 0x61, 0x23, 0x74, 0x57, 0x3d, 0xba,
- 0x4f, 0xb5, 0x9d, 0xae, 0xd4, 0x24, 0xb4, 0xd3, 0x0a, 0x8a, 0x13, 0xd8, 0xda, 0xf9, 0x32, 0xd8,
- 0xb7, 0xc0, 0xdd, 0x33, 0xf8, 0x0e, 0x65, 0xff, 0x1d, 0xf6, 0x75, 0x21, 0xb3, 0x55, 0x08, 0xf6,
- 0xcf, 0x3f, 0x38, 0xc4, 0x12, 0x46, 0xef, 0xa0, 0x8d, 0x6d, 0xa7, 0x33, 0xdf, 0x8d, 0xb6, 0x97,
- 0xdc, 0xb0, 0xe1, 0xef, 0x92, 0x60, 0x8f, 0xa9, 0x0f, 0x46, 0xe2, 0x3b, 0xa8, 0x02, 0x2c, 0xde,
- 0x98, 0xaf, 0x51, 0x4c, 0x9c, 0xae, 0x83, 0xe6, 0x61, 0x4a, 0x16, 0xd6, 0x49, 0xc8, 0x8e, 0x80,
- 0x31, 0x46, 0x46, 0xbd, 0xaa, 0x16, 0xc5, 0x8a, 0x48, 0x12, 0xdf, 0x14, 0x70, 0xe1, 0x49, 0x08,
- 0xb8, 0x5f, 0x80, 0x09, 0xd7, 0x73, 0x23, 0xd7, 0x89, 0x7c, 0x6e, 0x68, 0xe3, 0x9a, 0x02, 0xa6,
- 0x13, 0x5f, 0xd5, 0x01, 0xd8, 0xc4, 0xb3, 0xff, 0x8f, 0x01, 0x98, 0x61, 0xd3, 0xf6, 0xe9, 0x0a,
- 0xfb, 0x61, 0x5a, 0x61, 0x77, 0xd2, 0x2b, 0xec, 0x49, 0x48, 0xee, 0x8f, 0xbd, 0xcc, 0xbe, 0x63,
- 0xc1, 0x0c, 0x53, 0xcb, 0x1b, 0xcb, 0xec, 0x0a, 0x8c, 0x06, 0xc6, 0x83, 0xf7, 0x51, 0xdd, 0xfa,
- 0x27, 0xdf, 0xae, 0xc7, 0x38, 0xe8, 0x3d, 0x80, 0x4e, 0xac, 0xf6, 0x2f, 0x19, 0x51, 0x8a, 0x21,
- 0x57, 0xe3, 0xaf, 0xd5, 0xb1, 0xbf, 0x05, 0xa3, 0xea, 0x45, 0xbb, 0xbc, 0x20, 0x5b, 0x39, 0x17,
- 0xe4, 0xde, 0x62, 0x84, 0xf4, 0x4c, 0x2c, 0x67, 0x7a, 0x26, 0xfe, 0x6b, 0x0b, 0x62, 0xa3, 0x0c,
- 0xfa, 0x00, 0x46, 0x3b, 0x3e, 0x73, 0x64, 0x0f, 0xe4, 0xeb, 0x90, 0xe7, 0x0b, 0xad, 0x3a, 0x3c,
- 0x14, 0x69, 0xc0, 0xa7, 0xa3, 0x26, 0xab, 0xe2, 0x98, 0x0a, 0xba, 0x09, 0xc3, 0x9d, 0x80, 0xd4,
- 0x23, 0x16, 0x27, 0xaf, 0x7f, 0x82, 0x7c, 0xf9, 0xf2, 0x8a, 0x58, 0x52, 0x48, 0xf8, 0x05, 0x97,
- 0xfb, 0xf7, 0x0b, 0xb6, 0xff, 0x7e, 0x09, 0xa6, 0x93, 0x8d, 0xa0, 0x77, 0x60, 0x80, 0x3c, 0x24,
- 0x0d, 0xf1, 0xa5, 0x99, 0xd2, 0x44, 0xac, 0x10, 0xe2, 0x43, 0x47, 0xff, 0x63, 0x56, 0x0b, 0xdd,
- 0x80, 0x61, 0x2a, 0x4a, 0x5c, 0x57, 0xd1, 0x64, 0x9f, 0xcd, 0x13, 0x47, 0x94, 0x4c, 0xc6, 0x3f,
- 0x4b, 0x14, 0x61, 0x59, 0x9d, 0x39, 0x12, 0x36, 0x3a, 0x75, 0x7a, 0x4b, 0x8b, 0x8a, 0x94, 0x09,
- 0x1b, 0x8b, 0x35, 0x8e, 0x24, 0xa8, 0x71, 0x47, 0x42, 0x59, 0x88, 0x63, 0x22, 0xe8, 0x3d, 0x18,
- 0x0c, 0x5b, 0x84, 0x74, 0x84, 0xa7, 0x48, 0xa6, 0x4a, 0xb7, 0x4e, 0x11, 0x04, 0x25, 0xa6, 0x02,
- 0x62, 0x05, 0x98, 0x57, 0xb4, 0x7f, 0xcd, 0x02, 0xe0, 0x9e, 0x97, 0x8e, 0xb7, 0x45, 0x8e, 0xc1,
- 0x0a, 0xb2, 0x04, 0x03, 0x61, 0x87, 0x34, 0x8a, 0xde, 0x77, 0xc4, 0xfd, 0xa9, 0x77, 0x48, 0x23,
- 0x5e, 0xed, 0xf4, 0x1f, 0x66, 0xb5, 0xed, 0x9f, 0x00, 0x98, 0x8c, 0xd1, 0x56, 0x23, 0xd2, 0x46,
- 0xaf, 0x1a, 0x21, 0xb8, 0xce, 0x26, 0x42, 0x70, 0x8d, 0x32, 0x6c, 0x4d, 0xe1, 0xfe, 0x2d, 0x28,
- 0xb7, 0x9d, 0x87, 0x42, 0xa3, 0xfa, 0x72, 0x71, 0x37, 0x28, 0xfd, 0xb9, 0x35, 0xe7, 0x21, 0xbf,
- 0xc1, 0xbf, 0x2c, 0x77, 0xe7, 0x9a, 0xf3, 0xb0, 0xe7, 0x1b, 0x04, 0xda, 0x08, 0x6b, 0xcb, 0xf5,
- 0x84, 0x53, 0x61, 0x5f, 0x6d, 0xb9, 0x5e, 0xb2, 0x2d, 0xd7, 0xeb, 0xa3, 0x2d, 0xd7, 0x43, 0x8f,
- 0x60, 0x58, 0xf8, 0xfc, 0x8a, 0xd8, 0xa0, 0x57, 0xfa, 0x68, 0x4f, 0xb8, 0x0c, 0xf3, 0x36, 0xaf,
- 0x48, 0x0d, 0x85, 0x28, 0xed, 0xd9, 0xae, 0x6c, 0x10, 0xfd, 0x35, 0x0b, 0x26, 0xc5, 0x6f, 0xf1,
- 0x9c, 0x56, 0x48, 0xf0, 0x9f, 0xef, 0xbf, 0x0f, 0xa2, 0x22, 0xef, 0xca, 0xe7, 0xe5, 0x61, 0x6b,
- 0x02, 0x7b, 0xf6, 0x28, 0xd1, 0x0b, 0xf4, 0xf7, 0x2d, 0x38, 0xd9, 0x76, 0x1e, 0xf2, 0x16, 0x79,
- 0x19, 0x76, 0x22, 0xd7, 0x17, 0x6e, 0x2e, 0xef, 0xf4, 0x37, 0xfd, 0xa9, 0xea, 0xbc, 0x93, 0xd2,
- 0xba, 0x7c, 0x32, 0x0b, 0xa5, 0x67, 0x57, 0x33, 0xfb, 0x35, 0xbb, 0x09, 0x23, 0x72, 0xbd, 0x3d,
- 0xcd, 0x07, 0x0d, 0xac, 0x1d, 0xb1, 0xd6, 0x9e, 0x6a, 0x3b, 0xdf, 0x82, 0x71, 0x7d, 0x8d, 0x3d,
- 0xd5, 0xb6, 0x3e, 0x82, 0x13, 0x19, 0x6b, 0xe9, 0xa9, 0x36, 0xf9, 0x00, 0xce, 0xe6, 0xae, 0x8f,
- 0xa7, 0xfa, 0x20, 0xe5, 0x57, 0x2d, 0x9d, 0x0f, 0x1e, 0x83, 0x29, 0x6a, 0xd1, 0x34, 0x45, 0x5d,
- 0x28, 0xde, 0x39, 0x39, 0xf6, 0xa8, 0x0f, 0xf5, 0x4e, 0x53, 0xae, 0x8e, 0xde, 0x87, 0xa1, 0x16,
- 0x2d, 0x91, 0x9e, 0xe3, 0x76, 0xef, 0x1d, 0x19, 0x4b, 0xd4, 0xac, 0x3c, 0xc4, 0x82, 0x82, 0xfd,
- 0x33, 0x16, 0x64, 0x3c, 0xa9, 0xa1, 0x12, 0x56, 0xd7, 0x6d, 0xb2, 0x21, 0x29, 0xc7, 0x12, 0x96,
- 0x8a, 0x50, 0x75, 0x1e, 0xca, 0x5b, 0x6e, 0x53, 0xbc, 0xd6, 0x57, 0xe0, 0xeb, 0x14, 0xbc, 0xe5,
- 0x36, 0xd1, 0x0a, 0xa0, 0xb0, 0xdb, 0xe9, 0xb4, 0x98, 0x67, 0x98, 0xd3, 0xba, 0x1e, 0xf8, 0xdd,
- 0x0e, 0x77, 0x13, 0x2f, 0x73, 0xf5, 0x52, 0x3d, 0x05, 0xc5, 0x19, 0x35, 0xec, 0x7f, 0x64, 0xc1,
- 0xc0, 0x31, 0x4c, 0x13, 0x36, 0xa7, 0xe9, 0xd5, 0x5c, 0xd2, 0x22, 0xa5, 0xcc, 0x1c, 0x76, 0x1e,
- 0xb0, 0x70, 0x0d, 0x21, 0x13, 0x38, 0x32, 0x67, 0x6d, 0xdf, 0x82, 0x13, 0xb7, 0x7c, 0xa7, 0xb9,
- 0xe0, 0xb4, 0x1c, 0xaf, 0x41, 0x82, 0x55, 0x6f, 0xeb, 0x48, 0x6f, 0x32, 0x4a, 0x3d, 0xdf, 0x64,
- 0x5c, 0x83, 0x21, 0xb7, 0xa3, 0xe5, 0xa4, 0xb8, 0x48, 0x67, 0x77, 0xb5, 0x26, 0xd2, 0x51, 0x20,
- 0xa3, 0x71, 0x56, 0x8a, 0x05, 0x3e, 0x5d, 0x96, 0xdc, 0x6f, 0x71, 0x20, 0x7f, 0x59, 0xd2, 0x5b,
- 0x52, 0x32, 0xd6, 0xa2, 0xe1, 0xb6, 0xbf, 0x0d, 0x46, 0x13, 0xe2, 0x91, 0x1a, 0x86, 0x61, 0x97,
- 0x7f, 0xa9, 0x58, 0x9b, 0x2f, 0x66, 0xdf, 0x5e, 0x52, 0x03, 0xa3, 0xbd, 0xc6, 0xe4, 0x05, 0x58,
- 0x12, 0xb2, 0xaf, 0x41, 0x66, 0x6c, 0xac, 0xde, 0x9a, 0x29, 0xfb, 0x2b, 0x30, 0xc3, 0x6a, 0x1e,
- 0x51, 0xeb, 0x63, 0x27, 0xf4, 0xe9, 0x19, 0xe1, 0xc5, 0xed, 0xff, 0xc5, 0x02, 0xb4, 0xe6, 0x37,
- 0xdd, 0xcd, 0x3d, 0x41, 0x9c, 0x7f, 0xff, 0x47, 0x50, 0xe5, 0xd7, 0xea, 0x64, 0x08, 0xee, 0xc5,
- 0x96, 0x13, 0x86, 0x9a, 0x2e, 0xff, 0x45, 0xd1, 0x6e, 0x75, 0xa3, 0x18, 0x1d, 0xf7, 0xa2, 0x87,
- 0x3e, 0x48, 0x44, 0x44, 0xfd, 0x62, 0x2a, 0x22, 0xea, 0x8b, 0x99, 0x4e, 0x40, 0xe9, 0xde, 0xcb,
- 0x48, 0xa9, 0xf6, 0x77, 0x2d, 0x98, 0x5a, 0x4f, 0x84, 0x94, 0xbe, 0xc4, 0x3c, 0x22, 0x32, 0x6c,
- 0x54, 0x75, 0x56, 0x8a, 0x05, 0xf4, 0x89, 0xeb, 0x70, 0xff, 0xd4, 0x82, 0x38, 0x16, 0xdf, 0x31,
- 0x88, 0xdc, 0x8b, 0x86, 0xc8, 0x9d, 0x79, 0x7d, 0x51, 0xdd, 0xc9, 0x93, 0xb8, 0xd1, 0x4d, 0x35,
- 0x27, 0x05, 0x37, 0x97, 0x98, 0x0c, 0xdf, 0x67, 0x93, 0xe6, 0xc4, 0xa9, 0xd9, 0xf8, 0xfd, 0x12,
- 0x20, 0x85, 0xdb, 0x77, 0x14, 0xdd, 0x74, 0x8d, 0x27, 0x13, 0x45, 0x77, 0x17, 0x10, 0xf3, 0xe9,
- 0x09, 0x1c, 0x2f, 0xe4, 0x64, 0x5d, 0xa1, 0xb5, 0x3e, 0x9a, 0xc3, 0x90, 0x72, 0x89, 0xbd, 0x95,
- 0xa2, 0x86, 0x33, 0x5a, 0xd0, 0x7c, 0xb5, 0x06, 0xfb, 0xf5, 0xd5, 0x1a, 0xea, 0xf1, 0xe8, 0xfe,
- 0x57, 0x2c, 0x98, 0x50, 0xc3, 0xf4, 0x09, 0x79, 0xba, 0xa3, 0xfa, 0x93, 0x73, 0xae, 0xd4, 0xb4,
- 0x2e, 0x33, 0x61, 0xe0, 0x47, 0x58, 0xf0, 0x04, 0xa7, 0xe5, 0x3e, 0x22, 0x2a, 0xd8, 0x7b, 0x55,
- 0x04, 0x43, 0x10, 0xa5, 0x87, 0xfb, 0xd5, 0x09, 0xf5, 0x8f, 0xfb, 0x23, 0xc4, 0x55, 0xec, 0xbf,
- 0x4d, 0x37, 0xbb, 0xb9, 0x14, 0xd1, 0x9b, 0x30, 0xd8, 0xd9, 0x76, 0x42, 0x92, 0x78, 0xe2, 0x38,
- 0x58, 0xa3, 0x85, 0x87, 0xfb, 0xd5, 0x49, 0x55, 0x81, 0x95, 0x60, 0x8e, 0xdd, 0x7f, 0x6c, 0xe2,
- 0xf4, 0xe2, 0xec, 0x19, 0x9b, 0xf8, 0xdf, 0x59, 0x30, 0xb0, 0x4e, 0x4f, 0xaf, 0xa7, 0xcf, 0x02,
- 0xde, 0x35, 0x58, 0xc0, 0xb9, 0xbc, 0xb4, 0x67, 0xb9, 0xbb, 0x7f, 0x25, 0xb1, 0xfb, 0x2f, 0xe4,
- 0x52, 0x28, 0xde, 0xf8, 0x6d, 0x18, 0x63, 0xc9, 0xd4, 0xc4, 0x73, 0xce, 0xd7, 0x8d, 0x0d, 0x5f,
- 0x4d, 0x6c, 0xf8, 0x29, 0x0d, 0x55, 0xdb, 0xe9, 0x2f, 0xc1, 0xb0, 0x78, 0x1f, 0x98, 0x8c, 0x41,
- 0x21, 0x70, 0xb1, 0x84, 0xdb, 0x3f, 0x57, 0x06, 0x23, 0x79, 0x1b, 0xfa, 0x27, 0x16, 0xcc, 0x05,
- 0xdc, 0xc5, 0xbf, 0xb9, 0xd4, 0x0d, 0x5c, 0x6f, 0xab, 0xde, 0xd8, 0x26, 0xcd, 0x6e, 0xcb, 0xf5,
- 0xb6, 0x56, 0xb7, 0x3c, 0x5f, 0x15, 0x2f, 0x3f, 0x24, 0x8d, 0xae, 0x8a, 0xdb, 0x53, 0x90, 0x29,
- 0x4e, 0x3d, 0x93, 0x79, 0xed, 0x60, 0xbf, 0x3a, 0x87, 0x8f, 0x44, 0x1b, 0x1f, 0xb1, 0x2f, 0xe8,
- 0x9f, 0x5b, 0x70, 0x85, 0x27, 0x11, 0xeb, 0xbf, 0xff, 0x05, 0x1a, 0x8e, 0x9a, 0x24, 0x15, 0x13,
- 0xd9, 0x20, 0x41, 0x7b, 0xe1, 0x0b, 0x62, 0x40, 0xaf, 0xd4, 0x8e, 0xd6, 0x16, 0x3e, 0x6a, 0xe7,
- 0xec, 0xff, 0xa6, 0x0c, 0x13, 0x22, 0x86, 0xad, 0x38, 0x03, 0xde, 0x34, 0x96, 0xc4, 0xb3, 0x89,
- 0x25, 0x31, 0x63, 0x20, 0x3f, 0x19, 0xf6, 0x1f, 0xc2, 0x0c, 0x65, 0xce, 0x37, 0x88, 0x13, 0x44,
- 0xf7, 0x89, 0xc3, 0x5d, 0x30, 0xcb, 0x47, 0xe6, 0xfe, 0x4a, 0xb1, 0x7e, 0x2b, 0x49, 0x0c, 0xa7,
- 0xe9, 0xff, 0x30, 0x9d, 0x39, 0x1e, 0x4c, 0xa7, 0xc2, 0x10, 0x7f, 0x15, 0x46, 0xd5, 0xe3, 0x36,
- 0xc1, 0x74, 0x8a, 0xa3, 0x79, 0x27, 0x29, 0x70, 0xa5, 0x67, 0xfc, 0xb0, 0x32, 0x26, 0x67, 0xff,
- 0x72, 0xc9, 0x68, 0x90, 0x4f, 0xe2, 0x3a, 0x8c, 0x38, 0x21, 0xcb, 0x30, 0xd0, 0x2c, 0xd2, 0x68,
- 0xa7, 0x9a, 0x61, 0x7e, 0x66, 0xf3, 0xa2, 0x26, 0x56, 0x34, 0xd0, 0x0d, 0xee, 0xe8, 0xba, 0x4b,
- 0x8a, 0xd4, 0xd9, 0x29, 0x6a, 0x20, 0x5d, 0x61, 0x77, 0x09, 0x16, 0xf5, 0xd1, 0xd7, 0xb9, 0x27,
- 0xf2, 0x4d, 0xcf, 0x7f, 0xe0, 0x5d, 0xf7, 0x7d, 0x19, 0x04, 0xaa, 0x3f, 0x82, 0x33, 0xd2, 0xff,
- 0x58, 0x55, 0xc7, 0x26, 0xb5, 0xfe, 0xe2, 0xfa, 0xff, 0x28, 0xb0, 0xa4, 0x49, 0x66, 0x2c, 0x89,
- 0x10, 0x11, 0x98, 0x12, 0x01, 0x92, 0x65, 0x99, 0x18, 0xbb, 0xcc, 0xeb, 0xb7, 0x59, 0x3b, 0xb6,
- 0x00, 0xdd, 0x34, 0x49, 0xe0, 0x24, 0x4d, 0x7b, 0x9b, 0x33, 0xe1, 0x15, 0xe2, 0x44, 0xdd, 0x80,
- 0x84, 0xe8, 0xcb, 0x50, 0x49, 0xdf, 0x8c, 0x85, 0x21, 0xc5, 0x62, 0xd2, 0xf3, 0xb9, 0x83, 0xfd,
- 0x6a, 0xa5, 0x9e, 0x83, 0x83, 0x73, 0x6b, 0xdb, 0x3f, 0x6f, 0x01, 0x7b, 0xc1, 0x7f, 0x0c, 0x92,
- 0xcf, 0x97, 0x4c, 0xc9, 0xa7, 0x92, 0x37, 0x9d, 0x39, 0x42, 0xcf, 0x1b, 0x7c, 0x0d, 0xd7, 0x02,
- 0xff, 0xe1, 0x9e, 0xf0, 0xfa, 0xea, 0x7d, 0x8d, 0xb3, 0xbf, 0x67, 0x01, 0xcb, 0x30, 0x86, 0xf9,
- 0xad, 0x5d, 0x1a, 0x38, 0x7a, 0x3b, 0x34, 0x7c, 0x19, 0x46, 0x36, 0xc5, 0xf0, 0x67, 0x28, 0x9d,
- 0x8c, 0x0e, 0x9b, 0xb4, 0xe5, 0xa4, 0x89, 0x97, 0xb8, 0xe2, 0x1f, 0x56, 0xd4, 0xec, 0xff, 0xd2,
- 0x82, 0xd9, 0xfc, 0x6a, 0xe8, 0x0e, 0x9c, 0x09, 0x48, 0xa3, 0x1b, 0x84, 0x74, 0x4b, 0x88, 0x0b,
- 0x90, 0x78, 0x01, 0xc6, 0xa7, 0xfa, 0x99, 0x83, 0xfd, 0xea, 0x19, 0x9c, 0x8d, 0x82, 0xf3, 0xea,
- 0xa2, 0xb7, 0x60, 0xb2, 0x1b, 0x72, 0xc9, 0x8f, 0x09, 0x5d, 0xa1, 0x08, 0x63, 0xcf, 0x1e, 0x49,
- 0xdd, 0x31, 0x20, 0x38, 0x81, 0x69, 0xff, 0x79, 0xbe, 0x1c, 0x95, 0xc7, 0x6b, 0x1b, 0x66, 0x3c,
- 0xed, 0x3f, 0x3d, 0x01, 0xe5, 0x55, 0xff, 0xf9, 0x5e, 0xa7, 0x3e, 0x3b, 0x2e, 0xb5, 0x18, 0x03,
- 0x09, 0x32, 0x38, 0x4d, 0xd9, 0xfe, 0x9b, 0x16, 0x9c, 0xd1, 0x11, 0xb5, 0x17, 0x87, 0xbd, 0xac,
- 0x80, 0x4b, 0x5a, 0x00, 0x3e, 0x7e, 0xcc, 0x5d, 0xce, 0x08, 0xc0, 0x77, 0x52, 0xa7, 0x5e, 0x18,
- 0x6d, 0x8f, 0xbf, 0x2d, 0xcd, 0x8a, 0xb6, 0xf7, 0x47, 0x16, 0x5f, 0x9f, 0x7a, 0xd7, 0xd1, 0x47,
- 0x30, 0xdd, 0x76, 0xa2, 0xc6, 0xf6, 0xf2, 0xc3, 0x4e, 0xc0, 0x8d, 0xbb, 0x72, 0x9c, 0x5e, 0xee,
- 0x35, 0x4e, 0xda, 0x47, 0xc6, 0xde, 0xe0, 0x6b, 0x09, 0x62, 0x38, 0x45, 0x1e, 0xdd, 0x87, 0x31,
- 0x56, 0xc6, 0xde, 0x62, 0x87, 0x45, 0xb2, 0x4c, 0x5e, 0x6b, 0xca, 0x39, 0x68, 0x2d, 0xa6, 0x83,
- 0x75, 0xa2, 0xf6, 0x2f, 0x95, 0x39, 0xd3, 0x60, 0x77, 0x8f, 0x97, 0x60, 0xb8, 0xe3, 0x37, 0x17,
- 0x57, 0x97, 0xb0, 0x98, 0x05, 0x75, 0xee, 0xd5, 0x78, 0x31, 0x96, 0x70, 0x74, 0x19, 0x46, 0xc4,
- 0x4f, 0x69, 0x8c, 0x67, 0x7b, 0x44, 0xe0, 0x85, 0x58, 0x41, 0xd1, 0x6b, 0x00, 0x9d, 0xc0, 0xdf,
- 0x75, 0x9b, 0x2c, 0xf6, 0x56, 0xd9, 0xf4, 0xeb, 0xab, 0x29, 0x08, 0xd6, 0xb0, 0xd0, 0xdb, 0x30,
- 0xd1, 0xf5, 0x42, 0x2e, 0x3f, 0x69, 0xc9, 0x38, 0x94, 0xc7, 0xd9, 0x1d, 0x1d, 0x88, 0x4d, 0x5c,
- 0x34, 0x0f, 0x43, 0x91, 0xc3, 0xfc, 0xd4, 0x06, 0xf3, 0x5f, 0x0c, 0x6c, 0x50, 0x0c, 0x3d, 0xed,
- 0x25, 0xad, 0x80, 0x45, 0x45, 0xf4, 0x55, 0x19, 0x16, 0x81, 0x9f, 0x44, 0xe2, 0xa9, 0x4e, 0x7f,
- 0xa7, 0x96, 0x16, 0x14, 0x41, 0x3c, 0x01, 0x32, 0x68, 0xa1, 0xb7, 0x00, 0xc8, 0xc3, 0x88, 0x04,
- 0x9e, 0xd3, 0x52, 0xde, 0xa5, 0x4a, 0x90, 0x59, 0xf2, 0xd7, 0xfd, 0xe8, 0x4e, 0x48, 0x96, 0x15,
- 0x06, 0xd6, 0xb0, 0xed, 0x9f, 0x18, 0x03, 0x88, 0x2f, 0x1a, 0xe8, 0x11, 0x8c, 0x34, 0x9c, 0x8e,
- 0xd3, 0xe0, 0x39, 0x9d, 0xcb, 0x79, 0x0f, 0xcb, 0xe3, 0x1a, 0x73, 0x8b, 0x02, 0x9d, 0x1b, 0x6f,
- 0x64, 0x3e, 0x83, 0x11, 0x59, 0xdc, 0xd3, 0x60, 0xa3, 0xda, 0x43, 0xdf, 0xb1, 0x60, 0x4c, 0xc4,
- 0xb6, 0x62, 0x33, 0x54, 0xca, 0xb7, 0xb7, 0x69, 0xed, 0xcf, 0xc7, 0x35, 0x78, 0x17, 0x5e, 0x97,
- 0x2b, 0x54, 0x83, 0xf4, 0xec, 0x85, 0xde, 0x30, 0xfa, 0x9c, 0xbc, 0xdb, 0x96, 0x8d, 0xa1, 0x54,
- 0x77, 0xdb, 0x51, 0x76, 0xd4, 0xe8, 0xd7, 0xda, 0x3b, 0xc6, 0xb5, 0x76, 0x20, 0xff, 0x89, 0xb6,
- 0x21, 0x6f, 0xf7, 0xba, 0xd1, 0xa2, 0x9a, 0x1e, 0x03, 0x66, 0x30, 0xff, 0x85, 0xaf, 0x76, 0xb1,
- 0xeb, 0x11, 0xff, 0xe5, 0x5b, 0x30, 0xd5, 0x34, 0xa5, 0x16, 0xb1, 0x12, 0x5f, 0xcc, 0xa3, 0x9b,
- 0x10, 0x72, 0x62, 0x39, 0x25, 0x01, 0xc0, 0x49, 0xc2, 0xa8, 0xc6, 0x43, 0x02, 0xad, 0x7a, 0x9b,
- 0xbe, 0x78, 0x2e, 0x66, 0xe7, 0xce, 0xe5, 0x5e, 0x18, 0x91, 0x36, 0xc5, 0x8c, 0x85, 0x84, 0x75,
- 0x51, 0x17, 0x2b, 0x2a, 0xe8, 0x7d, 0x18, 0x62, 0x4f, 0x3c, 0xc3, 0xca, 0x48, 0xbe, 0x59, 0xc3,
- 0x8c, 0x2e, 0x1c, 0x6f, 0x48, 0xf6, 0x37, 0xc4, 0x82, 0x02, 0xba, 0x21, 0x1f, 0x50, 0x87, 0xab,
- 0xde, 0x9d, 0x90, 0xb0, 0x07, 0xd4, 0xa3, 0x0b, 0xcf, 0xc7, 0x6f, 0xa3, 0x79, 0x79, 0x66, 0x72,
- 0x6c, 0xa3, 0x26, 0x15, 0xfb, 0xc4, 0x7f, 0x99, 0x73, 0x5b, 0x44, 0xea, 0xcb, 0xec, 0x9e, 0x99,
- 0x97, 0x3b, 0x1e, 0xce, 0xbb, 0x26, 0x09, 0x9c, 0xa4, 0x49, 0x45, 0x68, 0xbe, 0xeb, 0xc5, 0x83,
- 0xb3, 0x5e, 0xbc, 0x83, 0x6b, 0x0e, 0xd8, 0x69, 0xc4, 0x4b, 0xb0, 0xa8, 0x8f, 0x5c, 0x98, 0x0a,
- 0x0c, 0xf1, 0x42, 0x06, 0xd8, 0xbb, 0xd4, 0x9f, 0x10, 0xa3, 0x65, 0x19, 0x31, 0xc9, 0xe0, 0x24,
- 0x5d, 0xf4, 0xbe, 0x26, 0x28, 0x4d, 0x14, 0xdf, 0xfc, 0x7b, 0x89, 0x46, 0xb3, 0x3b, 0x30, 0x61,
- 0x30, 0x9b, 0xa7, 0x6a, 0x82, 0xf4, 0x60, 0x3a, 0xc9, 0x59, 0x9e, 0xaa, 0xe5, 0xf1, 0x2d, 0x98,
- 0x64, 0x1b, 0xe1, 0x81, 0xd3, 0x11, 0xac, 0xf8, 0xb2, 0xc1, 0x8a, 0xad, 0xcb, 0x65, 0x3e, 0x30,
- 0x72, 0x08, 0x62, 0xc6, 0x69, 0xff, 0x9d, 0x41, 0x51, 0x59, 0xed, 0x22, 0x74, 0x05, 0x46, 0x45,
- 0x07, 0x54, 0xaa, 0x3e, 0xc5, 0x18, 0xd6, 0x24, 0x00, 0xc7, 0x38, 0x2c, 0x43, 0x23, 0xab, 0xae,
- 0xbd, 0x50, 0x88, 0x33, 0x34, 0x2a, 0x08, 0xd6, 0xb0, 0xe8, 0xe5, 0xf7, 0xbe, 0xef, 0x47, 0xea,
- 0x0c, 0x56, 0x5b, 0x6d, 0x81, 0x95, 0x62, 0x01, 0xa5, 0x67, 0xef, 0x0e, 0x09, 0x3c, 0xd2, 0x32,
- 0x73, 0xd5, 0xa8, 0xb3, 0xf7, 0xa6, 0x0e, 0xc4, 0x26, 0x2e, 0x95, 0x20, 0xfc, 0x90, 0xed, 0x5d,
- 0x71, 0xc5, 0x8e, 0x5f, 0x7c, 0xd4, 0x79, 0x90, 0x0f, 0x09, 0x47, 0x5f, 0x81, 0x33, 0x2a, 0xd8,
- 0xa6, 0x58, 0x99, 0xb2, 0xc5, 0x21, 0x43, 0x23, 0x76, 0x66, 0x31, 0x1b, 0x0d, 0xe7, 0xd5, 0x47,
- 0xef, 0xc2, 0xa4, 0xb8, 0x86, 0x49, 0x8a, 0xc3, 0xa6, 0xfb, 0xe2, 0x4d, 0x03, 0x8a, 0x13, 0xd8,
- 0x32, 0xdb, 0x0e, 0xbb, 0x9f, 0x48, 0x0a, 0x23, 0xe9, 0x6c, 0x3b, 0x3a, 0x1c, 0xa7, 0x6a, 0xa0,
- 0x79, 0x98, 0xe2, 0x62, 0xa7, 0xeb, 0x6d, 0xf1, 0x39, 0x11, 0x4f, 0x60, 0xd5, 0x86, 0xbc, 0x6d,
- 0x82, 0x71, 0x12, 0x1f, 0x5d, 0x83, 0x71, 0x27, 0x68, 0x6c, 0xbb, 0x11, 0x69, 0xd0, 0x5d, 0xc5,
- 0x3c, 0x08, 0x35, 0xff, 0xcf, 0x79, 0x0d, 0x86, 0x0d, 0x4c, 0xf4, 0x1e, 0x0c, 0x84, 0x0f, 0x9c,
- 0x8e, 0xe0, 0x3e, 0xf9, 0xac, 0x5c, 0xad, 0x60, 0xee, 0xfa, 0x45, 0xff, 0x63, 0x56, 0xd3, 0x7e,
- 0x04, 0x27, 0x32, 0x82, 0x12, 0xd1, 0xa5, 0xe7, 0x74, 0x5c, 0x39, 0x2a, 0x89, 0x67, 0x1a, 0xf3,
- 0xb5, 0x55, 0x39, 0x1e, 0x1a, 0x16, 0x5d, 0xdf, 0x2c, 0x78, 0x51, 0x2d, 0x36, 0x24, 0xa9, 0xf5,
- 0xbd, 0x22, 0x01, 0x38, 0xc6, 0xb1, 0xff, 0xa4, 0x04, 0x53, 0x19, 0xe6, 0x41, 0x96, 0x1b, 0x3f,
- 0x71, 0xcf, 0x8b, 0x53, 0xe1, 0x9b, 0xe9, 0x9f, 0x4a, 0x47, 0x48, 0xff, 0x54, 0xee, 0x95, 0xfe,
- 0x69, 0xe0, 0xe3, 0xa4, 0x7f, 0x32, 0x47, 0x6c, 0xb0, 0xaf, 0x11, 0xcb, 0x48, 0x19, 0x35, 0x74,
- 0xc4, 0x94, 0x51, 0xc6, 0xa0, 0x0f, 0xf7, 0x31, 0xe8, 0xff, 0x69, 0x09, 0xa6, 0x93, 0x96, 0xc5,
- 0x63, 0xd0, 0xce, 0xbf, 0x6f, 0x68, 0xe7, 0x2f, 0xf7, 0x13, 0xf4, 0x20, 0x57, 0x53, 0x8f, 0x13,
- 0x9a, 0xfa, 0xcf, 0xf6, 0x45, 0xad, 0x58, 0x6b, 0xff, 0xb7, 0x4a, 0x70, 0x2a, 0xd3, 0xe0, 0x7a,
- 0x0c, 0x63, 0x73, 0xdb, 0x18, 0x9b, 0x57, 0xfb, 0x0e, 0x08, 0x91, 0x3b, 0x40, 0xf7, 0x12, 0x03,
- 0x74, 0xa5, 0x7f, 0x92, 0xc5, 0xa3, 0xf4, 0xfd, 0x32, 0x5c, 0xc8, 0xac, 0x17, 0x2b, 0xb7, 0x57,
- 0x0c, 0xe5, 0xf6, 0x6b, 0x09, 0xe5, 0xb6, 0x5d, 0x5c, 0xfb, 0xc9, 0x68, 0xbb, 0x45, 0x60, 0x04,
- 0x16, 0xde, 0xe5, 0x31, 0x35, 0xdd, 0x46, 0x60, 0x04, 0x45, 0x08, 0x9b, 0x74, 0x7f, 0x98, 0x34,
- 0xdc, 0xff, 0x83, 0x05, 0x67, 0x33, 0xe7, 0xe6, 0x18, 0xf4, 0x8c, 0xeb, 0xa6, 0x9e, 0xf1, 0xa5,
- 0xbe, 0x57, 0x6b, 0x8e, 0xe2, 0xf1, 0xbb, 0x43, 0x39, 0xdf, 0xc2, 0xd4, 0x1f, 0xb7, 0x61, 0xcc,
- 0x69, 0x34, 0x48, 0x18, 0xae, 0xb1, 0x54, 0x13, 0xdc, 0xf6, 0xfa, 0x2a, 0xbb, 0x9c, 0xc6, 0xc5,
- 0x87, 0xfb, 0xd5, 0xd9, 0x24, 0x89, 0x18, 0x8c, 0x75, 0x0a, 0xe8, 0xeb, 0x30, 0x12, 0xca, 0x24,
- 0xbf, 0x03, 0x8f, 0x9f, 0xe4, 0x97, 0x49, 0x92, 0x4a, 0xbd, 0xa3, 0x48, 0xa2, 0x3f, 0xa7, 0x87,
- 0xf7, 0x2a, 0x50, 0x6c, 0xf2, 0x4e, 0x3e, 0x46, 0x90, 0x2f, 0xf3, 0x39, 0x7c, 0xb9, 0xaf, 0xe7,
- 0xf0, 0xef, 0xc1, 0x74, 0xc8, 0xc3, 0xe5, 0xc6, 0x2e, 0x32, 0x7c, 0x2d, 0xb2, 0x88, 0x83, 0xf5,
- 0x04, 0x0c, 0xa7, 0xb0, 0xd1, 0x8a, 0x6c, 0x95, 0x39, 0x43, 0xf1, 0xe5, 0x79, 0x29, 0x6e, 0x51,
- 0x38, 0x44, 0x9d, 0x4c, 0x4e, 0x02, 0x1b, 0x7e, 0xad, 0x26, 0xfa, 0x3a, 0x00, 0x5d, 0x44, 0x42,
- 0x85, 0x33, 0x9c, 0xcf, 0x42, 0x29, 0x6f, 0x69, 0x66, 0xbe, 0xc0, 0x60, 0x11, 0x0d, 0x96, 0x14,
- 0x11, 0xac, 0x11, 0x44, 0x0e, 0x4c, 0xc4, 0xff, 0x30, 0xd9, 0x2c, 0x0a, 0xb0, 0xc6, 0x5a, 0x48,
- 0x12, 0x67, 0xe6, 0x8d, 0x25, 0x9d, 0x04, 0x36, 0x29, 0xa2, 0xaf, 0xc1, 0xd9, 0xdd, 0x5c, 0xbf,
- 0x23, 0x2e, 0x4b, 0x9e, 0x3f, 0xd8, 0xaf, 0x9e, 0xcd, 0xf7, 0x36, 0xca, 0xaf, 0x6f, 0xff, 0x8f,
- 0x00, 0xcf, 0x14, 0x70, 0x7a, 0x34, 0x6f, 0xfa, 0x0c, 0xbc, 0x9c, 0xd4, 0xab, 0xcc, 0x66, 0x56,
- 0x36, 0x14, 0x2d, 0x89, 0x0d, 0x55, 0xfa, 0xd8, 0x1b, 0xea, 0xa7, 0x2c, 0xed, 0x9a, 0xc5, 0x3d,
- 0xca, 0xbf, 0x74, 0xc4, 0x13, 0xec, 0x09, 0xaa, 0xc0, 0x36, 0x33, 0xf4, 0x48, 0xaf, 0xf5, 0xdd,
- 0x9d, 0xfe, 0x15, 0x4b, 0xbf, 0x9a, 0x9d, 0x60, 0x80, 0xab, 0x98, 0xae, 0x1f, 0xf5, 0xfb, 0x8f,
- 0x2b, 0xd9, 0xc0, 0xef, 0x5b, 0x70, 0x36, 0x55, 0xcc, 0xfb, 0x40, 0x42, 0x11, 0xce, 0x70, 0xfd,
- 0x63, 0x77, 0x5e, 0x12, 0xe4, 0xdf, 0x70, 0x43, 0x7c, 0xc3, 0xd9, 0x5c, 0xbc, 0x64, 0xd7, 0x7f,
- 0xf2, 0x5f, 0x55, 0x4f, 0xb0, 0x06, 0x4c, 0x44, 0x9c, 0xdf, 0x75, 0xd4, 0x81, 0x8b, 0x8d, 0x6e,
- 0x10, 0xc4, 0x8b, 0x35, 0x63, 0x73, 0xf2, 0xdb, 0xe2, 0xf3, 0x07, 0xfb, 0xd5, 0x8b, 0x8b, 0x3d,
- 0x70, 0x71, 0x4f, 0x6a, 0xc8, 0x03, 0xd4, 0x4e, 0x79, 0xf7, 0x31, 0x06, 0x90, 0xa3, 0x05, 0x4a,
- 0xfb, 0x02, 0x72, 0x3f, 0xdd, 0x0c, 0x1f, 0xc1, 0x0c, 0xca, 0xc7, 0xab, 0xbb, 0xf9, 0xc1, 0x64,
- 0x33, 0x98, 0xbd, 0x05, 0x17, 0x8a, 0x17, 0xd3, 0x91, 0x42, 0x50, 0xfc, 0x9e, 0x05, 0xe7, 0x0b,
- 0x43, 0xb3, 0xfd, 0x19, 0xbc, 0x2c, 0xd8, 0xdf, 0xb6, 0xe0, 0xd9, 0xcc, 0x1a, 0xc9, 0xc7, 0x83,
- 0x0d, 0x5a, 0xa8, 0x39, 0xc3, 0xc6, 0x41, 0x8a, 0x24, 0x00, 0xc7, 0x38, 0x86, 0xbf, 0x68, 0xa9,
- 0xa7, 0xbf, 0xe8, 0x3f, 0xb5, 0x20, 0x75, 0xd4, 0x1f, 0x83, 0xe4, 0xb9, 0x6a, 0x4a, 0x9e, 0xcf,
- 0xf7, 0x33, 0x9a, 0x39, 0x42, 0xe7, 0xbf, 0x9d, 0x82, 0xd3, 0x39, 0x2f, 0xc8, 0x77, 0x61, 0x66,
- 0xab, 0x41, 0xcc, 0x90, 0x21, 0x45, 0xd1, 0xff, 0x0a, 0xe3, 0x8b, 0x2c, 0x9c, 0x3a, 0xd8, 0xaf,
- 0xce, 0xa4, 0x50, 0x70, 0xba, 0x09, 0xf4, 0x6d, 0x0b, 0x4e, 0x3a, 0x0f, 0xc2, 0x65, 0x7a, 0x83,
- 0x70, 0x1b, 0x0b, 0x2d, 0xbf, 0xb1, 0x43, 0x05, 0x33, 0xb9, 0xad, 0xde, 0xc8, 0x54, 0x85, 0xdf,
- 0xab, 0xa7, 0xf0, 0x8d, 0xe6, 0x2b, 0x07, 0xfb, 0xd5, 0x93, 0x59, 0x58, 0x38, 0xb3, 0x2d, 0x84,
- 0x45, 0x0e, 0x3f, 0x27, 0xda, 0x2e, 0x0a, 0x6a, 0x93, 0xf5, 0xd4, 0x9f, 0x8b, 0xc4, 0x12, 0x82,
- 0x15, 0x1d, 0xf4, 0x4d, 0x18, 0xdd, 0x92, 0xf1, 0x2b, 0x32, 0x44, 0xee, 0x78, 0x20, 0x8b, 0xa3,
- 0x7a, 0x70, 0x07, 0x1c, 0x85, 0x84, 0x63, 0xa2, 0xe8, 0x5d, 0x28, 0x7b, 0x9b, 0x61, 0x51, 0x08,
- 0xe9, 0x84, 0xa7, 0x35, 0x8f, 0x76, 0xb5, 0xbe, 0x52, 0xc7, 0xb4, 0x22, 0xba, 0x01, 0xe5, 0xe0,
- 0x7e, 0x53, 0xd8, 0x71, 0x32, 0x37, 0x29, 0x5e, 0x58, 0xca, 0xe9, 0x15, 0xa3, 0x84, 0x17, 0x96,
- 0x30, 0x25, 0x81, 0x6a, 0x30, 0xc8, 0x9e, 0x5d, 0x0b, 0xd1, 0x36, 0xf3, 0x2a, 0x5f, 0x10, 0xbe,
- 0x80, 0xbf, 0x87, 0x64, 0x08, 0x98, 0x13, 0x42, 0x1b, 0x30, 0xd4, 0x70, 0xbd, 0x26, 0x09, 0x84,
- 0x2c, 0xfb, 0xb9, 0x4c, 0x8b, 0x0d, 0xc3, 0xc8, 0xa1, 0xc9, 0x0d, 0x18, 0x0c, 0x03, 0x0b, 0x5a,
- 0x8c, 0x2a, 0xe9, 0x6c, 0x6f, 0xca, 0x13, 0x2b, 0x9b, 0x2a, 0xe9, 0x6c, 0xaf, 0xd4, 0x0b, 0xa9,
- 0x32, 0x0c, 0x2c, 0x68, 0xa1, 0xb7, 0xa0, 0xb4, 0xd9, 0x10, 0x4f, 0xaa, 0x33, 0xd5, 0x9b, 0x66,
- 0xc0, 0xb2, 0x85, 0xa1, 0x83, 0xfd, 0x6a, 0x69, 0x65, 0x11, 0x97, 0x36, 0x1b, 0x68, 0x1d, 0x86,
- 0x37, 0x79, 0xbc, 0x20, 0xa1, 0x1f, 0x7d, 0x31, 0x3b, 0x94, 0x51, 0x2a, 0xa4, 0x10, 0x7f, 0xdb,
- 0x2a, 0x00, 0x58, 0x12, 0x61, 0x09, 0xcf, 0x54, 0xdc, 0x23, 0x11, 0x29, 0x76, 0xee, 0x68, 0xb1,
- 0xaa, 0x44, 0xa0, 0x71, 0x45, 0x05, 0x6b, 0x14, 0xe9, 0xaa, 0x76, 0x1e, 0x75, 0x03, 0x96, 0x11,
- 0x45, 0x18, 0x66, 0x32, 0x57, 0xf5, 0xbc, 0x44, 0x2a, 0x5a, 0xd5, 0x0a, 0x09, 0xc7, 0x44, 0xd1,
- 0x0e, 0x4c, 0xec, 0x86, 0x9d, 0x6d, 0x22, 0xb7, 0x34, 0x8b, 0x30, 0x98, 0x23, 0xcd, 0xde, 0x15,
- 0x88, 0x6e, 0x10, 0x75, 0x9d, 0x56, 0x8a, 0x0b, 0xb1, 0x6b, 0xcd, 0x5d, 0x9d, 0x18, 0x36, 0x69,
- 0xd3, 0xe1, 0xff, 0xa8, 0xeb, 0xdf, 0xdf, 0x8b, 0x88, 0x08, 0xf0, 0x9a, 0x39, 0xfc, 0x1f, 0x70,
- 0x94, 0xf4, 0xf0, 0x0b, 0x00, 0x96, 0x44, 0xd0, 0x5d, 0x31, 0x3c, 0x8c, 0x7b, 0x4e, 0xe7, 0x07,
- 0xc2, 0x9f, 0x97, 0x48, 0x39, 0x83, 0xc2, 0xb8, 0x65, 0x4c, 0x8a, 0x71, 0xc9, 0xce, 0xb6, 0x1f,
- 0xf9, 0x5e, 0x82, 0x43, 0xcf, 0xe4, 0x73, 0xc9, 0x5a, 0x06, 0x7e, 0x9a, 0x4b, 0x66, 0x61, 0xe1,
- 0xcc, 0xb6, 0x50, 0x13, 0x26, 0x3b, 0x7e, 0x10, 0x3d, 0xf0, 0x03, 0xb9, 0xbe, 0x50, 0x81, 0xa2,
- 0xd4, 0xc0, 0x14, 0x2d, 0x32, 0xb7, 0x20, 0x13, 0x82, 0x13, 0x34, 0xd1, 0x97, 0x61, 0x38, 0x6c,
- 0x38, 0x2d, 0xb2, 0x7a, 0xbb, 0x72, 0x22, 0xff, 0xf8, 0xa9, 0x73, 0x94, 0x9c, 0xd5, 0xc5, 0xc3,
- 0x3d, 0x71, 0x14, 0x2c, 0xc9, 0xa1, 0x15, 0x18, 0x64, 0x39, 0xef, 0x59, 0x34, 0xe2, 0x9c, 0x78,
- 0xfe, 0xa9, 0x47, 0x3d, 0x9c, 0x37, 0xb1, 0x62, 0xcc, 0xab, 0xd3, 0x3d, 0x20, 0x34, 0x05, 0x7e,
- 0x58, 0x39, 0x95, 0xbf, 0x07, 0x84, 0x82, 0xe1, 0x76, 0xbd, 0x68, 0x0f, 0x28, 0x24, 0x1c, 0x13,
- 0xa5, 0x9c, 0x99, 0x72, 0xd3, 0xd3, 0x05, 0x0e, 0x9b, 0xb9, 0xbc, 0x94, 0x71, 0x66, 0xca, 0x49,
- 0x29, 0x09, 0xfb, 0x37, 0x47, 0xd2, 0x32, 0x0b, 0xd3, 0x30, 0xfd, 0xc7, 0x56, 0xca, 0x63, 0xe3,
- 0xf3, 0xfd, 0x2a, 0xbc, 0x9f, 0xe0, 0xc5, 0xf5, 0xdb, 0x16, 0x9c, 0xee, 0x64, 0x7e, 0x88, 0x10,
- 0x00, 0xfa, 0xd3, 0x9b, 0xf3, 0x4f, 0x57, 0x91, 0xab, 0xb3, 0xe1, 0x38, 0xa7, 0xa5, 0xa4, 0x72,
- 0xa0, 0xfc, 0xb1, 0x95, 0x03, 0x6b, 0x30, 0xd2, 0xe0, 0x37, 0x39, 0x99, 0x3c, 0xa2, 0xaf, 0xb8,
- 0xab, 0xdc, 0x4e, 0x2b, 0x2a, 0x62, 0x45, 0x02, 0xfd, 0xb4, 0x05, 0xe7, 0x93, 0x5d, 0xc7, 0x84,
- 0x81, 0x85, 0xbb, 0x26, 0x57, 0x6b, 0xad, 0x88, 0xef, 0x4f, 0xc9, 0xff, 0x06, 0xf2, 0x61, 0x2f,
- 0x04, 0x5c, 0xdc, 0x18, 0x5a, 0xca, 0xd0, 0xab, 0x0d, 0x99, 0x36, 0xc9, 0x3e, 0x74, 0x6b, 0x6f,
- 0xc0, 0x78, 0xdb, 0xef, 0x7a, 0x91, 0xf0, 0xba, 0x14, 0xae, 0x5b, 0xcc, 0x65, 0x69, 0x4d, 0x2b,
- 0xc7, 0x06, 0x56, 0x42, 0x23, 0x37, 0xf2, 0xd8, 0x1a, 0xb9, 0x0f, 0x61, 0xdc, 0xd3, 0x1e, 0x24,
- 0x14, 0xdd, 0x60, 0x85, 0x76, 0x51, 0xc3, 0xe6, 0xbd, 0xd4, 0x4b, 0xb0, 0x41, 0xad, 0x58, 0x5b,
- 0x06, 0x1f, 0x4f, 0x5b, 0x76, 0xac, 0x57, 0x62, 0xfb, 0xef, 0x95, 0x32, 0x6e, 0x0c, 0x5c, 0x2b,
- 0xf7, 0x8e, 0xa9, 0x95, 0xbb, 0x94, 0xd4, 0xca, 0xa5, 0x4c, 0x55, 0x86, 0x42, 0xae, 0xff, 0x0c,
- 0xa6, 0x7d, 0xc7, 0xd2, 0xfe, 0x0b, 0x16, 0x9c, 0x61, 0xb6, 0x0f, 0xda, 0xc0, 0xc7, 0xb6, 0x77,
- 0x30, 0x87, 0xd8, 0x5b, 0xd9, 0xe4, 0x70, 0x5e, 0x3b, 0x76, 0x0b, 0x2e, 0xf6, 0x3a, 0x77, 0x99,
- 0x7f, 0x71, 0x53, 0xb9, 0x57, 0xc4, 0xfe, 0xc5, 0xcd, 0xd5, 0x25, 0xcc, 0x20, 0xfd, 0x86, 0x5d,
- 0xb4, 0xff, 0x4f, 0x0b, 0xca, 0x35, 0xbf, 0x79, 0x0c, 0x37, 0xfa, 0x2f, 0x19, 0x37, 0xfa, 0x67,
- 0xb2, 0x4f, 0xfc, 0x66, 0xae, 0xb1, 0x6f, 0x39, 0x61, 0xec, 0x3b, 0x9f, 0x47, 0xa0, 0xd8, 0xb4,
- 0xf7, 0xb7, 0xcb, 0x30, 0x56, 0xf3, 0x9b, 0x6a, 0x9f, 0xfd, 0x77, 0x8f, 0xf3, 0x8c, 0x28, 0x37,
- 0x67, 0x99, 0x46, 0x99, 0xf9, 0x13, 0xcb, 0xa8, 0x17, 0x7f, 0xc6, 0x5e, 0x13, 0xdd, 0x23, 0xee,
- 0xd6, 0x76, 0x44, 0x9a, 0xc9, 0xcf, 0x39, 0xbe, 0xd7, 0x44, 0x7f, 0x58, 0x86, 0xa9, 0x44, 0xeb,
- 0xa8, 0x05, 0x13, 0x2d, 0xdd, 0x94, 0x24, 0xd6, 0xe9, 0x63, 0x59, 0xa1, 0xc4, 0x6b, 0x0c, 0xad,
- 0x08, 0x9b, 0xc4, 0xd1, 0x1c, 0x80, 0xa7, 0xfb, 0xa4, 0xab, 0x98, 0xd0, 0x9a, 0x3f, 0xba, 0x86,
- 0x81, 0xde, 0x84, 0xb1, 0xc8, 0xef, 0xf8, 0x2d, 0x7f, 0x6b, 0xef, 0xa6, 0x8a, 0x8f, 0xac, 0x5c,
- 0x96, 0x37, 0x62, 0x10, 0xd6, 0xf1, 0xd0, 0x43, 0x98, 0x51, 0x44, 0xea, 0x4f, 0xc0, 0xbc, 0xc6,
- 0xd4, 0x26, 0xeb, 0x49, 0x8a, 0x38, 0xdd, 0x08, 0x7a, 0x0b, 0x26, 0x99, 0xef, 0x34, 0xab, 0x7f,
- 0x93, 0xec, 0xc9, 0xe0, 0xd2, 0x4c, 0xc2, 0x5e, 0x33, 0x20, 0x38, 0x81, 0x89, 0x16, 0x61, 0xa6,
- 0xed, 0x86, 0x89, 0xea, 0x43, 0xac, 0x3a, 0xeb, 0xc0, 0x5a, 0x12, 0x88, 0xd3, 0xf8, 0xf6, 0x2f,
- 0x88, 0x39, 0xf6, 0x22, 0xf7, 0xd3, 0xed, 0xf8, 0xc9, 0xde, 0x8e, 0xdf, 0xb7, 0x60, 0x9a, 0xb6,
- 0xce, 0x1c, 0x42, 0xa5, 0x20, 0xa5, 0xd2, 0x8f, 0x58, 0x05, 0xe9, 0x47, 0x2e, 0x51, 0xb6, 0xdd,
- 0xf4, 0xbb, 0x91, 0xd0, 0x8e, 0x6a, 0x7c, 0x99, 0x96, 0x62, 0x01, 0x15, 0x78, 0x24, 0x08, 0xc4,
- 0xab, 0x7b, 0x1d, 0x8f, 0x04, 0x01, 0x16, 0x50, 0x99, 0x9d, 0x64, 0x20, 0x3b, 0x3b, 0x09, 0x0f,
- 0x32, 0x2f, 0xfc, 0xe8, 0x84, 0x48, 0xab, 0x05, 0x99, 0x97, 0x0e, 0x76, 0x31, 0x8e, 0xfd, 0xd7,
- 0xca, 0x50, 0xa9, 0xf9, 0xcd, 0x45, 0x12, 0x44, 0xee, 0xa6, 0xdb, 0x70, 0x22, 0xa2, 0xe5, 0xdb,
- 0x7d, 0x0d, 0x80, 0x3d, 0x22, 0x0b, 0xb2, 0x22, 0xa8, 0xd7, 0x15, 0x04, 0x6b, 0x58, 0x54, 0x2a,
- 0xd9, 0x21, 0x7b, 0xda, 0xc9, 0xab, 0xa4, 0x92, 0x9b, 0xbc, 0x18, 0x4b, 0x38, 0xba, 0xc5, 0x42,
- 0x19, 0x2d, 0x3f, 0xec, 0xb8, 0x01, 0xcf, 0x4c, 0x4e, 0x1a, 0xbe, 0xd7, 0x0c, 0x45, 0xe0, 0xb7,
- 0x8a, 0x08, 0x44, 0x94, 0x82, 0xe3, 0xcc, 0x5a, 0xa8, 0x06, 0x27, 0x1b, 0x01, 0x69, 0x12, 0x2f,
- 0x72, 0x9d, 0xd6, 0x42, 0xd7, 0x6b, 0xb6, 0x78, 0x4a, 0x9e, 0x01, 0x23, 0x83, 0xe8, 0xc9, 0xc5,
- 0x0c, 0x1c, 0x9c, 0x59, 0x53, 0x7c, 0x0a, 0x23, 0x32, 0x98, 0xfa, 0x14, 0x56, 0x4f, 0xc2, 0x59,
- 0xe3, 0xf1, 0x10, 0x2e, 0x6e, 0x3b, 0xae, 0xc7, 0xea, 0x0d, 0x25, 0x1a, 0xcf, 0xc0, 0xc1, 0x99,
- 0x35, 0xed, 0x3f, 0x2d, 0xc3, 0x38, 0x9d, 0x18, 0xe5, 0x71, 0xf3, 0x86, 0xe1, 0x71, 0x73, 0x31,
- 0xe1, 0x71, 0x33, 0xad, 0xe3, 0x6a, 0xfe, 0x35, 0xef, 0x03, 0xf2, 0x45, 0x52, 0x82, 0xeb, 0xc4,
- 0x23, 0x7c, 0xc8, 0x98, 0x92, 0xb1, 0x1c, 0xfb, 0xa3, 0xdc, 0x4e, 0x61, 0xe0, 0x8c, 0x5a, 0x9f,
- 0xfa, 0xea, 0x1c, 0xaf, 0xaf, 0xce, 0x6f, 0x59, 0x6c, 0x05, 0x2c, 0xad, 0xd7, 0xb9, 0x13, 0x39,
- 0xba, 0x0a, 0x63, 0xec, 0x18, 0x63, 0xb1, 0x3c, 0xa4, 0x4b, 0x0b, 0xcb, 0x6e, 0xbb, 0x1e, 0x17,
- 0x63, 0x1d, 0x07, 0x5d, 0x86, 0x91, 0x90, 0x38, 0x41, 0x63, 0x5b, 0x9d, 0xe1, 0xc2, 0xff, 0x84,
- 0x97, 0x61, 0x05, 0x45, 0x1f, 0xc4, 0x11, 0xe1, 0xcb, 0xf9, 0x1e, 0xe9, 0x7a, 0x7f, 0x38, 0x1f,
- 0xcc, 0x0f, 0x03, 0x6f, 0xdf, 0x03, 0x94, 0xc6, 0xef, 0xe3, 0x89, 0x5f, 0xd5, 0x8c, 0x59, 0x3c,
- 0x9a, 0x8a, 0x57, 0xfc, 0xef, 0x2d, 0x98, 0xac, 0xf9, 0x4d, 0xca, 0x9f, 0x7f, 0x98, 0x98, 0xb1,
- 0x9e, 0xc1, 0x63, 0xa8, 0x20, 0x83, 0xc7, 0x81, 0x05, 0x17, 0xd8, 0xe7, 0x47, 0xc4, 0x6b, 0xc6,
- 0x06, 0x4f, 0xdd, 0xdf, 0xe3, 0x01, 0x4c, 0x05, 0x3c, 0x7c, 0xd7, 0x9a, 0xd3, 0xe9, 0xb8, 0xde,
- 0x96, 0x7c, 0xdf, 0xf6, 0x46, 0xe1, 0xbb, 0x8d, 0x24, 0x49, 0x11, 0x02, 0x4c, 0x77, 0x54, 0x35,
- 0x88, 0xe2, 0x64, 0x2b, 0x3c, 0x2b, 0x8d, 0xd6, 0x1f, 0x2d, 0x41, 0xa5, 0x96, 0x95, 0x26, 0x81,
- 0x80, 0xd3, 0x75, 0xec, 0xe7, 0x60, 0xb0, 0xe6, 0x37, 0x7b, 0x04, 0x8f, 0xfe, 0x3b, 0x16, 0x0c,
- 0xd7, 0xfc, 0xe6, 0x31, 0x98, 0x10, 0xdf, 0x31, 0x4d, 0x88, 0x67, 0x72, 0x36, 0x47, 0x8e, 0xd5,
- 0xf0, 0x9f, 0x0d, 0xc0, 0x04, 0xed, 0xa7, 0xbf, 0x25, 0xd7, 0xab, 0xb1, 0x36, 0xac, 0x3e, 0xd6,
- 0x06, 0xbd, 0xd0, 0xfa, 0xad, 0x96, 0xff, 0x20, 0xb9, 0x76, 0x57, 0x58, 0x29, 0x16, 0x50, 0xf4,
- 0x0a, 0x8c, 0x74, 0x02, 0xb2, 0xeb, 0xfa, 0xe2, 0xa6, 0xa8, 0x19, 0x64, 0x6b, 0xa2, 0x1c, 0x2b,
- 0x0c, 0xf4, 0x06, 0x8c, 0x87, 0xae, 0x47, 0xa5, 0x62, 0x7e, 0xf4, 0x0e, 0xb0, 0x83, 0x81, 0xe7,
- 0xd2, 0xd3, 0xca, 0xb1, 0x81, 0x85, 0xee, 0xc1, 0x28, 0xfb, 0xcf, 0x78, 0xeb, 0xe0, 0x91, 0x79,
- 0xab, 0x48, 0x94, 0x2e, 0x08, 0xe0, 0x98, 0x16, 0x15, 0x38, 0x22, 0x99, 0x8f, 0x2a, 0x14, 0x41,
- 0x84, 0x95, 0xc0, 0xa1, 0x32, 0x55, 0x85, 0x58, 0xc3, 0x42, 0x2f, 0xc3, 0x68, 0xe4, 0xb8, 0xad,
- 0x5b, 0xae, 0xc7, 0x3c, 0x51, 0x68, 0xff, 0x45, 0xbe, 0x72, 0x51, 0x88, 0x63, 0x38, 0xbd, 0xd5,
- 0xb0, 0xd8, 0x6a, 0x0b, 0x7b, 0x91, 0xc8, 0xa2, 0x59, 0xe6, 0xb7, 0x9a, 0x5b, 0xaa, 0x14, 0x6b,
- 0x18, 0x68, 0x1b, 0xce, 0xb9, 0x1e, 0xcb, 0x3b, 0x47, 0xea, 0x3b, 0x6e, 0x67, 0xe3, 0x56, 0xfd,
- 0x2e, 0x09, 0xdc, 0xcd, 0xbd, 0x05, 0xa7, 0xb1, 0x43, 0xbc, 0x26, 0x53, 0x7a, 0x8d, 0x2c, 0x3c,
- 0x2f, 0xba, 0x78, 0x6e, 0xb5, 0x00, 0x17, 0x17, 0x52, 0x42, 0x36, 0xe5, 0x39, 0x01, 0x71, 0xda,
- 0x42, 0xbb, 0xc5, 0x73, 0x56, 0xb1, 0x12, 0x2c, 0x20, 0xf6, 0xeb, 0x6c, 0x4f, 0xdc, 0xae, 0xa3,
- 0xcf, 0x1a, 0x3c, 0xf4, 0xb4, 0xce, 0x43, 0x0f, 0xf7, 0xab, 0x43, 0xb7, 0xeb, 0x5a, 0x9c, 0xad,
- 0x6b, 0x70, 0xaa, 0xe6, 0x37, 0x6b, 0x7e, 0x10, 0xad, 0xf8, 0xc1, 0x03, 0x27, 0x68, 0xca, 0x25,
- 0x58, 0x95, 0x91, 0xc6, 0x28, 0x67, 0x18, 0xe4, 0x6c, 0xd6, 0x88, 0x22, 0xf6, 0x3a, 0xbb, 0x9f,
- 0x1c, 0xf1, 0x61, 0x77, 0x83, 0x49, 0xca, 0x2a, 0xbb, 0xe3, 0x75, 0x27, 0x22, 0xe8, 0x36, 0x4c,
- 0x34, 0x74, 0xd9, 0x44, 0x54, 0x7f, 0x49, 0x9e, 0xe8, 0x86, 0xe0, 0x92, 0x29, 0xcc, 0x98, 0xf5,
- 0xed, 0xdf, 0xb7, 0x44, 0x2b, 0x1a, 0xd7, 0xe8, 0xe3, 0x60, 0x59, 0xcc, 0x62, 0x4e, 0xfc, 0xa6,
- 0x7a, 0xaa, 0x5f, 0xc6, 0x84, 0xbe, 0x06, 0x67, 0x8d, 0x42, 0xe9, 0x14, 0xa2, 0xe5, 0xdf, 0x67,
- 0x9a, 0x49, 0x9c, 0x87, 0x84, 0xf3, 0xeb, 0xdb, 0x3f, 0x06, 0xa7, 0x93, 0xdf, 0x25, 0x38, 0xfa,
- 0x63, 0x7e, 0x5d, 0xe9, 0x68, 0x5f, 0x67, 0xbf, 0x09, 0x33, 0x35, 0x5f, 0x8b, 0xa2, 0xc2, 0xe6,
- 0xaf, 0x77, 0x30, 0xb7, 0x5f, 0x1e, 0x61, 0x67, 0x7d, 0x22, 0x65, 0x23, 0xfa, 0x06, 0x4c, 0x86,
- 0x84, 0x45, 0x30, 0x94, 0x3a, 0xea, 0x82, 0xa8, 0x0c, 0xf5, 0x65, 0x1d, 0x93, 0xdf, 0xc3, 0xcd,
- 0x32, 0x9c, 0xa0, 0x86, 0xda, 0x30, 0xf9, 0xc0, 0xf5, 0x9a, 0xfe, 0x83, 0x50, 0xd2, 0x1f, 0xc9,
- 0x37, 0x78, 0xdd, 0xe3, 0x98, 0x89, 0x3e, 0x1a, 0xcd, 0xdd, 0x33, 0x88, 0xe1, 0x04, 0x71, 0xca,
- 0x6a, 0x82, 0xae, 0x37, 0x1f, 0xde, 0x09, 0x49, 0x20, 0xe2, 0x2b, 0x32, 0x56, 0x83, 0x65, 0x21,
- 0x8e, 0xe1, 0x94, 0xd5, 0xb0, 0x3f, 0x2c, 0xac, 0x03, 0xe3, 0x65, 0x82, 0xd5, 0x60, 0x55, 0x8a,
- 0x35, 0x0c, 0xca, 0x8a, 0xd9, 0xbf, 0x75, 0xdf, 0xc3, 0xbe, 0x1f, 0x49, 0xe6, 0xcd, 0xb2, 0xea,
- 0x6a, 0xe5, 0xd8, 0xc0, 0xca, 0x89, 0xe6, 0x38, 0x70, 0xd4, 0x68, 0x8e, 0x28, 0x2a, 0x88, 0x64,
- 0xc1, 0xe3, 0x91, 0x5f, 0x2b, 0x8a, 0x64, 0x71, 0xf8, 0x58, 0x51, 0x2e, 0xa8, 0xc0, 0xb3, 0x29,
- 0x06, 0x68, 0x90, 0x87, 0xab, 0x64, 0x26, 0xf9, 0x3a, 0x1f, 0x1d, 0x09, 0x43, 0xcb, 0x30, 0x1c,
- 0xee, 0x85, 0x8d, 0xa8, 0x15, 0x16, 0x65, 0x4e, 0xae, 0x33, 0x94, 0x58, 0x1e, 0xe5, 0xff, 0x43,
- 0x2c, 0xeb, 0xa2, 0x06, 0x9c, 0x10, 0x14, 0x17, 0xb7, 0x1d, 0x4f, 0x65, 0x56, 0xe5, 0xbe, 0xb7,
- 0x57, 0x0f, 0xf6, 0xab, 0x27, 0x44, 0xcb, 0x3a, 0xf8, 0x70, 0xbf, 0x4a, 0xb7, 0x64, 0x06, 0x04,
- 0x67, 0x51, 0xe3, 0x4b, 0xbe, 0xd1, 0xf0, 0xdb, 0x9d, 0x5a, 0xe0, 0x6f, 0xba, 0x2d, 0x52, 0xe4,
- 0xd6, 0x50, 0x37, 0x30, 0xc5, 0x92, 0x37, 0xca, 0x70, 0x82, 0x1a, 0xba, 0x0f, 0x53, 0x4e, 0xa7,
- 0x33, 0x1f, 0xb4, 0xfd, 0x40, 0x36, 0x30, 0x96, 0x6f, 0x1f, 0x9b, 0x37, 0x51, 0x79, 0x62, 0xd5,
- 0x44, 0x21, 0x4e, 0x12, 0xa4, 0x03, 0x25, 0x36, 0x9a, 0x31, 0x50, 0x13, 0xf1, 0x40, 0x89, 0x7d,
- 0x99, 0x31, 0x50, 0x19, 0x10, 0x9c, 0x45, 0xcd, 0xfe, 0xf3, 0xec, 0x76, 0xc3, 0xa2, 0x9d, 0xb3,
- 0x47, 0x6e, 0x6d, 0x98, 0xe8, 0x30, 0xb6, 0x2f, 0x92, 0x1e, 0x0a, 0x56, 0xf1, 0x46, 0x9f, 0x6a,
- 0xf8, 0x07, 0x2c, 0xab, 0xb3, 0xe1, 0x8e, 0x5d, 0xd3, 0xc9, 0x61, 0x93, 0xba, 0xfd, 0xaf, 0x67,
- 0x99, 0xe8, 0x58, 0xe7, 0xba, 0xf5, 0x61, 0xf1, 0xe4, 0x57, 0x48, 0xc9, 0xb3, 0xf9, 0x56, 0xac,
- 0x78, 0x7d, 0x89, 0x67, 0xc3, 0x58, 0xd6, 0x45, 0x5f, 0x87, 0x49, 0xd7, 0x73, 0xe3, 0x24, 0xeb,
- 0x61, 0xe5, 0x64, 0x7e, 0x2c, 0x39, 0x85, 0xa5, 0x27, 0x44, 0xd5, 0x2b, 0xe3, 0x04, 0x31, 0xf4,
- 0x01, 0xf3, 0x50, 0x96, 0xa4, 0x4b, 0xfd, 0x90, 0xd6, 0x9d, 0x91, 0x25, 0x59, 0x8d, 0x08, 0xea,
- 0xc2, 0x89, 0x74, 0xb2, 0xf9, 0xb0, 0x62, 0xe7, 0x5f, 0x00, 0xd3, 0xf9, 0xe2, 0xe3, 0xcc, 0x95,
- 0x69, 0x58, 0x88, 0xb3, 0xe8, 0xa3, 0x5b, 0xc9, 0x54, 0xe0, 0x65, 0xc3, 0xfe, 0x95, 0x4a, 0x07,
- 0x3e, 0x51, 0x98, 0x05, 0x7c, 0x0b, 0xce, 0x6b, 0x79, 0x8d, 0xaf, 0x07, 0x0e, 0xf3, 0x90, 0x73,
- 0xd9, 0x69, 0xa4, 0x09, 0xb5, 0xcf, 0x1e, 0xec, 0x57, 0xcf, 0x6f, 0x14, 0x21, 0xe2, 0x62, 0x3a,
- 0xe8, 0x36, 0x9c, 0xe2, 0x91, 0x90, 0x96, 0x88, 0xd3, 0x6c, 0xb9, 0x9e, 0x92, 0x9a, 0x39, 0xef,
- 0x3a, 0x7b, 0xb0, 0x5f, 0x3d, 0x35, 0x9f, 0x85, 0x80, 0xb3, 0xeb, 0xa1, 0x77, 0x60, 0xb4, 0xe9,
- 0x49, 0x2e, 0x3b, 0x64, 0xa4, 0x8e, 0x1e, 0x5d, 0x5a, 0xaf, 0xab, 0xef, 0x8f, 0xff, 0xe0, 0xb8,
- 0x02, 0xda, 0xe2, 0x06, 0x58, 0xa5, 0x35, 0x1f, 0x4e, 0x05, 0xc8, 0x4d, 0x1a, 0x96, 0x8c, 0xd0,
- 0x22, 0xdc, 0xf3, 0x40, 0x3d, 0x3f, 0x35, 0xa2, 0x8e, 0x18, 0x84, 0xd1, 0xfb, 0x80, 0x44, 0xbe,
- 0xaf, 0xf9, 0x06, 0xcb, 0xa8, 0xa9, 0x79, 0x45, 0x2b, 0x3d, 0x49, 0x3d, 0x85, 0x81, 0x33, 0x6a,
- 0xa1, 0x1b, 0x94, 0x3d, 0xea, 0xa5, 0x82, 0xfd, 0x4a, 0x7d, 0x56, 0x65, 0x89, 0x74, 0x02, 0xc2,
- 0x1c, 0x79, 0x4d, 0x8a, 0x38, 0x51, 0x0f, 0x35, 0xe1, 0x9c, 0xd3, 0x8d, 0x7c, 0x66, 0xdb, 0x36,
- 0x51, 0x37, 0xfc, 0x1d, 0xe2, 0x31, 0xb7, 0x92, 0x11, 0x16, 0x78, 0xf7, 0xdc, 0x7c, 0x01, 0x1e,
- 0x2e, 0xa4, 0x42, 0xaf, 0x53, 0x74, 0x2c, 0x34, 0xb3, 0xb3, 0x11, 0x25, 0x81, 0xfb, 0x62, 0x48,
- 0x0c, 0xf4, 0x26, 0x8c, 0x6d, 0xfb, 0x61, 0xb4, 0x4e, 0xa2, 0x07, 0x7e, 0xb0, 0x23, 0x12, 0x8c,
- 0xc4, 0x49, 0x9d, 0x62, 0x10, 0xd6, 0xf1, 0xd0, 0x4b, 0x30, 0xcc, 0x9c, 0x1e, 0x57, 0x97, 0xd8,
- 0x59, 0x3b, 0x12, 0xf3, 0x98, 0x1b, 0xbc, 0x18, 0x4b, 0xb8, 0x44, 0x5d, 0xad, 0x2d, 0x32, 0x76,
- 0x9c, 0x40, 0x5d, 0xad, 0x2d, 0x62, 0x09, 0xa7, 0xcb, 0x35, 0xdc, 0x76, 0x02, 0x52, 0x0b, 0xfc,
- 0x06, 0x09, 0xb5, 0x54, 0x62, 0xcf, 0xf0, 0xf4, 0x29, 0x74, 0xb9, 0xd6, 0xb3, 0x10, 0x70, 0x76,
- 0x3d, 0x44, 0xd2, 0x39, 0xbd, 0x27, 0xf3, 0x8d, 0xfe, 0x69, 0x71, 0xb0, 0xcf, 0xb4, 0xde, 0x1e,
- 0x4c, 0xab, 0x6c, 0xe2, 0x3c, 0x61, 0x4a, 0x58, 0x99, 0xca, 0xcf, 0xe9, 0x9f, 0xf9, 0xd6, 0x47,
- 0xb9, 0x51, 0xac, 0x26, 0x28, 0xe1, 0x14, 0x6d, 0x23, 0xb2, 0xf3, 0x74, 0xcf, 0xc8, 0xce, 0x57,
- 0x60, 0x34, 0xec, 0xde, 0x6f, 0xfa, 0x6d, 0xc7, 0xf5, 0x98, 0xef, 0x98, 0x76, 0x71, 0xaf, 0x4b,
- 0x00, 0x8e, 0x71, 0xd0, 0x0a, 0x8c, 0x38, 0xd2, 0x47, 0x02, 0xe5, 0x07, 0xad, 0x54, 0x9e, 0x11,
- 0x3c, 0x8e, 0x9b, 0xf4, 0x8a, 0x50, 0x75, 0xd1, 0xdb, 0x30, 0x21, 0x02, 0xe3, 0x08, 0x7d, 0xfc,
- 0x09, 0xf3, 0x29, 0x7f, 0x5d, 0x07, 0x62, 0x13, 0x17, 0xdd, 0x81, 0xb1, 0xc8, 0x6f, 0x09, 0x45,
- 0x6e, 0x58, 0x39, 0x9d, 0x1f, 0x5b, 0x7a, 0x43, 0xa1, 0xe9, 0xd6, 0x3b, 0x55, 0x15, 0xeb, 0x74,
- 0xd0, 0x06, 0x5f, 0xef, 0x2c, 0x71, 0x18, 0x09, 0x2b, 0x67, 0xf2, 0xcf, 0x24, 0x95, 0x5f, 0xcc,
- 0xdc, 0x0e, 0xa2, 0x26, 0xd6, 0xc9, 0xa0, 0xeb, 0x30, 0xd3, 0x09, 0x5c, 0x9f, 0xad, 0x09, 0xe5,
- 0xf3, 0x51, 0x31, 0x75, 0x48, 0xb5, 0x24, 0x02, 0x4e, 0xd7, 0x61, 0x71, 0x8d, 0x44, 0x61, 0xe5,
- 0x2c, 0x4f, 0x75, 0xc8, 0xf5, 0x20, 0xbc, 0x0c, 0x2b, 0x28, 0x5a, 0x63, 0x9c, 0x98, 0xeb, 0x29,
- 0x2b, 0xb3, 0xf9, 0xd1, 0x32, 0x74, 0x7d, 0x26, 0x97, 0xfd, 0xd5, 0x5f, 0x1c, 0x53, 0x40, 0x4d,
- 0x98, 0x0c, 0xf4, 0x1b, 0x70, 0x58, 0x39, 0x57, 0xe0, 0x79, 0x9e, 0xb8, 0x2e, 0xc7, 0x02, 0x81,
- 0x51, 0x1c, 0xe2, 0x04, 0x4d, 0xf4, 0x1e, 0x4c, 0x8b, 0xa0, 0x1f, 0xf1, 0x30, 0x9d, 0x8f, 0x5f,
- 0xe7, 0xe1, 0x04, 0x0c, 0xa7, 0xb0, 0x79, 0xaa, 0x41, 0xe7, 0x7e, 0x8b, 0x08, 0xd6, 0x77, 0xcb,
- 0xf5, 0x76, 0xc2, 0xca, 0x05, 0xc6, 0x1f, 0x44, 0xaa, 0xc1, 0x24, 0x14, 0x67, 0xd4, 0x40, 0x1b,
- 0x30, 0xdd, 0x09, 0x08, 0x69, 0xb3, 0x7b, 0x92, 0x38, 0xcf, 0xaa, 0x3c, 0xac, 0x17, 0xed, 0x49,
- 0x2d, 0x01, 0x3b, 0xcc, 0x28, 0xc3, 0x29, 0x0a, 0xe8, 0x01, 0x8c, 0xf8, 0xbb, 0x24, 0xd8, 0x26,
- 0x4e, 0xb3, 0x72, 0xb1, 0xe0, 0xcd, 0xa8, 0x38, 0xdc, 0x6e, 0x0b, 0xdc, 0x84, 0x4b, 0x9d, 0x2c,
- 0xee, 0xed, 0x52, 0x27, 0x1b, 0x43, 0xff, 0x89, 0x05, 0x67, 0xa5, 0x91, 0xba, 0xde, 0xa1, 0xa3,
- 0xbe, 0xe8, 0x7b, 0x61, 0x14, 0xf0, 0x40, 0x54, 0xcf, 0xe6, 0x07, 0x67, 0xda, 0xc8, 0xa9, 0xa4,
- 0x4c, 0x25, 0x67, 0xf3, 0x30, 0x42, 0x9c, 0xdf, 0x22, 0xbd, 0xd9, 0x87, 0x24, 0x92, 0xcc, 0x68,
- 0x3e, 0x5c, 0xf9, 0x60, 0x69, 0xbd, 0xf2, 0x1c, 0x8f, 0xa2, 0x45, 0x37, 0x43, 0x3d, 0x09, 0xc4,
- 0x69, 0x7c, 0x74, 0x15, 0x4a, 0x7e, 0x58, 0x79, 0x9e, 0xad, 0xed, 0xb3, 0x39, 0xe3, 0x78, 0xbb,
- 0xce, 0x5d, 0xab, 0x6f, 0xd7, 0x71, 0xc9, 0x0f, 0x65, 0xba, 0x3f, 0x7a, 0x9d, 0x0d, 0x2b, 0x2f,
- 0x70, 0xc5, 0xba, 0x4c, 0xf7, 0xc7, 0x0a, 0x71, 0x0c, 0x47, 0xdb, 0x30, 0x15, 0x1a, 0x6a, 0x83,
- 0xb0, 0x72, 0x89, 0x8d, 0xd4, 0x0b, 0x79, 0x93, 0x66, 0x60, 0x6b, 0x79, 0xb8, 0x4c, 0x2a, 0x38,
- 0x49, 0x96, 0xef, 0x2e, 0x4d, 0x71, 0x11, 0x56, 0x5e, 0xec, 0xb1, 0xbb, 0x34, 0x64, 0x7d, 0x77,
- 0xe9, 0x34, 0x70, 0x82, 0x26, 0xba, 0xa3, 0x3f, 0xc8, 0xbd, 0x9c, 0xef, 0xa6, 0x9b, 0xf9, 0x14,
- 0x77, 0x22, 0xf7, 0x19, 0xee, 0x7b, 0x30, 0x2d, 0xcf, 0x12, 0xba, 0x32, 0x03, 0xb7, 0x49, 0x2a,
- 0x2f, 0xc5, 0x9b, 0xf6, 0x46, 0x02, 0x86, 0x53, 0xd8, 0xb3, 0x3f, 0x02, 0x33, 0x29, 0x39, 0xee,
- 0x28, 0xef, 0x9b, 0x66, 0x77, 0x60, 0xc2, 0xd8, 0x2b, 0x4f, 0xd7, 0xfd, 0x6d, 0x0c, 0x46, 0x95,
- 0x5b, 0x52, 0x8e, 0x39, 0x72, 0xe6, 0xb1, 0xcc, 0x91, 0x57, 0x4c, 0xef, 0xb9, 0xb3, 0x49, 0xef,
- 0xb9, 0x91, 0x9a, 0xdf, 0x34, 0x1c, 0xe6, 0x36, 0x32, 0x22, 0x60, 0xe7, 0x71, 0xf9, 0xfe, 0x1f,
- 0x74, 0x6a, 0x16, 0xbd, 0x72, 0xdf, 0x6e, 0x78, 0x03, 0x85, 0x46, 0xc2, 0xeb, 0x30, 0xe3, 0xf9,
- 0xec, 0x22, 0x42, 0x9a, 0x52, 0xca, 0x64, 0xc2, 0xe4, 0xa8, 0x1e, 0xa1, 0x31, 0x81, 0x80, 0xd3,
- 0x75, 0x68, 0x83, 0x5c, 0x1a, 0x4c, 0x5a, 0x25, 0xb9, 0xb0, 0x88, 0x05, 0x94, 0x5e, 0x80, 0xf9,
- 0xaf, 0xb0, 0x32, 0x9d, 0x7f, 0x01, 0xe6, 0x95, 0x92, 0x12, 0x67, 0x28, 0x25, 0x4e, 0x66, 0x84,
- 0xeb, 0xf8, 0xcd, 0xd5, 0x9a, 0xb8, 0xcb, 0x68, 0xb9, 0x29, 0x9a, 0xab, 0x35, 0xcc, 0x61, 0x68,
- 0x1e, 0x86, 0xd8, 0x0f, 0x19, 0xf9, 0x2a, 0x8f, 0x17, 0xad, 0xd6, 0xb4, 0x9c, 0xca, 0xac, 0x02,
- 0x16, 0x15, 0x99, 0xfd, 0x81, 0x5e, 0x00, 0x99, 0xfd, 0x61, 0xf8, 0x31, 0xed, 0x0f, 0x92, 0x00,
- 0x8e, 0x69, 0xa1, 0x87, 0x70, 0xca, 0xb8, 0x74, 0xab, 0x17, 0xae, 0x90, 0xef, 0x64, 0x93, 0x40,
- 0x5e, 0x38, 0x2f, 0x3a, 0x7d, 0x6a, 0x35, 0x8b, 0x12, 0xce, 0x6e, 0x00, 0xb5, 0x60, 0xa6, 0x91,
- 0x6a, 0x75, 0xa4, 0xff, 0x56, 0xd5, 0xba, 0x48, 0xb7, 0x98, 0x26, 0x8c, 0xde, 0x86, 0x91, 0x8f,
- 0x7c, 0xee, 0x10, 0x2b, 0xee, 0x5f, 0x32, 0x3e, 0xd3, 0xc8, 0x07, 0xb7, 0xeb, 0xac, 0xfc, 0x70,
- 0xbf, 0x3a, 0x56, 0xf3, 0x9b, 0xf2, 0x2f, 0x56, 0x15, 0xd0, 0x5f, 0xb2, 0x60, 0x36, 0x7d, 0xab,
- 0x57, 0x9d, 0x9e, 0xe8, 0xbf, 0xd3, 0xb6, 0x68, 0x74, 0x76, 0x39, 0x97, 0x1c, 0x2e, 0x68, 0x0a,
- 0x7d, 0x91, 0xee, 0xa7, 0xd0, 0x7d, 0xc4, 0x5f, 0xb8, 0x68, 0x0e, 0x09, 0x98, 0x95, 0x1e, 0xee,
- 0x57, 0xa7, 0x38, 0xfb, 0x77, 0x1f, 0xa9, 0x2c, 0x1a, 0xbc, 0x02, 0xfa, 0x31, 0x38, 0x15, 0xa4,
- 0xb5, 0xec, 0x44, 0xde, 0x34, 0x3e, 0xdb, 0xcf, 0x51, 0x92, 0x9c, 0x70, 0x9c, 0x45, 0x10, 0x67,
- 0xb7, 0x83, 0xfe, 0xaa, 0x05, 0xcf, 0x90, 0x7c, 0x0b, 0xae, 0xb8, 0x2a, 0xbc, 0x96, 0xd3, 0x8f,
- 0x02, 0xdb, 0x2f, 0x4b, 0x30, 0xf0, 0x4c, 0x01, 0x02, 0x2e, 0x6a, 0xd7, 0xfe, 0xc7, 0x16, 0xb3,
- 0xfa, 0x08, 0x54, 0x12, 0x76, 0x5b, 0xd1, 0x31, 0x38, 0xc7, 0x2e, 0x1b, 0xae, 0x25, 0x8f, 0xed,
- 0xdd, 0xfa, 0xdf, 0x5a, 0xcc, 0xbb, 0xf5, 0x18, 0xdf, 0xe9, 0x7e, 0x00, 0x23, 0x91, 0x68, 0x4d,
- 0x74, 0x3d, 0xcf, 0x13, 0x4f, 0x76, 0x8a, 0x79, 0xf8, 0xaa, 0x1b, 0xa6, 0x2c, 0xc5, 0x8a, 0x8c,
- 0xfd, 0x5f, 0xf1, 0x19, 0x90, 0x90, 0x63, 0x30, 0x6e, 0x2f, 0x99, 0xc6, 0xed, 0x6a, 0x8f, 0x2f,
- 0xc8, 0x31, 0x72, 0xff, 0x03, 0xb3, 0xdf, 0x4c, 0xb3, 0xfa, 0x49, 0x77, 0xab, 0xb6, 0xbf, 0x6b,
- 0x01, 0xc4, 0xe9, 0x94, 0xfa, 0x48, 0x8c, 0x7f, 0x8d, 0xde, 0x29, 0xfd, 0xc8, 0x6f, 0xf8, 0x2d,
- 0x61, 0x5c, 0x3b, 0x17, 0xdb, 0xd7, 0x79, 0xf9, 0xa1, 0xf6, 0x1b, 0x2b, 0x6c, 0x54, 0x95, 0xf1,
- 0xcd, 0xcb, 0xb1, 0x5b, 0x8b, 0x11, 0xdb, 0xfc, 0x67, 0x2c, 0x38, 0x99, 0xf5, 0xe8, 0x0b, 0xbd,
- 0x02, 0x23, 0x5c, 0xc7, 0xac, 0x5c, 0xde, 0xd5, 0x6c, 0xde, 0x15, 0xe5, 0x58, 0x61, 0xf4, 0xeb,
- 0xfa, 0x7e, 0xc4, 0x54, 0x3f, 0xb7, 0x61, 0xa2, 0x16, 0x10, 0x4d, 0xee, 0x79, 0x37, 0xce, 0x42,
- 0x36, 0xba, 0xf0, 0xca, 0x91, 0x23, 0xa9, 0xd9, 0xbf, 0x54, 0x82, 0x93, 0xdc, 0x71, 0x73, 0x7e,
- 0xd7, 0x77, 0x9b, 0x35, 0xbf, 0x29, 0x9e, 0xea, 0x7f, 0x15, 0xc6, 0x3b, 0x9a, 0x61, 0xa0, 0x28,
- 0x6d, 0x85, 0x6e, 0x40, 0x88, 0x55, 0x99, 0x7a, 0x29, 0x36, 0x68, 0xa1, 0x26, 0x8c, 0x93, 0x5d,
- 0xb7, 0xa1, 0x1c, 0xc3, 0x4a, 0x47, 0x16, 0x1e, 0x54, 0x2b, 0xcb, 0x1a, 0x1d, 0x6c, 0x50, 0xed,
- 0xfb, 0xb9, 0x85, 0x26, 0x3a, 0x0e, 0xf4, 0x70, 0x06, 0xfb, 0x59, 0x0b, 0xce, 0xe4, 0x24, 0xb9,
- 0xa0, 0xcd, 0x3d, 0x60, 0x2e, 0xb2, 0x62, 0xd9, 0xaa, 0xe6, 0xb8, 0xe3, 0x2c, 0x16, 0x50, 0xf4,
- 0x65, 0x80, 0x4e, 0x9c, 0x1a, 0xb8, 0x47, 0x36, 0x00, 0x23, 0x2e, 0xb8, 0x16, 0xe2, 0x59, 0x65,
- 0x10, 0xd6, 0x68, 0xd9, 0x3f, 0x33, 0x00, 0x83, 0xcc, 0x07, 0x0f, 0xd5, 0x60, 0x78, 0x9b, 0x47,
- 0x20, 0x2d, 0x9c, 0x37, 0x8a, 0x2b, 0x43, 0x9a, 0xc6, 0xf3, 0xa6, 0x95, 0x62, 0x49, 0x06, 0xad,
- 0xc1, 0x09, 0x9e, 0xf6, 0xb8, 0xb5, 0x44, 0x5a, 0xce, 0x9e, 0xd4, 0xb9, 0x97, 0xd8, 0xa7, 0x2a,
- 0xdb, 0xc3, 0x6a, 0x1a, 0x05, 0x67, 0xd5, 0x43, 0xef, 0xc2, 0x64, 0xe4, 0xb6, 0x89, 0xdf, 0x8d,
- 0x4c, 0x77, 0x53, 0x75, 0x2d, 0xdc, 0x30, 0xa0, 0x38, 0x81, 0x8d, 0xde, 0x86, 0x89, 0x4e, 0xca,
- 0xba, 0x30, 0x18, 0xab, 0xe1, 0x4c, 0x8b, 0x82, 0x89, 0xcb, 0xde, 0x7d, 0x75, 0xd9, 0x2b, 0xb7,
- 0x8d, 0xed, 0x80, 0x84, 0xdb, 0x7e, 0xab, 0xc9, 0x24, 0xf3, 0x41, 0xed, 0xdd, 0x57, 0x02, 0x8e,
- 0x53, 0x35, 0x28, 0x95, 0x4d, 0xc7, 0x6d, 0x75, 0x03, 0x12, 0x53, 0x19, 0x32, 0xa9, 0xac, 0x24,
- 0xe0, 0x38, 0x55, 0xa3, 0xb7, 0xd9, 0x64, 0xf8, 0xc9, 0x98, 0x4d, 0xec, 0xbf, 0x5b, 0x02, 0x63,
- 0x6a, 0x7f, 0x88, 0xb3, 0x18, 0xbf, 0x03, 0x03, 0x5b, 0x41, 0xa7, 0x21, 0xfc, 0x4d, 0x33, 0xbf,
- 0xec, 0x3a, 0xae, 0x2d, 0xea, 0x5f, 0x46, 0xff, 0x63, 0x56, 0x8b, 0xee, 0xf1, 0x53, 0xc2, 0xfb,
- 0x5a, 0x06, 0x29, 0x56, 0xcf, 0x2b, 0x87, 0xa5, 0x26, 0xa2, 0x20, 0x9c, 0xbf, 0x78, 0x23, 0xa6,
- 0xfc, 0xb7, 0x35, 0x53, 0xb8, 0xd0, 0x43, 0x48, 0x2a, 0xe8, 0x2a, 0x8c, 0x89, 0xc4, 0xb2, 0xec,
- 0x15, 0x20, 0xdf, 0x4c, 0xcc, 0x95, 0x74, 0x29, 0x2e, 0xc6, 0x3a, 0x8e, 0xfd, 0x97, 0x4b, 0x70,
- 0x22, 0xe3, 0x19, 0x37, 0x3f, 0x46, 0xb6, 0xdc, 0x30, 0x0a, 0xf6, 0x92, 0x87, 0x13, 0x16, 0xe5,
- 0x58, 0x61, 0x50, 0x5e, 0xc5, 0x0f, 0xaa, 0xe4, 0xe1, 0x24, 0x9e, 0x49, 0x0a, 0xe8, 0xd1, 0x0e,
- 0x27, 0x7a, 0x6c, 0x77, 0x43, 0x22, 0x33, 0x87, 0xa8, 0x63, 0x9b, 0xb9, 0x64, 0x30, 0x08, 0xbd,
- 0x9a, 0x6e, 0x29, 0x3f, 0x03, 0xed, 0x6a, 0xca, 0x3d, 0x0d, 0x38, 0x8c, 0x76, 0x2e, 0x22, 0x9e,
- 0xe3, 0x45, 0xe2, 0x02, 0x1b, 0x47, 0x94, 0x67, 0xa5, 0x58, 0x40, 0xed, 0xef, 0x95, 0xe1, 0x6c,
- 0x6e, 0x60, 0x07, 0xda, 0xf5, 0xb6, 0xef, 0xb9, 0x91, 0xaf, 0x7c, 0x74, 0x79, 0x14, 0x79, 0xd2,
- 0xd9, 0x5e, 0x13, 0xe5, 0x58, 0x61, 0xa0, 0x4b, 0x30, 0xc8, 0x2c, 0x12, 0xc9, 0xa4, 0x92, 0x78,
- 0x61, 0x89, 0xc7, 0xd8, 0xe5, 0x60, 0xed, 0x54, 0x2f, 0x17, 0x9e, 0xea, 0xcf, 0x51, 0x09, 0xc6,
- 0x6f, 0x25, 0x0f, 0x14, 0xda, 0x5d, 0xdf, 0x6f, 0x61, 0x06, 0x44, 0x2f, 0x88, 0xf1, 0x4a, 0x38,
- 0xa5, 0x62, 0xa7, 0xe9, 0x87, 0xda, 0xa0, 0x71, 0x07, 0xf8, 0xc0, 0xf5, 0xb6, 0x92, 0xce, 0xca,
- 0x37, 0x79, 0x31, 0x96, 0x70, 0xba, 0x97, 0xe2, 0xdc, 0xf8, 0xc3, 0xf9, 0x7b, 0x49, 0x65, 0xc0,
- 0xef, 0x99, 0x16, 0x5f, 0x5f, 0x01, 0x23, 0x3d, 0xc5, 0x93, 0x9f, 0x2a, 0xc3, 0x14, 0x5e, 0x58,
- 0xfa, 0x74, 0x22, 0xee, 0xa4, 0x27, 0xa2, 0x7f, 0xb3, 0xd9, 0x93, 0x9a, 0x8d, 0x7f, 0x68, 0xc1,
- 0x14, 0x4b, 0x6f, 0x2b, 0xa2, 0x32, 0xb9, 0xbe, 0x77, 0x0c, 0x57, 0x81, 0xe7, 0x60, 0x30, 0xa0,
- 0x8d, 0x8a, 0x19, 0x54, 0x7b, 0x9c, 0xf5, 0x04, 0x73, 0x18, 0x3a, 0x07, 0x03, 0xac, 0x0b, 0x74,
- 0xf2, 0xc6, 0x39, 0x0b, 0x5e, 0x72, 0x22, 0x07, 0xb3, 0x52, 0x16, 0x1f, 0x16, 0x93, 0x4e, 0xcb,
- 0xe5, 0x9d, 0x8e, 0xfd, 0x45, 0x3e, 0x19, 0x21, 0x9f, 0x32, 0xbb, 0xf6, 0xf1, 0xe2, 0xc3, 0x66,
- 0x93, 0x2c, 0xbe, 0x66, 0xff, 0x71, 0x09, 0x2e, 0x64, 0xd6, 0xeb, 0x3b, 0x3e, 0x6c, 0x71, 0xed,
- 0xa7, 0x99, 0x0c, 0xb3, 0x7c, 0x8c, 0x4f, 0x41, 0x06, 0xfa, 0x95, 0xfe, 0x07, 0xfb, 0x08, 0xdb,
- 0x9a, 0x39, 0x64, 0x9f, 0x90, 0xb0, 0xad, 0x99, 0x7d, 0xcb, 0x51, 0x13, 0xfc, 0x69, 0x29, 0xe7,
- 0x5b, 0x98, 0xc2, 0xe0, 0x32, 0xe5, 0x33, 0x0c, 0x18, 0xca, 0x4b, 0x38, 0xe7, 0x31, 0xbc, 0x0c,
- 0x2b, 0x28, 0x9a, 0x87, 0xa9, 0xb6, 0xeb, 0x51, 0xe6, 0xb3, 0x67, 0x8a, 0xe2, 0xca, 0x90, 0xb4,
- 0x66, 0x82, 0x71, 0x12, 0x1f, 0xb9, 0x5a, 0x48, 0x57, 0xfe, 0x75, 0x6f, 0x1f, 0x69, 0xd7, 0xcd,
- 0x99, 0xbe, 0x34, 0x6a, 0x14, 0x33, 0xc2, 0xbb, 0xae, 0x69, 0x7a, 0xa2, 0x72, 0xff, 0x7a, 0xa2,
- 0xf1, 0x6c, 0x1d, 0xd1, 0xec, 0xdb, 0x30, 0xf1, 0xd8, 0xf6, 0x1f, 0xfb, 0xfb, 0x65, 0x78, 0xa6,
- 0x60, 0xdb, 0x73, 0x5e, 0x6f, 0xcc, 0x81, 0xc6, 0xeb, 0x53, 0xf3, 0x50, 0x83, 0x93, 0x9b, 0xdd,
- 0x56, 0x6b, 0x8f, 0x3d, 0x6c, 0x25, 0x4d, 0x89, 0x21, 0x64, 0x4a, 0xf5, 0xf4, 0x6d, 0x25, 0x03,
- 0x07, 0x67, 0xd6, 0xa4, 0x57, 0x2c, 0x7a, 0x92, 0xec, 0x29, 0x52, 0x89, 0x2b, 0x16, 0xd6, 0x81,
- 0xd8, 0xc4, 0x45, 0xd7, 0x61, 0xc6, 0xd9, 0x75, 0x5c, 0x9e, 0x4c, 0x48, 0x12, 0xe0, 0x77, 0x2c,
- 0xa5, 0x23, 0x9f, 0x4f, 0x22, 0xe0, 0x74, 0x9d, 0x1c, 0x53, 0x55, 0xf9, 0xb1, 0x4c, 0x55, 0x66,
- 0x70, 0xd1, 0xa1, 0xfc, 0xe0, 0xa2, 0xc5, 0x7c, 0xb1, 0x67, 0x1e, 0xd6, 0x0f, 0x61, 0xe2, 0xa8,
- 0x3e, 0xf1, 0x2f, 0xc1, 0xb0, 0x78, 0xc3, 0x93, 0x7c, 0xaf, 0x29, 0xf3, 0xff, 0x4b, 0xb8, 0xfd,
- 0xbf, 0x5a, 0xa0, 0x74, 0xdc, 0x66, 0x1e, 0x81, 0xb7, 0x99, 0x83, 0x3f, 0xd7, 0xce, 0x6b, 0x6f,
- 0x45, 0x4f, 0x69, 0x0e, 0xfe, 0x31, 0x10, 0x9b, 0xb8, 0x7c, 0xb9, 0x85, 0x71, 0xc4, 0x1a, 0xe3,
- 0x02, 0x21, 0x6c, 0xab, 0x0a, 0x03, 0x7d, 0x05, 0x86, 0x9b, 0xee, 0xae, 0x1b, 0x0a, 0x3d, 0xda,
- 0x91, 0x6d, 0x93, 0xf1, 0xf7, 0x2d, 0x71, 0x32, 0x58, 0xd2, 0xb3, 0xff, 0x8a, 0x05, 0xca, 0x28,
- 0x7c, 0x83, 0x38, 0xad, 0x68, 0x1b, 0xbd, 0x07, 0x20, 0x29, 0x28, 0xdd, 0x9b, 0x74, 0x55, 0x03,
- 0xac, 0x20, 0x87, 0xc6, 0x3f, 0xac, 0xd5, 0x41, 0xef, 0xc2, 0xd0, 0x36, 0xa3, 0x25, 0xbe, 0xed,
- 0x92, 0x32, 0xc1, 0xb1, 0xd2, 0xc3, 0xfd, 0xea, 0x49, 0xb3, 0x4d, 0x79, 0x8a, 0xf1, 0x5a, 0xf6,
- 0x4f, 0x95, 0xe2, 0x39, 0xfd, 0xa0, 0xeb, 0x47, 0xce, 0x31, 0x48, 0x22, 0xd7, 0x0d, 0x49, 0xe4,
- 0x85, 0x22, 0xab, 0x37, 0xeb, 0x52, 0xae, 0x04, 0x72, 0x3b, 0x21, 0x81, 0xbc, 0xd8, 0x9b, 0x54,
- 0xb1, 0xe4, 0xf1, 0x5f, 0x5b, 0x30, 0x63, 0xe0, 0x1f, 0xc3, 0x01, 0xb8, 0x62, 0x1e, 0x80, 0xcf,
- 0xf6, 0xfc, 0x86, 0x9c, 0x83, 0xef, 0x27, 0xca, 0x89, 0xbe, 0xb3, 0x03, 0xef, 0x23, 0x18, 0xd8,
- 0x76, 0x82, 0xa6, 0xb8, 0xd7, 0x5f, 0xe9, 0x6b, 0xac, 0xe7, 0x6e, 0x38, 0x81, 0x70, 0x73, 0x79,
- 0x45, 0x8e, 0x3a, 0x2d, 0xea, 0xe9, 0xe2, 0xc2, 0x9a, 0x42, 0xd7, 0x60, 0x28, 0x6c, 0xf8, 0x1d,
- 0xf5, 0x24, 0xf4, 0x22, 0x1b, 0x68, 0x56, 0x72, 0xb8, 0x5f, 0x45, 0x66, 0x73, 0xb4, 0x18, 0x0b,
- 0x7c, 0xf4, 0x55, 0x98, 0x60, 0xbf, 0x94, 0xcf, 0x69, 0x39, 0x5f, 0x03, 0x53, 0xd7, 0x11, 0xb9,
- 0x43, 0xb6, 0x51, 0x84, 0x4d, 0x52, 0xb3, 0x5b, 0x30, 0xaa, 0x3e, 0xeb, 0xa9, 0x7a, 0x24, 0xfc,
- 0x8b, 0x32, 0x9c, 0xc8, 0x58, 0x73, 0x28, 0x34, 0x66, 0xe2, 0x6a, 0x9f, 0x4b, 0xf5, 0x63, 0xce,
- 0x45, 0xc8, 0x2e, 0x80, 0x4d, 0xb1, 0xb6, 0xfa, 0x6e, 0xf4, 0x4e, 0x48, 0x92, 0x8d, 0xd2, 0xa2,
- 0xde, 0x8d, 0xd2, 0xc6, 0x8e, 0x6d, 0xa8, 0x69, 0x43, 0xaa, 0xa7, 0x4f, 0x75, 0x4e, 0x7f, 0x6b,
- 0x00, 0x4e, 0x66, 0x39, 0xe2, 0xa0, 0x1f, 0x85, 0x21, 0xf6, 0x9c, 0xaf, 0xf0, 0xfd, 0x6b, 0x56,
- 0xcd, 0x39, 0xf6, 0x22, 0x50, 0x84, 0xa2, 0x9e, 0x93, 0xec, 0x88, 0x17, 0xf6, 0x1c, 0x66, 0xd1,
- 0x26, 0x0b, 0x11, 0x27, 0x4e, 0x4f, 0xc9, 0x3e, 0x3e, 0xdf, 0x77, 0x07, 0xc4, 0xf9, 0x1b, 0x26,
- 0xfc, 0xd9, 0x64, 0x71, 0x6f, 0x7f, 0x36, 0xd9, 0x32, 0x5a, 0x85, 0xa1, 0x06, 0x77, 0x94, 0x2a,
- 0xf7, 0x66, 0x61, 0xdc, 0x4b, 0x4a, 0x31, 0x60, 0xe1, 0x1d, 0x25, 0x08, 0xcc, 0xba, 0x30, 0xa6,
- 0x0d, 0xcc, 0x53, 0x5d, 0x3c, 0x3b, 0xf4, 0xe0, 0xd3, 0x86, 0xe0, 0xa9, 0x2e, 0xa0, 0xbf, 0xae,
- 0x9d, 0xfd, 0x82, 0x1f, 0x7c, 0xce, 0x90, 0x9d, 0xce, 0x25, 0x1e, 0x59, 0x26, 0xf6, 0x15, 0x93,
- 0xa5, 0xea, 0x66, 0x0e, 0x87, 0xdc, 0x44, 0x74, 0xe6, 0x81, 0x5f, 0x9c, 0xb7, 0xc1, 0xfe, 0x59,
- 0x0b, 0x12, 0xcf, 0xe0, 0x94, 0xba, 0xd3, 0xca, 0x55, 0x77, 0x5e, 0x84, 0x81, 0xc0, 0x6f, 0x49,
- 0x79, 0x4a, 0x61, 0x60, 0xbf, 0x45, 0x30, 0x83, 0x50, 0x8c, 0x28, 0x56, 0x62, 0x8d, 0xeb, 0x17,
- 0x74, 0x71, 0xf5, 0x7e, 0x0e, 0x06, 0x5b, 0x64, 0x97, 0xb4, 0x92, 0xf9, 0x98, 0x6f, 0xd1, 0x42,
- 0xcc, 0x61, 0xf6, 0x3f, 0x1c, 0x80, 0xf3, 0x85, 0x91, 0x24, 0xa9, 0x80, 0xb9, 0xe5, 0x44, 0xe4,
- 0x81, 0xb3, 0x97, 0xcc, 0x43, 0x7a, 0x9d, 0x17, 0x63, 0x09, 0x67, 0xef, 0xee, 0x79, 0x6e, 0xad,
- 0x84, 0x72, 0x58, 0xa4, 0xd4, 0x12, 0x50, 0x53, 0xd9, 0x58, 0x7e, 0x12, 0xca, 0xc6, 0xd7, 0x00,
- 0xc2, 0xb0, 0xc5, 0xbd, 0x5d, 0x9b, 0xe2, 0x41, 0x7f, 0x1c, 0xe9, 0xa4, 0x7e, 0x4b, 0x40, 0xb0,
- 0x86, 0x85, 0x96, 0x60, 0xba, 0x13, 0xf8, 0x11, 0xd7, 0xb5, 0x2f, 0x71, 0x87, 0xf0, 0x41, 0x33,
- 0x88, 0x5f, 0x2d, 0x01, 0xc7, 0xa9, 0x1a, 0xe8, 0x4d, 0x18, 0x13, 0x81, 0xfd, 0x6a, 0xbe, 0xdf,
- 0x12, 0xea, 0x3d, 0xe5, 0x23, 0x5d, 0x8f, 0x41, 0x58, 0xc7, 0xd3, 0xaa, 0x31, 0x05, 0xfe, 0x70,
- 0x66, 0x35, 0xae, 0xc4, 0xd7, 0xf0, 0x12, 0x49, 0x40, 0x46, 0xfa, 0x4a, 0x02, 0x12, 0x2b, 0x3c,
- 0x47, 0xfb, 0xb6, 0x27, 0x43, 0x4f, 0x15, 0xe1, 0xaf, 0x0c, 0xc0, 0x09, 0xb1, 0x70, 0x9e, 0xf6,
- 0x72, 0xb9, 0x93, 0x5e, 0x2e, 0x4f, 0x42, 0x25, 0xfa, 0xe9, 0x9a, 0x39, 0xee, 0x35, 0xf3, 0xd3,
- 0x16, 0x98, 0x32, 0x24, 0xfa, 0x8f, 0x72, 0x13, 0x39, 0xbf, 0x99, 0x2b, 0x93, 0xc6, 0x19, 0x02,
- 0x3e, 0x5e, 0x4a, 0x67, 0xfb, 0x7f, 0xb6, 0xe0, 0xd9, 0x9e, 0x14, 0xd1, 0x32, 0x8c, 0x32, 0x41,
- 0x57, 0xbb, 0x17, 0xbf, 0xa8, 0x1e, 0x8c, 0x48, 0x40, 0x8e, 0xdc, 0x1d, 0xd7, 0x44, 0xcb, 0xa9,
- 0x8c, 0xd9, 0x2f, 0x65, 0x64, 0xcc, 0x3e, 0x65, 0x0c, 0xcf, 0x63, 0xa6, 0xcc, 0xfe, 0x49, 0x7a,
- 0xe2, 0x98, 0xaf, 0x4e, 0x3f, 0x6f, 0xa8, 0x73, 0xed, 0x84, 0x3a, 0x17, 0x99, 0xd8, 0xda, 0x19,
- 0xf2, 0x1e, 0x4c, 0xb3, 0x88, 0xbf, 0xec, 0xf9, 0x92, 0x78, 0xae, 0x5a, 0x8a, 0xbd, 0x9d, 0x6f,
- 0x25, 0x60, 0x38, 0x85, 0x6d, 0xff, 0x9b, 0x32, 0x0c, 0xf1, 0xed, 0x77, 0x0c, 0x17, 0xdf, 0x97,
- 0x61, 0xd4, 0x6d, 0xb7, 0xbb, 0x3c, 0x09, 0xf2, 0x60, 0xec, 0xf0, 0xbe, 0x2a, 0x0b, 0x71, 0x0c,
- 0x47, 0x2b, 0xc2, 0x92, 0x50, 0x90, 0x54, 0x80, 0x77, 0x7c, 0x6e, 0xc9, 0x89, 0x1c, 0x2e, 0xc5,
- 0xa9, 0x73, 0x36, 0xb6, 0x39, 0xa0, 0x6f, 0x00, 0x84, 0x51, 0xe0, 0x7a, 0x5b, 0xb4, 0x4c, 0x64,
- 0x9e, 0xf9, 0x6c, 0x01, 0xb5, 0xba, 0x42, 0xe6, 0x34, 0x63, 0x9e, 0xa3, 0x00, 0x58, 0xa3, 0x88,
- 0xe6, 0x8c, 0x93, 0x7e, 0x36, 0x31, 0x77, 0xc0, 0xa9, 0xc6, 0x73, 0x36, 0xfb, 0x05, 0x18, 0x55,
- 0xc4, 0x7b, 0xe9, 0x15, 0xc7, 0x75, 0x81, 0xed, 0x4b, 0x30, 0x95, 0xe8, 0xdb, 0x91, 0xd4, 0x92,
- 0xbf, 0x6e, 0xc1, 0x14, 0xef, 0xcc, 0xb2, 0xb7, 0x2b, 0x4e, 0x83, 0x47, 0x70, 0xb2, 0x95, 0xc1,
- 0x95, 0xc5, 0xf4, 0xf7, 0xcf, 0xc5, 0x95, 0x1a, 0x32, 0x0b, 0x8a, 0x33, 0xdb, 0x40, 0x97, 0xe9,
- 0x8e, 0xa3, 0x5c, 0xd7, 0x69, 0x89, 0x98, 0x2b, 0xe3, 0x7c, 0xb7, 0xf1, 0x32, 0xac, 0xa0, 0xf6,
- 0x1f, 0x58, 0x30, 0xc3, 0x7b, 0x7e, 0x93, 0xec, 0x29, 0xde, 0xf4, 0x83, 0xec, 0xbb, 0x48, 0xbf,
- 0x5f, 0xca, 0x49, 0xbf, 0xaf, 0x7f, 0x5a, 0xb9, 0xf0, 0xd3, 0x7e, 0xc9, 0x02, 0xb1, 0x42, 0x8e,
- 0x41, 0xd3, 0xf2, 0x23, 0xa6, 0xa6, 0x65, 0x36, 0x7f, 0x13, 0xe4, 0xa8, 0x58, 0xfe, 0xbd, 0x05,
- 0xd3, 0x1c, 0x41, 0x8b, 0x62, 0xf7, 0x83, 0x9c, 0x87, 0x05, 0xf3, 0x8b, 0x32, 0xdd, 0x5a, 0x6f,
- 0x92, 0xbd, 0x0d, 0xbf, 0xe6, 0x44, 0xdb, 0xd9, 0x1f, 0x65, 0x4c, 0xd6, 0x40, 0xe1, 0x64, 0x35,
- 0xe5, 0x06, 0x32, 0x12, 0xad, 0xf6, 0x50, 0x00, 0x1f, 0x35, 0xd1, 0xaa, 0xfd, 0x47, 0x16, 0x20,
- 0xde, 0x8c, 0x21, 0xb8, 0x51, 0x71, 0x88, 0x95, 0x66, 0x06, 0x0b, 0x54, 0x10, 0xac, 0x61, 0x3d,
- 0x91, 0xe1, 0x49, 0xb8, 0xb2, 0x94, 0x7b, 0xbb, 0xb2, 0x1c, 0x61, 0x44, 0x7f, 0x69, 0x18, 0x92,
- 0x0f, 0x56, 0xd1, 0x5d, 0x18, 0x6f, 0x38, 0x1d, 0xe7, 0xbe, 0xdb, 0x72, 0x23, 0x97, 0x84, 0x45,
- 0x7e, 0x6e, 0x8b, 0x1a, 0x9e, 0x70, 0x3e, 0xd0, 0x4a, 0xb0, 0x41, 0x07, 0xcd, 0x01, 0x74, 0x02,
- 0x77, 0xd7, 0x6d, 0x91, 0x2d, 0xa6, 0x10, 0x62, 0x51, 0x9e, 0xb8, 0xd3, 0x9d, 0x2c, 0xc5, 0x1a,
- 0x46, 0x46, 0x70, 0x95, 0xf2, 0x53, 0x0e, 0xae, 0x02, 0xc7, 0x16, 0x5c, 0x65, 0xe0, 0x48, 0xc1,
- 0x55, 0x46, 0x8e, 0x1c, 0x5c, 0x65, 0xb0, 0xaf, 0xe0, 0x2a, 0x18, 0x4e, 0x4b, 0xd9, 0x93, 0xfe,
- 0x5f, 0x71, 0x5b, 0x44, 0x5c, 0x38, 0x78, 0x68, 0xaa, 0xd9, 0x83, 0xfd, 0xea, 0x69, 0x9c, 0x89,
- 0x81, 0x73, 0x6a, 0xa2, 0x2f, 0x43, 0xc5, 0x69, 0xb5, 0xfc, 0x07, 0x6a, 0x52, 0x97, 0xc3, 0x86,
- 0xd3, 0x8a, 0xc3, 0x32, 0x8e, 0x2c, 0x9c, 0x3b, 0xd8, 0xaf, 0x56, 0xe6, 0x73, 0x70, 0x70, 0x6e,
- 0x6d, 0xf4, 0x0e, 0x8c, 0x76, 0x02, 0xbf, 0xb1, 0xa6, 0xbd, 0xaa, 0xbf, 0x40, 0x07, 0xb0, 0x26,
- 0x0b, 0x0f, 0xf7, 0xab, 0x13, 0xea, 0x0f, 0x3b, 0xf0, 0xe3, 0x0a, 0x19, 0x71, 0x4b, 0xc6, 0x9e,
- 0x76, 0xdc, 0x92, 0xf1, 0x27, 0x1c, 0xb7, 0xc4, 0xde, 0x81, 0x13, 0x75, 0x12, 0xb8, 0x4e, 0xcb,
- 0x7d, 0x44, 0x65, 0x72, 0xc9, 0x03, 0x37, 0x60, 0x34, 0x48, 0x70, 0xfd, 0xbe, 0x92, 0x09, 0x68,
- 0x7a, 0x19, 0xc9, 0xe5, 0x63, 0x42, 0xf6, 0xff, 0x6b, 0xc1, 0xb0, 0x78, 0x04, 0x7b, 0x0c, 0x92,
- 0xe9, 0xbc, 0x61, 0x92, 0xa9, 0x66, 0x4f, 0x0a, 0xeb, 0x4c, 0xae, 0x31, 0x66, 0x35, 0x61, 0x8c,
- 0x79, 0xb6, 0x88, 0x48, 0xb1, 0x19, 0xe6, 0x3f, 0x2b, 0xd3, 0x1b, 0x82, 0x11, 0x8e, 0xe1, 0xe9,
- 0x0f, 0xc1, 0x3a, 0x0c, 0x87, 0x22, 0x1c, 0x40, 0x29, 0xff, 0x8d, 0x51, 0x72, 0x12, 0x63, 0x1f,
- 0x48, 0x11, 0x00, 0x40, 0x12, 0xc9, 0x8c, 0x33, 0x50, 0x7e, 0x8a, 0x71, 0x06, 0x7a, 0x05, 0xac,
- 0x18, 0x78, 0x12, 0x01, 0x2b, 0xec, 0xdf, 0x60, 0xa7, 0xb3, 0x5e, 0x7e, 0x0c, 0x82, 0xdb, 0x75,
- 0xf3, 0x1c, 0xb7, 0x0b, 0x56, 0x96, 0xe8, 0x54, 0x8e, 0x00, 0xf7, 0x6b, 0x16, 0x9c, 0xcf, 0xf8,
- 0x2a, 0x4d, 0x9a, 0x7b, 0x05, 0x46, 0x9c, 0x6e, 0xd3, 0x55, 0x7b, 0x59, 0xb3, 0x16, 0xcf, 0x8b,
- 0x72, 0xac, 0x30, 0xd0, 0x22, 0xcc, 0x90, 0x54, 0x7c, 0x61, 0x1e, 0xb9, 0x8b, 0xbd, 0x9c, 0x4e,
- 0x07, 0x17, 0x4e, 0xe3, 0xab, 0xa0, 0x77, 0xe5, 0xdc, 0xa0, 0x77, 0x7f, 0xcf, 0x82, 0x31, 0xf5,
- 0x20, 0xfe, 0xa9, 0x8f, 0xf6, 0x7b, 0xe6, 0x68, 0x3f, 0x53, 0x30, 0xda, 0x39, 0xc3, 0xfc, 0x7b,
- 0x25, 0xd5, 0xdf, 0x9a, 0x1f, 0x44, 0x7d, 0x48, 0x89, 0x8f, 0xff, 0xec, 0xe5, 0x2a, 0x8c, 0x39,
- 0x9d, 0x8e, 0x04, 0x48, 0xff, 0x45, 0x96, 0x1a, 0x26, 0x2e, 0xc6, 0x3a, 0x8e, 0x7a, 0x85, 0x53,
- 0xce, 0x7d, 0x85, 0xd3, 0x04, 0x88, 0x9c, 0x60, 0x8b, 0x44, 0xb4, 0x4c, 0xb8, 0x5b, 0xe7, 0xf3,
- 0x9b, 0x6e, 0xe4, 0xb6, 0xe6, 0x5c, 0x2f, 0x0a, 0xa3, 0x60, 0x6e, 0xd5, 0x8b, 0x6e, 0x07, 0xfc,
- 0x9a, 0xaa, 0x85, 0x96, 0x54, 0xb4, 0xb0, 0x46, 0x57, 0x06, 0x7f, 0x61, 0x6d, 0x0c, 0x9a, 0x8e,
- 0x30, 0xeb, 0xa2, 0x1c, 0x2b, 0x0c, 0xfb, 0x0b, 0xec, 0xf4, 0x61, 0x63, 0x7a, 0xb4, 0x90, 0x89,
- 0x7f, 0x3c, 0xae, 0x66, 0x83, 0x99, 0x84, 0x97, 0xf4, 0xc0, 0x8c, 0xc5, 0xcc, 0x9e, 0x36, 0xac,
- 0xbf, 0xb3, 0x8d, 0xa3, 0x37, 0xa2, 0xaf, 0xa5, 0x9c, 0x9b, 0x5e, 0xed, 0x71, 0x6a, 0x1c, 0xc1,
- 0x9d, 0x89, 0xe5, 0x89, 0x64, 0x59, 0xf4, 0x56, 0x6b, 0x62, 0x5f, 0x68, 0x79, 0x22, 0x05, 0x00,
- 0xc7, 0x38, 0x54, 0x60, 0x53, 0x7f, 0xc2, 0x0a, 0x8a, 0xd3, 0x09, 0x28, 0xec, 0x10, 0x6b, 0x18,
- 0xe8, 0x8a, 0x50, 0x5a, 0x70, 0xdb, 0xc3, 0x33, 0x09, 0xa5, 0x85, 0x1c, 0x2e, 0x4d, 0xd3, 0x74,
- 0x15, 0xc6, 0xc8, 0xc3, 0x88, 0x04, 0x9e, 0xd3, 0xa2, 0x2d, 0x0c, 0xc6, 0xc1, 0x91, 0x97, 0xe3,
- 0x62, 0xac, 0xe3, 0xa0, 0x0d, 0x98, 0x0a, 0xb9, 0x2e, 0x4f, 0x25, 0xb1, 0xe1, 0x3a, 0xd1, 0xcf,
- 0xaa, 0x50, 0x04, 0x26, 0xf8, 0x90, 0x15, 0x71, 0xee, 0x24, 0x03, 0xb4, 0x24, 0x49, 0xa0, 0x77,
- 0x61, 0xb2, 0xe5, 0x3b, 0xcd, 0x05, 0xa7, 0xe5, 0x78, 0x0d, 0x36, 0x3e, 0x23, 0x46, 0x94, 0xce,
- 0xc9, 0x5b, 0x06, 0x14, 0x27, 0xb0, 0xa9, 0x80, 0xa8, 0x97, 0x88, 0xc4, 0x4b, 0x8e, 0xb7, 0x45,
- 0xc2, 0xca, 0x28, 0xfb, 0x2a, 0x26, 0x20, 0xde, 0xca, 0xc1, 0xc1, 0xb9, 0xb5, 0xd1, 0x35, 0x18,
- 0x97, 0x9f, 0xaf, 0xc5, 0x33, 0x8a, 0x1f, 0x34, 0x69, 0x30, 0x6c, 0x60, 0xa2, 0x10, 0x4e, 0xc9,
- 0xff, 0x1b, 0x81, 0xb3, 0xb9, 0xe9, 0x36, 0x44, 0x90, 0x0f, 0xfe, 0x28, 0xfd, 0x4b, 0xf2, 0x05,
- 0xec, 0x72, 0x16, 0xd2, 0xe1, 0x7e, 0xf5, 0x9c, 0x18, 0xb5, 0x4c, 0x38, 0xce, 0xa6, 0x8d, 0xd6,
- 0xe0, 0x04, 0xf7, 0x81, 0x59, 0xdc, 0x26, 0x8d, 0x1d, 0xb9, 0xe1, 0x98, 0xd4, 0xa8, 0x3d, 0xfc,
- 0xb9, 0x91, 0x46, 0xc1, 0x59, 0xf5, 0xd0, 0x87, 0x50, 0xe9, 0x74, 0xef, 0xb7, 0xdc, 0x70, 0x7b,
- 0xdd, 0x8f, 0x98, 0x0b, 0xd9, 0x7c, 0xb3, 0x19, 0x90, 0x90, 0xbf, 0x59, 0x66, 0x47, 0xaf, 0x8c,
- 0x41, 0x55, 0xcb, 0xc1, 0xc3, 0xb9, 0x14, 0xd0, 0x23, 0x38, 0x95, 0x58, 0x08, 0x22, 0x98, 0xcc,
- 0x64, 0x7e, 0x0a, 0xbb, 0x7a, 0x56, 0x05, 0x11, 0x97, 0x29, 0x0b, 0x84, 0xb3, 0x9b, 0x40, 0x6f,
- 0x01, 0xb8, 0x9d, 0x15, 0xa7, 0xed, 0xb6, 0xe8, 0x75, 0xf4, 0x04, 0x5b, 0x23, 0xf4, 0x6a, 0x02,
- 0xab, 0x35, 0x59, 0x4a, 0x79, 0xb3, 0xf8, 0xb7, 0x87, 0x35, 0x6c, 0x74, 0x0b, 0x26, 0xc5, 0xbf,
- 0x3d, 0x31, 0xa5, 0x33, 0x2a, 0xdb, 0xf1, 0xa4, 0xac, 0xa1, 0xe6, 0x31, 0x51, 0x82, 0x13, 0x75,
- 0xd1, 0x16, 0x9c, 0x97, 0xa9, 0x96, 0xf5, 0xf5, 0x29, 0xe7, 0x20, 0x64, 0x79, 0xe3, 0x46, 0xf8,
- 0x9b, 0xa2, 0xf9, 0x22, 0x44, 0x5c, 0x4c, 0x87, 0x9e, 0xeb, 0xfa, 0x32, 0xe7, 0x2f, 0xd9, 0x4f,
- 0xc5, 0xb1, 0x4e, 0x6f, 0x25, 0x81, 0x38, 0x8d, 0x8f, 0x7c, 0x38, 0xe5, 0x7a, 0x59, 0xab, 0xfa,
- 0x34, 0x23, 0xf4, 0x45, 0xfe, 0x88, 0xbf, 0x78, 0x45, 0x67, 0xc2, 0x71, 0x36, 0x5d, 0xb4, 0x0a,
- 0x27, 0x22, 0x5e, 0xb0, 0xe4, 0x86, 0x3c, 0x2d, 0x15, 0xbd, 0xf6, 0x9d, 0x61, 0xcd, 0x9d, 0xa1,
- 0xab, 0x79, 0x23, 0x0d, 0xc6, 0x59, 0x75, 0x3e, 0x9e, 0x03, 0xe8, 0xef, 0x5b, 0xb4, 0xb6, 0x26,
- 0xe8, 0xa3, 0x6f, 0xc2, 0xb8, 0x3e, 0x3e, 0x42, 0x68, 0xb9, 0x94, 0x2d, 0x07, 0x6b, 0xec, 0x85,
- 0x5f, 0x13, 0x14, 0x0b, 0xd1, 0x61, 0xd8, 0xa0, 0x88, 0x1a, 0x19, 0xc1, 0x37, 0xae, 0xf4, 0x27,
- 0x14, 0xf5, 0xef, 0xff, 0x48, 0x20, 0x7b, 0xe7, 0xa0, 0x5b, 0x30, 0xd2, 0x68, 0xb9, 0xc4, 0x8b,
- 0x56, 0x6b, 0x45, 0x21, 0x68, 0x17, 0x05, 0x8e, 0xd8, 0x8a, 0x22, 0x9b, 0x1c, 0x2f, 0xc3, 0x8a,
- 0x82, 0x7d, 0x0d, 0xc6, 0xea, 0x2d, 0x42, 0x3a, 0xfc, 0x1d, 0x17, 0x7a, 0x89, 0x5d, 0x4c, 0x98,
- 0x68, 0x69, 0x31, 0xd1, 0x52, 0xbf, 0x73, 0x30, 0xa1, 0x52, 0xc2, 0xed, 0xdf, 0x2e, 0x41, 0xb5,
- 0x47, 0x52, 0xc3, 0x84, 0xbd, 0xcd, 0xea, 0xcb, 0xde, 0x36, 0x0f, 0x53, 0xf1, 0x3f, 0x5d, 0x95,
- 0xa7, 0x9c, 0xa1, 0xef, 0x9a, 0x60, 0x9c, 0xc4, 0xef, 0xfb, 0x5d, 0x8b, 0x6e, 0xb2, 0x1b, 0xe8,
- 0xf9, 0x32, 0xcb, 0x30, 0xd5, 0x0f, 0xf6, 0x7f, 0xf7, 0xce, 0x35, 0xbb, 0xda, 0xbf, 0x51, 0x82,
- 0x53, 0x6a, 0x08, 0x7f, 0x78, 0x07, 0xee, 0x4e, 0x7a, 0xe0, 0x9e, 0x80, 0xd1, 0xda, 0xbe, 0x0d,
- 0x43, 0x3c, 0x2e, 0x6e, 0x1f, 0x32, 0xff, 0x73, 0x66, 0x1e, 0x06, 0x25, 0x66, 0x1a, 0xb9, 0x18,
- 0xfe, 0x92, 0x05, 0x53, 0x89, 0x07, 0x92, 0x08, 0x6b, 0xaf, 0xe8, 0x1f, 0x47, 0x2e, 0xcf, 0x92,
- 0xf8, 0x2f, 0xc2, 0xc0, 0xb6, 0xaf, 0x9c, 0x94, 0x15, 0xc6, 0x0d, 0x3f, 0x8c, 0x30, 0x83, 0xd8,
- 0xff, 0xd2, 0x82, 0xc1, 0x0d, 0xc7, 0xf5, 0x22, 0x69, 0xfd, 0xb0, 0x72, 0xac, 0x1f, 0xfd, 0x7c,
- 0x17, 0x7a, 0x13, 0x86, 0xc8, 0xe6, 0x26, 0x69, 0x44, 0x62, 0x56, 0x65, 0x94, 0x8f, 0xa1, 0x65,
- 0x56, 0x4a, 0x85, 0x50, 0xd6, 0x18, 0xff, 0x8b, 0x05, 0x32, 0xba, 0x07, 0xa3, 0x91, 0xdb, 0x26,
- 0xf3, 0xcd, 0xa6, 0xf0, 0x09, 0x78, 0x8c, 0xd0, 0x34, 0x1b, 0x92, 0x00, 0x8e, 0x69, 0xd9, 0xdf,
- 0x2b, 0x01, 0xc4, 0x71, 0xf8, 0x7a, 0x7d, 0xe2, 0x42, 0xca, 0x5a, 0x7c, 0x29, 0xc3, 0x5a, 0x8c,
- 0x62, 0x82, 0x19, 0xa6, 0x62, 0x35, 0x4c, 0xe5, 0xbe, 0x86, 0x69, 0xe0, 0x28, 0xc3, 0xb4, 0x08,
- 0x33, 0x71, 0x1c, 0x41, 0x33, 0x8c, 0x2a, 0x3b, 0xbf, 0x37, 0x92, 0x40, 0x9c, 0xc6, 0xb7, 0x09,
- 0x5c, 0x54, 0xe1, 0xd4, 0xc4, 0x59, 0xc8, 0x9e, 0x12, 0xe8, 0xd6, 0xf7, 0x1e, 0xe3, 0x14, 0x9b,
- 0xc3, 0x4b, 0xb9, 0xe6, 0xf0, 0xbf, 0x69, 0xc1, 0xc9, 0x64, 0x3b, 0xec, 0xdd, 0xfd, 0x77, 0x2d,
- 0x38, 0x15, 0xe7, 0xf4, 0x4a, 0xbb, 0x20, 0xbc, 0x51, 0x18, 0x22, 0x2e, 0xa7, 0xc7, 0x71, 0x38,
- 0x99, 0xb5, 0x2c, 0xd2, 0x38, 0xbb, 0x45, 0xfb, 0xff, 0x19, 0x80, 0x4a, 0x5e, 0x6c, 0x39, 0xf6,
- 0xd2, 0xc8, 0x79, 0x58, 0xdf, 0x21, 0x0f, 0xc4, 0x7b, 0x8e, 0xf8, 0xa5, 0x11, 0x2f, 0xc6, 0x12,
- 0x9e, 0x4c, 0xe3, 0x56, 0xea, 0x33, 0x8d, 0xdb, 0x36, 0xcc, 0x3c, 0xd8, 0x26, 0xde, 0x1d, 0x2f,
- 0x74, 0x22, 0x37, 0xdc, 0x74, 0x99, 0x01, 0x9d, 0xaf, 0x9b, 0xb7, 0xe4, 0xab, 0x8b, 0x7b, 0x49,
- 0x84, 0xc3, 0xfd, 0xea, 0x79, 0xa3, 0x20, 0xee, 0x32, 0x67, 0x24, 0x38, 0x4d, 0x34, 0x9d, 0x05,
- 0x6f, 0xe0, 0x29, 0x67, 0xc1, 0x6b, 0xbb, 0xc2, 0xed, 0x46, 0x3e, 0x23, 0x61, 0xd7, 0xd6, 0x35,
- 0x55, 0x8a, 0x35, 0x0c, 0xf4, 0x75, 0x40, 0x7a, 0x1a, 0x53, 0x23, 0xb4, 0xef, 0xab, 0x07, 0xfb,
- 0x55, 0xb4, 0x9e, 0x82, 0x1e, 0xee, 0x57, 0x4f, 0xd0, 0xd2, 0x55, 0x8f, 0x5e, 0x7f, 0xe3, 0x78,
- 0x88, 0x19, 0x84, 0xd0, 0x3d, 0x98, 0xa6, 0xa5, 0x6c, 0x47, 0xc9, 0xb8, 0xc1, 0xfc, 0xca, 0xfa,
- 0xf2, 0xc1, 0x7e, 0x75, 0x7a, 0x3d, 0x01, 0xcb, 0x23, 0x9d, 0x22, 0x92, 0x91, 0x0c, 0x6f, 0xa4,
- 0xdf, 0x64, 0x78, 0xf6, 0x77, 0x2d, 0x38, 0x4b, 0x0f, 0xb8, 0xe6, 0xad, 0x1c, 0x2b, 0xba, 0xd3,
- 0x71, 0xb9, 0x9d, 0x46, 0x1c, 0x35, 0x4c, 0x57, 0x57, 0x5b, 0xe5, 0x56, 0x1a, 0x05, 0xa5, 0x1c,
- 0x7e, 0xc7, 0xf5, 0x9a, 0x49, 0x0e, 0x7f, 0xd3, 0xf5, 0x9a, 0x98, 0x41, 0xd4, 0x91, 0x55, 0xce,
- 0xcd, 0x43, 0xf0, 0x2b, 0x74, 0xaf, 0xd2, 0xbe, 0xfc, 0x40, 0xbb, 0x81, 0x5e, 0xd6, 0x6d, 0xaa,
- 0xc2, 0x7d, 0x32, 0xd7, 0x9e, 0xfa, 0x1d, 0x0b, 0xc4, 0xeb, 0xf7, 0x3e, 0xce, 0xe4, 0xaf, 0xc2,
- 0xf8, 0x6e, 0x3a, 0xc5, 0xf3, 0xc5, 0xfc, 0x70, 0x00, 0x22, 0xb1, 0xb3, 0x12, 0xd1, 0x8d, 0x74,
- 0xce, 0x06, 0x2d, 0xbb, 0x09, 0x02, 0xba, 0x44, 0x98, 0x55, 0xa3, 0x77, 0x6f, 0x5e, 0x03, 0x68,
- 0x32, 0x5c, 0x96, 0xec, 0xac, 0x64, 0x4a, 0x5c, 0x4b, 0x0a, 0x82, 0x35, 0x2c, 0xfb, 0x17, 0xca,
- 0x30, 0x26, 0x53, 0x0a, 0x77, 0xbd, 0x7e, 0x74, 0x8f, 0xba, 0xe0, 0x54, 0xea, 0x29, 0x38, 0x7d,
- 0x08, 0x33, 0x01, 0x69, 0x74, 0x83, 0xd0, 0xdd, 0x25, 0x12, 0x2c, 0x36, 0xc9, 0x1c, 0x4f, 0x83,
- 0x91, 0x00, 0x1e, 0xb2, 0xd0, 0x5d, 0x89, 0x42, 0x66, 0x34, 0x4e, 0x13, 0x42, 0x57, 0x60, 0x94,
- 0xa9, 0xde, 0x6b, 0xb1, 0x42, 0x58, 0x29, 0xbe, 0xd6, 0x24, 0x00, 0xc7, 0x38, 0xec, 0x72, 0xd0,
- 0xbd, 0xaf, 0x65, 0xa2, 0x8b, 0x2f, 0x07, 0xbc, 0x18, 0x4b, 0x38, 0xfa, 0x32, 0x4c, 0xf3, 0x7a,
- 0x81, 0xdf, 0x71, 0xb6, 0xb8, 0x49, 0x70, 0x50, 0x85, 0xd7, 0x99, 0x5e, 0x4b, 0xc0, 0x0e, 0xf7,
- 0xab, 0x27, 0x93, 0x65, 0xac, 0xdb, 0x29, 0x2a, 0xcc, 0xf3, 0x8f, 0x37, 0x42, 0xcf, 0x8c, 0x94,
- 0xc3, 0x60, 0x0c, 0xc2, 0x3a, 0x9e, 0xfd, 0x27, 0x16, 0xcc, 0x68, 0x53, 0xd5, 0x77, 0x26, 0x12,
- 0x63, 0x90, 0x4a, 0x7d, 0x0c, 0xd2, 0xd1, 0xa2, 0x3d, 0x64, 0xce, 0xf0, 0xc0, 0x13, 0x9a, 0x61,
- 0xfb, 0x9b, 0x80, 0xd2, 0xf9, 0xaa, 0xd1, 0xfb, 0xdc, 0x91, 0xdf, 0x0d, 0x48, 0xb3, 0xc8, 0xe0,
- 0xaf, 0x47, 0xce, 0x91, 0x2f, 0x57, 0x79, 0x2d, 0xac, 0xea, 0xdb, 0x7f, 0x32, 0x00, 0xd3, 0xc9,
- 0x58, 0x1d, 0xe8, 0x06, 0x0c, 0x71, 0x29, 0x5d, 0x90, 0x2f, 0xf0, 0x27, 0xd3, 0x22, 0x7c, 0xf0,
- 0x2c, 0x41, 0x5c, 0xba, 0x17, 0xf5, 0xd1, 0x87, 0x30, 0xd6, 0xf4, 0x1f, 0x78, 0x0f, 0x9c, 0xa0,
- 0x39, 0x5f, 0x5b, 0x15, 0x1c, 0x22, 0x53, 0x01, 0xb5, 0x14, 0xa3, 0xe9, 0x51, 0x43, 0x98, 0xef,
- 0x44, 0x0c, 0xc2, 0x3a, 0x39, 0xb4, 0xc1, 0x12, 0x57, 0x6d, 0xba, 0x5b, 0x6b, 0x4e, 0xa7, 0xe8,
- 0x55, 0xd7, 0xa2, 0x44, 0xd2, 0x28, 0x4f, 0x88, 0xec, 0x56, 0x1c, 0x80, 0x63, 0x42, 0xe8, 0x47,
- 0xe1, 0x44, 0x98, 0x63, 0x12, 0xcb, 0x71, 0x38, 0x28, 0xb4, 0x12, 0x71, 0x65, 0x4a, 0x96, 0xf1,
- 0x2c, 0xab, 0x19, 0xf4, 0x10, 0x90, 0x50, 0x3d, 0x6f, 0x04, 0xdd, 0x30, 0xe2, 0x29, 0x20, 0xc5,
- 0xa5, 0xeb, 0x73, 0xd9, 0x7a, 0x82, 0x24, 0xb6, 0xd6, 0x36, 0x0b, 0x9c, 0x9c, 0xc6, 0xc0, 0x19,
- 0x6d, 0xa0, 0x6d, 0x98, 0xec, 0x18, 0xd9, 0x37, 0xd9, 0xde, 0xcc, 0x89, 0x2e, 0x9c, 0x97, 0xa7,
- 0x93, 0x9f, 0xd2, 0x26, 0x14, 0x27, 0xe8, 0xda, 0xdf, 0x19, 0x80, 0x59, 0x99, 0x8a, 0x3e, 0xe3,
- 0x9d, 0xcc, 0xb7, 0xad, 0xc4, 0x43, 0x99, 0xb7, 0xf2, 0x8f, 0x94, 0xa7, 0xf6, 0x5c, 0xe6, 0x27,
- 0xd3, 0xcf, 0x65, 0xde, 0x39, 0x62, 0x37, 0x9e, 0xd8, 0xa3, 0x99, 0x1f, 0xda, 0x97, 0x2e, 0x07,
- 0x27, 0xc1, 0x10, 0x02, 0x10, 0xe6, 0xf1, 0xef, 0x6b, 0xd2, 0x48, 0x95, 0xa3, 0x68, 0xb8, 0x21,
- 0x70, 0x0c, 0xb1, 0x62, 0x5c, 0x46, 0xc9, 0x67, 0x1c, 0x5d, 0xd1, 0xa1, 0x34, 0x49, 0xbb, 0x13,
- 0xed, 0x2d, 0xb9, 0x81, 0xe8, 0x71, 0x26, 0xcd, 0x65, 0x81, 0x93, 0xa6, 0x29, 0x21, 0x58, 0xd1,
- 0x41, 0xbb, 0x30, 0xb3, 0xc5, 0x62, 0x4b, 0x69, 0x59, 0xe1, 0x05, 0x07, 0xca, 0xe4, 0x10, 0xd7,
- 0x17, 0x97, 0xf3, 0x53, 0xc8, 0xf3, 0x6b, 0x66, 0x0a, 0x05, 0xa7, 0x9b, 0xa0, 0x5b, 0xe3, 0xa4,
- 0xf3, 0x20, 0x5c, 0x6e, 0x39, 0x61, 0xe4, 0x36, 0x16, 0x5a, 0x7e, 0x63, 0xa7, 0x1e, 0xf9, 0x81,
- 0xcc, 0x2a, 0x9a, 0x79, 0xcb, 0x9b, 0xbf, 0x57, 0x4f, 0xe1, 0x1b, 0xcd, 0xb3, 0xec, 0xb6, 0x59,
- 0x58, 0x38, 0xb3, 0x2d, 0xb4, 0x0e, 0xc3, 0x5b, 0x6e, 0x84, 0x49, 0xc7, 0x17, 0x7c, 0x29, 0x93,
- 0xe9, 0x5e, 0xe7, 0x28, 0x46, 0x4b, 0x2c, 0xf6, 0x95, 0x00, 0x60, 0x49, 0x04, 0xbd, 0xaf, 0x8e,
- 0x9b, 0xa1, 0x7c, 0x55, 0x6f, 0xda, 0xcb, 0x2f, 0xf3, 0xc0, 0x79, 0x17, 0xca, 0xde, 0x66, 0x58,
- 0x14, 0xf5, 0x67, 0x7d, 0xc5, 0xd0, 0xd4, 0x2d, 0x0c, 0xd3, 0x4b, 0xf8, 0xfa, 0x4a, 0x1d, 0xd3,
- 0x8a, 0xec, 0x81, 0x6d, 0xd8, 0x08, 0x5d, 0x91, 0xbc, 0x2b, 0xf3, 0xbd, 0xf1, 0x6a, 0x7d, 0xb1,
- 0xbe, 0x6a, 0xd0, 0x60, 0xf1, 0x13, 0x59, 0x31, 0xe6, 0xd5, 0xd1, 0x5d, 0x18, 0xdd, 0xe2, 0x2c,
- 0x76, 0x93, 0x87, 0xb5, 0xcd, 0x39, 0xf6, 0xae, 0x4b, 0x24, 0x83, 0x1e, 0x3b, 0x9c, 0x14, 0x08,
- 0xc7, 0xa4, 0xd0, 0x77, 0x2c, 0x38, 0xd5, 0x49, 0xe8, 0x6a, 0xd9, 0xb3, 0x38, 0xe1, 0x10, 0x97,
- 0xf9, 0xd4, 0xa0, 0x96, 0x55, 0xc1, 0x68, 0x90, 0x19, 0x7a, 0x32, 0xd1, 0x70, 0x76, 0x73, 0x74,
- 0xa0, 0x83, 0xfb, 0xcd, 0xa2, 0x7c, 0x4f, 0x89, 0x10, 0x48, 0x7c, 0xa0, 0xf1, 0xc2, 0x12, 0xa6,
- 0x15, 0xd1, 0x06, 0xc0, 0x66, 0x8b, 0x88, 0xd8, 0x92, 0xc2, 0xfd, 0x2a, 0x53, 0xce, 0x58, 0x51,
- 0x58, 0x82, 0x0e, 0xbb, 0xf3, 0xc6, 0xa5, 0x58, 0xa3, 0x43, 0x97, 0x52, 0xc3, 0xf5, 0x9a, 0x24,
- 0x60, 0x66, 0xb4, 0x9c, 0xa5, 0xb4, 0xc8, 0x30, 0xd2, 0x4b, 0x89, 0x97, 0x63, 0x41, 0x81, 0xd1,
- 0x22, 0x9d, 0xed, 0xcd, 0xb0, 0x28, 0xb3, 0xc8, 0x22, 0xe9, 0x6c, 0x27, 0x16, 0x14, 0xa7, 0xc5,
- 0xca, 0xb1, 0xa0, 0x40, 0xb7, 0xcc, 0x26, 0xdd, 0x40, 0x24, 0xa8, 0x4c, 0xe5, 0x6f, 0x99, 0x15,
- 0x8e, 0x92, 0xde, 0x32, 0x02, 0x80, 0x25, 0x11, 0xf4, 0x0d, 0x53, 0xae, 0x9a, 0x66, 0x34, 0x5f,
- 0xee, 0x21, 0x57, 0x19, 0x74, 0x8b, 0x25, 0xab, 0xb7, 0xa0, 0xb4, 0xd9, 0x60, 0xe6, 0xb7, 0x1c,
- 0xeb, 0xc4, 0xca, 0xa2, 0x41, 0x8d, 0x45, 0xea, 0x5f, 0x59, 0xc4, 0xa5, 0xcd, 0x06, 0x5d, 0xfa,
- 0xce, 0xa3, 0x6e, 0x40, 0x56, 0xdc, 0x16, 0x11, 0xa1, 0x83, 0x33, 0x97, 0xfe, 0xbc, 0x44, 0x4a,
- 0x2f, 0x7d, 0x05, 0xc2, 0x31, 0x29, 0x4a, 0x37, 0x96, 0xf6, 0x4e, 0xe4, 0xd3, 0x55, 0x42, 0x5d,
- 0x9a, 0x6e, 0xa6, 0xbc, 0xb7, 0x03, 0x13, 0xbb, 0x61, 0x67, 0x9b, 0x48, 0xae, 0xc8, 0x0c, 0x83,
- 0x39, 0x31, 0x31, 0xee, 0x0a, 0x44, 0x37, 0x88, 0xba, 0x4e, 0x2b, 0xc5, 0xc8, 0x99, 0x12, 0xe7,
- 0xae, 0x4e, 0x0c, 0x9b, 0xb4, 0xe9, 0x42, 0xf8, 0x88, 0x07, 0xae, 0x63, 0x26, 0xc2, 0x9c, 0x85,
- 0x90, 0x11, 0xdb, 0x8e, 0x2f, 0x04, 0x01, 0xc0, 0x92, 0x88, 0x1a, 0x6c, 0x76, 0x00, 0x9d, 0xee,
- 0x31, 0xd8, 0xa9, 0xfe, 0xc6, 0x83, 0xcd, 0x0e, 0x9c, 0x98, 0x14, 0x3b, 0x68, 0x3a, 0xdb, 0x7e,
- 0xe4, 0x7b, 0x89, 0x43, 0xee, 0x4c, 0xfe, 0x41, 0x53, 0xcb, 0xc0, 0x4f, 0x1f, 0x34, 0x59, 0x58,
- 0x38, 0xb3, 0x2d, 0xfa, 0x71, 0x1d, 0x19, 0x83, 0x50, 0x64, 0x42, 0x79, 0x29, 0x27, 0x84, 0x67,
- 0x3a, 0x50, 0x21, 0xff, 0x38, 0x05, 0xc2, 0x31, 0x29, 0xd4, 0xa4, 0x92, 0xae, 0x1e, 0xdb, 0x96,
- 0x65, 0x74, 0xc9, 0x91, 0x0b, 0xb2, 0xa2, 0xe0, 0x4a, 0x29, 0x57, 0x87, 0xe0, 0x04, 0x4d, 0xe6,
- 0x23, 0xc8, 0x1f, 0x15, 0xb2, 0x84, 0x2f, 0x39, 0x53, 0x9d, 0xf1, 0xee, 0x90, 0x4f, 0xb5, 0x00,
- 0x60, 0x49, 0x84, 0x8e, 0x86, 0x78, 0x0a, 0xe7, 0x87, 0x2c, 0x6f, 0x52, 0x9e, 0x29, 0x3f, 0xcb,
- 0x20, 0x25, 0x03, 0xcd, 0x0b, 0x10, 0x8e, 0x49, 0x51, 0x4e, 0x4e, 0x0f, 0xbc, 0x73, 0xf9, 0x9c,
- 0x3c, 0x79, 0xdc, 0x31, 0x4e, 0x4e, 0x0f, 0xbb, 0xb2, 0x38, 0xea, 0x54, 0x5c, 0x74, 0x96, 0xf3,
- 0x25, 0xa7, 0x5f, 0x2a, 0xb0, 0x7a, 0xba, 0x5f, 0x0a, 0x84, 0x63, 0x52, 0xec, 0x28, 0x66, 0x41,
- 0xf0, 0x2e, 0x14, 0x1c, 0xc5, 0x14, 0x21, 0xe3, 0x28, 0xd6, 0x82, 0xe4, 0xd9, 0x7f, 0xb9, 0x04,
- 0x17, 0x8a, 0xf7, 0x6d, 0x6c, 0xad, 0xab, 0xc5, 0xde, 0x51, 0x09, 0x6b, 0x1d, 0xd7, 0x1d, 0xc5,
- 0x58, 0x7d, 0x87, 0x36, 0xbe, 0x0e, 0x33, 0xea, 0xe1, 0x63, 0xcb, 0x6d, 0xec, 0x69, 0x89, 0x5e,
- 0x55, 0x10, 0xa0, 0x7a, 0x12, 0x01, 0xa7, 0xeb, 0xa0, 0x79, 0x98, 0x32, 0x0a, 0x57, 0x97, 0x84,
- 0xa2, 0x21, 0xce, 0x56, 0x62, 0x82, 0x71, 0x12, 0xdf, 0xfe, 0x45, 0x0b, 0xce, 0xf0, 0x40, 0xbc,
- 0xa4, 0x59, 0xf3, 0x9b, 0x52, 0xa3, 0x70, 0xa4, 0xc8, 0xbd, 0x9b, 0x30, 0xd5, 0x31, 0xab, 0xf6,
- 0x08, 0x36, 0xae, 0xa3, 0xc6, 0x7d, 0x4d, 0x00, 0x70, 0x92, 0xa8, 0xfd, 0xf3, 0x25, 0x38, 0x5f,
- 0xe8, 0xc9, 0x8f, 0x30, 0x9c, 0xde, 0x6a, 0x87, 0xce, 0x62, 0x40, 0x9a, 0xc4, 0x8b, 0x5c, 0xa7,
- 0x55, 0xef, 0x90, 0x86, 0x66, 0x6f, 0x65, 0x2e, 0xf1, 0xd7, 0xd7, 0xea, 0xf3, 0x69, 0x0c, 0x9c,
- 0x53, 0x13, 0xad, 0x00, 0x4a, 0x43, 0xc4, 0x0c, 0xb3, 0xcb, 0x74, 0x9a, 0x1e, 0xce, 0xa8, 0x81,
- 0xbe, 0x00, 0x13, 0xea, 0x85, 0x80, 0x36, 0xe3, 0xec, 0x80, 0xc0, 0x3a, 0x00, 0x9b, 0x78, 0xe8,
- 0x2a, 0x4f, 0x63, 0x25, 0x12, 0x9e, 0x09, 0xe3, 0xec, 0x94, 0xcc, 0x51, 0x25, 0x8a, 0xb1, 0x8e,
- 0xb3, 0x70, 0xed, 0x77, 0xfe, 0xf0, 0xc2, 0x67, 0x7e, 0xf7, 0x0f, 0x2f, 0x7c, 0xe6, 0x0f, 0xfe,
- 0xf0, 0xc2, 0x67, 0x7e, 0xfc, 0xe0, 0x82, 0xf5, 0x3b, 0x07, 0x17, 0xac, 0xdf, 0x3d, 0xb8, 0x60,
- 0xfd, 0xc1, 0xc1, 0x05, 0xeb, 0x7f, 0x3b, 0xb8, 0x60, 0x7d, 0xef, 0x7f, 0xbf, 0xf0, 0x99, 0xaf,
- 0xa2, 0x38, 0x16, 0xf6, 0x15, 0x3a, 0x3b, 0x57, 0x76, 0xaf, 0xfe, 0x87, 0x00, 0x00, 0x00, 0xff,
- 0xff, 0xba, 0xfb, 0xfc, 0xdd, 0x18, 0x2e, 0x01, 0x00,
-}
+func (m *VolumeMountStatus) Reset() { *m = VolumeMountStatus{} }
+
+func (m *VolumeNodeAffinity) Reset() { *m = VolumeNodeAffinity{} }
+
+func (m *VolumeProjection) Reset() { *m = VolumeProjection{} }
+
+func (m *VolumeResourceRequirements) Reset() { *m = VolumeResourceRequirements{} }
+
+func (m *VolumeSource) Reset() { *m = VolumeSource{} }
+
+func (m *VsphereVirtualDiskVolumeSource) Reset() { *m = VsphereVirtualDiskVolumeSource{} }
+
+func (m *WeightedPodAffinityTerm) Reset() { *m = WeightedPodAffinityTerm{} }
+
+func (m *WindowsSecurityContextOptions) Reset() { *m = WindowsSecurityContextOptions{} }
+
+func (m *WorkloadReference) Reset() { *m = WorkloadReference{} }
func (m *AWSElasticBlockStoreVolumeSource) Marshal() (dAtA []byte, err error) {
size := m.Size()
@@ -8495,7 +1001,7 @@ func (m *CSIPersistentVolumeSource) MarshalToSizedBuffer(dAtA []byte) (int, erro
for k := range m.VolumeAttributes {
keysForVolumeAttributes = append(keysForVolumeAttributes, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForVolumeAttributes)
+ sort.Strings(keysForVolumeAttributes)
for iNdEx := len(keysForVolumeAttributes) - 1; iNdEx >= 0; iNdEx-- {
v := m.VolumeAttributes[string(keysForVolumeAttributes[iNdEx])]
baseI := i
@@ -8577,7 +1083,7 @@ func (m *CSIVolumeSource) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.VolumeAttributes {
keysForVolumeAttributes = append(keysForVolumeAttributes, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForVolumeAttributes)
+ sort.Strings(keysForVolumeAttributes)
for iNdEx := len(keysForVolumeAttributes) - 1; iNdEx >= 0; iNdEx-- {
v := m.VolumeAttributes[string(keysForVolumeAttributes[iNdEx])]
baseI := i
@@ -9166,7 +1672,7 @@ func (m *ConfigMap) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.BinaryData {
keysForBinaryData = append(keysForBinaryData, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForBinaryData)
+ sort.Strings(keysForBinaryData)
for iNdEx := len(keysForBinaryData) - 1; iNdEx >= 0; iNdEx-- {
v := m.BinaryData[string(keysForBinaryData[iNdEx])]
baseI := i
@@ -9192,7 +1698,7 @@ func (m *ConfigMap) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.Data {
keysForData = append(keysForData, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForData)
+ sort.Strings(keysForData)
for iNdEx := len(keysForData) - 1; iNdEx >= 0; iNdEx-- {
v := m.Data[string(keysForData[iNdEx])]
baseI := i
@@ -10317,7 +2823,7 @@ func (m *ContainerStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.AllocatedResources {
keysForAllocatedResources = append(keysForAllocatedResources, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForAllocatedResources)
+ sort.Strings(keysForAllocatedResources)
for iNdEx := len(keysForAllocatedResources) - 1; iNdEx >= 0; iNdEx-- {
v := m.AllocatedResources[ResourceName(keysForAllocatedResources[iNdEx])]
baseI := i
@@ -11859,7 +4365,7 @@ func (m *FlexPersistentVolumeSource) MarshalToSizedBuffer(dAtA []byte) (int, err
for k := range m.Options {
keysForOptions = append(keysForOptions, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForOptions)
+ sort.Strings(keysForOptions)
for iNdEx := len(keysForOptions) - 1; iNdEx >= 0; iNdEx-- {
v := m.Options[string(keysForOptions[iNdEx])]
baseI := i
@@ -11936,7 +4442,7 @@ func (m *FlexVolumeSource) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.Options {
keysForOptions = append(keysForOptions, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForOptions)
+ sort.Strings(keysForOptions)
for iNdEx := len(keysForOptions) - 1; iNdEx >= 0; iNdEx-- {
v := m.Options[string(keysForOptions[iNdEx])]
baseI := i
@@ -12880,7 +5386,7 @@ func (m *LimitRangeItem) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.MaxLimitRequestRatio {
keysForMaxLimitRequestRatio = append(keysForMaxLimitRequestRatio, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForMaxLimitRequestRatio)
+ sort.Strings(keysForMaxLimitRequestRatio)
for iNdEx := len(keysForMaxLimitRequestRatio) - 1; iNdEx >= 0; iNdEx-- {
v := m.MaxLimitRequestRatio[ResourceName(keysForMaxLimitRequestRatio[iNdEx])]
baseI := i
@@ -12909,7 +5415,7 @@ func (m *LimitRangeItem) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.DefaultRequest {
keysForDefaultRequest = append(keysForDefaultRequest, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForDefaultRequest)
+ sort.Strings(keysForDefaultRequest)
for iNdEx := len(keysForDefaultRequest) - 1; iNdEx >= 0; iNdEx-- {
v := m.DefaultRequest[ResourceName(keysForDefaultRequest[iNdEx])]
baseI := i
@@ -12938,7 +5444,7 @@ func (m *LimitRangeItem) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.Default {
keysForDefault = append(keysForDefault, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForDefault)
+ sort.Strings(keysForDefault)
for iNdEx := len(keysForDefault) - 1; iNdEx >= 0; iNdEx-- {
v := m.Default[ResourceName(keysForDefault[iNdEx])]
baseI := i
@@ -12967,7 +5473,7 @@ func (m *LimitRangeItem) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.Min {
keysForMin = append(keysForMin, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForMin)
+ sort.Strings(keysForMin)
for iNdEx := len(keysForMin) - 1; iNdEx >= 0; iNdEx-- {
v := m.Min[ResourceName(keysForMin[iNdEx])]
baseI := i
@@ -12996,7 +5502,7 @@ func (m *LimitRangeItem) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.Max {
keysForMax = append(keysForMax, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForMax)
+ sort.Strings(keysForMax)
for iNdEx := len(keysForMax) - 1; iNdEx >= 0; iNdEx-- {
v := m.Max[ResourceName(keysForMax[iNdEx])]
baseI := i
@@ -14402,6 +6908,15 @@ func (m *NodeStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ if len(m.DeclaredFeatures) > 0 {
+ for iNdEx := len(m.DeclaredFeatures) - 1; iNdEx >= 0; iNdEx-- {
+ i -= len(m.DeclaredFeatures[iNdEx])
+ copy(dAtA[i:], m.DeclaredFeatures[iNdEx])
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeclaredFeatures[iNdEx])))
+ i--
+ dAtA[i] = 0x72
+ }
+ }
if m.Features != nil {
{
size, err := m.Features.MarshalToSizedBuffer(dAtA[:i])
@@ -14535,7 +7050,7 @@ func (m *NodeStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.Allocatable {
keysForAllocatable = append(keysForAllocatable, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForAllocatable)
+ sort.Strings(keysForAllocatable)
for iNdEx := len(keysForAllocatable) - 1; iNdEx >= 0; iNdEx-- {
v := m.Allocatable[ResourceName(keysForAllocatable[iNdEx])]
baseI := i
@@ -14564,7 +7079,7 @@ func (m *NodeStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.Capacity {
keysForCapacity = append(keysForCapacity, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForCapacity)
+ sort.Strings(keysForCapacity)
for iNdEx := len(keysForCapacity) - 1; iNdEx >= 0; iNdEx-- {
v := m.Capacity[ResourceName(keysForCapacity[iNdEx])]
baseI := i
@@ -15159,7 +7674,7 @@ func (m *PersistentVolumeClaimStatus) MarshalToSizedBuffer(dAtA []byte) (int, er
for k := range m.AllocatedResourceStatuses {
keysForAllocatedResourceStatuses = append(keysForAllocatedResourceStatuses, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForAllocatedResourceStatuses)
+ sort.Strings(keysForAllocatedResourceStatuses)
for iNdEx := len(keysForAllocatedResourceStatuses) - 1; iNdEx >= 0; iNdEx-- {
v := m.AllocatedResourceStatuses[ResourceName(keysForAllocatedResourceStatuses[iNdEx])]
baseI := i
@@ -15183,7 +7698,7 @@ func (m *PersistentVolumeClaimStatus) MarshalToSizedBuffer(dAtA []byte) (int, er
for k := range m.AllocatedResources {
keysForAllocatedResources = append(keysForAllocatedResources, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForAllocatedResources)
+ sort.Strings(keysForAllocatedResources)
for iNdEx := len(keysForAllocatedResources) - 1; iNdEx >= 0; iNdEx-- {
v := m.AllocatedResources[ResourceName(keysForAllocatedResources[iNdEx])]
baseI := i
@@ -15226,7 +7741,7 @@ func (m *PersistentVolumeClaimStatus) MarshalToSizedBuffer(dAtA []byte) (int, er
for k := range m.Capacity {
keysForCapacity = append(keysForCapacity, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForCapacity)
+ sort.Strings(keysForCapacity)
for iNdEx := len(keysForCapacity) - 1; iNdEx >= 0; iNdEx-- {
v := m.Capacity[ResourceName(keysForCapacity[iNdEx])]
baseI := i
@@ -15795,7 +8310,7 @@ func (m *PersistentVolumeSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.Capacity {
keysForCapacity = append(keysForCapacity, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForCapacity)
+ sort.Strings(keysForCapacity)
for iNdEx := len(keysForCapacity) - 1; iNdEx >= 0; iNdEx-- {
v := m.Capacity[ResourceName(keysForCapacity[iNdEx])]
baseI := i
@@ -16219,6 +8734,30 @@ func (m *PodCertificateProjection) MarshalToSizedBuffer(dAtA []byte) (int, error
_ = i
var l int
_ = l
+ if len(m.UserAnnotations) > 0 {
+ keysForUserAnnotations := make([]string, 0, len(m.UserAnnotations))
+ for k := range m.UserAnnotations {
+ keysForUserAnnotations = append(keysForUserAnnotations, string(k))
+ }
+ sort.Strings(keysForUserAnnotations)
+ for iNdEx := len(keysForUserAnnotations) - 1; iNdEx >= 0; iNdEx-- {
+ v := m.UserAnnotations[string(keysForUserAnnotations[iNdEx])]
+ baseI := i
+ i -= len(v)
+ copy(dAtA[i:], v)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(v)))
+ i--
+ dAtA[i] = 0x12
+ i -= len(keysForUserAnnotations[iNdEx])
+ copy(dAtA[i:], keysForUserAnnotations[iNdEx])
+ i = encodeVarintGenerated(dAtA, i, uint64(len(keysForUserAnnotations[iNdEx])))
+ i--
+ dAtA[i] = 0xa
+ i = encodeVarintGenerated(dAtA, i, uint64(baseI-i))
+ i--
+ dAtA[i] = 0x3a
+ }
+ }
i -= len(m.CertificateChainPath)
copy(dAtA[i:], m.CertificateChainPath)
i = encodeVarintGenerated(dAtA, i, uint64(len(m.CertificateChainPath)))
@@ -17100,6 +9639,20 @@ func (m *PodSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ if m.WorkloadRef != nil {
+ {
+ size, err := m.WorkloadRef.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x2
+ i--
+ dAtA[i] = 0xd2
+ }
if m.HostnameOverride != nil {
i -= len(*m.HostnameOverride)
copy(dAtA[i:], *m.HostnameOverride)
@@ -17230,7 +9783,7 @@ func (m *PodSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.Overhead {
keysForOverhead = append(keysForOverhead, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForOverhead)
+ sort.Strings(keysForOverhead)
for iNdEx := len(keysForOverhead) - 1; iNdEx >= 0; iNdEx-- {
v := m.Overhead[ResourceName(keysForOverhead[iNdEx])]
baseI := i
@@ -17507,7 +10060,7 @@ func (m *PodSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.NodeSelector {
keysForNodeSelector = append(keysForNodeSelector, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForNodeSelector)
+ sort.Strings(keysForNodeSelector)
for iNdEx := len(keysForNodeSelector) - 1; iNdEx >= 0; iNdEx-- {
v := m.NodeSelector[string(keysForNodeSelector[iNdEx])]
baseI := i
@@ -17597,6 +10150,51 @@ func (m *PodStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ if m.Resources != nil {
+ {
+ size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenerated(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x1
+ i--
+ dAtA[i] = 0xa2
+ }
+ if len(m.AllocatedResources) > 0 {
+ keysForAllocatedResources := make([]string, 0, len(m.AllocatedResources))
+ for k := range m.AllocatedResources {
+ keysForAllocatedResources = append(keysForAllocatedResources, string(k))
+ }
+ sort.Strings(keysForAllocatedResources)
+ for iNdEx := len(keysForAllocatedResources) - 1; iNdEx >= 0; iNdEx-- {
+ v := m.AllocatedResources[ResourceName(keysForAllocatedResources[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(keysForAllocatedResources[iNdEx])
+ copy(dAtA[i:], keysForAllocatedResources[iNdEx])
+ i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAllocatedResources[iNdEx])))
+ i--
+ dAtA[i] = 0xa
+ i = encodeVarintGenerated(dAtA, i, uint64(baseI-i))
+ i--
+ dAtA[i] = 0x1
+ i--
+ dAtA[i] = 0x9a
+ }
+ }
if m.ExtendedResourceClaimStatus != nil {
{
size, err := m.ExtendedResourceClaimStatus.MarshalToSizedBuffer(dAtA[:i])
@@ -18759,7 +11357,7 @@ func (m *ReplicationControllerSpec) MarshalToSizedBuffer(dAtA []byte) (int, erro
for k := range m.Selector {
keysForSelector = append(keysForSelector, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForSelector)
+ sort.Strings(keysForSelector)
for iNdEx := len(keysForSelector) - 1; iNdEx >= 0; iNdEx-- {
v := m.Selector[string(keysForSelector[iNdEx])]
baseI := i
@@ -19093,7 +11691,7 @@ func (m *ResourceQuotaSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.Hard {
keysForHard = append(keysForHard, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForHard)
+ sort.Strings(keysForHard)
for iNdEx := len(keysForHard) - 1; iNdEx >= 0; iNdEx-- {
v := m.Hard[ResourceName(keysForHard[iNdEx])]
baseI := i
@@ -19145,7 +11743,7 @@ func (m *ResourceQuotaStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.Used {
keysForUsed = append(keysForUsed, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForUsed)
+ sort.Strings(keysForUsed)
for iNdEx := len(keysForUsed) - 1; iNdEx >= 0; iNdEx-- {
v := m.Used[ResourceName(keysForUsed[iNdEx])]
baseI := i
@@ -19174,7 +11772,7 @@ func (m *ResourceQuotaStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.Hard {
keysForHard = append(keysForHard, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForHard)
+ sort.Strings(keysForHard)
for iNdEx := len(keysForHard) - 1; iNdEx >= 0; iNdEx-- {
v := m.Hard[ResourceName(keysForHard[iNdEx])]
baseI := i
@@ -19240,7 +11838,7 @@ func (m *ResourceRequirements) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.Requests {
keysForRequests = append(keysForRequests, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForRequests)
+ sort.Strings(keysForRequests)
for iNdEx := len(keysForRequests) - 1; iNdEx >= 0; iNdEx-- {
v := m.Requests[ResourceName(keysForRequests[iNdEx])]
baseI := i
@@ -19269,7 +11867,7 @@ func (m *ResourceRequirements) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.Limits {
keysForLimits = append(keysForLimits, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForLimits)
+ sort.Strings(keysForLimits)
for iNdEx := len(keysForLimits) - 1; iNdEx >= 0; iNdEx-- {
v := m.Limits[ResourceName(keysForLimits[iNdEx])]
baseI := i
@@ -19702,7 +12300,7 @@ func (m *Secret) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.StringData {
keysForStringData = append(keysForStringData, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForStringData)
+ sort.Strings(keysForStringData)
for iNdEx := len(keysForStringData) - 1; iNdEx >= 0; iNdEx-- {
v := m.StringData[string(keysForStringData[iNdEx])]
baseI := i
@@ -19731,7 +12329,7 @@ func (m *Secret) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.Data {
keysForData = append(keysForData, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForData)
+ sort.Strings(keysForData)
for iNdEx := len(keysForData) - 1; iNdEx >= 0; iNdEx-- {
v := m.Data[string(keysForData[iNdEx])]
baseI := i
@@ -20729,7 +13327,7 @@ func (m *ServiceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.Selector {
keysForSelector = append(keysForSelector, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForSelector)
+ sort.Strings(keysForSelector)
for iNdEx := len(keysForSelector) - 1; iNdEx >= 0; iNdEx-- {
v := m.Selector[string(keysForSelector[iNdEx])]
baseI := i
@@ -21734,7 +14332,7 @@ func (m *VolumeResourceRequirements) MarshalToSizedBuffer(dAtA []byte) (int, err
for k := range m.Requests {
keysForRequests = append(keysForRequests, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForRequests)
+ sort.Strings(keysForRequests)
for iNdEx := len(keysForRequests) - 1; iNdEx >= 0; iNdEx-- {
v := m.Requests[ResourceName(keysForRequests[iNdEx])]
baseI := i
@@ -21763,7 +14361,7 @@ func (m *VolumeResourceRequirements) MarshalToSizedBuffer(dAtA []byte) (int, err
for k := range m.Limits {
keysForLimits = append(keysForLimits, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForLimits)
+ sort.Strings(keysForLimits)
for iNdEx := len(keysForLimits) - 1; iNdEx >= 0; iNdEx-- {
v := m.Limits[ResourceName(keysForLimits[iNdEx])]
baseI := i
@@ -22336,6 +14934,44 @@ func (m *WindowsSecurityContextOptions) MarshalToSizedBuffer(dAtA []byte) (int,
return len(dAtA) - i, nil
}
+func (m *WorkloadReference) 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 *WorkloadReference) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *WorkloadReference) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ i -= len(m.PodGroupReplicaKey)
+ copy(dAtA[i:], m.PodGroupReplicaKey)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.PodGroupReplicaKey)))
+ i--
+ dAtA[i] = 0x1a
+ i -= len(m.PodGroup)
+ copy(dAtA[i:], m.PodGroup)
+ i = encodeVarintGenerated(dAtA, i, uint64(len(m.PodGroup)))
+ 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 encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
offset -= sovGenerated(v)
base := offset
@@ -24786,6 +17422,12 @@ func (m *NodeStatus) Size() (n int) {
l = m.Features.Size()
n += 1 + l + sovGenerated(uint64(l))
}
+ if len(m.DeclaredFeatures) > 0 {
+ for _, s := range m.DeclaredFeatures {
+ l = len(s)
+ n += 1 + l + sovGenerated(uint64(l))
+ }
+ }
return n
}
@@ -25389,6 +18031,14 @@ func (m *PodCertificateProjection) Size() (n int) {
n += 1 + l + sovGenerated(uint64(l))
l = len(m.CertificateChainPath)
n += 1 + l + sovGenerated(uint64(l))
+ if len(m.UserAnnotations) > 0 {
+ for k, v := range m.UserAnnotations {
+ _ = 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
}
@@ -25885,6 +18535,10 @@ func (m *PodSpec) Size() (n int) {
l = len(*m.HostnameOverride)
n += 2 + l + sovGenerated(uint64(l))
}
+ if m.WorkloadRef != nil {
+ l = m.WorkloadRef.Size()
+ n += 2 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -25961,6 +18615,19 @@ func (m *PodStatus) Size() (n int) {
l = m.ExtendedResourceClaimStatus.Size()
n += 2 + l + sovGenerated(uint64(l))
}
+ if len(m.AllocatedResources) > 0 {
+ for k, v := range m.AllocatedResources {
+ _ = k
+ _ = v
+ l = v.Size()
+ mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l))
+ n += mapEntrySize + 2 + sovGenerated(uint64(mapEntrySize))
+ }
+ }
+ if m.Resources != nil {
+ l = m.Resources.Size()
+ n += 2 + l + sovGenerated(uint64(l))
+ }
return n
}
@@ -27632,6 +20299,21 @@ func (m *WindowsSecurityContextOptions) Size() (n int) {
return n
}
+func (m *WorkloadReference) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Name)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.PodGroup)
+ n += 1 + l + sovGenerated(uint64(l))
+ l = len(m.PodGroupReplicaKey)
+ n += 1 + l + sovGenerated(uint64(l))
+ return n
+}
+
func sovGenerated(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
@@ -27759,7 +20441,7 @@ func (this *CSIPersistentVolumeSource) String() string {
for k := range this.VolumeAttributes {
keysForVolumeAttributes = append(keysForVolumeAttributes, k)
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForVolumeAttributes)
+ sort.Strings(keysForVolumeAttributes)
mapStringForVolumeAttributes := "map[string]string{"
for _, k := range keysForVolumeAttributes {
mapStringForVolumeAttributes += fmt.Sprintf("%v: %v,", k, this.VolumeAttributes[k])
@@ -27788,7 +20470,7 @@ func (this *CSIVolumeSource) String() string {
for k := range this.VolumeAttributes {
keysForVolumeAttributes = append(keysForVolumeAttributes, k)
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForVolumeAttributes)
+ sort.Strings(keysForVolumeAttributes)
mapStringForVolumeAttributes := "map[string]string{"
for _, k := range keysForVolumeAttributes {
mapStringForVolumeAttributes += fmt.Sprintf("%v: %v,", k, this.VolumeAttributes[k])
@@ -27948,7 +20630,7 @@ func (this *ConfigMap) String() string {
for k := range this.Data {
keysForData = append(keysForData, k)
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForData)
+ sort.Strings(keysForData)
mapStringForData := "map[string]string{"
for _, k := range keysForData {
mapStringForData += fmt.Sprintf("%v: %v,", k, this.Data[k])
@@ -27958,7 +20640,7 @@ func (this *ConfigMap) String() string {
for k := range this.BinaryData {
keysForBinaryData = append(keysForBinaryData, k)
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForBinaryData)
+ sort.Strings(keysForBinaryData)
mapStringForBinaryData := "map[string][]byte{"
for _, k := range keysForBinaryData {
mapStringForBinaryData += fmt.Sprintf("%v: %v,", k, this.BinaryData[k])
@@ -28267,7 +20949,7 @@ func (this *ContainerStatus) String() string {
for k := range this.AllocatedResources {
keysForAllocatedResources = append(keysForAllocatedResources, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForAllocatedResources)
+ sort.Strings(keysForAllocatedResources)
mapStringForAllocatedResources := "ResourceList{"
for _, k := range keysForAllocatedResources {
mapStringForAllocatedResources += fmt.Sprintf("%v: %v,", k, this.AllocatedResources[ResourceName(k)])
@@ -28688,7 +21370,7 @@ func (this *FlexPersistentVolumeSource) String() string {
for k := range this.Options {
keysForOptions = append(keysForOptions, k)
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForOptions)
+ sort.Strings(keysForOptions)
mapStringForOptions := "map[string]string{"
for _, k := range keysForOptions {
mapStringForOptions += fmt.Sprintf("%v: %v,", k, this.Options[k])
@@ -28712,7 +21394,7 @@ func (this *FlexVolumeSource) String() string {
for k := range this.Options {
keysForOptions = append(keysForOptions, k)
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForOptions)
+ sort.Strings(keysForOptions)
mapStringForOptions := "map[string]string{"
for _, k := range keysForOptions {
mapStringForOptions += fmt.Sprintf("%v: %v,", k, this.Options[k])
@@ -28969,7 +21651,7 @@ func (this *LimitRangeItem) String() string {
for k := range this.Max {
keysForMax = append(keysForMax, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForMax)
+ sort.Strings(keysForMax)
mapStringForMax := "ResourceList{"
for _, k := range keysForMax {
mapStringForMax += fmt.Sprintf("%v: %v,", k, this.Max[ResourceName(k)])
@@ -28979,7 +21661,7 @@ func (this *LimitRangeItem) String() string {
for k := range this.Min {
keysForMin = append(keysForMin, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForMin)
+ sort.Strings(keysForMin)
mapStringForMin := "ResourceList{"
for _, k := range keysForMin {
mapStringForMin += fmt.Sprintf("%v: %v,", k, this.Min[ResourceName(k)])
@@ -28989,7 +21671,7 @@ func (this *LimitRangeItem) String() string {
for k := range this.Default {
keysForDefault = append(keysForDefault, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForDefault)
+ sort.Strings(keysForDefault)
mapStringForDefault := "ResourceList{"
for _, k := range keysForDefault {
mapStringForDefault += fmt.Sprintf("%v: %v,", k, this.Default[ResourceName(k)])
@@ -28999,7 +21681,7 @@ func (this *LimitRangeItem) String() string {
for k := range this.DefaultRequest {
keysForDefaultRequest = append(keysForDefaultRequest, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForDefaultRequest)
+ sort.Strings(keysForDefaultRequest)
mapStringForDefaultRequest := "ResourceList{"
for _, k := range keysForDefaultRequest {
mapStringForDefaultRequest += fmt.Sprintf("%v: %v,", k, this.DefaultRequest[ResourceName(k)])
@@ -29009,7 +21691,7 @@ func (this *LimitRangeItem) String() string {
for k := range this.MaxLimitRequestRatio {
keysForMaxLimitRequestRatio = append(keysForMaxLimitRequestRatio, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForMaxLimitRequestRatio)
+ sort.Strings(keysForMaxLimitRequestRatio)
mapStringForMaxLimitRequestRatio := "ResourceList{"
for _, k := range keysForMaxLimitRequestRatio {
mapStringForMaxLimitRequestRatio += fmt.Sprintf("%v: %v,", k, this.MaxLimitRequestRatio[ResourceName(k)])
@@ -29477,7 +22159,7 @@ func (this *NodeStatus) String() string {
for k := range this.Capacity {
keysForCapacity = append(keysForCapacity, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForCapacity)
+ sort.Strings(keysForCapacity)
mapStringForCapacity := "ResourceList{"
for _, k := range keysForCapacity {
mapStringForCapacity += fmt.Sprintf("%v: %v,", k, this.Capacity[ResourceName(k)])
@@ -29487,7 +22169,7 @@ func (this *NodeStatus) String() string {
for k := range this.Allocatable {
keysForAllocatable = append(keysForAllocatable, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForAllocatable)
+ sort.Strings(keysForAllocatable)
mapStringForAllocatable := "ResourceList{"
for _, k := range keysForAllocatable {
mapStringForAllocatable += fmt.Sprintf("%v: %v,", k, this.Allocatable[ResourceName(k)])
@@ -29507,6 +22189,7 @@ func (this *NodeStatus) String() string {
`Config:` + strings.Replace(this.Config.String(), "NodeConfigStatus", "NodeConfigStatus", 1) + `,`,
`RuntimeHandlers:` + repeatedStringForRuntimeHandlers + `,`,
`Features:` + strings.Replace(this.Features.String(), "NodeFeatures", "NodeFeatures", 1) + `,`,
+ `DeclaredFeatures:` + fmt.Sprintf("%v", this.DeclaredFeatures) + `,`,
`}`,
}, "")
return s
@@ -29654,7 +22337,7 @@ func (this *PersistentVolumeClaimStatus) String() string {
for k := range this.Capacity {
keysForCapacity = append(keysForCapacity, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForCapacity)
+ sort.Strings(keysForCapacity)
mapStringForCapacity := "ResourceList{"
for _, k := range keysForCapacity {
mapStringForCapacity += fmt.Sprintf("%v: %v,", k, this.Capacity[ResourceName(k)])
@@ -29664,7 +22347,7 @@ func (this *PersistentVolumeClaimStatus) String() string {
for k := range this.AllocatedResources {
keysForAllocatedResources = append(keysForAllocatedResources, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForAllocatedResources)
+ sort.Strings(keysForAllocatedResources)
mapStringForAllocatedResources := "ResourceList{"
for _, k := range keysForAllocatedResources {
mapStringForAllocatedResources += fmt.Sprintf("%v: %v,", k, this.AllocatedResources[ResourceName(k)])
@@ -29674,7 +22357,7 @@ func (this *PersistentVolumeClaimStatus) String() string {
for k := range this.AllocatedResourceStatuses {
keysForAllocatedResourceStatuses = append(keysForAllocatedResourceStatuses, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForAllocatedResourceStatuses)
+ sort.Strings(keysForAllocatedResourceStatuses)
mapStringForAllocatedResourceStatuses := "map[ResourceName]ClaimResourceStatus{"
for _, k := range keysForAllocatedResourceStatuses {
mapStringForAllocatedResourceStatuses += fmt.Sprintf("%v: %v,", k, this.AllocatedResourceStatuses[ResourceName(k)])
@@ -29770,7 +22453,7 @@ func (this *PersistentVolumeSpec) String() string {
for k := range this.Capacity {
keysForCapacity = append(keysForCapacity, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForCapacity)
+ sort.Strings(keysForCapacity)
mapStringForCapacity := "ResourceList{"
for _, k := range keysForCapacity {
mapStringForCapacity += fmt.Sprintf("%v: %v,", k, this.Capacity[ResourceName(k)])
@@ -29902,6 +22585,16 @@ func (this *PodCertificateProjection) String() string {
if this == nil {
return "nil"
}
+ keysForUserAnnotations := make([]string, 0, len(this.UserAnnotations))
+ for k := range this.UserAnnotations {
+ keysForUserAnnotations = append(keysForUserAnnotations, k)
+ }
+ sort.Strings(keysForUserAnnotations)
+ mapStringForUserAnnotations := "map[string]string{"
+ for _, k := range keysForUserAnnotations {
+ mapStringForUserAnnotations += fmt.Sprintf("%v: %v,", k, this.UserAnnotations[k])
+ }
+ mapStringForUserAnnotations += "}"
s := strings.Join([]string{`&PodCertificateProjection{`,
`SignerName:` + fmt.Sprintf("%v", this.SignerName) + `,`,
`KeyType:` + fmt.Sprintf("%v", this.KeyType) + `,`,
@@ -29909,6 +22602,7 @@ func (this *PodCertificateProjection) String() string {
`CredentialBundlePath:` + fmt.Sprintf("%v", this.CredentialBundlePath) + `,`,
`KeyPath:` + fmt.Sprintf("%v", this.KeyPath) + `,`,
`CertificateChainPath:` + fmt.Sprintf("%v", this.CertificateChainPath) + `,`,
+ `UserAnnotations:` + mapStringForUserAnnotations + `,`,
`}`,
}, "")
return s
@@ -30206,7 +22900,7 @@ func (this *PodSpec) String() string {
for k := range this.NodeSelector {
keysForNodeSelector = append(keysForNodeSelector, k)
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForNodeSelector)
+ sort.Strings(keysForNodeSelector)
mapStringForNodeSelector := "map[string]string{"
for _, k := range keysForNodeSelector {
mapStringForNodeSelector += fmt.Sprintf("%v: %v,", k, this.NodeSelector[k])
@@ -30216,7 +22910,7 @@ func (this *PodSpec) String() string {
for k := range this.Overhead {
keysForOverhead = append(keysForOverhead, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForOverhead)
+ sort.Strings(keysForOverhead)
mapStringForOverhead := "ResourceList{"
for _, k := range keysForOverhead {
mapStringForOverhead += fmt.Sprintf("%v: %v,", k, this.Overhead[ResourceName(k)])
@@ -30264,6 +22958,7 @@ func (this *PodSpec) String() string {
`ResourceClaims:` + repeatedStringForResourceClaims + `,`,
`Resources:` + strings.Replace(this.Resources.String(), "ResourceRequirements", "ResourceRequirements", 1) + `,`,
`HostnameOverride:` + valueToStringGenerated(this.HostnameOverride) + `,`,
+ `WorkloadRef:` + strings.Replace(this.WorkloadRef.String(), "WorkloadReference", "WorkloadReference", 1) + `,`,
`}`,
}, "")
return s
@@ -30307,6 +23002,16 @@ func (this *PodStatus) String() string {
repeatedStringForHostIPs += strings.Replace(strings.Replace(f.String(), "HostIP", "HostIP", 1), `&`, ``, 1) + ","
}
repeatedStringForHostIPs += "}"
+ keysForAllocatedResources := make([]string, 0, len(this.AllocatedResources))
+ for k := range this.AllocatedResources {
+ keysForAllocatedResources = append(keysForAllocatedResources, string(k))
+ }
+ sort.Strings(keysForAllocatedResources)
+ mapStringForAllocatedResources := "ResourceList{"
+ for _, k := range keysForAllocatedResources {
+ mapStringForAllocatedResources += fmt.Sprintf("%v: %v,", k, this.AllocatedResources[ResourceName(k)])
+ }
+ mapStringForAllocatedResources += "}"
s := strings.Join([]string{`&PodStatus{`,
`Phase:` + fmt.Sprintf("%v", this.Phase) + `,`,
`Conditions:` + repeatedStringForConditions + `,`,
@@ -30326,6 +23031,8 @@ func (this *PodStatus) String() string {
`HostIPs:` + repeatedStringForHostIPs + `,`,
`ObservedGeneration:` + fmt.Sprintf("%v", this.ObservedGeneration) + `,`,
`ExtendedResourceClaimStatus:` + strings.Replace(this.ExtendedResourceClaimStatus.String(), "PodExtendedResourceClaimStatus", "PodExtendedResourceClaimStatus", 1) + `,`,
+ `AllocatedResources:` + mapStringForAllocatedResources + `,`,
+ `Resources:` + strings.Replace(this.Resources.String(), "ResourceRequirements", "ResourceRequirements", 1) + `,`,
`}`,
}, "")
return s
@@ -30593,7 +23300,7 @@ func (this *ReplicationControllerSpec) String() string {
for k := range this.Selector {
keysForSelector = append(keysForSelector, k)
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForSelector)
+ sort.Strings(keysForSelector)
mapStringForSelector := "map[string]string{"
for _, k := range keysForSelector {
mapStringForSelector += fmt.Sprintf("%v: %v,", k, this.Selector[k])
@@ -30698,7 +23405,7 @@ func (this *ResourceQuotaSpec) String() string {
for k := range this.Hard {
keysForHard = append(keysForHard, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForHard)
+ sort.Strings(keysForHard)
mapStringForHard := "ResourceList{"
for _, k := range keysForHard {
mapStringForHard += fmt.Sprintf("%v: %v,", k, this.Hard[ResourceName(k)])
@@ -30720,7 +23427,7 @@ func (this *ResourceQuotaStatus) String() string {
for k := range this.Hard {
keysForHard = append(keysForHard, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForHard)
+ sort.Strings(keysForHard)
mapStringForHard := "ResourceList{"
for _, k := range keysForHard {
mapStringForHard += fmt.Sprintf("%v: %v,", k, this.Hard[ResourceName(k)])
@@ -30730,7 +23437,7 @@ func (this *ResourceQuotaStatus) String() string {
for k := range this.Used {
keysForUsed = append(keysForUsed, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForUsed)
+ sort.Strings(keysForUsed)
mapStringForUsed := "ResourceList{"
for _, k := range keysForUsed {
mapStringForUsed += fmt.Sprintf("%v: %v,", k, this.Used[ResourceName(k)])
@@ -30756,7 +23463,7 @@ func (this *ResourceRequirements) String() string {
for k := range this.Limits {
keysForLimits = append(keysForLimits, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForLimits)
+ sort.Strings(keysForLimits)
mapStringForLimits := "ResourceList{"
for _, k := range keysForLimits {
mapStringForLimits += fmt.Sprintf("%v: %v,", k, this.Limits[ResourceName(k)])
@@ -30766,7 +23473,7 @@ func (this *ResourceRequirements) String() string {
for k := range this.Requests {
keysForRequests = append(keysForRequests, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForRequests)
+ sort.Strings(keysForRequests)
mapStringForRequests := "ResourceList{"
for _, k := range keysForRequests {
mapStringForRequests += fmt.Sprintf("%v: %v,", k, this.Requests[ResourceName(k)])
@@ -30893,7 +23600,7 @@ func (this *Secret) String() string {
for k := range this.Data {
keysForData = append(keysForData, k)
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForData)
+ sort.Strings(keysForData)
mapStringForData := "map[string][]byte{"
for _, k := range keysForData {
mapStringForData += fmt.Sprintf("%v: %v,", k, this.Data[k])
@@ -30903,7 +23610,7 @@ func (this *Secret) String() string {
for k := range this.StringData {
keysForStringData = append(keysForStringData, k)
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForStringData)
+ sort.Strings(keysForStringData)
mapStringForStringData := "map[string]string{"
for _, k := range keysForStringData {
mapStringForStringData += fmt.Sprintf("%v: %v,", k, this.StringData[k])
@@ -31152,7 +23859,7 @@ func (this *ServiceSpec) String() string {
for k := range this.Selector {
keysForSelector = append(keysForSelector, k)
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForSelector)
+ sort.Strings(keysForSelector)
mapStringForSelector := "map[string]string{"
for _, k := range keysForSelector {
mapStringForSelector += fmt.Sprintf("%v: %v,", k, this.Selector[k])
@@ -31448,7 +24155,7 @@ func (this *VolumeResourceRequirements) String() string {
for k := range this.Limits {
keysForLimits = append(keysForLimits, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForLimits)
+ sort.Strings(keysForLimits)
mapStringForLimits := "ResourceList{"
for _, k := range keysForLimits {
mapStringForLimits += fmt.Sprintf("%v: %v,", k, this.Limits[ResourceName(k)])
@@ -31458,7 +24165,7 @@ func (this *VolumeResourceRequirements) String() string {
for k := range this.Requests {
keysForRequests = append(keysForRequests, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForRequests)
+ sort.Strings(keysForRequests)
mapStringForRequests := "ResourceList{"
for _, k := range keysForRequests {
mapStringForRequests += fmt.Sprintf("%v: %v,", k, this.Requests[ResourceName(k)])
@@ -31547,6 +24254,18 @@ func (this *WindowsSecurityContextOptions) String() string {
}, "")
return s
}
+func (this *WorkloadReference) String() string {
+ if this == nil {
+ return "nil"
+ }
+ s := strings.Join([]string{`&WorkloadReference{`,
+ `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
+ `PodGroup:` + fmt.Sprintf("%v", this.PodGroup) + `,`,
+ `PodGroupReplicaKey:` + fmt.Sprintf("%v", this.PodGroupReplicaKey) + `,`,
+ `}`,
+ }, "")
+ return s
+}
func valueToStringGenerated(v interface{}) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
@@ -52070,14 +44789,214 @@ func (m *NodeStatus) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Conditions = append(m.Conditions, NodeCondition{})
- if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ m.Conditions = append(m.Conditions, NodeCondition{})
+ if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 5:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Addresses", 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.Addresses = append(m.Addresses, NodeAddress{})
+ if err := m.Addresses[len(m.Addresses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 6:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field DaemonEndpoints", 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.DaemonEndpoints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 7:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field NodeInfo", 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.NodeInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 8:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Images", 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.Images = append(m.Images, ContainerImage{})
+ if err := m.Images[len(m.Images)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 9:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field VolumesInUse", 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.VolumesInUse = append(m.VolumesInUse, UniqueVolumeName(dAtA[iNdEx:postIndex]))
+ iNdEx = postIndex
+ case 10:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field VolumesAttached", 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.VolumesAttached = append(m.VolumesAttached, AttachedVolume{})
+ if err := m.VolumesAttached[len(m.VolumesAttached)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
- case 5:
+ case 11:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -52104,47 +45023,16 @@ func (m *NodeStatus) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Addresses = append(m.Addresses, NodeAddress{})
- if err := m.Addresses[len(m.Addresses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 6:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field DaemonEndpoints", 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.Config == nil {
+ m.Config = &NodeConfigStatus{}
}
- if err := m.DaemonEndpoints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
- case 7:
+ case 12:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field NodeInfo", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field RuntimeHandlers", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -52171,13 +45059,14 @@ func (m *NodeStatus) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.NodeInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ m.RuntimeHandlers = append(m.RuntimeHandlers, NodeRuntimeHandler{})
+ if err := m.RuntimeHandlers[len(m.RuntimeHandlers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
- case 8:
+ case 13:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Images", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Features", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -52204,14 +45093,16 @@ func (m *NodeStatus) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Images = append(m.Images, ContainerImage{})
- if err := m.Images[len(m.Images)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if m.Features == nil {
+ m.Features = &NodeFeatures{}
+ }
+ if err := m.Features.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
- case 9:
+ case 14:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field VolumesInUse", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field DeclaredFeatures", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -52239,147 +45130,7 @@ func (m *NodeStatus) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.VolumesInUse = append(m.VolumesInUse, UniqueVolumeName(dAtA[iNdEx:postIndex]))
- iNdEx = postIndex
- case 10:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field VolumesAttached", 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.VolumesAttached = append(m.VolumesAttached, AttachedVolume{})
- if err := m.VolumesAttached[len(m.VolumesAttached)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 11:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Config", 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.Config == nil {
- m.Config = &NodeConfigStatus{}
- }
- if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 12:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field RuntimeHandlers", 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.RuntimeHandlers = append(m.RuntimeHandlers, NodeRuntimeHandler{})
- if err := m.RuntimeHandlers[len(m.RuntimeHandlers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- 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
- }
+ m.DeclaredFeatures = append(m.DeclaredFeatures, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -57720,31 +50471,63 @@ func (m *PodCertificateProjection) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.KeyType = string(dAtA[iNdEx:postIndex])
+ m.KeyType = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 3:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field MaxExpirationSeconds", wireType)
+ }
+ var v int32
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ v |= int32(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ m.MaxExpirationSeconds = &v
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field CredentialBundlePath", 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.CredentialBundlePath = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field MaxExpirationSeconds", wireType)
- }
- var v int32
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.MaxExpirationSeconds = &v
- case 4:
+ case 5:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field CredentialBundlePath", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field KeyPath", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -57772,11 +50555,11 @@ func (m *PodCertificateProjection) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.CredentialBundlePath = string(dAtA[iNdEx:postIndex])
+ m.KeyPath = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
- case 5:
+ case 6:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field KeyPath", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field CertificateChainPath", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -57804,13 +50587,13 @@ func (m *PodCertificateProjection) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.KeyPath = string(dAtA[iNdEx:postIndex])
+ m.CertificateChainPath = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
- case 6:
+ case 7:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field CertificateChainPath", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field UserAnnotations", wireType)
}
- var stringLen uint64
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
@@ -57820,23 +50603,118 @@ func (m *PodCertificateProjection) 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.CertificateChainPath = string(dAtA[iNdEx:postIndex])
+ if m.UserAnnotations == nil {
+ m.UserAnnotations = 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.UserAnnotations[mapkey] = mapvalue
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -61923,6 +54801,42 @@ func (m *PodSpec) Unmarshal(dAtA []byte) error {
s := string(dAtA[iNdEx:postIndex])
m.HostnameOverride = &s
iNdEx = postIndex
+ case 42:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field WorkloadRef", 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.WorkloadRef == nil {
+ m.WorkloadRef = &WorkloadReference{}
+ }
+ if err := m.WorkloadRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@@ -62498,33 +55412,198 @@ func (m *PodStatus) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.HostIPs = append(m.HostIPs, HostIP{})
- if err := m.HostIPs[len(m.HostIPs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 17:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ObservedGeneration", wireType)
+ m.HostIPs = append(m.HostIPs, HostIP{})
+ if err := m.HostIPs[len(m.HostIPs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 17:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ObservedGeneration", wireType)
+ }
+ m.ObservedGeneration = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowGenerated
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.ObservedGeneration |= int64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 18:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ExtendedResourceClaimStatus", 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.ExtendedResourceClaimStatus == nil {
+ m.ExtendedResourceClaimStatus = &PodExtendedResourceClaimStatus{}
+ }
+ if err := m.ExtendedResourceClaimStatus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 19:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field AllocatedResources", 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.AllocatedResources == nil {
+ m.AllocatedResources = make(ResourceList)
}
- m.ObservedGeneration = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowGenerated
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
+ var mapkey ResourceName
+ 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
+ }
}
- b := dAtA[iNdEx]
- iNdEx++
- m.ObservedGeneration |= int64(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 = ResourceName(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
}
}
- case 18:
+ m.AllocatedResources[ResourceName(mapkey)] = *mapvalue
+ iNdEx = postIndex
+ case 20:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExtendedResourceClaimStatus", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -62551,10 +55630,10 @@ func (m *PodStatus) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if m.ExtendedResourceClaimStatus == nil {
- m.ExtendedResourceClaimStatus = &PodExtendedResourceClaimStatus{}
+ if m.Resources == nil {
+ m.Resources = &ResourceRequirements{}
}
- if err := m.ExtendedResourceClaimStatus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -77305,6 +70384,152 @@ func (m *WindowsSecurityContextOptions) Unmarshal(dAtA []byte) error {
}
return nil
}
+func (m *WorkloadReference) 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: WorkloadReference: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: WorkloadReference: 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 PodGroup", 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.PodGroup = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field PodGroupReplicaKey", 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.PodGroupReplicaKey = 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
diff --git a/api/vendor/k8s.io/api/core/v1/generated.proto b/api/vendor/k8s.io/api/core/v1/generated.proto
index fb26953147d9..570b4d343892 100644
--- a/api/vendor/k8s.io/api/core/v1/generated.proto
+++ b/api/vendor/k8s.io/api/core/v1/generated.proto
@@ -762,6 +762,7 @@ message Container {
optional ResourceRequirements resources = 8;
// Resources resize policy for the container.
+ // This field cannot be set on ephemeral containers.
// +featureGate=InPlacePodVerticalScaling
// +optional
// +listType=atomic
@@ -782,7 +783,6 @@ message Container {
// container. Instead, the next init container starts immediately after this
// init container is started, or after any startupProbe has successfully
// completed.
- // +featureGate=SidecarContainers
// +optional
optional string restartPolicy = 24;
@@ -1148,7 +1148,6 @@ message ContainerStatus {
// +patchStrategy=merge
// +listType=map
// +listMapKey=mountPath
- // +featureGate=RecursiveReadOnlyMounts
repeated VolumeMountStatus volumeMounts = 12;
// User represents user identity information initially attached to the first process of the container
@@ -1582,7 +1581,6 @@ message EphemeralContainerCommon {
// Restart policy for the container to manage the restart behavior of each
// container within a pod.
// You cannot set this field on ephemeral containers.
- // +featureGate=SidecarContainers
// +optional
optional string restartPolicy = 24;
@@ -2346,7 +2344,6 @@ message LifecycleHandler {
optional TCPSocketAction tcpSocket = 3;
// Sleep represents a duration that the container should sleep.
- // +featureGate=PodLifecycleSleepAction
// +optional
optional SleepAction sleep = 4;
}
@@ -2811,7 +2808,6 @@ message NodeRuntimeHandler {
// 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;
@@ -2978,7 +2974,6 @@ message NodeStatus {
optional NodeConfigStatus config = 11;
// The available runtime handlers.
- // +featureGate=RecursiveReadOnlyMounts
// +featureGate=UserNamespacesSupport
// +optional
// +listType=atomic
@@ -2988,6 +2983,12 @@ message NodeStatus {
// +featureGate=SupplementalGroupsPolicy
// +optional
optional NodeFeatures features = 13;
+
+ // DeclaredFeatures represents the features related to feature gates that are declared by the node.
+ // +featureGate=NodeDeclaredFeatures
+ // +optional
+ // +listType=atomic
+ repeated string declaredFeatures = 14;
}
// NodeSwapStatus represents swap memory information.
@@ -3206,7 +3207,7 @@ message PersistentVolumeClaimSpec {
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
+ // Users are allowed to specify resource requirements
// that are lower than previous value but must still be higher than capacity recorded in the
// status field of the claim.
// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
@@ -3324,9 +3325,6 @@ message PersistentVolumeClaimStatus {
// 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.
- //
- // This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.
- // +featureGate=RecoverVolumeExpansionFailure
// +optional
map allocatedResources = 5;
@@ -3363,9 +3361,6 @@ message PersistentVolumeClaimStatus {
// 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.
- //
- // This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.
- // +featureGate=RecoverVolumeExpansionFailure
// +mapType=granular
// +optional
map allocatedResourceStatuses = 7;
@@ -3609,6 +3604,7 @@ message PersistentVolumeSpec {
// nodeAffinity defines constraints that limit what nodes this volume can be accessed from.
// This field influences the scheduling of pods that use this volume.
+ // This field is mutable if MutablePVNodeAffinity feature gate is enabled.
// +optional
optional VolumeNodeAffinity nodeAffinity = 9;
@@ -3898,6 +3894,21 @@ message PodCertificateProjection {
//
// +optional
optional string certificateChainPath = 6;
+
+ // userAnnotations allow pod authors to pass additional information to
+ // the signer implementation. Kubernetes does not restrict or validate this
+ // metadata in any way.
+ //
+ // These values are copied verbatim into the `spec.unverifiedUserAnnotations` field of
+ // the PodCertificateRequest objects that Kubelet creates.
+ //
+ // Entries are subject to the same validation as object metadata annotations,
+ // with the addition that all keys must be domain-prefixed. No restrictions
+ // are placed on values, except an overall size limitation on the entire field.
+ //
+ // Signers should document the keys and values they support. Signers should
+ // deny requests that contain keys they do not recognize.
+ map userAnnotations = 7;
}
// PodCondition contains details for the current condition of this pod.
@@ -3907,7 +3918,7 @@ message PodCondition {
optional string type = 1;
// If set, this represents the .metadata.generation that the pod condition was set based upon.
- // This is an alpha field. Enable PodObservedGenerationTracking to be able to use this field.
+ // The PodObservedGenerationTracking feature gate must be enabled to use this field.
// +featureGate=PodObservedGenerationTracking
// +optional
optional int64 observedGeneration = 7;
@@ -4681,8 +4692,8 @@ message PodSpec {
// 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 is a stable field but requires that the
+ // DynamicResourceAllocation feature gate is enabled.
//
// This field is immutable.
//
@@ -4723,6 +4734,18 @@ message PodSpec {
// +featureGate=HostnameOverride
// +optional
optional string hostnameOverride = 41;
+
+ // WorkloadRef provides a reference to the Workload object that this Pod belongs to.
+ // This field is used by the scheduler to identify the PodGroup and apply the
+ // correct group scheduling policies. The Workload object referenced
+ // by this field may not exist at the time the Pod is created.
+ // This field is immutable, but a Workload object with the same name
+ // may be recreated with different policies. Doing this during pod scheduling
+ // may result in the placement not conforming to the expected policies.
+ //
+ // +featureGate=GenericWorkload
+ // +optional
+ optional WorkloadReference workloadRef = 42;
}
// PodStatus represents information about the status of a pod. Status may trail the actual
@@ -4730,7 +4753,7 @@ message PodSpec {
// plane.
message PodStatus {
// If set, this represents the .metadata.generation that the pod status was set based upon.
- // This is an alpha field. Enable PodObservedGenerationTracking to be able to use this field.
+ // The PodObservedGenerationTracking feature gate must be enabled to use this field.
// +featureGate=PodObservedGenerationTracking
// +optional
optional int64 observedGeneration = 17;
@@ -4886,6 +4909,20 @@ message PodStatus {
// +featureGate=DRAExtendedResource
// +optional
optional PodExtendedResourceClaimStatus extendedResourceClaimStatus = 18;
+
+ // AllocatedResources is the total requests allocated for this pod by the node.
+ // If pod-level requests are not set, this will be the total requests aggregated
+ // across containers in the pod.
+ // +featureGate=InPlacePodLevelResourcesVerticalScaling
+ // +optional
+ map allocatedResources = 19;
+
+ // Resources represents the compute resource requests and limits that have been
+ // applied at the pod level if pod-level requests or limits are set in
+ // PodSpec.Resources
+ // +featureGate=InPlacePodLevelResourcesVerticalScaling
+ // +optional
+ optional ResourceRequirements resources = 20;
}
// PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded
@@ -5263,6 +5300,8 @@ 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
+ // +k8s:subfield(name)=+k8s:optional
+ // +k8s:subfield(name)=+k8s:format=k8s-long-name
optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the specification of the desired behavior of the replication controller.
@@ -6378,7 +6417,6 @@ message ServiceSpec {
// field is not set, the implementation will apply its default routing
// strategy. If set to "PreferClose", implementations should prioritize
// endpoints that are in the same zone.
- // +featureGate=ServiceTrafficDistribution
// +optional
optional string trafficDistribution = 23;
}
@@ -6526,9 +6564,10 @@ message Toleration {
optional string key = 1;
// Operator represents a key's relationship to the value.
- // Valid operators are Exists and Equal. Defaults to Equal.
+ // Valid operators are Exists, Equal, Lt, and Gt. Defaults to Equal.
// Exists is equivalent to wildcard for value, so that a pod can
// tolerate all taints of a particular category.
+ // Lt and Gt perform numeric comparisons (requires feature gate TaintTolerationComparisonOperators).
// +optional
optional string operator = 2;
@@ -6800,8 +6839,6 @@ message VolumeMount {
// None (or be unspecified, which defaults to None).
//
// If this field is not specified, it is treated as an equivalent of Disabled.
- //
- // +featureGate=RecursiveReadOnlyMounts
// +optional
optional string recursiveReadOnly = 7;
@@ -6846,7 +6883,6 @@ message VolumeMountStatus {
// RecursiveReadOnly must be set to Disabled, Enabled, or unspecified (for non-readonly mounts).
// An IfPossible value in the original VolumeMount must be translated to Disabled or Enabled,
// depending on the mount result.
- // +featureGate=RecursiveReadOnlyMounts
// +optional
optional string recursiveReadOnly = 4;
}
@@ -6929,7 +6965,8 @@ message VolumeProjection {
// issues; consult the signer implementation's documentation to learn how to
// use the certificates it issues.
//
- // +featureGate=PodCertificateProjection +optional
+ // +featureGate=PodCertificateProjection
+ // +optional
optional PodCertificateProjection podCertificate = 6;
}
@@ -7212,3 +7249,33 @@ message WindowsSecurityContextOptions {
optional bool hostProcess = 4;
}
+// WorkloadReference identifies the Workload object and PodGroup membership
+// that a Pod belongs to. The scheduler uses this information to apply
+// workload-aware scheduling semantics.
+message WorkloadReference {
+ // Name defines the name of the Workload object this Pod belongs to.
+ // Workload must be in the same namespace as the Pod.
+ // If it doesn't match any existing Workload, the Pod will remain unschedulable
+ // until a Workload object is created and observed by the kube-scheduler.
+ // It must be a DNS subdomain.
+ //
+ // +required
+ optional string name = 1;
+
+ // PodGroup is the name of the PodGroup within the Workload that this Pod
+ // belongs to. If it doesn't match any existing PodGroup within the Workload,
+ // the Pod will remain unschedulable until the Workload object is recreated
+ // and observed by the kube-scheduler. It must be a DNS label.
+ //
+ // +required
+ optional string podGroup = 2;
+
+ // PodGroupReplicaKey specifies the replica key of the PodGroup to which this
+ // Pod belongs. It is used to distinguish pods belonging to different replicas
+ // of the same pod group. The pod group policy is applied separately to each replica.
+ // When set, it must be a DNS label.
+ //
+ // +optional
+ optional string podGroupReplicaKey = 3;
+}
+
diff --git a/api/vendor/k8s.io/api/core/v1/generated.protomessage.pb.go b/api/vendor/k8s.io/api/core/v1/generated.protomessage.pb.go
new file mode 100644
index 000000000000..cf74ffa0885e
--- /dev/null
+++ b/api/vendor/k8s.io/api/core/v1/generated.protomessage.pb.go
@@ -0,0 +1,498 @@
+//go:build kubernetes_protomessage_one_more_release
+// +build kubernetes_protomessage_one_more_release
+
+/*
+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 go-to-protobuf. DO NOT EDIT.
+
+package v1
+
+func (*AWSElasticBlockStoreVolumeSource) ProtoMessage() {}
+
+func (*Affinity) ProtoMessage() {}
+
+func (*AppArmorProfile) ProtoMessage() {}
+
+func (*AttachedVolume) ProtoMessage() {}
+
+func (*AvoidPods) ProtoMessage() {}
+
+func (*AzureDiskVolumeSource) ProtoMessage() {}
+
+func (*AzureFilePersistentVolumeSource) ProtoMessage() {}
+
+func (*AzureFileVolumeSource) ProtoMessage() {}
+
+func (*Binding) ProtoMessage() {}
+
+func (*CSIPersistentVolumeSource) ProtoMessage() {}
+
+func (*CSIVolumeSource) ProtoMessage() {}
+
+func (*Capabilities) ProtoMessage() {}
+
+func (*CephFSPersistentVolumeSource) ProtoMessage() {}
+
+func (*CephFSVolumeSource) ProtoMessage() {}
+
+func (*CinderPersistentVolumeSource) ProtoMessage() {}
+
+func (*CinderVolumeSource) ProtoMessage() {}
+
+func (*ClientIPConfig) ProtoMessage() {}
+
+func (*ClusterTrustBundleProjection) ProtoMessage() {}
+
+func (*ComponentCondition) ProtoMessage() {}
+
+func (*ComponentStatus) ProtoMessage() {}
+
+func (*ComponentStatusList) ProtoMessage() {}
+
+func (*ConfigMap) ProtoMessage() {}
+
+func (*ConfigMapEnvSource) ProtoMessage() {}
+
+func (*ConfigMapKeySelector) ProtoMessage() {}
+
+func (*ConfigMapList) ProtoMessage() {}
+
+func (*ConfigMapNodeConfigSource) ProtoMessage() {}
+
+func (*ConfigMapProjection) ProtoMessage() {}
+
+func (*ConfigMapVolumeSource) ProtoMessage() {}
+
+func (*Container) ProtoMessage() {}
+
+func (*ContainerExtendedResourceRequest) ProtoMessage() {}
+
+func (*ContainerImage) ProtoMessage() {}
+
+func (*ContainerPort) ProtoMessage() {}
+
+func (*ContainerResizePolicy) ProtoMessage() {}
+
+func (*ContainerRestartRule) ProtoMessage() {}
+
+func (*ContainerRestartRuleOnExitCodes) ProtoMessage() {}
+
+func (*ContainerState) ProtoMessage() {}
+
+func (*ContainerStateRunning) ProtoMessage() {}
+
+func (*ContainerStateTerminated) ProtoMessage() {}
+
+func (*ContainerStateWaiting) ProtoMessage() {}
+
+func (*ContainerStatus) ProtoMessage() {}
+
+func (*ContainerUser) ProtoMessage() {}
+
+func (*DaemonEndpoint) ProtoMessage() {}
+
+func (*DownwardAPIProjection) ProtoMessage() {}
+
+func (*DownwardAPIVolumeFile) ProtoMessage() {}
+
+func (*DownwardAPIVolumeSource) ProtoMessage() {}
+
+func (*EmptyDirVolumeSource) ProtoMessage() {}
+
+func (*EndpointAddress) ProtoMessage() {}
+
+func (*EndpointPort) ProtoMessage() {}
+
+func (*EndpointSubset) ProtoMessage() {}
+
+func (*Endpoints) ProtoMessage() {}
+
+func (*EndpointsList) ProtoMessage() {}
+
+func (*EnvFromSource) ProtoMessage() {}
+
+func (*EnvVar) ProtoMessage() {}
+
+func (*EnvVarSource) ProtoMessage() {}
+
+func (*EphemeralContainer) ProtoMessage() {}
+
+func (*EphemeralContainerCommon) ProtoMessage() {}
+
+func (*EphemeralVolumeSource) ProtoMessage() {}
+
+func (*Event) ProtoMessage() {}
+
+func (*EventList) ProtoMessage() {}
+
+func (*EventSeries) ProtoMessage() {}
+
+func (*EventSource) ProtoMessage() {}
+
+func (*ExecAction) ProtoMessage() {}
+
+func (*FCVolumeSource) ProtoMessage() {}
+
+func (*FileKeySelector) ProtoMessage() {}
+
+func (*FlexPersistentVolumeSource) ProtoMessage() {}
+
+func (*FlexVolumeSource) ProtoMessage() {}
+
+func (*FlockerVolumeSource) ProtoMessage() {}
+
+func (*GCEPersistentDiskVolumeSource) ProtoMessage() {}
+
+func (*GRPCAction) ProtoMessage() {}
+
+func (*GitRepoVolumeSource) ProtoMessage() {}
+
+func (*GlusterfsPersistentVolumeSource) ProtoMessage() {}
+
+func (*GlusterfsVolumeSource) ProtoMessage() {}
+
+func (*HTTPGetAction) ProtoMessage() {}
+
+func (*HTTPHeader) ProtoMessage() {}
+
+func (*HostAlias) ProtoMessage() {}
+
+func (*HostIP) ProtoMessage() {}
+
+func (*HostPathVolumeSource) ProtoMessage() {}
+
+func (*ISCSIPersistentVolumeSource) ProtoMessage() {}
+
+func (*ISCSIVolumeSource) ProtoMessage() {}
+
+func (*ImageVolumeSource) ProtoMessage() {}
+
+func (*KeyToPath) ProtoMessage() {}
+
+func (*Lifecycle) ProtoMessage() {}
+
+func (*LifecycleHandler) ProtoMessage() {}
+
+func (*LimitRange) ProtoMessage() {}
+
+func (*LimitRangeItem) ProtoMessage() {}
+
+func (*LimitRangeList) ProtoMessage() {}
+
+func (*LimitRangeSpec) ProtoMessage() {}
+
+func (*LinuxContainerUser) ProtoMessage() {}
+
+func (*List) ProtoMessage() {}
+
+func (*LoadBalancerIngress) ProtoMessage() {}
+
+func (*LoadBalancerStatus) ProtoMessage() {}
+
+func (*LocalObjectReference) ProtoMessage() {}
+
+func (*LocalVolumeSource) ProtoMessage() {}
+
+func (*ModifyVolumeStatus) ProtoMessage() {}
+
+func (*NFSVolumeSource) ProtoMessage() {}
+
+func (*Namespace) ProtoMessage() {}
+
+func (*NamespaceCondition) ProtoMessage() {}
+
+func (*NamespaceList) ProtoMessage() {}
+
+func (*NamespaceSpec) ProtoMessage() {}
+
+func (*NamespaceStatus) ProtoMessage() {}
+
+func (*Node) ProtoMessage() {}
+
+func (*NodeAddress) ProtoMessage() {}
+
+func (*NodeAffinity) ProtoMessage() {}
+
+func (*NodeCondition) ProtoMessage() {}
+
+func (*NodeConfigSource) ProtoMessage() {}
+
+func (*NodeConfigStatus) ProtoMessage() {}
+
+func (*NodeDaemonEndpoints) ProtoMessage() {}
+
+func (*NodeFeatures) ProtoMessage() {}
+
+func (*NodeList) ProtoMessage() {}
+
+func (*NodeProxyOptions) ProtoMessage() {}
+
+func (*NodeRuntimeHandler) ProtoMessage() {}
+
+func (*NodeRuntimeHandlerFeatures) ProtoMessage() {}
+
+func (*NodeSelector) ProtoMessage() {}
+
+func (*NodeSelectorRequirement) ProtoMessage() {}
+
+func (*NodeSelectorTerm) ProtoMessage() {}
+
+func (*NodeSpec) ProtoMessage() {}
+
+func (*NodeStatus) ProtoMessage() {}
+
+func (*NodeSwapStatus) ProtoMessage() {}
+
+func (*NodeSystemInfo) ProtoMessage() {}
+
+func (*ObjectFieldSelector) ProtoMessage() {}
+
+func (*ObjectReference) ProtoMessage() {}
+
+func (*PersistentVolume) ProtoMessage() {}
+
+func (*PersistentVolumeClaim) ProtoMessage() {}
+
+func (*PersistentVolumeClaimCondition) ProtoMessage() {}
+
+func (*PersistentVolumeClaimList) ProtoMessage() {}
+
+func (*PersistentVolumeClaimSpec) ProtoMessage() {}
+
+func (*PersistentVolumeClaimStatus) ProtoMessage() {}
+
+func (*PersistentVolumeClaimTemplate) ProtoMessage() {}
+
+func (*PersistentVolumeClaimVolumeSource) ProtoMessage() {}
+
+func (*PersistentVolumeList) ProtoMessage() {}
+
+func (*PersistentVolumeSource) ProtoMessage() {}
+
+func (*PersistentVolumeSpec) ProtoMessage() {}
+
+func (*PersistentVolumeStatus) ProtoMessage() {}
+
+func (*PhotonPersistentDiskVolumeSource) ProtoMessage() {}
+
+func (*Pod) ProtoMessage() {}
+
+func (*PodAffinity) ProtoMessage() {}
+
+func (*PodAffinityTerm) ProtoMessage() {}
+
+func (*PodAntiAffinity) ProtoMessage() {}
+
+func (*PodAttachOptions) ProtoMessage() {}
+
+func (*PodCertificateProjection) ProtoMessage() {}
+
+func (*PodCondition) ProtoMessage() {}
+
+func (*PodDNSConfig) ProtoMessage() {}
+
+func (*PodDNSConfigOption) ProtoMessage() {}
+
+func (*PodExecOptions) ProtoMessage() {}
+
+func (*PodExtendedResourceClaimStatus) ProtoMessage() {}
+
+func (*PodIP) ProtoMessage() {}
+
+func (*PodList) ProtoMessage() {}
+
+func (*PodLogOptions) ProtoMessage() {}
+
+func (*PodOS) ProtoMessage() {}
+
+func (*PodPortForwardOptions) ProtoMessage() {}
+
+func (*PodProxyOptions) ProtoMessage() {}
+
+func (*PodReadinessGate) ProtoMessage() {}
+
+func (*PodResourceClaim) ProtoMessage() {}
+
+func (*PodResourceClaimStatus) ProtoMessage() {}
+
+func (*PodSchedulingGate) ProtoMessage() {}
+
+func (*PodSecurityContext) ProtoMessage() {}
+
+func (*PodSignature) ProtoMessage() {}
+
+func (*PodSpec) ProtoMessage() {}
+
+func (*PodStatus) ProtoMessage() {}
+
+func (*PodStatusResult) ProtoMessage() {}
+
+func (*PodTemplate) ProtoMessage() {}
+
+func (*PodTemplateList) ProtoMessage() {}
+
+func (*PodTemplateSpec) ProtoMessage() {}
+
+func (*PortStatus) ProtoMessage() {}
+
+func (*PortworxVolumeSource) ProtoMessage() {}
+
+func (*Preconditions) ProtoMessage() {}
+
+func (*PreferAvoidPodsEntry) ProtoMessage() {}
+
+func (*PreferredSchedulingTerm) ProtoMessage() {}
+
+func (*Probe) ProtoMessage() {}
+
+func (*ProbeHandler) ProtoMessage() {}
+
+func (*ProjectedVolumeSource) ProtoMessage() {}
+
+func (*QuobyteVolumeSource) ProtoMessage() {}
+
+func (*RBDPersistentVolumeSource) ProtoMessage() {}
+
+func (*RBDVolumeSource) ProtoMessage() {}
+
+func (*RangeAllocation) ProtoMessage() {}
+
+func (*ReplicationController) ProtoMessage() {}
+
+func (*ReplicationControllerCondition) ProtoMessage() {}
+
+func (*ReplicationControllerList) ProtoMessage() {}
+
+func (*ReplicationControllerSpec) ProtoMessage() {}
+
+func (*ReplicationControllerStatus) ProtoMessage() {}
+
+func (*ResourceClaim) ProtoMessage() {}
+
+func (*ResourceFieldSelector) ProtoMessage() {}
+
+func (*ResourceHealth) ProtoMessage() {}
+
+func (*ResourceQuota) ProtoMessage() {}
+
+func (*ResourceQuotaList) ProtoMessage() {}
+
+func (*ResourceQuotaSpec) ProtoMessage() {}
+
+func (*ResourceQuotaStatus) ProtoMessage() {}
+
+func (*ResourceRequirements) ProtoMessage() {}
+
+func (*ResourceStatus) ProtoMessage() {}
+
+func (*SELinuxOptions) ProtoMessage() {}
+
+func (*ScaleIOPersistentVolumeSource) ProtoMessage() {}
+
+func (*ScaleIOVolumeSource) ProtoMessage() {}
+
+func (*ScopeSelector) ProtoMessage() {}
+
+func (*ScopedResourceSelectorRequirement) ProtoMessage() {}
+
+func (*SeccompProfile) ProtoMessage() {}
+
+func (*Secret) ProtoMessage() {}
+
+func (*SecretEnvSource) ProtoMessage() {}
+
+func (*SecretKeySelector) ProtoMessage() {}
+
+func (*SecretList) ProtoMessage() {}
+
+func (*SecretProjection) ProtoMessage() {}
+
+func (*SecretReference) ProtoMessage() {}
+
+func (*SecretVolumeSource) ProtoMessage() {}
+
+func (*SecurityContext) ProtoMessage() {}
+
+func (*SerializedReference) ProtoMessage() {}
+
+func (*Service) ProtoMessage() {}
+
+func (*ServiceAccount) ProtoMessage() {}
+
+func (*ServiceAccountList) ProtoMessage() {}
+
+func (*ServiceAccountTokenProjection) ProtoMessage() {}
+
+func (*ServiceList) ProtoMessage() {}
+
+func (*ServicePort) ProtoMessage() {}
+
+func (*ServiceProxyOptions) ProtoMessage() {}
+
+func (*ServiceSpec) ProtoMessage() {}
+
+func (*ServiceStatus) ProtoMessage() {}
+
+func (*SessionAffinityConfig) ProtoMessage() {}
+
+func (*SleepAction) ProtoMessage() {}
+
+func (*StorageOSPersistentVolumeSource) ProtoMessage() {}
+
+func (*StorageOSVolumeSource) ProtoMessage() {}
+
+func (*Sysctl) ProtoMessage() {}
+
+func (*TCPSocketAction) ProtoMessage() {}
+
+func (*Taint) ProtoMessage() {}
+
+func (*Toleration) ProtoMessage() {}
+
+func (*TopologySelectorLabelRequirement) ProtoMessage() {}
+
+func (*TopologySelectorTerm) ProtoMessage() {}
+
+func (*TopologySpreadConstraint) ProtoMessage() {}
+
+func (*TypedLocalObjectReference) ProtoMessage() {}
+
+func (*TypedObjectReference) ProtoMessage() {}
+
+func (*Volume) ProtoMessage() {}
+
+func (*VolumeDevice) ProtoMessage() {}
+
+func (*VolumeMount) ProtoMessage() {}
+
+func (*VolumeMountStatus) ProtoMessage() {}
+
+func (*VolumeNodeAffinity) ProtoMessage() {}
+
+func (*VolumeProjection) ProtoMessage() {}
+
+func (*VolumeResourceRequirements) ProtoMessage() {}
+
+func (*VolumeSource) ProtoMessage() {}
+
+func (*VsphereVirtualDiskVolumeSource) ProtoMessage() {}
+
+func (*WeightedPodAffinityTerm) ProtoMessage() {}
+
+func (*WindowsSecurityContextOptions) ProtoMessage() {}
+
+func (*WorkloadReference) ProtoMessage() {}
diff --git a/api/vendor/k8s.io/api/core/v1/toleration.go b/api/vendor/k8s.io/api/core/v1/toleration.go
index e803d518b5cc..080c228d2d9d 100644
--- a/api/vendor/k8s.io/api/core/v1/toleration.go
+++ b/api/vendor/k8s.io/api/core/v1/toleration.go
@@ -16,6 +16,16 @@ limitations under the License.
package v1
+import (
+ "errors"
+ "strconv"
+ "strings"
+
+ "k8s.io/apimachinery/pkg/api/validate/content"
+
+ "k8s.io/klog/v2"
+)
+
// MatchToleration checks if the toleration matches tolerationToMatch. Tolerations are unique by ,
// if the two tolerations have same combination, regard as they match.
// TODO: uniqueness check for tolerations in api validations.
@@ -35,7 +45,11 @@ func (t *Toleration) MatchToleration(tolerationToMatch *Toleration) bool {
// 3. Empty toleration.key means to match all taint keys.
// If toleration.key is empty, toleration.operator must be 'Exists';
// this combination means to match all taint values and all taint keys.
-func (t *Toleration) ToleratesTaint(taint *Taint) bool {
+// 4. If toleration.operator is 'Lt' or 'Gt', numeric comparison is performed
+// between toleration.value and taint.value.
+// 5. If enableComparisonOperators is false and the toleration uses 'Lt' or 'Gt'
+// operators, the toleration does not match (returns false).
+func (t *Toleration) ToleratesTaint(logger klog.Logger, taint *Taint, enableComparisonOperators bool) bool {
if len(t.Effect) > 0 && t.Effect != taint.Effect {
return false
}
@@ -51,6 +65,47 @@ func (t *Toleration) ToleratesTaint(taint *Taint) bool {
return t.Value == taint.Value
case TolerationOpExists:
return true
+ case TolerationOpLt, TolerationOpGt:
+ // If comparison operators are disabled, this toleration doesn't match
+ if !enableComparisonOperators {
+ return false
+ }
+ return compareNumericValues(logger, t.Value, taint.Value, t.Operator)
+ default:
+ return false
+ }
+}
+
+// compareNumericValues performs numeric comparison between toleration and taint values
+func compareNumericValues(logger klog.Logger, tolerationVal, taintVal string, op TolerationOperator) bool {
+
+ errorMsgs := content.IsDecimalInteger(tolerationVal)
+ if len(errorMsgs) > 0 {
+ logger.Error(errors.New(strings.Join(errorMsgs, ",")), "failed to parse toleration value as int64", "toleration", tolerationVal)
+ return false
+ }
+ tVal, err := strconv.ParseInt(tolerationVal, 10, 64)
+ if err != nil {
+ logger.Error(err, "failed to parse toleration value as int64", "toleration", tolerationVal)
+ return false
+ }
+
+ errorMsgs = content.IsDecimalInteger(taintVal)
+ if len(errorMsgs) > 0 {
+ logger.Error(errors.New(strings.Join(errorMsgs, ",")), "failed to parse taint value as int64", "taint", taintVal)
+ return false
+ }
+ tntVal, err := strconv.ParseInt(taintVal, 10, 64)
+ if err != nil {
+ logger.Error(err, "failed to parse taint value as int64", "taint", taintVal)
+ return false
+ }
+
+ switch op {
+ case TolerationOpLt:
+ return tntVal < tVal
+ case TolerationOpGt:
+ return tntVal > tVal
default:
return false
}
diff --git a/api/vendor/k8s.io/api/core/v1/types.go b/api/vendor/k8s.io/api/core/v1/types.go
index 08b6d351cc67..705c82083cc5 100644
--- a/api/vendor/k8s.io/api/core/v1/types.go
+++ b/api/vendor/k8s.io/api/core/v1/types.go
@@ -427,6 +427,7 @@ type PersistentVolumeSpec struct {
VolumeMode *PersistentVolumeMode `json:"volumeMode,omitempty" protobuf:"bytes,8,opt,name=volumeMode,casttype=PersistentVolumeMode"`
// nodeAffinity defines constraints that limit what nodes this volume can be accessed from.
// This field influences the scheduling of pods that use this volume.
+ // This field is mutable if MutablePVNodeAffinity feature gate is enabled.
// +optional
NodeAffinity *VolumeNodeAffinity `json:"nodeAffinity,omitempty" protobuf:"bytes,9,opt,name=nodeAffinity"`
// Name of VolumeAttributesClass to which this persistent volume belongs. Empty value
@@ -558,7 +559,7 @@ type PersistentVolumeClaimSpec struct {
// +optional
Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,4,opt,name=selector"`
// resources represents the minimum resources the volume should have.
- // If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements
+ // Users are allowed to specify resource requirements
// that are lower than previous value but must still be higher than capacity recorded in the
// status field of the claim.
// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
@@ -648,7 +649,7 @@ type TypedObjectReference struct {
// Valid values are:
// - "Resizing", "FileSystemResizePending"
//
-// If RecoverVolumeExpansionFailure feature gate is enabled, then following additional values can be expected:
+// The following additional values can be expected:
// - "ControllerResizeError", "NodeResizeError"
//
// If VolumeAttributesClass feature gate is enabled, then following additional values can be expected:
@@ -796,9 +797,6 @@ type PersistentVolumeClaimStatus struct {
// 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.
- //
- // This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.
- // +featureGate=RecoverVolumeExpansionFailure
// +optional
AllocatedResources ResourceList `json:"allocatedResources,omitempty" protobuf:"bytes,5,rep,name=allocatedResources,casttype=ResourceList,castkey=ResourceName"`
@@ -838,9 +836,6 @@ type PersistentVolumeClaimStatus struct {
// 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.
- //
- // This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.
- // +featureGate=RecoverVolumeExpansionFailure
// +mapType=granular
// +optional
AllocatedResourceStatuses map[ResourceName]ClaimResourceStatus `json:"allocatedResourceStatuses,omitempty" protobuf:"bytes,7,rep,name=allocatedResourceStatuses"`
@@ -2056,6 +2051,21 @@ type PodCertificateProjection struct {
//
// +optional
CertificateChainPath string `json:"certificateChainPath,omitempty" protobuf:"bytes,6,rep,name=certificateChainPath"`
+
+ // userAnnotations allow pod authors to pass additional information to
+ // the signer implementation. Kubernetes does not restrict or validate this
+ // metadata in any way.
+ //
+ // These values are copied verbatim into the `spec.unverifiedUserAnnotations` field of
+ // the PodCertificateRequest objects that Kubelet creates.
+ //
+ // Entries are subject to the same validation as object metadata annotations,
+ // with the addition that all keys must be domain-prefixed. No restrictions
+ // are placed on values, except an overall size limitation on the entire field.
+ //
+ // Signers should document the keys and values they support. Signers should
+ // deny requests that contain keys they do not recognize.
+ UserAnnotations map[string]string `json:"userAnnotations,omitempty" protobuf:"bytes,7,rep,name=userAnnotations"`
}
// Represents a projected volume source
@@ -2144,7 +2154,8 @@ type VolumeProjection struct {
// issues; consult the signer implementation's documentation to learn how to
// use the certificates it issues.
//
- // +featureGate=PodCertificateProjection +optional
+ // +featureGate=PodCertificateProjection
+ // +optional
PodCertificate *PodCertificateProjection `json:"podCertificate,omitempty" protobuf:"bytes,6,opt,name=podCertificate"`
}
@@ -2379,8 +2390,6 @@ type VolumeMount struct {
// None (or be unspecified, which defaults to None).
//
// If this field is not specified, it is treated as an equivalent of Disabled.
- //
- // +featureGate=RecursiveReadOnlyMounts
// +optional
RecursiveReadOnly *RecursiveReadOnlyMode `json:"recursiveReadOnly,omitempty" protobuf:"bytes,7,opt,name=recursiveReadOnly,casttype=RecursiveReadOnlyMode"`
// Path within the container at which the volume should be mounted. Must
@@ -2965,6 +2974,7 @@ type Container struct {
// +optional
Resources ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"`
// Resources resize policy for the container.
+ // This field cannot be set on ephemeral containers.
// +featureGate=InPlacePodVerticalScaling
// +optional
// +listType=atomic
@@ -2984,7 +2994,6 @@ type Container struct {
// container. Instead, the next init container starts immediately after this
// init container is started, or after any startupProbe has successfully
// completed.
- // +featureGate=SidecarContainers
// +optional
RestartPolicy *ContainerRestartPolicy `json:"restartPolicy,omitempty" protobuf:"bytes,24,opt,name=restartPolicy,casttype=ContainerRestartPolicy"`
// Represents a list of rules to be checked to determine if the
@@ -3128,7 +3137,6 @@ type LifecycleHandler struct {
// +optional
TCPSocket *TCPSocketAction `json:"tcpSocket,omitempty" protobuf:"bytes,3,opt,name=tcpSocket"`
// Sleep represents a duration that the container should sleep.
- // +featureGate=PodLifecycleSleepAction
// +optional
Sleep *SleepAction `json:"sleep,omitempty" protobuf:"bytes,4,opt,name=sleep"`
}
@@ -3369,7 +3377,6 @@ type ContainerStatus struct {
// +patchStrategy=merge
// +listType=map
// +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
@@ -3523,6 +3530,8 @@ const (
// If both PodResizePending and PodResizeInProgress are set, it means that a new resize was
// requested in the middle of a previous pod resize that is still in progress.
PodResizeInProgress PodConditionType = "PodResizeInProgress"
+ // AllContainersRestarting indicates that all containers of the pod is being restarted.
+ AllContainersRestarting PodConditionType = "AllContainersRestarting"
)
// These are reasons for a pod's transition to a condition.
@@ -3566,7 +3575,7 @@ type PodCondition struct {
// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions
Type PodConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=PodConditionType"`
// If set, this represents the .metadata.generation that the pod condition was set based upon.
- // This is an alpha field. Enable PodObservedGenerationTracking to be able to use this field.
+ // The PodObservedGenerationTracking feature gate must be enabled to use this field.
// +featureGate=PodObservedGenerationTracking
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,7,opt,name=observedGeneration"`
@@ -3612,7 +3621,6 @@ type VolumeMountStatus struct {
// RecursiveReadOnly must be set to Disabled, Enabled, or unspecified (for non-readonly mounts).
// An IfPossible value in the original VolumeMount must be translated to Disabled or Enabled,
// depending on the mount result.
- // +featureGate=RecursiveReadOnlyMounts
// +optional
RecursiveReadOnly *RecursiveReadOnlyMode `json:"recursiveReadOnly,omitempty" protobuf:"bytes,4,opt,name=recursiveReadOnly,casttype=RecursiveReadOnlyMode"`
}
@@ -3660,7 +3668,8 @@ type ContainerRestartRuleAction string
// The only valid action is Restart.
const (
- ContainerRestartRuleActionRestart ContainerRestartRuleAction = "Restart"
+ ContainerRestartRuleActionRestart ContainerRestartRuleAction = "Restart"
+ ContainerRestartRuleActionRestartAllContainers ContainerRestartRuleAction = "RestartAllContainers"
)
// ContainerRestartRuleOnExitCodes describes the condition
@@ -4048,9 +4057,10 @@ type Toleration struct {
// +optional
Key string `json:"key,omitempty" protobuf:"bytes,1,opt,name=key"`
// Operator represents a key's relationship to the value.
- // Valid operators are Exists and Equal. Defaults to Equal.
+ // Valid operators are Exists, Equal, Lt, and Gt. Defaults to Equal.
// Exists is equivalent to wildcard for value, so that a pod can
// tolerate all taints of a particular category.
+ // Lt and Gt perform numeric comparisons (requires feature gate TaintTolerationComparisonOperators).
// +optional
Operator TolerationOperator `json:"operator,omitempty" protobuf:"bytes,2,opt,name=operator,casttype=TolerationOperator"`
// Value is the taint value the toleration matches to.
@@ -4076,6 +4086,8 @@ type TolerationOperator string
const (
TolerationOpExists TolerationOperator = "Exists"
TolerationOpEqual TolerationOperator = "Equal"
+ TolerationOpLt TolerationOperator = "Lt"
+ TolerationOpGt TolerationOperator = "Gt"
)
// PodReadinessGate contains the reference to a pod condition
@@ -4388,8 +4400,8 @@ type PodSpec struct {
// 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 is a stable field but requires that the
+ // DynamicResourceAllocation feature gate is enabled.
//
// This field is immutable.
//
@@ -4428,6 +4440,17 @@ type PodSpec struct {
// +featureGate=HostnameOverride
// +optional
HostnameOverride *string `json:"hostnameOverride,omitempty" protobuf:"bytes,41,opt,name=hostnameOverride"`
+ // WorkloadRef provides a reference to the Workload object that this Pod belongs to.
+ // This field is used by the scheduler to identify the PodGroup and apply the
+ // correct group scheduling policies. The Workload object referenced
+ // by this field may not exist at the time the Pod is created.
+ // This field is immutable, but a Workload object with the same name
+ // may be recreated with different policies. Doing this during pod scheduling
+ // may result in the placement not conforming to the expected policies.
+ //
+ // +featureGate=GenericWorkload
+ // +optional
+ WorkloadRef *WorkloadReference `json:"workloadRef,omitempty" protobuf:"bytes,42,opt,name=workloadRef"`
}
// PodResourceClaim references exactly one ResourceClaim, either directly
@@ -4539,6 +4562,36 @@ type PodSchedulingGate struct {
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
}
+// WorkloadReference identifies the Workload object and PodGroup membership
+// that a Pod belongs to. The scheduler uses this information to apply
+// workload-aware scheduling semantics.
+type WorkloadReference struct {
+ // Name defines the name of the Workload object this Pod belongs to.
+ // Workload must be in the same namespace as the Pod.
+ // If it doesn't match any existing Workload, the Pod will remain unschedulable
+ // until a Workload object is created and observed by the kube-scheduler.
+ // It must be a DNS subdomain.
+ //
+ // +required
+ Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
+
+ // PodGroup is the name of the PodGroup within the Workload that this Pod
+ // belongs to. If it doesn't match any existing PodGroup within the Workload,
+ // the Pod will remain unschedulable until the Workload object is recreated
+ // and observed by the kube-scheduler. It must be a DNS label.
+ //
+ // +required
+ PodGroup string `json:"podGroup" protobuf:"bytes,2,opt,name=podGroup"`
+
+ // PodGroupReplicaKey specifies the replica key of the PodGroup to which this
+ // Pod belongs. It is used to distinguish pods belonging to different replicas
+ // of the same pod group. The pod group policy is applied separately to each replica.
+ // When set, it must be a DNS label.
+ //
+ // +optional
+ PodGroupReplicaKey string `json:"podGroupReplicaKey,omitempty" protobuf:"bytes,3,opt,name=podGroupReplicaKey"`
+}
+
// +enum
type UnsatisfiableConstraintAction string
@@ -5074,7 +5127,6 @@ type EphemeralContainerCommon struct {
// Restart policy for the container to manage the restart behavior of each
// container within a pod.
// You cannot set this field on ephemeral containers.
- // +featureGate=SidecarContainers
// +optional
RestartPolicy *ContainerRestartPolicy `json:"restartPolicy,omitempty" protobuf:"bytes,24,opt,name=restartPolicy,casttype=ContainerRestartPolicy"`
// Represents a list of rules to be checked to determine if the
@@ -5198,7 +5250,7 @@ type EphemeralContainer struct {
// plane.
type PodStatus struct {
// If set, this represents the .metadata.generation that the pod status was set based upon.
- // This is an alpha field. Enable PodObservedGenerationTracking to be able to use this field.
+ // The PodObservedGenerationTracking feature gate must be enabled to use this field.
// +featureGate=PodObservedGenerationTracking
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,17,opt,name=observedGeneration"`
@@ -5348,6 +5400,20 @@ type PodStatus struct {
// +featureGate=DRAExtendedResource
// +optional
ExtendedResourceClaimStatus *PodExtendedResourceClaimStatus `json:"extendedResourceClaimStatus,omitempty" protobuf:"bytes,18,opt,name=extendedResourceClaimStatus"`
+
+ // AllocatedResources is the total requests allocated for this pod by the node.
+ // If pod-level requests are not set, this will be the total requests aggregated
+ // across containers in the pod.
+ // +featureGate=InPlacePodLevelResourcesVerticalScaling
+ // +optional
+ AllocatedResources ResourceList `json:"allocatedResources,omitempty" protobuf:"bytes,19,rep,name=allocatedResources,casttype=ResourceList,castkey=ResourceName"`
+
+ // Resources represents the compute resource requests and limits that have been
+ // applied at the pod level if pod-level requests or limits are set in
+ // PodSpec.Resources
+ // +featureGate=InPlacePodLevelResourcesVerticalScaling
+ // +optional
+ Resources *ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,20,opt,name=resources"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@@ -5578,6 +5644,8 @@ type ReplicationController struct {
// 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
+ // +k8s:subfield(name)=+k8s:optional
+ // +k8s:subfield(name)=+k8s:format=k8s-long-name
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec defines the specification of the desired behavior of the replication controller.
@@ -5678,8 +5746,11 @@ const (
ServiceInternalTrafficPolicyLocal ServiceInternalTrafficPolicy = "Local"
)
-// for backwards compat
+// ServiceInternalTrafficPolicy describes how nodes distribute service traffic they
+// receive on the ClusterIP.
// +enum
+//
+// Deprecated: use ServiceInternalTrafficPolicy instead.
type ServiceInternalTrafficPolicyType = ServiceInternalTrafficPolicy
// ServiceExternalTrafficPolicy describes how nodes distribute service traffic they
@@ -5698,8 +5769,12 @@ const (
ServiceExternalTrafficPolicyLocal ServiceExternalTrafficPolicy = "Local"
)
-// for backwards compat
+// ServiceExternalTrafficPolicy describes how nodes distribute service traffic they
+// receive on one of the Service's "externally-facing" addresses (NodePorts, ExternalIPs,
+// and LoadBalancer IPs.
// +enum
+//
+// Deprecated: use ServiceExternalTrafficPolicy instead.
type ServiceExternalTrafficPolicyType = ServiceExternalTrafficPolicy
const (
@@ -5709,27 +5784,25 @@ const (
// These are valid values for the TrafficDistribution field of a Service.
const (
- // Indicates a preference for routing traffic to endpoints that are in the same
- // zone as the client. Users should not set this value unless they have ensured
- // that clients and endpoints are distributed in such a way that the "same zone"
- // preference will not result in endpoints getting overloaded.
- ServiceTrafficDistributionPreferClose = "PreferClose"
-
- // Indicates a preference for routing traffic to endpoints that are in the same
- // zone as the client. Users should not set this value unless they have ensured
- // that clients and endpoints are distributed in such a way that the "same zone"
- // preference will not result in endpoints getting overloaded.
- // This is an alias for "PreferClose", but it is an Alpha feature and is only
- // recognized if the PreferSameTrafficDistribution feature gate is enabled.
+ // ServiceTrafficDistributionPreferSameZone indicates a preference for routing
+ // traffic to endpoints that are in the same zone as the client. Users should only
+ // set this value if they have ensured that clients and endpoints are distributed
+ // in such a way that the "same zone" preference will not result in endpoints
+ // getting overloaded.
ServiceTrafficDistributionPreferSameZone = "PreferSameZone"
- // Indicates a preference for routing traffic to endpoints that are on the same
- // node as the client. Users should not set this value unless they have ensured
- // that clients and endpoints are distributed in such a way that the "same node"
- // preference will not result in endpoints getting overloaded.
- // This is an Alpha feature and is only recognized if the
- // PreferSameTrafficDistribution feature gate is enabled.
+ // ServiceTrafficDistributionPreferSameNode indicates a preference for routing
+ // traffic to endpoints that are on the same node as the client. Users should only
+ // set this value if they have ensured that clients and endpoints are distributed
+ // in such a way that the "same node" preference will not result in endpoints
+ // getting overloaded.
ServiceTrafficDistributionPreferSameNode = "PreferSameNode"
+
+ // ServiceTrafficDistributionPreferClose is the original name of "PreferSameZone".
+ // Despite the generic-sounding name, it has exactly the same meaning as
+ // "PreferSameZone".
+ // Deprecated: use "PreferSameZone" instead.
+ ServiceTrafficDistributionPreferClose = "PreferClose"
)
// These are the valid conditions of a service.
@@ -5833,8 +5906,10 @@ const (
IPFamilyPolicyRequireDualStack IPFamilyPolicy = "RequireDualStack"
)
-// for backwards compat
+// IPFamilyPolicy represents the dual-stack-ness requested or required by a Service
// +enum
+//
+// Deprecated: use IPFamilyPolicy instead.
type IPFamilyPolicyType = IPFamilyPolicy
// ServiceSpec describes the attributes that a user creates on a service.
@@ -6083,7 +6158,6 @@ type ServiceSpec struct {
// field is not set, the implementation will apply its default routing
// strategy. If set to "PreferClose", implementations should prioritize
// endpoints that are in the same zone.
- // +featureGate=ServiceTrafficDistribution
// +optional
TrafficDistribution *string `json:"trafficDistribution,omitempty" protobuf:"bytes,23,opt,name=trafficDistribution"`
}
@@ -6508,7 +6582,6 @@ type NodeDaemonEndpoints struct {
// 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"`
// UserNamespaces is set to true if the runtime handler supports UserNamespaces, including for volumes.
@@ -6683,7 +6756,6 @@ type NodeStatus struct {
// +optional
Config *NodeConfigStatus `json:"config,omitempty" protobuf:"bytes,11,opt,name=config"`
// The available runtime handlers.
- // +featureGate=RecursiveReadOnlyMounts
// +featureGate=UserNamespacesSupport
// +optional
// +listType=atomic
@@ -6692,6 +6764,11 @@ type NodeStatus struct {
// +featureGate=SupplementalGroupsPolicy
// +optional
Features *NodeFeatures `json:"features,omitempty" protobuf:"bytes,13,rep,name=features"`
+ // DeclaredFeatures represents the features related to feature gates that are declared by the node.
+ // +featureGate=NodeDeclaredFeatures
+ // +optional
+ // +listType=atomic
+ DeclaredFeatures []string `json:"declaredFeatures,omitempty" protobuf:"bytes,14,rep,name=declaredFeatures"`
}
type UniqueVolumeName string
@@ -7645,6 +7722,8 @@ const (
ResourceLimitsEphemeralStorage ResourceName = "limits.ephemeral-storage"
// resource.k8s.io devices requested with a certain DeviceClass, number
ResourceClaimsPerClass string = ".deviceclass.resource.k8s.io/devices"
+ // resource.k8s.io devices requested with a certain DeviceClass by implicit extended resource name, number
+ ResourceImplicitExtendedClaimsPerClass string = "requests.deviceclass.resource.kubernetes.io/"
)
// The following identify resource prefix for Kubernetes object types
diff --git a/api/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go b/api/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go
index 1204307667fa..0f5e44e917a4 100644
--- a/api/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go
+++ b/api/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go
@@ -359,7 +359,7 @@ var map_Container = map[string]string{
"envFrom": "List of sources to populate environment variables in the container. The keys defined within a source may consist of any printable ASCII characters except '='. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.",
"env": "List of environment variables to set in the container. Cannot be updated.",
"resources": "Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/",
- "resizePolicy": "Resources resize policy for the container.",
+ "resizePolicy": "Resources resize policy for the container. This field cannot be set on ephemeral containers.",
"restartPolicy": "RestartPolicy defines the restart behavior of individual containers in a pod. This overrides the pod-level restart policy. When this field is not specified, the restart behavior is defined by the Pod's restart policy and the container type. Additionally, setting the RestartPolicy as \"Always\" for the init container will have the following effect: this init container will be continually restarted on exit until all regular containers have terminated. Once all regular containers have completed, all init containers with restartPolicy \"Always\" will be shut down. This lifecycle differs from normal init containers and is often referred to as a \"sidecar\" container. Although this init container still starts in the init container sequence, it does not wait for the container to complete before proceeding to the next init container. Instead, the next init container starts immediately after this init container is started, or after any startupProbe has successfully completed.",
"restartPolicyRules": "Represents a list of rules to be checked to determine if the container should be restarted on exit. The rules are evaluated in order. Once a rule matches a container exit condition, the remaining rules are ignored. If no rule matches the container exit condition, the Container-level restart policy determines the whether the container is restarted or not. Constraints on the rules: - At most 20 rules are allowed. - Rules can have the same action. - Identical rules are not forbidden in validations. When rules are specified, container MUST set RestartPolicy explicitly even it if matches the Pod's RestartPolicy.",
"volumeMounts": "Pod volumes to mount into the container's filesystem. Cannot be updated.",
@@ -1363,20 +1363,21 @@ 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/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/reference/node/node-status/#condition",
- "addresses": "List of addresses reachable to the node. Queried from cloud provider, if available. More info: https://kubernetes.io/docs/reference/node/node-status/#addresses Note: This field is declared as mergeable, but the merge key is not sufficiently unique, which can cause data corruption when it is merged. Callers should instead use a full-replacement patch. See https://pr.k8s.io/79391 for an example. Consumers should assume that addresses can change during the lifetime of a Node. However, there are some exceptions where this may not be possible, such as Pods that inherit a Node's address in its own status or consumers of the downward API (status.hostIP).",
- "daemonEndpoints": "Endpoints of daemons running on the Node.",
- "nodeInfo": "Set of ids/uuids to uniquely identify the node. More info: https://kubernetes.io/docs/reference/node/node-status/#info",
- "images": "List of container images on this node",
- "volumesInUse": "List of attachable volumes in use (mounted) by the node.",
- "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.",
+ "": "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/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/reference/node/node-status/#condition",
+ "addresses": "List of addresses reachable to the node. Queried from cloud provider, if available. More info: https://kubernetes.io/docs/reference/node/node-status/#addresses Note: This field is declared as mergeable, but the merge key is not sufficiently unique, which can cause data corruption when it is merged. Callers should instead use a full-replacement patch. See https://pr.k8s.io/79391 for an example. Consumers should assume that addresses can change during the lifetime of a Node. However, there are some exceptions where this may not be possible, such as Pods that inherit a Node's address in its own status or consumers of the downward API (status.hostIP).",
+ "daemonEndpoints": "Endpoints of daemons running on the Node.",
+ "nodeInfo": "Set of ids/uuids to uniquely identify the node. More info: https://kubernetes.io/docs/reference/node/node-status/#info",
+ "images": "List of container images on this node",
+ "volumesInUse": "List of attachable volumes in use (mounted) by the node.",
+ "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.",
+ "declaredFeatures": "DeclaredFeatures represents the features related to feature gates that are declared by the node.",
}
func (NodeStatus) SwaggerDoc() map[string]string {
@@ -1486,7 +1487,7 @@ var map_PersistentVolumeClaimSpec = map[string]string{
"": "PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes",
"accessModes": "accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1",
"selector": "selector is a label query over volumes to consider for binding.",
- "resources": "resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources",
+ "resources": "resources represents the minimum resources the volume should have. Users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources",
"volumeName": "volumeName is the binding reference to the PersistentVolume backing this claim.",
"storageClassName": "storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1",
"volumeMode": "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.",
@@ -1505,8 +1506,8 @@ var map_PersistentVolumeClaimStatus = map[string]string{
"accessModes": "accessModes contains the actual access modes the volume backing the PVC has. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1",
"capacity": "capacity represents the actual resources of the underlying volume.",
"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.",
+ "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.",
+ "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.",
"currentVolumeAttributesClassName": "currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim",
"modifyVolumeStatus": "ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. When this is unset, there is no ModifyVolume operation being attempted.",
}
@@ -1584,7 +1585,7 @@ var map_PersistentVolumeSpec = map[string]string{
"storageClassName": "storageClassName is the name of StorageClass to which this persistent volume belongs. Empty value means that this volume does not belong to any StorageClass.",
"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.",
+ "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. This field is mutable if MutablePVNodeAffinity feature gate is enabled.",
"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.",
}
@@ -1680,6 +1681,7 @@ var map_PodCertificateProjection = map[string]string{
"credentialBundlePath": "Write the credential bundle at this path in the projected volume.\n\nThe credential bundle is a single file that contains multiple PEM blocks. The first PEM block is a PRIVATE KEY block, containing a PKCS#8 private key.\n\nThe remaining blocks are CERTIFICATE blocks, containing the issued certificate chain from the signer (leaf and any intermediates).\n\nUsing credentialBundlePath lets your Pod's application code make a single atomic read that retrieves a consistent key and certificate chain. If you project them to separate files, your application code will need to additionally check that the leaf certificate was issued to the key.",
"keyPath": "Write the key at this path in the projected volume.\n\nMost applications should use credentialBundlePath. When using keyPath and certificateChainPath, your application needs to check that the key and leaf certificate are consistent, because it is possible to read the files mid-rotation.",
"certificateChainPath": "Write the certificate chain at this path in the projected volume.\n\nMost applications should use credentialBundlePath. When using keyPath and certificateChainPath, your application needs to check that the key and leaf certificate are consistent, because it is possible to read the files mid-rotation.",
+ "userAnnotations": "userAnnotations allow pod authors to pass additional information to the signer implementation. Kubernetes does not restrict or validate this metadata in any way.\n\nThese values are copied verbatim into the `spec.unverifiedUserAnnotations` field of the PodCertificateRequest objects that Kubelet creates.\n\nEntries are subject to the same validation as object metadata annotations, with the addition that all keys must be domain-prefixed. No restrictions are placed on values, except an overall size limitation on the entire field.\n\nSigners should document the keys and values they support. Signers should deny requests that contain keys they do not recognize.",
}
func (PodCertificateProjection) SwaggerDoc() map[string]string {
@@ -1689,7 +1691,7 @@ func (PodCertificateProjection) SwaggerDoc() map[string]string {
var map_PodCondition = map[string]string{
"": "PodCondition contains details for the current condition of this pod.",
"type": "Type is the type of the condition. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions",
- "observedGeneration": "If set, this represents the .metadata.generation that the pod condition was set based upon. This is an alpha field. Enable PodObservedGenerationTracking to be able to use this field.",
+ "observedGeneration": "If set, this represents the .metadata.generation that the pod condition was set based upon. The PodObservedGenerationTracking feature gate must be enabled to use this field.",
"status": "Status is the status of the condition. Can be True, False, Unknown. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions",
"lastProbeTime": "Last time we probed the condition.",
"lastTransitionTime": "Last time the condition transitioned from one status to another.",
@@ -1919,9 +1921,10 @@ var map_PodSpec = map[string]string{
"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.resources - 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.",
+ "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 a stable field but requires that the DynamicResourceAllocation feature gate is enabled.\n\nThis field is immutable.",
"resources": "Resources is the total amount of CPU and Memory resources required by all containers in the pod. It supports specifying Requests and Limits for \"cpu\", \"memory\" and \"hugepages-\" resource names only. ResourceClaims are not supported.\n\nThis field enables fine-grained control over resource allocation for the entire pod, allowing resource sharing among containers in a pod.\n\nThis is an alpha field and requires enabling the PodLevelResources feature gate.",
"hostnameOverride": "HostnameOverride specifies an explicit override for the pod's hostname as perceived by the pod. This field only specifies the pod's hostname and does not affect its DNS records. When this field is set to a non-empty string: - It takes precedence over the values set in `hostname` and `subdomain`. - The Pod's hostname will be set to this value. - `setHostnameAsFQDN` must be nil or set to false. - `hostNetwork` must be set to false.\n\nThis field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters. Requires the HostnameOverride feature gate to be enabled.",
+ "workloadRef": "WorkloadRef provides a reference to the Workload object that this Pod belongs to. This field is used by the scheduler to identify the PodGroup and apply the correct group scheduling policies. The Workload object referenced by this field may not exist at the time the Pod is created. This field is immutable, but a Workload object with the same name may be recreated with different policies. Doing this during pod scheduling may result in the placement not conforming to the expected policies.",
}
func (PodSpec) SwaggerDoc() map[string]string {
@@ -1930,7 +1933,7 @@ func (PodSpec) SwaggerDoc() map[string]string {
var map_PodStatus = map[string]string{
"": "PodStatus represents information about the status of a pod. Status may trail the actual state of a system, especially if the node that hosts the pod cannot contact the control plane.",
- "observedGeneration": "If set, this represents the .metadata.generation that the pod status was set based upon. This is an alpha field. Enable PodObservedGenerationTracking to be able to use this field.",
+ "observedGeneration": "If set, this represents the .metadata.generation that the pod status was set based upon. The PodObservedGenerationTracking feature gate must be enabled to use this field.",
"phase": "The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. The conditions array, the reason and message fields, and the individual container status arrays contain more detail about the pod's status. There are five possible phase values:\n\nPending: The pod has been accepted by the Kubernetes system, but one or more of the container images has not been created. This includes time before being scheduled as well as time spent downloading images over the network, which could take a while. Running: The pod has been bound to a node, and all of the containers have been created. At least one container is still running, or is in the process of starting or restarting. Succeeded: All containers in the pod have terminated in success, and will not be restarted. Failed: All containers in the pod have terminated, and at least one container has terminated in failure. The container either exited with non-zero status or was terminated by the system. Unknown: For some reason the state of the pod could not be obtained, typically due to an error in communicating with the host of the pod.\n\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-phase",
"conditions": "Current service state of pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions",
"message": "A human readable message indicating details about why the pod is in this condition.",
@@ -1948,6 +1951,8 @@ var map_PodStatus = map[string]string{
"resize": "Status of resources resize desired for pod's containers. It is empty if no resources resize is pending. Any changes to container resources will automatically set this to \"Proposed\" Deprecated: Resize status is moved to two pod conditions PodResizePending and PodResizeInProgress. PodResizePending will track states where the spec has been resized, but the Kubelet has not yet allocated the resources. PodResizeInProgress will track in-progress resizes, and should be present whenever allocated resources != acknowledged resources.",
"resourceClaimStatuses": "Status of resource claims.",
"extendedResourceClaimStatus": "Status of extended resource claim backed by DRA.",
+ "allocatedResources": "AllocatedResources is the total requests allocated for this pod by the node. If pod-level requests are not set, this will be the total requests aggregated across containers in the pod.",
+ "resources": "Resources represents the compute resource requests and limits that have been applied at the pod level if pod-level requests or limits are set in PodSpec.Resources",
}
func (PodStatus) SwaggerDoc() map[string]string {
@@ -2669,7 +2674,7 @@ func (Taint) SwaggerDoc() map[string]string {
var map_Toleration = map[string]string{
"": "The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator .",
"key": "Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.",
- "operator": "Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.",
+ "operator": "Operator represents a key's relationship to the value. Valid operators are Exists, Equal, Lt, and Gt. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category. Lt and Gt perform numeric comparisons (requires feature gate TaintTolerationComparisonOperators).",
"value": "Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.",
"effect": "Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.",
"tolerationSeconds": "TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.",
@@ -2888,4 +2893,15 @@ func (WindowsSecurityContextOptions) SwaggerDoc() map[string]string {
return map_WindowsSecurityContextOptions
}
+var map_WorkloadReference = map[string]string{
+ "": "WorkloadReference identifies the Workload object and PodGroup membership that a Pod belongs to. The scheduler uses this information to apply workload-aware scheduling semantics.",
+ "name": "Name defines the name of the Workload object this Pod belongs to. Workload must be in the same namespace as the Pod. If it doesn't match any existing Workload, the Pod will remain unschedulable until a Workload object is created and observed by the kube-scheduler. It must be a DNS subdomain.",
+ "podGroup": "PodGroup is the name of the PodGroup within the Workload that this Pod belongs to. If it doesn't match any existing PodGroup within the Workload, the Pod will remain unschedulable until the Workload object is recreated and observed by the kube-scheduler. It must be a DNS label.",
+ "podGroupReplicaKey": "PodGroupReplicaKey specifies the replica key of the PodGroup to which this Pod belongs. It is used to distinguish pods belonging to different replicas of the same pod group. The pod group policy is applied separately to each replica. When set, it must be a DNS label.",
+}
+
+func (WorkloadReference) SwaggerDoc() map[string]string {
+ return map_WorkloadReference
+}
+
// AUTO-GENERATED FUNCTIONS END HERE
diff --git a/api/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go b/api/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go
index bcd91bd0190f..15bc2ee0331e 100644
--- a/api/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go
+++ b/api/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go
@@ -3145,6 +3145,11 @@ func (in *NodeStatus) DeepCopyInto(out *NodeStatus) {
*out = new(NodeFeatures)
(*in).DeepCopyInto(*out)
}
+ if in.DeclaredFeatures != nil {
+ in, out := &in.DeclaredFeatures, &out.DeclaredFeatures
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
return
}
@@ -3903,6 +3908,13 @@ func (in *PodCertificateProjection) DeepCopyInto(out *PodCertificateProjection)
*out = new(int32)
**out = **in
}
+ if in.UserAnnotations != nil {
+ in, out := &in.UserAnnotations, &out.UserAnnotations
+ *out = make(map[string]string, len(*in))
+ for key, val := range *in {
+ (*out)[key] = val
+ }
+ }
return
}
@@ -4557,6 +4569,11 @@ func (in *PodSpec) DeepCopyInto(out *PodSpec) {
*out = new(string)
**out = **in
}
+ if in.WorkloadRef != nil {
+ in, out := &in.WorkloadRef, &out.WorkloadRef
+ *out = new(WorkloadReference)
+ **out = **in
+ }
return
}
@@ -4627,6 +4644,18 @@ func (in *PodStatus) DeepCopyInto(out *PodStatus) {
*out = new(PodExtendedResourceClaimStatus)
(*in).DeepCopyInto(*out)
}
+ if in.AllocatedResources != nil {
+ in, out := &in.AllocatedResources, &out.AllocatedResources
+ *out = make(ResourceList, len(*in))
+ for key, val := range *in {
+ (*out)[key] = val.DeepCopy()
+ }
+ }
+ if in.Resources != nil {
+ in, out := &in.Resources, &out.Resources
+ *out = new(ResourceRequirements)
+ (*in).DeepCopyInto(*out)
+ }
return
}
@@ -6844,3 +6873,19 @@ func (in *WindowsSecurityContextOptions) DeepCopy() *WindowsSecurityContextOptio
in.DeepCopyInto(out)
return out
}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *WorkloadReference) DeepCopyInto(out *WorkloadReference) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadReference.
+func (in *WorkloadReference) DeepCopy() *WorkloadReference {
+ if in == nil {
+ return nil
+ }
+ out := new(WorkloadReference)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/api/vendor/k8s.io/api/core/v1/zz_generated.model_name.go b/api/vendor/k8s.io/api/core/v1/zz_generated.model_name.go
new file mode 100644
index 000000000000..523bb3a85290
--- /dev/null
+++ b/api/vendor/k8s.io/api/core/v1/zz_generated.model_name.go
@@ -0,0 +1,1212 @@
+//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 openapi-gen. DO NOT EDIT.
+
+package v1
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in AWSElasticBlockStoreVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Affinity) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.Affinity"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in AppArmorProfile) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.AppArmorProfile"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in AttachedVolume) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.AttachedVolume"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in AvoidPods) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.AvoidPods"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in AzureDiskVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.AzureDiskVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in AzureFilePersistentVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.AzureFilePersistentVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in AzureFileVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.AzureFileVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Binding) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.Binding"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in CSIPersistentVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.CSIPersistentVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in CSIVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.CSIVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Capabilities) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.Capabilities"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in CephFSPersistentVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.CephFSPersistentVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in CephFSVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.CephFSVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in CinderPersistentVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.CinderPersistentVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in CinderVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.CinderVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ClientIPConfig) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ClientIPConfig"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ClusterTrustBundleProjection) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ClusterTrustBundleProjection"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ComponentCondition) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ComponentCondition"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ComponentStatus) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ComponentStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ComponentStatusList) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ComponentStatusList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ConfigMap) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ConfigMap"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ConfigMapEnvSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ConfigMapEnvSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ConfigMapKeySelector) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ConfigMapKeySelector"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ConfigMapList) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ConfigMapList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ConfigMapNodeConfigSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ConfigMapNodeConfigSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ConfigMapProjection) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ConfigMapProjection"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ConfigMapVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ConfigMapVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Container) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.Container"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ContainerExtendedResourceRequest) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ContainerExtendedResourceRequest"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ContainerImage) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ContainerImage"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ContainerPort) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ContainerPort"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ContainerResizePolicy) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ContainerResizePolicy"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ContainerRestartRule) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ContainerRestartRule"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ContainerRestartRuleOnExitCodes) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ContainerRestartRuleOnExitCodes"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ContainerState) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ContainerState"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ContainerStateRunning) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ContainerStateRunning"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ContainerStateTerminated) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ContainerStateTerminated"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ContainerStateWaiting) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ContainerStateWaiting"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ContainerStatus) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ContainerStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ContainerUser) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ContainerUser"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in DaemonEndpoint) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.DaemonEndpoint"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in DownwardAPIProjection) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.DownwardAPIProjection"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in DownwardAPIVolumeFile) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.DownwardAPIVolumeFile"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in DownwardAPIVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.DownwardAPIVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in EmptyDirVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.EmptyDirVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in EndpointAddress) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.EndpointAddress"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in EndpointPort) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.EndpointPort"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in EndpointSubset) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.EndpointSubset"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Endpoints) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.Endpoints"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in EndpointsList) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.EndpointsList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in EnvFromSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.EnvFromSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in EnvVar) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.EnvVar"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in EnvVarSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.EnvVarSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in EphemeralContainer) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.EphemeralContainer"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in EphemeralContainerCommon) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.EphemeralContainerCommon"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in EphemeralVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.EphemeralVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Event) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.Event"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in EventList) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.EventList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in EventSeries) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.EventSeries"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in EventSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.EventSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ExecAction) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ExecAction"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in FCVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.FCVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in FileKeySelector) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.FileKeySelector"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in FlexPersistentVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.FlexPersistentVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in FlexVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.FlexVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in FlockerVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.FlockerVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in GCEPersistentDiskVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.GCEPersistentDiskVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in GRPCAction) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.GRPCAction"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in GitRepoVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.GitRepoVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in GlusterfsPersistentVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.GlusterfsPersistentVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in GlusterfsVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.GlusterfsVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in HTTPGetAction) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.HTTPGetAction"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in HTTPHeader) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.HTTPHeader"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in HostAlias) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.HostAlias"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in HostIP) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.HostIP"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in HostPathVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.HostPathVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ISCSIPersistentVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ISCSIPersistentVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ISCSIVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ISCSIVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ImageVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ImageVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in KeyToPath) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.KeyToPath"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Lifecycle) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.Lifecycle"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in LifecycleHandler) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.LifecycleHandler"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in LimitRange) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.LimitRange"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in LimitRangeItem) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.LimitRangeItem"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in LimitRangeList) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.LimitRangeList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in LimitRangeSpec) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.LimitRangeSpec"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in LinuxContainerUser) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.LinuxContainerUser"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in List) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.List"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in LoadBalancerIngress) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.LoadBalancerIngress"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in LoadBalancerStatus) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.LoadBalancerStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in LocalObjectReference) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.LocalObjectReference"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in LocalVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.LocalVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ModifyVolumeStatus) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ModifyVolumeStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NFSVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NFSVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Namespace) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.Namespace"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NamespaceCondition) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NamespaceCondition"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NamespaceList) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NamespaceList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NamespaceSpec) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NamespaceSpec"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NamespaceStatus) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NamespaceStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Node) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.Node"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NodeAddress) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NodeAddress"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NodeAffinity) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NodeAffinity"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NodeCondition) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NodeCondition"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NodeConfigSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NodeConfigSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NodeConfigStatus) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NodeConfigStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NodeDaemonEndpoints) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NodeDaemonEndpoints"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NodeFeatures) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NodeFeatures"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NodeList) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NodeList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NodeProxyOptions) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NodeProxyOptions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NodeRuntimeHandler) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NodeRuntimeHandler"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NodeRuntimeHandlerFeatures) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NodeRuntimeHandlerFeatures"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NodeSelector) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NodeSelector"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NodeSelectorRequirement) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NodeSelectorRequirement"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NodeSelectorTerm) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NodeSelectorTerm"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NodeSpec) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NodeSpec"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NodeStatus) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NodeStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NodeSwapStatus) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NodeSwapStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NodeSystemInfo) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.NodeSystemInfo"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ObjectFieldSelector) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ObjectFieldSelector"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ObjectReference) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ObjectReference"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PersistentVolume) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PersistentVolume"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PersistentVolumeClaim) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PersistentVolumeClaim"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PersistentVolumeClaimCondition) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PersistentVolumeClaimCondition"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PersistentVolumeClaimList) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PersistentVolumeClaimList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PersistentVolumeClaimSpec) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PersistentVolumeClaimSpec"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PersistentVolumeClaimStatus) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PersistentVolumeClaimStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PersistentVolumeClaimTemplate) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PersistentVolumeClaimTemplate"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PersistentVolumeClaimVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PersistentVolumeList) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PersistentVolumeList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PersistentVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PersistentVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PersistentVolumeSpec) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PersistentVolumeSpec"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PersistentVolumeStatus) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PersistentVolumeStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PhotonPersistentDiskVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Pod) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.Pod"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodAffinity) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodAffinity"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodAffinityTerm) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodAffinityTerm"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodAntiAffinity) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodAntiAffinity"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodAttachOptions) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodAttachOptions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodCertificateProjection) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodCertificateProjection"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodCondition) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodCondition"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodDNSConfig) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodDNSConfig"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodDNSConfigOption) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodDNSConfigOption"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodExecOptions) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodExecOptions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodExtendedResourceClaimStatus) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodExtendedResourceClaimStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodIP) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodIP"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodList) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodLogOptions) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodLogOptions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodOS) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodOS"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodPortForwardOptions) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodPortForwardOptions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodProxyOptions) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodProxyOptions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodReadinessGate) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodReadinessGate"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodResourceClaim) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodResourceClaim"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodResourceClaimStatus) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodResourceClaimStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodSchedulingGate) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodSchedulingGate"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodSecurityContext) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodSecurityContext"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodSignature) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodSignature"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodSpec) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodSpec"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodStatus) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodStatusResult) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodStatusResult"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodTemplate) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodTemplate"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodTemplateList) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodTemplateList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PodTemplateSpec) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PodTemplateSpec"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PortStatus) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PortStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PortworxVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PortworxVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Preconditions) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.Preconditions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PreferAvoidPodsEntry) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PreferAvoidPodsEntry"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PreferredSchedulingTerm) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.PreferredSchedulingTerm"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Probe) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.Probe"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ProbeHandler) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ProbeHandler"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ProjectedVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ProjectedVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in QuobyteVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.QuobyteVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in RBDPersistentVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.RBDPersistentVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in RBDVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.RBDVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in RangeAllocation) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.RangeAllocation"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ReplicationController) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ReplicationController"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ReplicationControllerCondition) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ReplicationControllerCondition"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ReplicationControllerList) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ReplicationControllerList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ReplicationControllerSpec) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ReplicationControllerSpec"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ReplicationControllerStatus) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ReplicationControllerStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ResourceClaim) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ResourceClaim"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ResourceFieldSelector) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ResourceFieldSelector"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ResourceHealth) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ResourceHealth"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ResourceQuota) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ResourceQuota"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ResourceQuotaList) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ResourceQuotaList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ResourceQuotaSpec) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ResourceQuotaSpec"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ResourceQuotaStatus) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ResourceQuotaStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ResourceRequirements) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ResourceRequirements"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ResourceStatus) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ResourceStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SELinuxOptions) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.SELinuxOptions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ScaleIOPersistentVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ScaleIOPersistentVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ScaleIOVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ScaleIOVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ScopeSelector) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ScopeSelector"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ScopedResourceSelectorRequirement) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ScopedResourceSelectorRequirement"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SeccompProfile) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.SeccompProfile"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Secret) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.Secret"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SecretEnvSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.SecretEnvSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SecretKeySelector) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.SecretKeySelector"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SecretList) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.SecretList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SecretProjection) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.SecretProjection"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SecretReference) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.SecretReference"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SecretVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.SecretVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SecurityContext) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.SecurityContext"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SerializedReference) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.SerializedReference"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Service) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.Service"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ServiceAccount) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ServiceAccount"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ServiceAccountList) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ServiceAccountList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ServiceAccountTokenProjection) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ServiceAccountTokenProjection"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ServiceList) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ServiceList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ServicePort) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ServicePort"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ServiceProxyOptions) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ServiceProxyOptions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ServiceSpec) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ServiceSpec"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ServiceStatus) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.ServiceStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SessionAffinityConfig) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.SessionAffinityConfig"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SleepAction) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.SleepAction"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in StorageOSPersistentVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.StorageOSPersistentVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in StorageOSVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.StorageOSVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Sysctl) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.Sysctl"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in TCPSocketAction) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.TCPSocketAction"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Taint) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.Taint"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Toleration) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.Toleration"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in TopologySelectorLabelRequirement) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.TopologySelectorLabelRequirement"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in TopologySelectorTerm) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.TopologySelectorTerm"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in TopologySpreadConstraint) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.TopologySpreadConstraint"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in TypedLocalObjectReference) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.TypedLocalObjectReference"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in TypedObjectReference) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.TypedObjectReference"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Volume) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.Volume"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in VolumeDevice) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.VolumeDevice"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in VolumeMount) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.VolumeMount"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in VolumeMountStatus) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.VolumeMountStatus"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in VolumeNodeAffinity) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.VolumeNodeAffinity"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in VolumeProjection) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.VolumeProjection"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in VolumeResourceRequirements) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.VolumeResourceRequirements"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in VolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.VolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in VsphereVirtualDiskVolumeSource) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in WeightedPodAffinityTerm) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.WeightedPodAffinityTerm"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in WindowsSecurityContextOptions) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.WindowsSecurityContextOptions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in WorkloadReference) OpenAPIModelName() string {
+ return "io.k8s.api.core.v1.WorkloadReference"
+}
diff --git a/api/vendor/k8s.io/api/rbac/v1/doc.go b/api/vendor/k8s.io/api/rbac/v1/doc.go
index 408546274b01..f120f5d3a230 100644
--- a/api/vendor/k8s.io/api/rbac/v1/doc.go
+++ b/api/vendor/k8s.io/api/rbac/v1/doc.go
@@ -18,6 +18,8 @@ limitations under the License.
// +k8s:protobuf-gen=package
// +k8s:openapi-gen=true
// +k8s:prerelease-lifecycle-gen=true
+// +k8s:openapi-model-package=io.k8s.api.rbac.v1
+
// +groupName=rbac.authorization.k8s.io
package v1
diff --git a/api/vendor/k8s.io/api/rbac/v1/generated.pb.go b/api/vendor/k8s.io/api/rbac/v1/generated.pb.go
index 112d18fb0651..ed31ec959a2e 100644
--- a/api/vendor/k8s.io/api/rbac/v1/generated.pb.go
+++ b/api/vendor/k8s.io/api/rbac/v1/generated.pb.go
@@ -24,434 +24,36 @@ import (
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
+func (m *AggregationRule) Reset() { *m = AggregationRule{} }
-// 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 *ClusterRole) Reset() { *m = ClusterRole{} }
-func (m *AggregationRule) Reset() { *m = AggregationRule{} }
-func (*AggregationRule) ProtoMessage() {}
-func (*AggregationRule) Descriptor() ([]byte, []int) {
- return fileDescriptor_c8ba2e7dd472de66, []int{0}
-}
-func (m *AggregationRule) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *AggregationRule) 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 *AggregationRule) XXX_Merge(src proto.Message) {
- xxx_messageInfo_AggregationRule.Merge(m, src)
-}
-func (m *AggregationRule) XXX_Size() int {
- return m.Size()
-}
-func (m *AggregationRule) XXX_DiscardUnknown() {
- xxx_messageInfo_AggregationRule.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_AggregationRule proto.InternalMessageInfo
-
-func (m *ClusterRole) Reset() { *m = ClusterRole{} }
-func (*ClusterRole) ProtoMessage() {}
-func (*ClusterRole) Descriptor() ([]byte, []int) {
- return fileDescriptor_c8ba2e7dd472de66, []int{1}
-}
-func (m *ClusterRole) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ClusterRole) 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 *ClusterRole) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ClusterRole.Merge(m, src)
-}
-func (m *ClusterRole) XXX_Size() int {
- return m.Size()
-}
-func (m *ClusterRole) XXX_DiscardUnknown() {
- xxx_messageInfo_ClusterRole.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ClusterRole proto.InternalMessageInfo
-
-func (m *ClusterRoleBinding) Reset() { *m = ClusterRoleBinding{} }
-func (*ClusterRoleBinding) ProtoMessage() {}
-func (*ClusterRoleBinding) Descriptor() ([]byte, []int) {
- return fileDescriptor_c8ba2e7dd472de66, []int{2}
-}
-func (m *ClusterRoleBinding) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ClusterRoleBinding) 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 *ClusterRoleBinding) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ClusterRoleBinding.Merge(m, src)
-}
-func (m *ClusterRoleBinding) XXX_Size() int {
- return m.Size()
-}
-func (m *ClusterRoleBinding) XXX_DiscardUnknown() {
- xxx_messageInfo_ClusterRoleBinding.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ClusterRoleBinding proto.InternalMessageInfo
-
-func (m *ClusterRoleBindingList) Reset() { *m = ClusterRoleBindingList{} }
-func (*ClusterRoleBindingList) ProtoMessage() {}
-func (*ClusterRoleBindingList) Descriptor() ([]byte, []int) {
- return fileDescriptor_c8ba2e7dd472de66, []int{3}
-}
-func (m *ClusterRoleBindingList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ClusterRoleBindingList) 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 *ClusterRoleBindingList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ClusterRoleBindingList.Merge(m, src)
-}
-func (m *ClusterRoleBindingList) XXX_Size() int {
- return m.Size()
-}
-func (m *ClusterRoleBindingList) XXX_DiscardUnknown() {
- xxx_messageInfo_ClusterRoleBindingList.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ClusterRoleBindingList proto.InternalMessageInfo
-
-func (m *ClusterRoleList) Reset() { *m = ClusterRoleList{} }
-func (*ClusterRoleList) ProtoMessage() {}
-func (*ClusterRoleList) Descriptor() ([]byte, []int) {
- return fileDescriptor_c8ba2e7dd472de66, []int{4}
-}
-func (m *ClusterRoleList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ClusterRoleList) 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 *ClusterRoleList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ClusterRoleList.Merge(m, src)
-}
-func (m *ClusterRoleList) XXX_Size() int {
- return m.Size()
-}
-func (m *ClusterRoleList) XXX_DiscardUnknown() {
- xxx_messageInfo_ClusterRoleList.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ClusterRoleList proto.InternalMessageInfo
-
-func (m *PolicyRule) Reset() { *m = PolicyRule{} }
-func (*PolicyRule) ProtoMessage() {}
-func (*PolicyRule) Descriptor() ([]byte, []int) {
- return fileDescriptor_c8ba2e7dd472de66, []int{5}
-}
-func (m *PolicyRule) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PolicyRule) 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 *PolicyRule) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PolicyRule.Merge(m, src)
-}
-func (m *PolicyRule) XXX_Size() int {
- return m.Size()
-}
-func (m *PolicyRule) XXX_DiscardUnknown() {
- xxx_messageInfo_PolicyRule.DiscardUnknown(m)
-}
+func (m *ClusterRoleBinding) Reset() { *m = ClusterRoleBinding{} }
-var xxx_messageInfo_PolicyRule proto.InternalMessageInfo
+func (m *ClusterRoleBindingList) Reset() { *m = ClusterRoleBindingList{} }
-func (m *Role) Reset() { *m = Role{} }
-func (*Role) ProtoMessage() {}
-func (*Role) Descriptor() ([]byte, []int) {
- return fileDescriptor_c8ba2e7dd472de66, []int{6}
-}
-func (m *Role) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Role) 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 *Role) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Role.Merge(m, src)
-}
-func (m *Role) XXX_Size() int {
- return m.Size()
-}
-func (m *Role) XXX_DiscardUnknown() {
- xxx_messageInfo_Role.DiscardUnknown(m)
-}
+func (m *ClusterRoleList) Reset() { *m = ClusterRoleList{} }
-var xxx_messageInfo_Role proto.InternalMessageInfo
+func (m *PolicyRule) Reset() { *m = PolicyRule{} }
-func (m *RoleBinding) Reset() { *m = RoleBinding{} }
-func (*RoleBinding) ProtoMessage() {}
-func (*RoleBinding) Descriptor() ([]byte, []int) {
- return fileDescriptor_c8ba2e7dd472de66, []int{7}
-}
-func (m *RoleBinding) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *RoleBinding) 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 *RoleBinding) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RoleBinding.Merge(m, src)
-}
-func (m *RoleBinding) XXX_Size() int {
- return m.Size()
-}
-func (m *RoleBinding) XXX_DiscardUnknown() {
- xxx_messageInfo_RoleBinding.DiscardUnknown(m)
-}
+func (m *Role) Reset() { *m = Role{} }
-var xxx_messageInfo_RoleBinding proto.InternalMessageInfo
+func (m *RoleBinding) Reset() { *m = RoleBinding{} }
-func (m *RoleBindingList) Reset() { *m = RoleBindingList{} }
-func (*RoleBindingList) ProtoMessage() {}
-func (*RoleBindingList) Descriptor() ([]byte, []int) {
- return fileDescriptor_c8ba2e7dd472de66, []int{8}
-}
-func (m *RoleBindingList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *RoleBindingList) 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 *RoleBindingList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RoleBindingList.Merge(m, src)
-}
-func (m *RoleBindingList) XXX_Size() int {
- return m.Size()
-}
-func (m *RoleBindingList) XXX_DiscardUnknown() {
- xxx_messageInfo_RoleBindingList.DiscardUnknown(m)
-}
+func (m *RoleBindingList) Reset() { *m = RoleBindingList{} }
-var xxx_messageInfo_RoleBindingList proto.InternalMessageInfo
+func (m *RoleList) Reset() { *m = RoleList{} }
-func (m *RoleList) Reset() { *m = RoleList{} }
-func (*RoleList) ProtoMessage() {}
-func (*RoleList) Descriptor() ([]byte, []int) {
- return fileDescriptor_c8ba2e7dd472de66, []int{9}
-}
-func (m *RoleList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *RoleList) 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 *RoleList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RoleList.Merge(m, src)
-}
-func (m *RoleList) XXX_Size() int {
- return m.Size()
-}
-func (m *RoleList) XXX_DiscardUnknown() {
- xxx_messageInfo_RoleList.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_RoleList proto.InternalMessageInfo
+func (m *RoleRef) Reset() { *m = RoleRef{} }
-func (m *RoleRef) Reset() { *m = RoleRef{} }
-func (*RoleRef) ProtoMessage() {}
-func (*RoleRef) Descriptor() ([]byte, []int) {
- return fileDescriptor_c8ba2e7dd472de66, []int{10}
-}
-func (m *RoleRef) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *RoleRef) 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 *RoleRef) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RoleRef.Merge(m, src)
-}
-func (m *RoleRef) XXX_Size() int {
- return m.Size()
-}
-func (m *RoleRef) XXX_DiscardUnknown() {
- xxx_messageInfo_RoleRef.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_RoleRef proto.InternalMessageInfo
-
-func (m *Subject) Reset() { *m = Subject{} }
-func (*Subject) ProtoMessage() {}
-func (*Subject) Descriptor() ([]byte, []int) {
- return fileDescriptor_c8ba2e7dd472de66, []int{11}
-}
-func (m *Subject) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Subject) 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 *Subject) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Subject.Merge(m, src)
-}
-func (m *Subject) XXX_Size() int {
- return m.Size()
-}
-func (m *Subject) XXX_DiscardUnknown() {
- xxx_messageInfo_Subject.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Subject proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*AggregationRule)(nil), "k8s.io.api.rbac.v1.AggregationRule")
- proto.RegisterType((*ClusterRole)(nil), "k8s.io.api.rbac.v1.ClusterRole")
- proto.RegisterType((*ClusterRoleBinding)(nil), "k8s.io.api.rbac.v1.ClusterRoleBinding")
- proto.RegisterType((*ClusterRoleBindingList)(nil), "k8s.io.api.rbac.v1.ClusterRoleBindingList")
- proto.RegisterType((*ClusterRoleList)(nil), "k8s.io.api.rbac.v1.ClusterRoleList")
- proto.RegisterType((*PolicyRule)(nil), "k8s.io.api.rbac.v1.PolicyRule")
- proto.RegisterType((*Role)(nil), "k8s.io.api.rbac.v1.Role")
- proto.RegisterType((*RoleBinding)(nil), "k8s.io.api.rbac.v1.RoleBinding")
- proto.RegisterType((*RoleBindingList)(nil), "k8s.io.api.rbac.v1.RoleBindingList")
- proto.RegisterType((*RoleList)(nil), "k8s.io.api.rbac.v1.RoleList")
- proto.RegisterType((*RoleRef)(nil), "k8s.io.api.rbac.v1.RoleRef")
- proto.RegisterType((*Subject)(nil), "k8s.io.api.rbac.v1.Subject")
-}
-
-func init() {
- proto.RegisterFile("k8s.io/api/rbac/v1/generated.proto", fileDescriptor_c8ba2e7dd472de66)
-}
-
-var fileDescriptor_c8ba2e7dd472de66 = []byte{
- // 790 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x56, 0x4d, 0x6f, 0xd3, 0x4a,
- 0x14, 0xcd, 0xa4, 0x89, 0x1a, 0x4f, 0x5e, 0x94, 0xd7, 0x79, 0xd5, 0x93, 0xd5, 0xf7, 0xe4, 0x54,
- 0x46, 0x42, 0x95, 0x00, 0x9b, 0x16, 0x04, 0xdd, 0x74, 0x51, 0x17, 0x81, 0xaa, 0x96, 0x52, 0x4d,
- 0x05, 0x0b, 0xc4, 0x82, 0x89, 0x33, 0x75, 0x87, 0xf8, 0x4b, 0x1e, 0x3b, 0x52, 0xc5, 0x06, 0x21,
- 0xb1, 0x60, 0xc7, 0x12, 0x7e, 0x01, 0x1b, 0x58, 0xf2, 0x0b, 0xd8, 0x74, 0xd9, 0x65, 0x57, 0x11,
- 0x35, 0x3f, 0x04, 0xe4, 0xaf, 0x38, 0x1f, 0x2e, 0xcd, 0x2a, 0x12, 0x62, 0x95, 0xcc, 0xbd, 0xe7,
- 0x9e, 0x7b, 0xe6, 0xd8, 0xf7, 0x26, 0x50, 0xee, 0xae, 0x73, 0x85, 0x39, 0x2a, 0x71, 0x99, 0xea,
- 0xb5, 0x89, 0xae, 0xf6, 0x56, 0x55, 0x83, 0xda, 0xd4, 0x23, 0x3e, 0xed, 0x28, 0xae, 0xe7, 0xf8,
- 0x0e, 0x42, 0x09, 0x46, 0x21, 0x2e, 0x53, 0x22, 0x8c, 0xd2, 0x5b, 0x5d, 0xba, 0x61, 0x30, 0xff,
- 0x28, 0x68, 0x2b, 0xba, 0x63, 0xa9, 0x86, 0x63, 0x38, 0x6a, 0x0c, 0x6d, 0x07, 0x87, 0xf1, 0x29,
- 0x3e, 0xc4, 0xdf, 0x12, 0x8a, 0xa5, 0xdb, 0x79, 0x1b, 0x8b, 0xe8, 0x47, 0xcc, 0xa6, 0xde, 0xb1,
- 0xea, 0x76, 0x8d, 0x28, 0xc0, 0x55, 0x8b, 0xfa, 0xa4, 0xa0, 0xf1, 0x92, 0x7a, 0x51, 0x95, 0x17,
- 0xd8, 0x3e, 0xb3, 0xe8, 0x44, 0xc1, 0x9d, 0xcb, 0x0a, 0xb8, 0x7e, 0x44, 0x2d, 0x32, 0x5e, 0x27,
- 0x7f, 0x00, 0xb0, 0xb9, 0x69, 0x18, 0x1e, 0x35, 0x88, 0xcf, 0x1c, 0x1b, 0x07, 0x26, 0x45, 0x6f,
- 0x00, 0x5c, 0xd4, 0xcd, 0x80, 0xfb, 0xd4, 0xc3, 0x8e, 0x49, 0x0f, 0xa8, 0x49, 0x75, 0xdf, 0xf1,
- 0xb8, 0x08, 0x96, 0xe7, 0x56, 0xea, 0x6b, 0xb7, 0x94, 0xdc, 0x95, 0x41, 0x2f, 0xc5, 0xed, 0x1a,
- 0x51, 0x80, 0x2b, 0xd1, 0x95, 0x94, 0xde, 0xaa, 0xb2, 0x4b, 0xda, 0xd4, 0xcc, 0x6a, 0xb5, 0xff,
- 0x4f, 0xfa, 0xad, 0x52, 0xd8, 0x6f, 0x2d, 0x6e, 0x15, 0x10, 0xe3, 0xc2, 0x76, 0xf2, 0xfb, 0x32,
- 0xac, 0x0f, 0xc1, 0xd1, 0x73, 0x58, 0x8b, 0xc8, 0x3b, 0xc4, 0x27, 0x22, 0x58, 0x06, 0x2b, 0xf5,
- 0xb5, 0x9b, 0xd3, 0x49, 0x79, 0xd4, 0x7e, 0x41, 0x75, 0xff, 0x21, 0xf5, 0x89, 0x86, 0x52, 0x1d,
- 0x30, 0x8f, 0xe1, 0x01, 0x2b, 0xda, 0x82, 0x55, 0x2f, 0x30, 0x29, 0x17, 0xcb, 0xf1, 0x4d, 0x25,
- 0x65, 0xf2, 0xf9, 0x2b, 0xfb, 0x8e, 0xc9, 0xf4, 0xe3, 0xc8, 0x28, 0xad, 0x91, 0x92, 0x55, 0xa3,
- 0x13, 0xc7, 0x49, 0x2d, 0x6a, 0xc3, 0x26, 0x19, 0x75, 0x54, 0x9c, 0x8b, 0xd5, 0x5e, 0x29, 0xa2,
- 0x1b, 0x33, 0x5f, 0xfb, 0x27, 0xec, 0xb7, 0xc6, 0x9f, 0x08, 0x1e, 0x27, 0x94, 0xdf, 0x96, 0x21,
- 0x1a, 0xb2, 0x46, 0x63, 0x76, 0x87, 0xd9, 0xc6, 0x0c, 0x1c, 0xda, 0x86, 0x35, 0x1e, 0xc4, 0x89,
- 0xcc, 0xa4, 0xff, 0x8a, 0x6e, 0x75, 0x90, 0x60, 0xb4, 0xbf, 0x53, 0xb2, 0x5a, 0x1a, 0xe0, 0x78,
- 0x50, 0x8e, 0xee, 0xc3, 0x79, 0xcf, 0x31, 0x29, 0xa6, 0x87, 0xa9, 0x3f, 0x85, 0x4c, 0x38, 0x81,
- 0x68, 0xcd, 0x94, 0x69, 0x3e, 0x0d, 0xe0, 0xac, 0x58, 0xfe, 0x0a, 0xe0, 0xbf, 0x93, 0x5e, 0xec,
- 0x32, 0xee, 0xa3, 0x67, 0x13, 0x7e, 0x28, 0x53, 0xbe, 0xbc, 0x8c, 0x27, 0x6e, 0x0c, 0x2e, 0x90,
- 0x45, 0x86, 0xbc, 0xd8, 0x81, 0x55, 0xe6, 0x53, 0x2b, 0x33, 0xe2, 0x6a, 0x91, 0xfc, 0x49, 0x61,
- 0xf9, 0x5b, 0xb3, 0x1d, 0x15, 0xe3, 0x84, 0x43, 0xfe, 0x02, 0x60, 0x73, 0x08, 0x3c, 0x03, 0xf9,
- 0xf7, 0x46, 0xe5, 0xb7, 0x2e, 0x93, 0x5f, 0xac, 0xfb, 0x07, 0x80, 0x30, 0x1f, 0x09, 0xd4, 0x82,
- 0xd5, 0x1e, 0xf5, 0xda, 0xc9, 0xae, 0x10, 0x34, 0x21, 0xc2, 0x3f, 0x89, 0x02, 0x38, 0x89, 0xa3,
- 0x6b, 0x50, 0x20, 0x2e, 0x7b, 0xe0, 0x39, 0x81, 0x9b, 0x74, 0x16, 0xb4, 0x46, 0xd8, 0x6f, 0x09,
- 0x9b, 0xfb, 0xdb, 0x49, 0x10, 0xe7, 0xf9, 0x08, 0xec, 0x51, 0xee, 0x04, 0x9e, 0x4e, 0xb9, 0x38,
- 0x97, 0x83, 0x71, 0x16, 0xc4, 0x79, 0x1e, 0xdd, 0x85, 0x8d, 0xec, 0xb0, 0x47, 0x2c, 0xca, 0xc5,
- 0x4a, 0x5c, 0xb0, 0x10, 0xf6, 0x5b, 0x0d, 0x3c, 0x9c, 0xc0, 0xa3, 0x38, 0xb4, 0x01, 0x9b, 0xb6,
- 0x63, 0x67, 0x90, 0xc7, 0x78, 0x97, 0x8b, 0xd5, 0xb8, 0x34, 0x9e, 0xc5, 0xbd, 0xd1, 0x14, 0x1e,
- 0xc7, 0xca, 0x9f, 0x01, 0xac, 0xfc, 0x46, 0xfb, 0x49, 0x7e, 0x5d, 0x86, 0xf5, 0x3f, 0x7e, 0x69,
- 0x44, 0xe3, 0x36, 0xdb, 0x6d, 0x31, 0xcd, 0xb8, 0x5d, 0xbe, 0x26, 0x3e, 0x02, 0x58, 0x9b, 0xd1,
- 0x7e, 0xd8, 0x18, 0x15, 0x2c, 0x5e, 0x28, 0xb8, 0x58, 0xe9, 0x4b, 0x98, 0xb9, 0x8e, 0xae, 0xc3,
- 0x5a, 0x36, 0xd3, 0xb1, 0x4e, 0x21, 0xef, 0x9b, 0x8d, 0x3d, 0x1e, 0x20, 0xd0, 0x32, 0xac, 0x74,
- 0x99, 0xdd, 0x11, 0xcb, 0x31, 0xf2, 0xaf, 0x14, 0x59, 0xd9, 0x61, 0x76, 0x07, 0xc7, 0x99, 0x08,
- 0x61, 0x13, 0x2b, 0xf9, 0x59, 0x1d, 0x42, 0x44, 0xd3, 0x8c, 0xe3, 0x8c, 0xfc, 0x09, 0xc0, 0xf9,
- 0xf4, 0xed, 0x19, 0xf0, 0x81, 0x0b, 0xf9, 0x86, 0xf5, 0x95, 0xa7, 0xd1, 0xf7, 0xeb, 0xee, 0x48,
- 0x85, 0x42, 0xf4, 0xc9, 0x5d, 0xa2, 0x53, 0xb1, 0x12, 0xc3, 0x16, 0x52, 0x98, 0xb0, 0x97, 0x25,
- 0x70, 0x8e, 0xd1, 0xd6, 0x4f, 0xce, 0xa5, 0xd2, 0xe9, 0xb9, 0x54, 0x3a, 0x3b, 0x97, 0x4a, 0xaf,
- 0x42, 0x09, 0x9c, 0x84, 0x12, 0x38, 0x0d, 0x25, 0x70, 0x16, 0x4a, 0xe0, 0x5b, 0x28, 0x81, 0x77,
- 0xdf, 0xa5, 0xd2, 0x53, 0x34, 0xf9, 0x8f, 0xf5, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x67, 0xff,
- 0x5a, 0x4f, 0xc6, 0x0a, 0x00, 0x00,
-}
+func (m *Subject) Reset() { *m = Subject{} }
func (m *AggregationRule) Marshal() (dAtA []byte, err error) {
size := m.Size()
diff --git a/api/vendor/k8s.io/api/rbac/v1/generated.proto b/api/vendor/k8s.io/api/rbac/v1/generated.proto
index 87b8f832d334..56869814ec48 100644
--- a/api/vendor/k8s.io/api/rbac/v1/generated.proto
+++ b/api/vendor/k8s.io/api/rbac/v1/generated.proto
@@ -185,6 +185,8 @@ message RoleRef {
optional string kind = 2;
// Name is the name of resource being referenced
+ // +required
+ // +k8s:required
optional string name = 3;
}
@@ -203,6 +205,8 @@ message Subject {
optional string apiGroup = 2;
// Name of the object being referenced.
+ // +required
+ // +k8s:required
optional string name = 3;
// 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/api/vendor/k8s.io/api/rbac/v1/generated.protomessage.pb.go b/api/vendor/k8s.io/api/rbac/v1/generated.protomessage.pb.go
new file mode 100644
index 000000000000..6e29e012fa59
--- /dev/null
+++ b/api/vendor/k8s.io/api/rbac/v1/generated.protomessage.pb.go
@@ -0,0 +1,46 @@
+//go:build kubernetes_protomessage_one_more_release
+// +build kubernetes_protomessage_one_more_release
+
+/*
+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 go-to-protobuf. DO NOT EDIT.
+
+package v1
+
+func (*AggregationRule) ProtoMessage() {}
+
+func (*ClusterRole) ProtoMessage() {}
+
+func (*ClusterRoleBinding) ProtoMessage() {}
+
+func (*ClusterRoleBindingList) ProtoMessage() {}
+
+func (*ClusterRoleList) ProtoMessage() {}
+
+func (*PolicyRule) ProtoMessage() {}
+
+func (*Role) ProtoMessage() {}
+
+func (*RoleBinding) ProtoMessage() {}
+
+func (*RoleBindingList) ProtoMessage() {}
+
+func (*RoleList) ProtoMessage() {}
+
+func (*RoleRef) ProtoMessage() {}
+
+func (*Subject) ProtoMessage() {}
diff --git a/api/vendor/k8s.io/api/rbac/v1/types.go b/api/vendor/k8s.io/api/rbac/v1/types.go
index f9628b8536a4..2fde11b30640 100644
--- a/api/vendor/k8s.io/api/rbac/v1/types.go
+++ b/api/vendor/k8s.io/api/rbac/v1/types.go
@@ -86,6 +86,8 @@ type Subject struct {
// +optional
APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,2,opt,name=apiGroup"`
// Name of the object being referenced.
+ // +required
+ // +k8s:required
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
// the Authorizer should report an error.
@@ -101,6 +103,8 @@ type RoleRef struct {
// Kind is the type of resource being referenced
Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"`
// Name is the name of resource being referenced
+ // +required
+ // +k8s:required
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
}
diff --git a/api/vendor/k8s.io/api/rbac/v1/zz_generated.model_name.go b/api/vendor/k8s.io/api/rbac/v1/zz_generated.model_name.go
new file mode 100644
index 000000000000..94da8174c578
--- /dev/null
+++ b/api/vendor/k8s.io/api/rbac/v1/zz_generated.model_name.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 openapi-gen. DO NOT EDIT.
+
+package v1
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in AggregationRule) OpenAPIModelName() string {
+ return "io.k8s.api.rbac.v1.AggregationRule"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ClusterRole) OpenAPIModelName() string {
+ return "io.k8s.api.rbac.v1.ClusterRole"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ClusterRoleBinding) OpenAPIModelName() string {
+ return "io.k8s.api.rbac.v1.ClusterRoleBinding"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ClusterRoleBindingList) OpenAPIModelName() string {
+ return "io.k8s.api.rbac.v1.ClusterRoleBindingList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ClusterRoleList) OpenAPIModelName() string {
+ return "io.k8s.api.rbac.v1.ClusterRoleList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PolicyRule) OpenAPIModelName() string {
+ return "io.k8s.api.rbac.v1.PolicyRule"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Role) OpenAPIModelName() string {
+ return "io.k8s.api.rbac.v1.Role"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in RoleBinding) OpenAPIModelName() string {
+ return "io.k8s.api.rbac.v1.RoleBinding"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in RoleBindingList) OpenAPIModelName() string {
+ return "io.k8s.api.rbac.v1.RoleBindingList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in RoleList) OpenAPIModelName() string {
+ return "io.k8s.api.rbac.v1.RoleList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in RoleRef) OpenAPIModelName() string {
+ return "io.k8s.api.rbac.v1.RoleRef"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Subject) OpenAPIModelName() string {
+ return "io.k8s.api.rbac.v1.Subject"
+}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/api/resource/generated.pb.go b/api/vendor/k8s.io/apimachinery/pkg/api/resource/generated.pb.go
index c3a272168e86..9e1a5c0e1fe9 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/api/resource/generated.pb.go
+++ b/api/vendor/k8s.io/apimachinery/pkg/api/resource/generated.pb.go
@@ -19,95 +19,6 @@ limitations under the License.
package resource
-import (
- fmt "fmt"
+func (m *Quantity) Reset() { *m = Quantity{} }
- math "math"
-
- proto "github.com/gogo/protobuf/proto"
-)
-
-// 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 *Quantity) Reset() { *m = Quantity{} }
-func (*Quantity) ProtoMessage() {}
-func (*Quantity) Descriptor() ([]byte, []int) {
- return fileDescriptor_7288c78ff45111e9, []int{0}
-}
-func (m *Quantity) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Quantity.Unmarshal(m, b)
-}
-func (m *Quantity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Quantity.Marshal(b, m, deterministic)
-}
-func (m *Quantity) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Quantity.Merge(m, src)
-}
-func (m *Quantity) XXX_Size() int {
- return xxx_messageInfo_Quantity.Size(m)
-}
-func (m *Quantity) XXX_DiscardUnknown() {
- xxx_messageInfo_Quantity.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Quantity proto.InternalMessageInfo
-
-func (m *QuantityValue) Reset() { *m = QuantityValue{} }
-func (*QuantityValue) ProtoMessage() {}
-func (*QuantityValue) Descriptor() ([]byte, []int) {
- return fileDescriptor_7288c78ff45111e9, []int{1}
-}
-func (m *QuantityValue) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_QuantityValue.Unmarshal(m, b)
-}
-func (m *QuantityValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_QuantityValue.Marshal(b, m, deterministic)
-}
-func (m *QuantityValue) XXX_Merge(src proto.Message) {
- xxx_messageInfo_QuantityValue.Merge(m, src)
-}
-func (m *QuantityValue) XXX_Size() int {
- return xxx_messageInfo_QuantityValue.Size(m)
-}
-func (m *QuantityValue) XXX_DiscardUnknown() {
- xxx_messageInfo_QuantityValue.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_QuantityValue proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*Quantity)(nil), "k8s.io.apimachinery.pkg.api.resource.Quantity")
- proto.RegisterType((*QuantityValue)(nil), "k8s.io.apimachinery.pkg.api.resource.QuantityValue")
-}
-
-func init() {
- proto.RegisterFile("k8s.io/apimachinery/pkg/api/resource/generated.proto", fileDescriptor_7288c78ff45111e9)
-}
-
-var fileDescriptor_7288c78ff45111e9 = []byte{
- // 234 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0xc9, 0xb6, 0x28, 0xd6,
- 0xcb, 0xcc, 0xd7, 0x4f, 0x2c, 0xc8, 0xcc, 0x4d, 0x4c, 0xce, 0xc8, 0xcc, 0x4b, 0x2d, 0xaa, 0xd4,
- 0x2f, 0xc8, 0x4e, 0x07, 0x09, 0xe8, 0x17, 0xa5, 0x16, 0xe7, 0x97, 0x16, 0x25, 0xa7, 0xea, 0xa7,
- 0xa7, 0xe6, 0xa5, 0x16, 0x25, 0x96, 0xa4, 0xa6, 0xe8, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0xa9,
- 0x40, 0x74, 0xe9, 0x21, 0xeb, 0xd2, 0x2b, 0xc8, 0x4e, 0x07, 0x09, 0xe8, 0xc1, 0x74, 0x49, 0xe9,
- 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0xe7, 0xa7, 0xe7, 0xeb,
- 0x83, 0x35, 0x27, 0x95, 0xa6, 0x81, 0x79, 0x60, 0x0e, 0x98, 0x05, 0x31, 0x54, 0xc9, 0x82, 0x8b,
- 0x23, 0xb0, 0x34, 0x31, 0xaf, 0x24, 0xb3, 0xa4, 0x52, 0x48, 0x8c, 0x8b, 0xad, 0xb8, 0xa4, 0x28,
- 0x33, 0x2f, 0x5d, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, 0xca, 0xb3, 0x12, 0x99, 0xb1, 0x40,
- 0x9e, 0xa1, 0x63, 0xa1, 0x3c, 0xc3, 0x84, 0x85, 0xf2, 0x0c, 0x0b, 0x16, 0xca, 0x33, 0x34, 0xdc,
- 0x51, 0x60, 0x50, 0xb2, 0xe5, 0xe2, 0x85, 0xe9, 0x0c, 0x4b, 0xcc, 0x29, 0x4d, 0x25, 0x4d, 0xbb,
- 0x93, 0xd7, 0x89, 0x87, 0x72, 0x0c, 0x17, 0x1e, 0xca, 0x31, 0xdc, 0x78, 0x28, 0xc7, 0xd0, 0xf0,
- 0x48, 0x8e, 0xf1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x6f, 0x3c, 0x92, 0x63, 0x7c,
- 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x28, 0x15, 0x62, 0x42, 0x0a, 0x10, 0x00, 0x00,
- 0xff, 0xff, 0x50, 0x91, 0xd0, 0x9c, 0x50, 0x01, 0x00, 0x00,
-}
+func (m *QuantityValue) Reset() { *m = QuantityValue{} }
diff --git a/api/vendor/k8s.io/apimachinery/pkg/api/resource/generated.proto b/api/vendor/k8s.io/apimachinery/pkg/api/resource/generated.proto
index ddd0db8fbd1b..875ad8577af0 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/api/resource/generated.proto
+++ b/api/vendor/k8s.io/apimachinery/pkg/api/resource/generated.proto
@@ -93,6 +93,7 @@ option go_package = "k8s.io/apimachinery/pkg/api/resource";
// +protobuf.options.(gogoproto.goproto_stringer)=false
// +k8s:deepcopy-gen=true
// +k8s:openapi-gen=true
+// +k8s:openapi-model-package=io.k8s.apimachinery.pkg.api.resource
message Quantity {
optional string string = 1;
}
@@ -105,6 +106,7 @@ message Quantity {
// +protobuf.options.marshal=false
// +protobuf.options.(gogoproto.goproto_stringer)=false
// +k8s:deepcopy-gen=true
+// +k8s:openapi-model-package=io.k8s.apimachinery.pkg.api.resource
message QuantityValue {
optional string string = 1;
}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/api/resource/generated.protomessage.pb.go b/api/vendor/k8s.io/apimachinery/pkg/api/resource/generated.protomessage.pb.go
new file mode 100644
index 000000000000..712e155c3e5e
--- /dev/null
+++ b/api/vendor/k8s.io/apimachinery/pkg/api/resource/generated.protomessage.pb.go
@@ -0,0 +1,26 @@
+//go:build kubernetes_protomessage_one_more_release
+// +build kubernetes_protomessage_one_more_release
+
+/*
+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 go-to-protobuf. DO NOT EDIT.
+
+package resource
+
+func (*Quantity) ProtoMessage() {}
+
+func (*QuantityValue) ProtoMessage() {}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go b/api/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go
index d0aada9dd753..f3cd60060491 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go
+++ b/api/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go
@@ -99,6 +99,7 @@ import (
// +protobuf.options.(gogoproto.goproto_stringer)=false
// +k8s:deepcopy-gen=true
// +k8s:openapi-gen=true
+// +k8s:openapi-model-package=io.k8s.apimachinery.pkg.api.resource
type Quantity struct {
// i is the quantity in int64 scaled form, if d.Dec == nil
i int64Amount
@@ -858,6 +859,7 @@ func (q *Quantity) SetScaled(value int64, scale Scale) {
// +protobuf.options.marshal=false
// +protobuf.options.(gogoproto.goproto_stringer)=false
// +k8s:deepcopy-gen=true
+// +k8s:openapi-model-package=io.k8s.apimachinery.pkg.api.resource
type QuantityValue struct {
Quantity
}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/api/resource/quantity_proto.go b/api/vendor/k8s.io/apimachinery/pkg/api/resource/quantity_proto.go
index 3e0cdb10d409..364ec80da229 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/api/resource/quantity_proto.go
+++ b/api/vendor/k8s.io/apimachinery/pkg/api/resource/quantity_proto.go
@@ -20,12 +20,8 @@ import (
"fmt"
"io"
"math/bits"
-
- "github.com/gogo/protobuf/proto"
)
-var _ proto.Sizer = &Quantity{}
-
func (m *Quantity) Marshal() (data []byte, err error) {
size := m.Size()
data = make([]byte, size)
diff --git a/api/vendor/k8s.io/apimachinery/pkg/api/resource/zz_generated.model_name.go b/api/vendor/k8s.io/apimachinery/pkg/api/resource/zz_generated.model_name.go
new file mode 100644
index 000000000000..2575a2e8c88d
--- /dev/null
+++ b/api/vendor/k8s.io/apimachinery/pkg/api/resource/zz_generated.model_name.go
@@ -0,0 +1,32 @@
+//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 openapi-gen. DO NOT EDIT.
+
+package resource
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Quantity) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.api.resource.Quantity"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in QuantityValue) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.api.resource.QuantityValue"
+}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/api/validate/constraints/constraints.go b/api/vendor/k8s.io/apimachinery/pkg/api/validate/constraints/constraints.go
new file mode 100644
index 000000000000..1689d3c0796d
--- /dev/null
+++ b/api/vendor/k8s.io/apimachinery/pkg/api/validate/constraints/constraints.go
@@ -0,0 +1,32 @@
+/*
+Copyright 2025 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 constraints
+
+// Signed is a constraint that permits any signed integer type.
+type Signed interface {
+ ~int | ~int8 | ~int16 | ~int32 | ~int64
+}
+
+// Unsigned is a constraint that permits any unsigned integer type.
+type Unsigned interface {
+ ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
+}
+
+// Integer is a constraint that permits any integer type.
+type Integer interface {
+ Signed | Unsigned
+}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/api/validate/content/decimal_int.go b/api/vendor/k8s.io/apimachinery/pkg/api/validate/content/decimal_int.go
new file mode 100644
index 000000000000..5622ca15a872
--- /dev/null
+++ b/api/vendor/k8s.io/apimachinery/pkg/api/validate/content/decimal_int.go
@@ -0,0 +1,62 @@
+/*
+Copyright 2025 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 content
+
+const decimalIntegerErrMsg string = "must be a valid decimal integer in canonical form"
+
+// IsDecimalInteger validates that a string represents a decimal integer in strict canonical form.
+// This means the string must be formatted exactly as a human would naturally write an integer,
+// without any programming language conventions like leading zeros, plus signs, or alternate bases.
+//
+// valid values:"0" or Non-zero integers (i.e., "123", "-456") where the first digit is 1-9,
+// followed by any digits 0-9.
+//
+// This validator is stricter than strconv.ParseInt, which accepts leading zeros values (i.e, "0700")
+// and interprets them as decimal 700, potentially causing confusion with octal notation.
+func IsDecimalInteger(value string) []string {
+ n := len(value)
+ if n == 0 {
+ return []string{EmptyError()}
+ }
+
+ i := 0
+ if value[0] == '-' {
+ if n == 1 {
+ return []string{decimalIntegerErrMsg}
+ }
+ i = 1
+ }
+
+ if value[i] == '0' {
+ if n == 1 && i == 0 {
+ return nil
+ }
+ return []string{decimalIntegerErrMsg}
+ }
+
+ if value[i] < '1' || value[i] > '9' {
+ return []string{decimalIntegerErrMsg}
+ }
+
+ for i++; i < n; i++ {
+ if value[i] < '0' || value[i] > '9' {
+ return []string{decimalIntegerErrMsg}
+ }
+ }
+
+ return nil
+}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/api/validate/content/dns.go b/api/vendor/k8s.io/apimachinery/pkg/api/validate/content/dns.go
new file mode 100644
index 000000000000..bd20720794c4
--- /dev/null
+++ b/api/vendor/k8s.io/apimachinery/pkg/api/validate/content/dns.go
@@ -0,0 +1,101 @@
+/*
+Copyright 2025 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 content
+
+import (
+ "regexp"
+)
+
+const dns1123LabelFmt string = "[a-z0-9]([-a-z0-9]*[a-z0-9])?"
+
+const dns1123LabelErrMsg string = "a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character"
+
+// DNS1123LabelMaxLength is a label's max length in DNS (RFC 1123)
+const DNS1123LabelMaxLength int = 63
+
+var dns1123LabelRegexp = regexp.MustCompile("^" + dns1123LabelFmt + "$")
+
+// IsDNS1123Label tests for a string that conforms to the definition of a label in
+// DNS (RFC 1123).
+func IsDNS1123Label(value string) []string {
+ var errs []string
+ if len(value) > DNS1123LabelMaxLength {
+ errs = append(errs, MaxLenError(DNS1123LabelMaxLength))
+ }
+ if !dns1123LabelRegexp.MatchString(value) {
+ if dns1123SubdomainRegexp.MatchString(value) {
+ // It was a valid subdomain and not a valid label. Since we
+ // already checked length, it must be dots.
+ errs = append(errs, "must not contain dots")
+ } else {
+ errs = append(errs, RegexError(dns1123LabelErrMsg, dns1123LabelFmt, "my-name", "123-abc"))
+ }
+ }
+ return errs
+}
+
+const dns1123SubdomainFmt string = dns1123LabelFmt + "(\\." + dns1123LabelFmt + ")*"
+const dns1123SubdomainFmtCaseless string = "(?i)" + dns1123SubdomainFmt
+const dns1123SubdomainErrorMsg string = "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character"
+const dns1123SubdomainCaselessErrorMsg string = "an RFC 1123 subdomain must consist of alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character"
+
+// DNS1123SubdomainMaxLength is a subdomain's max length in DNS (RFC 1123)
+const DNS1123SubdomainMaxLength int = 253
+
+var dns1123SubdomainRegexp = regexp.MustCompile("^" + dns1123SubdomainFmt + "$")
+var dns1123SubdomainCaselessRegexp = regexp.MustCompile("^" + dns1123SubdomainFmtCaseless + "$")
+
+// IsDNS1123Subdomain tests for a string that conforms to the definition of a
+// subdomain in DNS (RFC 1123) lowercase.
+func IsDNS1123Subdomain(value string) []string {
+ return isDNS1123Subdomain(value, false)
+}
+
+// IsDNS1123SubdomainCaseless tests for a string that conforms to the definition of a
+// subdomain in DNS (RFC 1123).
+//
+// Deprecated: API validation should never be caseless. Caseless validation is a vector
+// for bugs and failed uniqueness assumptions. For example, names like "foo.com" and
+// "FOO.COM" are both accepted as valid, but they are typically not treated as equal by
+// consumers (e.g. CSI and DRA driver names). This fails the "least surprise" principle and
+// can cause inconsistent behaviors.
+//
+// Note: This allows uppercase names but is not caseless — uppercase and lowercase are
+// treated as different values. Use IsDNS1123Subdomain for strict, lowercase validation
+// instead.
+func IsDNS1123SubdomainCaseless(value string) []string {
+ return isDNS1123Subdomain(value, true)
+}
+
+func isDNS1123Subdomain(value string, caseless bool) []string {
+ var errs []string
+ if len(value) > DNS1123SubdomainMaxLength {
+ errs = append(errs, MaxLenError(DNS1123SubdomainMaxLength))
+ }
+ errorMsg := dns1123SubdomainErrorMsg
+ example := "example.com"
+ regexp := dns1123SubdomainRegexp
+ if caseless {
+ errorMsg = dns1123SubdomainCaselessErrorMsg
+ example = "Example.com"
+ regexp = dns1123SubdomainCaselessRegexp
+ }
+ if !regexp.MatchString(value) {
+ errs = append(errs, RegexError(errorMsg, dns1123SubdomainFmt, example))
+ }
+ return errs
+}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/api/validate/content/errors.go b/api/vendor/k8s.io/apimachinery/pkg/api/validate/content/errors.go
new file mode 100644
index 000000000000..a4a1b5574c6e
--- /dev/null
+++ b/api/vendor/k8s.io/apimachinery/pkg/api/validate/content/errors.go
@@ -0,0 +1,66 @@
+/*
+Copyright 2014 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 content
+
+import (
+ "fmt"
+ "reflect"
+
+ "k8s.io/apimachinery/pkg/api/validate/constraints"
+)
+
+// MinError returns a string explanation of a "must be greater than or equal"
+// validation failure.
+func MinError[T constraints.Integer](min T) string {
+ return fmt.Sprintf("must be greater than or equal to %d", min)
+}
+
+// MaxLenError returns a string explanation of a "string too long" validation
+// failure.
+func MaxLenError(length int) string {
+ return fmt.Sprintf("must be no more than %d bytes", length)
+}
+
+// EmptyError returns a string explanation of an "empty string" validation.
+func EmptyError() string {
+ return "must be non-empty"
+}
+
+// RegexError returns a string explanation of a regex validation failure.
+func RegexError(msg string, re string, examples ...string) string {
+ if len(examples) == 0 {
+ return msg + " (regex used for validation is '" + re + "')"
+ }
+ msg += " (e.g. "
+ for i := range examples {
+ if i > 0 {
+ msg += " or "
+ }
+ msg += "'" + examples[i] + "', "
+ }
+ msg += "regex used for validation is '" + re + "')"
+ return msg
+}
+
+// NEQError returns a string explanation of a "must not be equal to" validation failure.
+func NEQError[T any](disallowed T) string {
+ format := "%v"
+ if reflect.ValueOf(disallowed).Kind() == reflect.String {
+ format = "%q"
+ }
+ return fmt.Sprintf("must not be equal to "+format, disallowed)
+}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/api/validate/content/identifier.go b/api/vendor/k8s.io/apimachinery/pkg/api/validate/content/identifier.go
new file mode 100644
index 000000000000..3913ec99163a
--- /dev/null
+++ b/api/vendor/k8s.io/apimachinery/pkg/api/validate/content/identifier.go
@@ -0,0 +1,35 @@
+/*
+Copyright 2025 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 content
+
+import (
+ "regexp"
+)
+
+const cIdentifierFmt string = "[A-Za-z_][A-Za-z0-9_]*"
+const identifierErrMsg string = "a valid C identifier must start with alphabetic character or '_', followed by a string of alphanumeric characters or '_'"
+
+var cIdentifierRegexp = regexp.MustCompile("^" + cIdentifierFmt + "$")
+
+// IsCIdentifier tests for a string that conforms the definition of an identifier
+// in C. This checks the format, but not the length.
+func IsCIdentifier(value string) []string {
+ if !cIdentifierRegexp.MatchString(value) {
+ return []string{RegexError(identifierErrMsg, cIdentifierFmt, "my_name", "MY_NAME", "MyName")}
+ }
+ return nil
+}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/api/validate/content/kube.go b/api/vendor/k8s.io/apimachinery/pkg/api/validate/content/kube.go
new file mode 100644
index 000000000000..44e82eefd33e
--- /dev/null
+++ b/api/vendor/k8s.io/apimachinery/pkg/api/validate/content/kube.go
@@ -0,0 +1,101 @@
+/*
+Copyright 2025 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 content
+
+import (
+ "regexp"
+ "strings"
+)
+
+const labelKeyCharFmt string = "[A-Za-z0-9]"
+const labelKeyExtCharFmt string = "[-A-Za-z0-9_.]"
+const labelKeyFmt string = "(" + labelKeyCharFmt + labelKeyExtCharFmt + "*)?" + labelKeyCharFmt
+const labelKeyErrMsg string = "must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character"
+const labelKeyMaxLength int = 63
+
+var labelKeyRegexp = regexp.MustCompile("^" + labelKeyFmt + "$")
+
+// IsQualifiedName tests whether the value passed is what Kubernetes calls a
+// "qualified name", which is the same as a label key.
+//
+// Deprecated: use IsLabelKey instead.
+var IsQualifiedName = IsLabelKey
+
+// IsLabelKey tests whether the value passed is a valid label key. This format
+// is used to validate many fields in the Kubernetes API.
+// Label keys consist of an optional prefix and a name, separated by a '/'.
+// If the value is not valid, a list of error strings is returned. Otherwise, an
+// empty list (or nil) is returned.
+func IsLabelKey(value string) []string {
+ var errs []string
+ parts := strings.Split(value, "/")
+ var name string
+ switch len(parts) {
+ case 1:
+ name = parts[0]
+ case 2:
+ var prefix string
+ prefix, name = parts[0], parts[1]
+ if len(prefix) == 0 {
+ errs = append(errs, "prefix part "+EmptyError())
+ } else if msgs := IsDNS1123Subdomain(prefix); len(msgs) != 0 {
+ errs = append(errs, prefixEach(msgs, "prefix part ")...)
+ }
+ default:
+ return append(errs, "a valid label key "+RegexError(labelKeyErrMsg, labelKeyFmt, "MyName", "my.name", "123-abc")+
+ " with an optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')")
+ }
+
+ if len(name) == 0 {
+ errs = append(errs, "name part "+EmptyError())
+ } else if len(name) > labelKeyMaxLength {
+ errs = append(errs, "name part "+MaxLenError(labelKeyMaxLength))
+ }
+ if !labelKeyRegexp.MatchString(name) {
+ errs = append(errs, "name part "+RegexError(labelKeyErrMsg, labelKeyFmt, "MyName", "my.name", "123-abc"))
+ }
+ return errs
+}
+
+const labelValueFmt string = "(" + labelKeyFmt + ")?"
+const labelValueErrMsg string = "a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character"
+
+// LabelValueMaxLength is a label's max length
+const LabelValueMaxLength int = 63
+
+var labelValueRegexp = regexp.MustCompile("^" + labelValueFmt + "$")
+
+// IsLabelValue tests whether the value passed is a valid label value. If
+// the value is not valid, a list of error strings is returned. Otherwise an
+// empty list (or nil) is returned.
+func IsLabelValue(value string) []string {
+ var errs []string
+ if len(value) > LabelValueMaxLength {
+ errs = append(errs, MaxLenError(LabelValueMaxLength))
+ }
+ if !labelValueRegexp.MatchString(value) {
+ errs = append(errs, RegexError(labelValueErrMsg, labelValueFmt, "MyValue", "my_value", "12345"))
+ }
+ return errs
+}
+
+func prefixEach(msgs []string, prefix string) []string {
+ for i := range msgs {
+ msgs[i] = prefix + msgs[i]
+ }
+ return msgs
+}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/doc.go b/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/doc.go
index 617b9a5d30f5..31c87361f63b 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/doc.go
+++ b/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/doc.go
@@ -18,6 +18,7 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:openapi-gen=true
// +k8s:defaulter-gen=TypeMeta
+// +k8s:openapi-model-package=io.k8s.apimachinery.pkg.apis.meta.v1
// +groupName=meta.k8s.io
diff --git a/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go b/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go
index 9ee6c0591853..f6b1a6a4e06b 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go
+++ b/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go
@@ -23,12 +23,10 @@ import (
fmt "fmt"
io "io"
+ "sort"
- proto "github.com/gogo/protobuf/proto"
- github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
runtime "k8s.io/apimachinery/pkg/runtime"
- math "math"
math_bits "math/bits"
reflect "reflect"
strings "strings"
@@ -37,1509 +35,95 @@ import (
k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types"
)
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-var _ = time.Kitchen
-
-// 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 *APIGroup) Reset() { *m = APIGroup{} }
-func (*APIGroup) ProtoMessage() {}
-func (*APIGroup) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{0}
-}
-func (m *APIGroup) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *APIGroup) 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 *APIGroup) XXX_Merge(src proto.Message) {
- xxx_messageInfo_APIGroup.Merge(m, src)
-}
-func (m *APIGroup) XXX_Size() int {
- return m.Size()
-}
-func (m *APIGroup) XXX_DiscardUnknown() {
- xxx_messageInfo_APIGroup.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_APIGroup proto.InternalMessageInfo
-
-func (m *APIGroupList) Reset() { *m = APIGroupList{} }
-func (*APIGroupList) ProtoMessage() {}
-func (*APIGroupList) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{1}
-}
-func (m *APIGroupList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *APIGroupList) 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 *APIGroupList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_APIGroupList.Merge(m, src)
-}
-func (m *APIGroupList) XXX_Size() int {
- return m.Size()
-}
-func (m *APIGroupList) XXX_DiscardUnknown() {
- xxx_messageInfo_APIGroupList.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_APIGroupList proto.InternalMessageInfo
-
-func (m *APIResource) Reset() { *m = APIResource{} }
-func (*APIResource) ProtoMessage() {}
-func (*APIResource) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{2}
-}
-func (m *APIResource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *APIResource) 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 *APIResource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_APIResource.Merge(m, src)
-}
-func (m *APIResource) XXX_Size() int {
- return m.Size()
-}
-func (m *APIResource) XXX_DiscardUnknown() {
- xxx_messageInfo_APIResource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_APIResource proto.InternalMessageInfo
-
-func (m *APIResourceList) Reset() { *m = APIResourceList{} }
-func (*APIResourceList) ProtoMessage() {}
-func (*APIResourceList) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{3}
-}
-func (m *APIResourceList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *APIResourceList) 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 *APIResourceList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_APIResourceList.Merge(m, src)
-}
-func (m *APIResourceList) XXX_Size() int {
- return m.Size()
-}
-func (m *APIResourceList) XXX_DiscardUnknown() {
- xxx_messageInfo_APIResourceList.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_APIResourceList proto.InternalMessageInfo
-
-func (m *APIVersions) Reset() { *m = APIVersions{} }
-func (*APIVersions) ProtoMessage() {}
-func (*APIVersions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{4}
-}
-func (m *APIVersions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *APIVersions) 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 *APIVersions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_APIVersions.Merge(m, src)
-}
-func (m *APIVersions) XXX_Size() int {
- return m.Size()
-}
-func (m *APIVersions) XXX_DiscardUnknown() {
- xxx_messageInfo_APIVersions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_APIVersions proto.InternalMessageInfo
-
-func (m *ApplyOptions) Reset() { *m = ApplyOptions{} }
-func (*ApplyOptions) ProtoMessage() {}
-func (*ApplyOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{5}
-}
-func (m *ApplyOptions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ApplyOptions) 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 *ApplyOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ApplyOptions.Merge(m, src)
-}
-func (m *ApplyOptions) XXX_Size() int {
- return m.Size()
-}
-func (m *ApplyOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_ApplyOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ApplyOptions proto.InternalMessageInfo
-
-func (m *Condition) Reset() { *m = Condition{} }
-func (*Condition) ProtoMessage() {}
-func (*Condition) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{6}
-}
-func (m *Condition) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Condition) 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 *Condition) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Condition.Merge(m, src)
-}
-func (m *Condition) XXX_Size() int {
- return m.Size()
-}
-func (m *Condition) XXX_DiscardUnknown() {
- xxx_messageInfo_Condition.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Condition proto.InternalMessageInfo
-
-func (m *CreateOptions) Reset() { *m = CreateOptions{} }
-func (*CreateOptions) ProtoMessage() {}
-func (*CreateOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{7}
-}
-func (m *CreateOptions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CreateOptions) 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 *CreateOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CreateOptions.Merge(m, src)
-}
-func (m *CreateOptions) XXX_Size() int {
- return m.Size()
-}
-func (m *CreateOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_CreateOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CreateOptions proto.InternalMessageInfo
-
-func (m *DeleteOptions) Reset() { *m = DeleteOptions{} }
-func (*DeleteOptions) ProtoMessage() {}
-func (*DeleteOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{8}
-}
-func (m *DeleteOptions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *DeleteOptions) 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 *DeleteOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DeleteOptions.Merge(m, src)
-}
-func (m *DeleteOptions) XXX_Size() int {
- return m.Size()
-}
-func (m *DeleteOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_DeleteOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DeleteOptions proto.InternalMessageInfo
-
-func (m *Duration) Reset() { *m = Duration{} }
-func (*Duration) ProtoMessage() {}
-func (*Duration) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{9}
-}
-func (m *Duration) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Duration) 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 *Duration) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Duration.Merge(m, src)
-}
-func (m *Duration) XXX_Size() int {
- return m.Size()
-}
-func (m *Duration) XXX_DiscardUnknown() {
- xxx_messageInfo_Duration.DiscardUnknown(m)
-}
-
-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{11}
-}
-func (m *FieldsV1) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *FieldsV1) 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 *FieldsV1) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FieldsV1.Merge(m, src)
-}
-func (m *FieldsV1) XXX_Size() int {
- return m.Size()
-}
-func (m *FieldsV1) XXX_DiscardUnknown() {
- xxx_messageInfo_FieldsV1.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FieldsV1 proto.InternalMessageInfo
-
-func (m *GetOptions) Reset() { *m = GetOptions{} }
-func (*GetOptions) ProtoMessage() {}
-func (*GetOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{12}
-}
-func (m *GetOptions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *GetOptions) 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 *GetOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GetOptions.Merge(m, src)
-}
-func (m *GetOptions) XXX_Size() int {
- return m.Size()
-}
-func (m *GetOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_GetOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GetOptions proto.InternalMessageInfo
-
-func (m *GroupKind) Reset() { *m = GroupKind{} }
-func (*GroupKind) ProtoMessage() {}
-func (*GroupKind) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{13}
-}
-func (m *GroupKind) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *GroupKind) 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 *GroupKind) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GroupKind.Merge(m, src)
-}
-func (m *GroupKind) XXX_Size() int {
- return m.Size()
-}
-func (m *GroupKind) XXX_DiscardUnknown() {
- xxx_messageInfo_GroupKind.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GroupKind proto.InternalMessageInfo
-
-func (m *GroupResource) Reset() { *m = GroupResource{} }
-func (*GroupResource) ProtoMessage() {}
-func (*GroupResource) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{14}
-}
-func (m *GroupResource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *GroupResource) 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 *GroupResource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GroupResource.Merge(m, src)
-}
-func (m *GroupResource) XXX_Size() int {
- return m.Size()
-}
-func (m *GroupResource) XXX_DiscardUnknown() {
- xxx_messageInfo_GroupResource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GroupResource proto.InternalMessageInfo
-
-func (m *GroupVersion) Reset() { *m = GroupVersion{} }
-func (*GroupVersion) ProtoMessage() {}
-func (*GroupVersion) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{15}
-}
-func (m *GroupVersion) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *GroupVersion) 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 *GroupVersion) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GroupVersion.Merge(m, src)
-}
-func (m *GroupVersion) XXX_Size() int {
- return m.Size()
-}
-func (m *GroupVersion) XXX_DiscardUnknown() {
- xxx_messageInfo_GroupVersion.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GroupVersion proto.InternalMessageInfo
-
-func (m *GroupVersionForDiscovery) Reset() { *m = GroupVersionForDiscovery{} }
-func (*GroupVersionForDiscovery) ProtoMessage() {}
-func (*GroupVersionForDiscovery) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{16}
-}
-func (m *GroupVersionForDiscovery) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *GroupVersionForDiscovery) 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 *GroupVersionForDiscovery) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GroupVersionForDiscovery.Merge(m, src)
-}
-func (m *GroupVersionForDiscovery) XXX_Size() int {
- return m.Size()
-}
-func (m *GroupVersionForDiscovery) XXX_DiscardUnknown() {
- xxx_messageInfo_GroupVersionForDiscovery.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GroupVersionForDiscovery proto.InternalMessageInfo
-
-func (m *GroupVersionKind) Reset() { *m = GroupVersionKind{} }
-func (*GroupVersionKind) ProtoMessage() {}
-func (*GroupVersionKind) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{17}
-}
-func (m *GroupVersionKind) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *GroupVersionKind) 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 *GroupVersionKind) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GroupVersionKind.Merge(m, src)
-}
-func (m *GroupVersionKind) XXX_Size() int {
- return m.Size()
-}
-func (m *GroupVersionKind) XXX_DiscardUnknown() {
- xxx_messageInfo_GroupVersionKind.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GroupVersionKind proto.InternalMessageInfo
-
-func (m *GroupVersionResource) Reset() { *m = GroupVersionResource{} }
-func (*GroupVersionResource) ProtoMessage() {}
-func (*GroupVersionResource) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{18}
-}
-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 *LabelSelector) Reset() { *m = LabelSelector{} }
-func (*LabelSelector) ProtoMessage() {}
-func (*LabelSelector) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{19}
-}
-func (m *LabelSelector) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *LabelSelector) 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 *LabelSelector) XXX_Merge(src proto.Message) {
- xxx_messageInfo_LabelSelector.Merge(m, src)
-}
-func (m *LabelSelector) XXX_Size() int {
- return m.Size()
-}
-func (m *LabelSelector) XXX_DiscardUnknown() {
- xxx_messageInfo_LabelSelector.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_LabelSelector proto.InternalMessageInfo
-
-func (m *LabelSelectorRequirement) Reset() { *m = LabelSelectorRequirement{} }
-func (*LabelSelectorRequirement) ProtoMessage() {}
-func (*LabelSelectorRequirement) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{20}
-}
-func (m *LabelSelectorRequirement) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *LabelSelectorRequirement) 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 *LabelSelectorRequirement) XXX_Merge(src proto.Message) {
- xxx_messageInfo_LabelSelectorRequirement.Merge(m, src)
-}
-func (m *LabelSelectorRequirement) XXX_Size() int {
- return m.Size()
-}
-func (m *LabelSelectorRequirement) XXX_DiscardUnknown() {
- xxx_messageInfo_LabelSelectorRequirement.DiscardUnknown(m)
-}
+func (m *APIGroup) Reset() { *m = APIGroup{} }
-var xxx_messageInfo_LabelSelectorRequirement proto.InternalMessageInfo
+func (m *APIGroupList) Reset() { *m = APIGroupList{} }
-func (m *List) Reset() { *m = List{} }
-func (*List) ProtoMessage() {}
-func (*List) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{21}
-}
-func (m *List) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *List) 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 *List) XXX_Merge(src proto.Message) {
- xxx_messageInfo_List.Merge(m, src)
-}
-func (m *List) XXX_Size() int {
- return m.Size()
-}
-func (m *List) XXX_DiscardUnknown() {
- xxx_messageInfo_List.DiscardUnknown(m)
-}
+func (m *APIResource) Reset() { *m = APIResource{} }
-var xxx_messageInfo_List proto.InternalMessageInfo
+func (m *APIResourceList) Reset() { *m = APIResourceList{} }
-func (m *ListMeta) Reset() { *m = ListMeta{} }
-func (*ListMeta) ProtoMessage() {}
-func (*ListMeta) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{22}
-}
-func (m *ListMeta) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListMeta) 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 *ListMeta) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListMeta.Merge(m, src)
-}
-func (m *ListMeta) XXX_Size() int {
- return m.Size()
-}
-func (m *ListMeta) XXX_DiscardUnknown() {
- xxx_messageInfo_ListMeta.DiscardUnknown(m)
-}
+func (m *APIVersions) Reset() { *m = APIVersions{} }
-var xxx_messageInfo_ListMeta proto.InternalMessageInfo
+func (m *ApplyOptions) Reset() { *m = ApplyOptions{} }
-func (m *ListOptions) Reset() { *m = ListOptions{} }
-func (*ListOptions) ProtoMessage() {}
-func (*ListOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{23}
-}
-func (m *ListOptions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListOptions) 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 *ListOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListOptions.Merge(m, src)
-}
-func (m *ListOptions) XXX_Size() int {
- return m.Size()
-}
-func (m *ListOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_ListOptions.DiscardUnknown(m)
-}
+func (m *Condition) Reset() { *m = Condition{} }
-var xxx_messageInfo_ListOptions proto.InternalMessageInfo
+func (m *CreateOptions) Reset() { *m = CreateOptions{} }
-func (m *ManagedFieldsEntry) Reset() { *m = ManagedFieldsEntry{} }
-func (*ManagedFieldsEntry) ProtoMessage() {}
-func (*ManagedFieldsEntry) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{24}
-}
-func (m *ManagedFieldsEntry) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ManagedFieldsEntry) 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 *ManagedFieldsEntry) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ManagedFieldsEntry.Merge(m, src)
-}
-func (m *ManagedFieldsEntry) XXX_Size() int {
- return m.Size()
-}
-func (m *ManagedFieldsEntry) XXX_DiscardUnknown() {
- xxx_messageInfo_ManagedFieldsEntry.DiscardUnknown(m)
-}
+func (m *DeleteOptions) Reset() { *m = DeleteOptions{} }
-var xxx_messageInfo_ManagedFieldsEntry proto.InternalMessageInfo
+func (m *Duration) Reset() { *m = Duration{} }
-func (m *MicroTime) Reset() { *m = MicroTime{} }
-func (*MicroTime) ProtoMessage() {}
-func (*MicroTime) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{25}
-}
-func (m *MicroTime) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_MicroTime.Unmarshal(m, b)
-}
-func (m *MicroTime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_MicroTime.Marshal(b, m, deterministic)
-}
-func (m *MicroTime) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MicroTime.Merge(m, src)
-}
-func (m *MicroTime) XXX_Size() int {
- return xxx_messageInfo_MicroTime.Size(m)
-}
-func (m *MicroTime) XXX_DiscardUnknown() {
- xxx_messageInfo_MicroTime.DiscardUnknown(m)
-}
+func (m *FieldSelectorRequirement) Reset() { *m = FieldSelectorRequirement{} }
-var xxx_messageInfo_MicroTime proto.InternalMessageInfo
+func (m *FieldsV1) Reset() { *m = FieldsV1{} }
-func (m *ObjectMeta) Reset() { *m = ObjectMeta{} }
-func (*ObjectMeta) ProtoMessage() {}
-func (*ObjectMeta) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{26}
-}
-func (m *ObjectMeta) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ObjectMeta) 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 *ObjectMeta) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ObjectMeta.Merge(m, src)
-}
-func (m *ObjectMeta) XXX_Size() int {
- return m.Size()
-}
-func (m *ObjectMeta) XXX_DiscardUnknown() {
- xxx_messageInfo_ObjectMeta.DiscardUnknown(m)
-}
+func (m *GetOptions) Reset() { *m = GetOptions{} }
-var xxx_messageInfo_ObjectMeta proto.InternalMessageInfo
+func (m *GroupKind) Reset() { *m = GroupKind{} }
-func (m *OwnerReference) Reset() { *m = OwnerReference{} }
-func (*OwnerReference) ProtoMessage() {}
-func (*OwnerReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{27}
-}
-func (m *OwnerReference) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *OwnerReference) 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 *OwnerReference) XXX_Merge(src proto.Message) {
- xxx_messageInfo_OwnerReference.Merge(m, src)
-}
-func (m *OwnerReference) XXX_Size() int {
- return m.Size()
-}
-func (m *OwnerReference) XXX_DiscardUnknown() {
- xxx_messageInfo_OwnerReference.DiscardUnknown(m)
-}
+func (m *GroupResource) Reset() { *m = GroupResource{} }
-var xxx_messageInfo_OwnerReference proto.InternalMessageInfo
+func (m *GroupVersion) Reset() { *m = GroupVersion{} }
-func (m *PartialObjectMetadata) Reset() { *m = PartialObjectMetadata{} }
-func (*PartialObjectMetadata) ProtoMessage() {}
-func (*PartialObjectMetadata) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{28}
-}
-func (m *PartialObjectMetadata) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PartialObjectMetadata) 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 *PartialObjectMetadata) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PartialObjectMetadata.Merge(m, src)
-}
-func (m *PartialObjectMetadata) XXX_Size() int {
- return m.Size()
-}
-func (m *PartialObjectMetadata) XXX_DiscardUnknown() {
- xxx_messageInfo_PartialObjectMetadata.DiscardUnknown(m)
-}
+func (m *GroupVersionForDiscovery) Reset() { *m = GroupVersionForDiscovery{} }
-var xxx_messageInfo_PartialObjectMetadata proto.InternalMessageInfo
+func (m *GroupVersionKind) Reset() { *m = GroupVersionKind{} }
-func (m *PartialObjectMetadataList) Reset() { *m = PartialObjectMetadataList{} }
-func (*PartialObjectMetadataList) ProtoMessage() {}
-func (*PartialObjectMetadataList) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{29}
-}
-func (m *PartialObjectMetadataList) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PartialObjectMetadataList) 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 *PartialObjectMetadataList) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PartialObjectMetadataList.Merge(m, src)
-}
-func (m *PartialObjectMetadataList) XXX_Size() int {
- return m.Size()
-}
-func (m *PartialObjectMetadataList) XXX_DiscardUnknown() {
- xxx_messageInfo_PartialObjectMetadataList.DiscardUnknown(m)
-}
+func (m *GroupVersionResource) Reset() { *m = GroupVersionResource{} }
-var xxx_messageInfo_PartialObjectMetadataList proto.InternalMessageInfo
+func (m *LabelSelector) Reset() { *m = LabelSelector{} }
-func (m *Patch) Reset() { *m = Patch{} }
-func (*Patch) ProtoMessage() {}
-func (*Patch) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{30}
-}
-func (m *Patch) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Patch) 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 *Patch) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Patch.Merge(m, src)
-}
-func (m *Patch) XXX_Size() int {
- return m.Size()
-}
-func (m *Patch) XXX_DiscardUnknown() {
- xxx_messageInfo_Patch.DiscardUnknown(m)
-}
+func (m *LabelSelectorRequirement) Reset() { *m = LabelSelectorRequirement{} }
-var xxx_messageInfo_Patch proto.InternalMessageInfo
+func (m *List) Reset() { *m = List{} }
-func (m *PatchOptions) Reset() { *m = PatchOptions{} }
-func (*PatchOptions) ProtoMessage() {}
-func (*PatchOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{31}
-}
-func (m *PatchOptions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PatchOptions) 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 *PatchOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PatchOptions.Merge(m, src)
-}
-func (m *PatchOptions) XXX_Size() int {
- return m.Size()
-}
-func (m *PatchOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_PatchOptions.DiscardUnknown(m)
-}
+func (m *ListMeta) Reset() { *m = ListMeta{} }
-var xxx_messageInfo_PatchOptions proto.InternalMessageInfo
+func (m *ListOptions) Reset() { *m = ListOptions{} }
-func (m *Preconditions) Reset() { *m = Preconditions{} }
-func (*Preconditions) ProtoMessage() {}
-func (*Preconditions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{32}
-}
-func (m *Preconditions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Preconditions) 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 *Preconditions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Preconditions.Merge(m, src)
-}
-func (m *Preconditions) XXX_Size() int {
- return m.Size()
-}
-func (m *Preconditions) XXX_DiscardUnknown() {
- xxx_messageInfo_Preconditions.DiscardUnknown(m)
-}
+func (m *ManagedFieldsEntry) Reset() { *m = ManagedFieldsEntry{} }
-var xxx_messageInfo_Preconditions proto.InternalMessageInfo
+func (m *MicroTime) Reset() { *m = MicroTime{} }
-func (m *RootPaths) Reset() { *m = RootPaths{} }
-func (*RootPaths) ProtoMessage() {}
-func (*RootPaths) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{33}
-}
-func (m *RootPaths) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *RootPaths) 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 *RootPaths) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RootPaths.Merge(m, src)
-}
-func (m *RootPaths) XXX_Size() int {
- return m.Size()
-}
-func (m *RootPaths) XXX_DiscardUnknown() {
- xxx_messageInfo_RootPaths.DiscardUnknown(m)
-}
+func (m *ObjectMeta) Reset() { *m = ObjectMeta{} }
-var xxx_messageInfo_RootPaths proto.InternalMessageInfo
+func (m *OwnerReference) Reset() { *m = OwnerReference{} }
-func (m *ServerAddressByClientCIDR) Reset() { *m = ServerAddressByClientCIDR{} }
-func (*ServerAddressByClientCIDR) ProtoMessage() {}
-func (*ServerAddressByClientCIDR) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{34}
-}
-func (m *ServerAddressByClientCIDR) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ServerAddressByClientCIDR) 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 *ServerAddressByClientCIDR) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ServerAddressByClientCIDR.Merge(m, src)
-}
-func (m *ServerAddressByClientCIDR) XXX_Size() int {
- return m.Size()
-}
-func (m *ServerAddressByClientCIDR) XXX_DiscardUnknown() {
- xxx_messageInfo_ServerAddressByClientCIDR.DiscardUnknown(m)
-}
+func (m *PartialObjectMetadata) Reset() { *m = PartialObjectMetadata{} }
-var xxx_messageInfo_ServerAddressByClientCIDR proto.InternalMessageInfo
+func (m *PartialObjectMetadataList) Reset() { *m = PartialObjectMetadataList{} }
-func (m *Status) Reset() { *m = Status{} }
-func (*Status) ProtoMessage() {}
-func (*Status) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{35}
-}
-func (m *Status) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Status) 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 *Status) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Status.Merge(m, src)
-}
-func (m *Status) XXX_Size() int {
- return m.Size()
-}
-func (m *Status) XXX_DiscardUnknown() {
- xxx_messageInfo_Status.DiscardUnknown(m)
-}
+func (m *Patch) Reset() { *m = Patch{} }
-var xxx_messageInfo_Status proto.InternalMessageInfo
+func (m *PatchOptions) Reset() { *m = PatchOptions{} }
-func (m *StatusCause) Reset() { *m = StatusCause{} }
-func (*StatusCause) ProtoMessage() {}
-func (*StatusCause) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{36}
-}
-func (m *StatusCause) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *StatusCause) 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 *StatusCause) XXX_Merge(src proto.Message) {
- xxx_messageInfo_StatusCause.Merge(m, src)
-}
-func (m *StatusCause) XXX_Size() int {
- return m.Size()
-}
-func (m *StatusCause) XXX_DiscardUnknown() {
- xxx_messageInfo_StatusCause.DiscardUnknown(m)
-}
+func (m *Preconditions) Reset() { *m = Preconditions{} }
-var xxx_messageInfo_StatusCause proto.InternalMessageInfo
+func (m *RootPaths) Reset() { *m = RootPaths{} }
-func (m *StatusDetails) Reset() { *m = StatusDetails{} }
-func (*StatusDetails) ProtoMessage() {}
-func (*StatusDetails) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{37}
-}
-func (m *StatusDetails) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *StatusDetails) 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 *StatusDetails) XXX_Merge(src proto.Message) {
- xxx_messageInfo_StatusDetails.Merge(m, src)
-}
-func (m *StatusDetails) XXX_Size() int {
- return m.Size()
-}
-func (m *StatusDetails) XXX_DiscardUnknown() {
- xxx_messageInfo_StatusDetails.DiscardUnknown(m)
-}
+func (m *ServerAddressByClientCIDR) Reset() { *m = ServerAddressByClientCIDR{} }
-var xxx_messageInfo_StatusDetails proto.InternalMessageInfo
+func (m *Status) Reset() { *m = Status{} }
-func (m *TableOptions) Reset() { *m = TableOptions{} }
-func (*TableOptions) ProtoMessage() {}
-func (*TableOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{38}
-}
-func (m *TableOptions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TableOptions) 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 *TableOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TableOptions.Merge(m, src)
-}
-func (m *TableOptions) XXX_Size() int {
- return m.Size()
-}
-func (m *TableOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_TableOptions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TableOptions proto.InternalMessageInfo
-
-func (m *Time) Reset() { *m = Time{} }
-func (*Time) ProtoMessage() {}
-func (*Time) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{39}
-}
-func (m *Time) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Time.Unmarshal(m, b)
-}
-func (m *Time) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Time.Marshal(b, m, deterministic)
-}
-func (m *Time) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Time.Merge(m, src)
-}
-func (m *Time) XXX_Size() int {
- return xxx_messageInfo_Time.Size(m)
-}
-func (m *Time) XXX_DiscardUnknown() {
- xxx_messageInfo_Time.DiscardUnknown(m)
-}
+func (m *StatusCause) Reset() { *m = StatusCause{} }
-var xxx_messageInfo_Time proto.InternalMessageInfo
+func (m *StatusDetails) Reset() { *m = StatusDetails{} }
-func (m *Timestamp) Reset() { *m = Timestamp{} }
-func (*Timestamp) ProtoMessage() {}
-func (*Timestamp) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{40}
-}
-func (m *Timestamp) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Timestamp) 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 *Timestamp) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Timestamp.Merge(m, src)
-}
-func (m *Timestamp) XXX_Size() int {
- return m.Size()
-}
-func (m *Timestamp) XXX_DiscardUnknown() {
- xxx_messageInfo_Timestamp.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Timestamp proto.InternalMessageInfo
-
-func (m *TypeMeta) Reset() { *m = TypeMeta{} }
-func (*TypeMeta) ProtoMessage() {}
-func (*TypeMeta) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{41}
-}
-func (m *TypeMeta) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TypeMeta) 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 *TypeMeta) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TypeMeta.Merge(m, src)
-}
-func (m *TypeMeta) XXX_Size() int {
- return m.Size()
-}
-func (m *TypeMeta) XXX_DiscardUnknown() {
- xxx_messageInfo_TypeMeta.DiscardUnknown(m)
-}
+func (m *TableOptions) Reset() { *m = TableOptions{} }
-var xxx_messageInfo_TypeMeta proto.InternalMessageInfo
+func (m *Time) Reset() { *m = Time{} }
-func (m *UpdateOptions) Reset() { *m = UpdateOptions{} }
-func (*UpdateOptions) ProtoMessage() {}
-func (*UpdateOptions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{42}
-}
-func (m *UpdateOptions) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *UpdateOptions) 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 *UpdateOptions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UpdateOptions.Merge(m, src)
-}
-func (m *UpdateOptions) XXX_Size() int {
- return m.Size()
-}
-func (m *UpdateOptions) XXX_DiscardUnknown() {
- xxx_messageInfo_UpdateOptions.DiscardUnknown(m)
-}
+func (m *Timestamp) Reset() { *m = Timestamp{} }
-var xxx_messageInfo_UpdateOptions proto.InternalMessageInfo
+func (m *TypeMeta) Reset() { *m = TypeMeta{} }
-func (m *Verbs) Reset() { *m = Verbs{} }
-func (*Verbs) ProtoMessage() {}
-func (*Verbs) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{43}
-}
-func (m *Verbs) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Verbs) 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 *Verbs) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Verbs.Merge(m, src)
-}
-func (m *Verbs) XXX_Size() int {
- return m.Size()
-}
-func (m *Verbs) XXX_DiscardUnknown() {
- xxx_messageInfo_Verbs.DiscardUnknown(m)
-}
+func (m *UpdateOptions) Reset() { *m = UpdateOptions{} }
-var xxx_messageInfo_Verbs proto.InternalMessageInfo
+func (m *Verbs) Reset() { *m = Verbs{} }
-func (m *WatchEvent) Reset() { *m = WatchEvent{} }
-func (*WatchEvent) ProtoMessage() {}
-func (*WatchEvent) Descriptor() ([]byte, []int) {
- return fileDescriptor_a8431b6e0aeeb761, []int{44}
-}
-func (m *WatchEvent) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *WatchEvent) 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 *WatchEvent) XXX_Merge(src proto.Message) {
- xxx_messageInfo_WatchEvent.Merge(m, src)
-}
-func (m *WatchEvent) XXX_Size() int {
- return m.Size()
-}
-func (m *WatchEvent) XXX_DiscardUnknown() {
- xxx_messageInfo_WatchEvent.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_WatchEvent proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*APIGroup)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.APIGroup")
- proto.RegisterType((*APIGroupList)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.APIGroupList")
- proto.RegisterType((*APIResource)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.APIResource")
- proto.RegisterType((*APIResourceList)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.APIResourceList")
- proto.RegisterType((*APIVersions)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.APIVersions")
- proto.RegisterType((*ApplyOptions)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.ApplyOptions")
- proto.RegisterType((*Condition)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.Condition")
- 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")
- proto.RegisterType((*GroupResource)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.GroupResource")
- proto.RegisterType((*GroupVersion)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersion")
- proto.RegisterType((*GroupVersionForDiscovery)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionForDiscovery")
- proto.RegisterType((*GroupVersionKind)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind")
- proto.RegisterType((*GroupVersionResource)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource")
- proto.RegisterType((*LabelSelector)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector")
- proto.RegisterMapType((map[string]string)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector.MatchLabelsEntry")
- proto.RegisterType((*LabelSelectorRequirement)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement")
- proto.RegisterType((*List)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.List")
- proto.RegisterType((*ListMeta)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta")
- proto.RegisterType((*ListOptions)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.ListOptions")
- proto.RegisterType((*ManagedFieldsEntry)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry")
- proto.RegisterType((*MicroTime)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime")
- proto.RegisterType((*ObjectMeta)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta")
- proto.RegisterMapType((map[string]string)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta.AnnotationsEntry")
- proto.RegisterMapType((map[string]string)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta.LabelsEntry")
- proto.RegisterType((*OwnerReference)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.OwnerReference")
- proto.RegisterType((*PartialObjectMetadata)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.PartialObjectMetadata")
- proto.RegisterType((*PartialObjectMetadataList)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.PartialObjectMetadataList")
- proto.RegisterType((*Patch)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.Patch")
- proto.RegisterType((*PatchOptions)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.PatchOptions")
- proto.RegisterType((*Preconditions)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.Preconditions")
- proto.RegisterType((*RootPaths)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.RootPaths")
- proto.RegisterType((*ServerAddressByClientCIDR)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.ServerAddressByClientCIDR")
- proto.RegisterType((*Status)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.Status")
- proto.RegisterType((*StatusCause)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.StatusCause")
- proto.RegisterType((*StatusDetails)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.StatusDetails")
- proto.RegisterType((*TableOptions)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.TableOptions")
- proto.RegisterType((*Time)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.Time")
- proto.RegisterType((*Timestamp)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.Timestamp")
- proto.RegisterType((*TypeMeta)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta")
- proto.RegisterType((*UpdateOptions)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.UpdateOptions")
- proto.RegisterType((*Verbs)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.Verbs")
- proto.RegisterType((*WatchEvent)(nil), "k8s.io.apimachinery.pkg.apis.meta.v1.WatchEvent")
-}
-
-func init() {
- proto.RegisterFile("k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto", fileDescriptor_a8431b6e0aeeb761)
-}
-
-var fileDescriptor_a8431b6e0aeeb761 = []byte{
- // 2928 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x3a, 0x4d, 0x6c, 0x24, 0x47,
- 0xd5, 0xee, 0xf9, 0xb1, 0x67, 0xde, 0x78, 0xfc, 0x53, 0xeb, 0xfd, 0xbe, 0x59, 0x23, 0x3c, 0x4e,
- 0x27, 0x8a, 0x36, 0x90, 0x8c, 0x77, 0x97, 0x25, 0xda, 0x6c, 0x48, 0xc0, 0xe3, 0x59, 0x6f, 0x9c,
- 0xac, 0x63, 0xab, 0xbc, 0xbb, 0x81, 0x10, 0xa1, 0x94, 0xa7, 0xcb, 0xe3, 0xc6, 0x3d, 0xdd, 0x93,
- 0xaa, 0x1e, 0x6f, 0x06, 0x0e, 0xe4, 0x00, 0x12, 0x48, 0x28, 0x0a, 0x37, 0x4e, 0x28, 0x11, 0x9c,
- 0x38, 0x21, 0x4e, 0xdc, 0x41, 0x22, 0xc7, 0x20, 0x2e, 0x91, 0x40, 0xa3, 0xac, 0x39, 0x70, 0x44,
- 0x5c, 0x2d, 0x24, 0x50, 0xfd, 0xf4, 0xdf, 0xfc, 0xac, 0x7b, 0x76, 0x97, 0x88, 0xdb, 0xf4, 0xfb,
- 0xaf, 0xaa, 0xf7, 0x5e, 0xbd, 0xf7, 0x6a, 0xe0, 0xea, 0xd1, 0x35, 0x5e, 0xb3, 0xbd, 0x35, 0xd2,
- 0xb1, 0xdb, 0xa4, 0x79, 0x68, 0xbb, 0x94, 0xf5, 0xd6, 0x3a, 0x47, 0x2d, 0x01, 0xe0, 0x6b, 0x6d,
- 0xea, 0x93, 0xb5, 0xe3, 0xcb, 0x6b, 0x2d, 0xea, 0x52, 0x46, 0x7c, 0x6a, 0xd5, 0x3a, 0xcc, 0xf3,
- 0x3d, 0xf4, 0x94, 0xe2, 0xaa, 0xc5, 0xb9, 0x6a, 0x9d, 0xa3, 0x96, 0x00, 0xf0, 0x9a, 0xe0, 0xaa,
- 0x1d, 0x5f, 0x5e, 0x7e, 0xae, 0x65, 0xfb, 0x87, 0xdd, 0xfd, 0x5a, 0xd3, 0x6b, 0xaf, 0xb5, 0xbc,
- 0x96, 0xb7, 0x26, 0x99, 0xf7, 0xbb, 0x07, 0xf2, 0x4b, 0x7e, 0xc8, 0x5f, 0x4a, 0xe8, 0xf2, 0xda,
- 0x38, 0x53, 0x58, 0xd7, 0xf5, 0xed, 0x36, 0x1d, 0xb4, 0x62, 0xf9, 0xf9, 0xb3, 0x18, 0x78, 0xf3,
- 0x90, 0xb6, 0xc9, 0x20, 0x9f, 0xf9, 0xc7, 0x2c, 0x14, 0xd6, 0x77, 0xb7, 0x6e, 0x32, 0xaf, 0xdb,
- 0x41, 0xab, 0x90, 0x73, 0x49, 0x9b, 0x56, 0x8c, 0x55, 0xe3, 0x62, 0xb1, 0x3e, 0xfb, 0x71, 0xbf,
- 0x3a, 0x75, 0xd2, 0xaf, 0xe6, 0x5e, 0x27, 0x6d, 0x8a, 0x25, 0x06, 0x39, 0x50, 0x38, 0xa6, 0x8c,
- 0xdb, 0x9e, 0xcb, 0x2b, 0x99, 0xd5, 0xec, 0xc5, 0xd2, 0x95, 0x97, 0x6b, 0x69, 0xd6, 0x5f, 0x93,
- 0x0a, 0xee, 0x2a, 0xd6, 0x4d, 0x8f, 0x35, 0x6c, 0xde, 0xf4, 0x8e, 0x29, 0xeb, 0xd5, 0x17, 0xb4,
- 0x96, 0x82, 0x46, 0x72, 0x1c, 0x6a, 0x40, 0x3f, 0x34, 0x60, 0xa1, 0xc3, 0xe8, 0x01, 0x65, 0x8c,
- 0x5a, 0x1a, 0x5f, 0xc9, 0xae, 0x1a, 0x8f, 0x41, 0x6d, 0x45, 0xab, 0x5d, 0xd8, 0x1d, 0x90, 0x8f,
- 0x87, 0x34, 0xa2, 0x5f, 0x1a, 0xb0, 0xcc, 0x29, 0x3b, 0xa6, 0x6c, 0xdd, 0xb2, 0x18, 0xe5, 0xbc,
- 0xde, 0xdb, 0x70, 0x6c, 0xea, 0xfa, 0x1b, 0x5b, 0x0d, 0xcc, 0x2b, 0x39, 0xb9, 0x0f, 0x5f, 0x4f,
- 0x67, 0xd0, 0xde, 0x38, 0x39, 0x75, 0x53, 0x5b, 0xb4, 0x3c, 0x96, 0x84, 0xe3, 0x07, 0x98, 0x61,
- 0x1e, 0xc0, 0x6c, 0x70, 0x90, 0xb7, 0x6c, 0xee, 0xa3, 0xbb, 0x30, 0xdd, 0x12, 0x1f, 0xbc, 0x62,
- 0x48, 0x03, 0x6b, 0xe9, 0x0c, 0x0c, 0x64, 0xd4, 0xe7, 0xb4, 0x3d, 0xd3, 0xf2, 0x93, 0x63, 0x2d,
- 0xcd, 0xfc, 0x49, 0x0e, 0x4a, 0xeb, 0xbb, 0x5b, 0x98, 0x72, 0xaf, 0xcb, 0x9a, 0x34, 0x85, 0xd3,
- 0x5c, 0x83, 0x59, 0x6e, 0xbb, 0xad, 0xae, 0x43, 0x98, 0x80, 0x56, 0xa6, 0x25, 0xe5, 0x92, 0xa6,
- 0x9c, 0xdd, 0x8b, 0xe1, 0x70, 0x82, 0x12, 0x5d, 0x01, 0x10, 0x12, 0x78, 0x87, 0x34, 0xa9, 0x55,
- 0xc9, 0xac, 0x1a, 0x17, 0x0b, 0x75, 0xa4, 0xf9, 0xe0, 0xf5, 0x10, 0x83, 0x63, 0x54, 0xe8, 0x49,
- 0xc8, 0x4b, 0x4b, 0x2b, 0x05, 0xa9, 0xa6, 0xac, 0xc9, 0xf3, 0x72, 0x19, 0x58, 0xe1, 0xd0, 0x33,
- 0x30, 0xa3, 0xbd, 0xac, 0x52, 0x94, 0x64, 0xf3, 0x9a, 0x6c, 0x26, 0x70, 0x83, 0x00, 0x2f, 0xd6,
- 0x77, 0x64, 0xbb, 0x96, 0xf4, 0xbb, 0xd8, 0xfa, 0x5e, 0xb3, 0x5d, 0x0b, 0x4b, 0x0c, 0xba, 0x05,
- 0xf9, 0x63, 0xca, 0xf6, 0x85, 0x27, 0x08, 0xd7, 0xfc, 0x72, 0xba, 0x8d, 0xbe, 0x2b, 0x58, 0xea,
- 0x45, 0x61, 0x9a, 0xfc, 0x89, 0x95, 0x10, 0x54, 0x03, 0xe0, 0x87, 0x1e, 0xf3, 0xe5, 0xf2, 0x2a,
- 0xf9, 0xd5, 0xec, 0xc5, 0x62, 0x7d, 0x4e, 0xac, 0x77, 0x2f, 0x84, 0xe2, 0x18, 0x85, 0xa0, 0x6f,
- 0x12, 0x9f, 0xb6, 0x3c, 0x66, 0x53, 0x5e, 0x99, 0x89, 0xe8, 0x37, 0x42, 0x28, 0x8e, 0x51, 0xa0,
- 0x57, 0x01, 0x71, 0xdf, 0x63, 0xa4, 0x45, 0xf5, 0x52, 0x5f, 0x21, 0xfc, 0xb0, 0x02, 0x72, 0x75,
- 0xcb, 0x7a, 0x75, 0x68, 0x6f, 0x88, 0x02, 0x8f, 0xe0, 0x32, 0x7f, 0x6b, 0xc0, 0x7c, 0xcc, 0x17,
- 0xa4, 0xdf, 0x5d, 0x83, 0xd9, 0x56, 0x2c, 0xea, 0xb4, 0x5f, 0x84, 0xa7, 0x1d, 0x8f, 0x48, 0x9c,
- 0xa0, 0x44, 0x14, 0x8a, 0x4c, 0x4b, 0x0a, 0xb2, 0xcb, 0xe5, 0xd4, 0x4e, 0x1b, 0xd8, 0x10, 0x69,
- 0x8a, 0x01, 0x39, 0x8e, 0x24, 0x9b, 0x7f, 0x37, 0xa4, 0x03, 0x07, 0xf9, 0x06, 0x5d, 0x8c, 0xe5,
- 0x34, 0x43, 0x6e, 0xdf, 0xec, 0x98, 0x7c, 0x74, 0x46, 0x22, 0xc8, 0xfc, 0x4f, 0x24, 0x82, 0xeb,
- 0x85, 0x9f, 0x7f, 0x58, 0x9d, 0x7a, 0xef, 0xaf, 0xab, 0x53, 0xe6, 0xcf, 0x0c, 0x98, 0x5d, 0xef,
- 0x74, 0x9c, 0xde, 0x4e, 0xc7, 0x97, 0x0b, 0x30, 0x61, 0xda, 0x62, 0x3d, 0xdc, 0x75, 0xf5, 0x42,
- 0x41, 0xc4, 0x77, 0x43, 0x42, 0xb0, 0xc6, 0x88, 0xf8, 0x39, 0xf0, 0x58, 0x93, 0xea, 0x70, 0x0b,
- 0xe3, 0x67, 0x53, 0x00, 0xb1, 0xc2, 0x89, 0x43, 0x3e, 0xb0, 0xa9, 0x63, 0x6d, 0x13, 0x97, 0xb4,
- 0x28, 0xd3, 0xc1, 0x11, 0x6e, 0xfd, 0x66, 0x0c, 0x87, 0x13, 0x94, 0xe6, 0xbf, 0x33, 0x50, 0xdc,
- 0xf0, 0x5c, 0xcb, 0xf6, 0x75, 0x70, 0xf9, 0xbd, 0xce, 0x50, 0xf2, 0xb8, 0xdd, 0xeb, 0x50, 0x2c,
- 0x31, 0xe8, 0x05, 0x98, 0xe6, 0x3e, 0xf1, 0xbb, 0x5c, 0xda, 0x53, 0xac, 0x3f, 0x11, 0xa4, 0xa5,
- 0x3d, 0x09, 0x3d, 0xed, 0x57, 0xe7, 0x43, 0x71, 0x0a, 0x84, 0x35, 0x83, 0xf0, 0x74, 0x6f, 0x5f,
- 0x6e, 0x94, 0x75, 0x53, 0x5d, 0x7b, 0xc1, 0xfd, 0x91, 0x8d, 0x3c, 0x7d, 0x67, 0x88, 0x02, 0x8f,
- 0xe0, 0x42, 0xc7, 0x80, 0x1c, 0xc2, 0xfd, 0xdb, 0x8c, 0xb8, 0x5c, 0xea, 0xba, 0x6d, 0xb7, 0xa9,
- 0x0e, 0xf8, 0x2f, 0xa5, 0x3b, 0x71, 0xc1, 0x11, 0xe9, 0xbd, 0x35, 0x24, 0x0d, 0x8f, 0xd0, 0x80,
- 0x9e, 0x86, 0x69, 0x46, 0x09, 0xf7, 0xdc, 0x4a, 0x5e, 0x2e, 0x3f, 0xcc, 0xca, 0x58, 0x42, 0xb1,
- 0xc6, 0x8a, 0x84, 0xd6, 0xa6, 0x9c, 0x93, 0x56, 0x90, 0x5e, 0xc3, 0x84, 0xb6, 0xad, 0xc0, 0x38,
- 0xc0, 0x9b, 0xbf, 0x31, 0xa0, 0xbc, 0xc1, 0x28, 0xf1, 0xe9, 0x24, 0x6e, 0xf1, 0xd0, 0x27, 0x8e,
- 0xd6, 0x61, 0x5e, 0x7e, 0xdf, 0x25, 0x8e, 0x6d, 0xa9, 0x33, 0xc8, 0x49, 0xe6, 0xff, 0xd7, 0xcc,
- 0xf3, 0x9b, 0x49, 0x34, 0x1e, 0xa4, 0x37, 0x7f, 0x9d, 0x83, 0x72, 0x83, 0x3a, 0x34, 0x32, 0x79,
- 0x13, 0x50, 0x8b, 0x91, 0x26, 0xdd, 0xa5, 0xcc, 0xf6, 0xac, 0x3d, 0xda, 0xf4, 0x5c, 0x8b, 0x4b,
- 0x37, 0xca, 0xd6, 0xff, 0x4f, 0xec, 0xef, 0xcd, 0x21, 0x2c, 0x1e, 0xc1, 0x81, 0x1c, 0x28, 0x77,
- 0x98, 0xfc, 0x2d, 0xf7, 0x5c, 0x79, 0x59, 0xe9, 0xca, 0x57, 0xd2, 0x1d, 0xe9, 0x6e, 0x9c, 0xb5,
- 0xbe, 0x78, 0xd2, 0xaf, 0x96, 0x13, 0x20, 0x9c, 0x14, 0x8e, 0xbe, 0x01, 0x0b, 0x1e, 0xeb, 0x1c,
- 0x12, 0xb7, 0x41, 0x3b, 0xd4, 0xb5, 0xa8, 0xeb, 0x73, 0xb9, 0x91, 0x85, 0xfa, 0x92, 0xa8, 0x45,
- 0x76, 0x06, 0x70, 0x78, 0x88, 0x1a, 0xbd, 0x09, 0x8b, 0x1d, 0xe6, 0x75, 0x48, 0x4b, 0x6e, 0xcc,
- 0xae, 0xe7, 0xd8, 0xcd, 0x9e, 0xde, 0xce, 0x67, 0x4f, 0xfa, 0xd5, 0xc5, 0xdd, 0x41, 0xe4, 0x69,
- 0xbf, 0x7a, 0x4e, 0x6e, 0x9d, 0x80, 0x44, 0x48, 0x3c, 0x2c, 0x26, 0xe6, 0x06, 0xf9, 0xb1, 0x6e,
- 0xf0, 0xa1, 0x01, 0x97, 0xec, 0x96, 0xeb, 0x31, 0x2a, 0xae, 0x08, 0x8a, 0x29, 0xb1, 0x6e, 0x30,
- 0xe6, 0xb1, 0x37, 0x6c, 0xff, 0x70, 0xc3, 0xe9, 0x72, 0x9f, 0xb2, 0x3a, 0xa3, 0xe4, 0xc8, 0x76,
- 0x5b, 0xbb, 0x9e, 0x4f, 0x5d, 0xdf, 0x26, 0x8e, 0xf4, 0xc8, 0x42, 0xfd, 0xea, 0x49, 0xbf, 0x7a,
- 0x69, 0x6b, 0x42, 0x5e, 0x3c, 0xb1, 0x36, 0x73, 0x0b, 0x0a, 0x8d, 0xae, 0x0e, 0xdb, 0x97, 0xa0,
- 0x60, 0xe9, 0xdf, 0xda, 0x39, 0x82, 0xfc, 0x11, 0xd2, 0x9c, 0xf6, 0xab, 0x65, 0x51, 0x21, 0xd7,
- 0x02, 0x00, 0x0e, 0x59, 0xcc, 0x5f, 0x19, 0x50, 0x91, 0xce, 0xb9, 0x47, 0x1d, 0xda, 0xf4, 0x3d,
- 0x86, 0xe9, 0x3b, 0x5d, 0x9b, 0xd1, 0x36, 0x75, 0x7d, 0xf4, 0x45, 0xc8, 0x1e, 0xd1, 0x9e, 0x4e,
- 0x5d, 0x25, 0x2d, 0x36, 0xfb, 0x1a, 0xed, 0x61, 0x01, 0x47, 0x37, 0xa0, 0xe0, 0x75, 0x44, 0xfa,
- 0xf0, 0x98, 0x4e, 0x5d, 0xcf, 0x04, 0xaa, 0x77, 0x34, 0xfc, 0xb4, 0x5f, 0x3d, 0x9f, 0x10, 0x1f,
- 0x20, 0x70, 0xc8, 0x2a, 0x0e, 0xe5, 0x98, 0x38, 0x5d, 0x2a, 0x1c, 0x25, 0x3c, 0x94, 0xbb, 0x12,
- 0x82, 0x35, 0xc6, 0x7c, 0x1a, 0x0a, 0x52, 0x0c, 0xbf, 0x7b, 0x19, 0x2d, 0x40, 0x16, 0x93, 0x7b,
- 0xd2, 0xaa, 0x59, 0x2c, 0x7e, 0xc6, 0xee, 0x83, 0x1d, 0x80, 0x9b, 0xd4, 0x0f, 0x42, 0x68, 0x1d,
- 0xe6, 0x83, 0x4b, 0x31, 0x79, 0x57, 0x87, 0x71, 0x89, 0x93, 0x68, 0x3c, 0x48, 0x6f, 0xbe, 0x05,
- 0x45, 0x79, 0x9f, 0x8b, 0x62, 0x28, 0x2a, 0xbc, 0x8c, 0x07, 0x14, 0x5e, 0x41, 0x35, 0x95, 0x19,
- 0x57, 0x4d, 0xc5, 0xcc, 0x75, 0xa0, 0xac, 0x78, 0x83, 0x52, 0x33, 0x95, 0x86, 0x67, 0xa1, 0x10,
- 0x98, 0xa9, 0xb5, 0x84, 0x2d, 0x46, 0x20, 0x08, 0x87, 0x14, 0x31, 0x6d, 0x87, 0x90, 0xa8, 0x4d,
- 0xd2, 0x29, 0x8b, 0xd5, 0x91, 0x99, 0x07, 0xd7, 0x91, 0x31, 0x4d, 0x3f, 0x80, 0xca, 0xb8, 0xbe,
- 0xe4, 0x11, 0xaa, 0xa7, 0xf4, 0xa6, 0x98, 0xef, 0x1b, 0xb0, 0x10, 0x97, 0x94, 0xfe, 0xf8, 0xd2,
- 0x2b, 0x39, 0xbb, 0x6e, 0x8e, 0xed, 0xc8, 0x2f, 0x0c, 0x58, 0x4a, 0x2c, 0x6d, 0xa2, 0x13, 0x9f,
- 0xc0, 0xa8, 0xb8, 0x73, 0x64, 0x27, 0x70, 0x8e, 0x3f, 0x67, 0xa0, 0x7c, 0x8b, 0xec, 0x53, 0x27,
- 0x88, 0x54, 0xf4, 0x7d, 0x28, 0xb5, 0x89, 0xdf, 0x3c, 0x94, 0xd0, 0xa0, 0xc7, 0x6a, 0xa4, 0xbb,
- 0x36, 0x12, 0x92, 0x6a, 0xdb, 0x91, 0x98, 0x1b, 0xae, 0xcf, 0x7a, 0xf5, 0x73, 0xda, 0xa4, 0x52,
- 0x0c, 0x83, 0xe3, 0xda, 0x64, 0x63, 0x2c, 0xbf, 0x6f, 0xbc, 0xdb, 0x11, 0x05, 0xe0, 0xe4, 0xfd,
- 0x78, 0xc2, 0x84, 0x58, 0x56, 0x8b, 0x1a, 0xe3, 0xed, 0x01, 0xf9, 0x78, 0x48, 0xe3, 0xf2, 0xcb,
- 0xb0, 0x30, 0x68, 0xbc, 0xc8, 0x3f, 0x61, 0x56, 0x54, 0x89, 0x70, 0x09, 0xf2, 0x32, 0x4f, 0xa9,
- 0xc3, 0xc1, 0xea, 0xe3, 0x7a, 0xe6, 0x9a, 0x21, 0xd3, 0xeb, 0x38, 0x43, 0x1e, 0x53, 0x7a, 0x4d,
- 0x88, 0x7f, 0xc8, 0xf4, 0xfa, 0x3b, 0x03, 0x72, 0xb2, 0xb5, 0x79, 0x0b, 0x0a, 0x62, 0xff, 0x2c,
- 0xe2, 0x13, 0x69, 0x57, 0xea, 0xa6, 0x5a, 0x70, 0x6f, 0x53, 0x9f, 0x44, 0xde, 0x16, 0x40, 0x70,
- 0x28, 0x11, 0x61, 0xc8, 0xdb, 0x3e, 0x6d, 0x07, 0x07, 0xf9, 0xdc, 0x58, 0xd1, 0x7a, 0xa4, 0x53,
- 0xc3, 0xe4, 0xde, 0x8d, 0x77, 0x7d, 0xea, 0x8a, 0xc3, 0x88, 0x42, 0x63, 0x4b, 0xc8, 0xc0, 0x4a,
- 0x94, 0xf9, 0x4f, 0x03, 0x42, 0x55, 0xc2, 0xf9, 0x39, 0x75, 0x0e, 0x6e, 0xd9, 0xee, 0x91, 0xde,
- 0xd6, 0xd0, 0x9c, 0x3d, 0x0d, 0xc7, 0x21, 0xc5, 0xa8, 0xeb, 0x21, 0x33, 0xd9, 0xf5, 0x20, 0x14,
- 0x36, 0x3d, 0xd7, 0xb7, 0xdd, 0xee, 0x50, 0xb4, 0x6d, 0x68, 0x38, 0x0e, 0x29, 0x44, 0x49, 0xc7,
- 0x68, 0x9b, 0xd8, 0xae, 0xed, 0xb6, 0xc4, 0x22, 0x36, 0xbc, 0xae, 0xeb, 0xcb, 0xda, 0x46, 0x97,
- 0x74, 0x78, 0x08, 0x8b, 0x47, 0x70, 0x98, 0xff, 0xca, 0x41, 0x49, 0xac, 0x39, 0xb8, 0xe7, 0x5e,
- 0x84, 0xb2, 0x13, 0xf7, 0x02, 0xbd, 0xf6, 0xf3, 0xda, 0x94, 0x64, 0x5c, 0xe3, 0x24, 0xad, 0x60,
- 0x3e, 0x88, 0xdf, 0xd0, 0x7a, 0x0f, 0x42, 0xe6, 0x64, 0x75, 0x90, 0xa4, 0x15, 0xd9, 0xeb, 0x9e,
- 0x88, 0x0f, 0x5d, 0xe3, 0x85, 0x47, 0xf4, 0x86, 0x00, 0x62, 0x85, 0x43, 0xdb, 0x70, 0x8e, 0x38,
- 0x8e, 0x77, 0x4f, 0x02, 0xeb, 0x9e, 0x77, 0xd4, 0x26, 0xec, 0x88, 0xcb, 0xb1, 0x44, 0xa1, 0xfe,
- 0x05, 0xcd, 0x72, 0x6e, 0x7d, 0x98, 0x04, 0x8f, 0xe2, 0x1b, 0x75, 0x6c, 0xb9, 0x09, 0x8f, 0xed,
- 0x10, 0x96, 0x06, 0x40, 0x32, 0xca, 0xf5, 0x8c, 0xe0, 0xaa, 0x96, 0xb3, 0x84, 0x47, 0xd0, 0x9c,
- 0x8e, 0x81, 0xe3, 0x91, 0x12, 0xd1, 0x75, 0x98, 0x13, 0x9e, 0xec, 0x75, 0xfd, 0xa0, 0x82, 0xcf,
- 0xcb, 0xe3, 0x46, 0x27, 0xfd, 0xea, 0xdc, 0xed, 0x04, 0x06, 0x0f, 0x50, 0x8a, 0xcd, 0x75, 0xec,
- 0xb6, 0xed, 0x57, 0x66, 0x24, 0x4b, 0xb8, 0xb9, 0xb7, 0x04, 0x10, 0x2b, 0x5c, 0xc2, 0x03, 0x0b,
- 0x67, 0x7a, 0xe0, 0x06, 0x2c, 0x72, 0xea, 0x5a, 0x5b, 0xae, 0x2d, 0x0a, 0xc9, 0x1b, 0xc7, 0xb2,
- 0x3e, 0x2f, 0xc9, 0x83, 0x38, 0x2f, 0x8a, 0xeb, 0xbd, 0x41, 0x24, 0x1e, 0xa6, 0x37, 0xff, 0x94,
- 0x05, 0xa4, 0x5a, 0x1f, 0x4b, 0x15, 0x65, 0x2a, 0x2f, 0x8a, 0x06, 0x4d, 0xb7, 0x4e, 0xc6, 0x40,
- 0x83, 0xa6, 0xbb, 0xa6, 0x00, 0x8f, 0xb6, 0xa1, 0xa8, 0xf2, 0x53, 0x14, 0x73, 0x6b, 0x9a, 0xb8,
- 0xb8, 0x13, 0x20, 0x4e, 0xfb, 0xd5, 0xe5, 0x84, 0x9a, 0x10, 0x23, 0x9b, 0xe7, 0x48, 0x02, 0xba,
- 0x02, 0x40, 0x3a, 0x76, 0x7c, 0x7c, 0x5a, 0x8c, 0x86, 0x68, 0xd1, 0x20, 0x04, 0xc7, 0xa8, 0xd0,
- 0x2b, 0x90, 0xf3, 0x1f, 0xae, 0xc1, 0x2d, 0xc8, 0xfe, 0x5d, 0xb4, 0xb3, 0x52, 0x82, 0xd0, 0x2e,
- 0x83, 0x82, 0x0b, 0xb3, 0x74, 0x6f, 0x1a, 0x6a, 0xdf, 0x0c, 0x31, 0x38, 0x46, 0x85, 0xbe, 0x09,
- 0x85, 0x03, 0x5d, 0xcf, 0xca, 0xd3, 0x4d, 0x9d, 0x67, 0x83, 0x2a, 0x58, 0x4d, 0x70, 0x82, 0x2f,
- 0x1c, 0x4a, 0x43, 0x5f, 0x85, 0x12, 0xef, 0xee, 0x87, 0x25, 0x80, 0x72, 0x89, 0xf0, 0xbe, 0xdd,
- 0x8b, 0x50, 0x38, 0x4e, 0x67, 0xbe, 0x03, 0xc5, 0x6d, 0xbb, 0xc9, 0x3c, 0xd9, 0x92, 0x3f, 0x03,
- 0x33, 0x3c, 0xd1, 0x6f, 0x86, 0x27, 0x19, 0xb8, 0x6a, 0x80, 0x17, 0x3e, 0xea, 0x12, 0xd7, 0x53,
- 0x5d, 0x65, 0x3e, 0xf2, 0xd1, 0xd7, 0x05, 0x10, 0x2b, 0xdc, 0xf5, 0x25, 0x51, 0x65, 0xfc, 0xf8,
- 0xa3, 0xea, 0xd4, 0x07, 0x1f, 0x55, 0xa7, 0x3e, 0xfc, 0x48, 0x57, 0x1c, 0xbf, 0x07, 0x80, 0x9d,
- 0xfd, 0xef, 0xd2, 0xa6, 0xca, 0xdd, 0xa9, 0xa6, 0xac, 0xc1, 0x70, 0x5f, 0x4e, 0x59, 0x33, 0x03,
- 0x95, 0x63, 0x0c, 0x87, 0x13, 0x94, 0x68, 0x0d, 0x8a, 0xe1, 0xfc, 0x54, 0xfb, 0xc7, 0x62, 0xe0,
- 0x6f, 0xe1, 0x90, 0x15, 0x47, 0x34, 0x89, 0x8b, 0x24, 0x77, 0xe6, 0x45, 0x52, 0x87, 0x6c, 0xd7,
- 0xb6, 0xf4, 0xfc, 0xe2, 0x52, 0x70, 0x91, 0xdf, 0xd9, 0x6a, 0x9c, 0xf6, 0xab, 0x4f, 0x8c, 0x7b,
- 0xb6, 0xf0, 0x7b, 0x1d, 0xca, 0x6b, 0x77, 0xb6, 0x1a, 0x58, 0x30, 0x8f, 0xca, 0x6a, 0xd3, 0x13,
- 0x66, 0xb5, 0x2b, 0x00, 0xad, 0x68, 0x0a, 0xa4, 0x92, 0x46, 0xe8, 0x88, 0xb1, 0xe9, 0x4f, 0x8c,
- 0x0a, 0x71, 0x58, 0x6c, 0x32, 0x4a, 0x82, 0x69, 0x0c, 0xf7, 0x49, 0x5b, 0xcd, 0x95, 0x27, 0x8b,
- 0x89, 0x0b, 0x5a, 0xcd, 0xe2, 0xc6, 0xa0, 0x30, 0x3c, 0x2c, 0x1f, 0x79, 0xb0, 0x68, 0xe9, 0x86,
- 0x3d, 0x52, 0x5a, 0x9c, 0x58, 0xa9, 0xcc, 0x58, 0x8d, 0x41, 0x41, 0x78, 0x58, 0x36, 0xfa, 0x0e,
- 0x2c, 0x07, 0xc0, 0xe1, 0xa9, 0x89, 0xcc, 0xfa, 0xd9, 0xfa, 0xca, 0x49, 0xbf, 0xba, 0xdc, 0x18,
- 0x4b, 0x85, 0x1f, 0x20, 0x01, 0x59, 0x30, 0xed, 0xa8, 0x2a, 0xb9, 0x24, 0x2b, 0x9b, 0xaf, 0xa5,
- 0x5b, 0x45, 0xe4, 0xfd, 0xb5, 0x78, 0x75, 0x1c, 0x4e, 0xc0, 0x74, 0x61, 0xac, 0x65, 0xa3, 0x77,
- 0xa1, 0x44, 0x5c, 0xd7, 0xf3, 0x89, 0x9a, 0xe3, 0xcc, 0x4a, 0x55, 0xeb, 0x13, 0xab, 0x5a, 0x8f,
- 0x64, 0x0c, 0x54, 0xe3, 0x31, 0x0c, 0x8e, 0xab, 0x42, 0xf7, 0x60, 0xde, 0xbb, 0xe7, 0x52, 0x86,
- 0xe9, 0x01, 0x65, 0xd4, 0x6d, 0x52, 0x5e, 0x29, 0x4b, 0xed, 0x57, 0x53, 0x6a, 0x4f, 0x30, 0x47,
- 0x2e, 0x9d, 0x84, 0x73, 0x3c, 0xa8, 0x05, 0xd5, 0x44, 0x6e, 0x75, 0x89, 0x63, 0x7f, 0x8f, 0x32,
- 0x5e, 0x99, 0x8b, 0x46, 0xff, 0x9b, 0x21, 0x14, 0xc7, 0x28, 0x50, 0x17, 0xca, 0xed, 0xf8, 0x95,
- 0x51, 0x59, 0x94, 0x66, 0x5e, 0x4b, 0x67, 0xe6, 0xf0, 0xa5, 0x16, 0x95, 0x41, 0x09, 0x1c, 0x4e,
- 0x6a, 0x59, 0x7e, 0x01, 0x4a, 0x0f, 0xd9, 0x21, 0x88, 0x0e, 0x63, 0xf0, 0x40, 0x26, 0xea, 0x30,
- 0xfe, 0x90, 0x81, 0xb9, 0xe4, 0x36, 0x0e, 0x5c, 0x87, 0xf9, 0x54, 0xd7, 0x61, 0xd0, 0xcb, 0x1a,
- 0x63, 0xdf, 0x80, 0x82, 0xfc, 0x9c, 0x1d, 0x9b, 0x9f, 0x75, 0x1a, 0xcc, 0x3d, 0x4a, 0x1a, 0xac,
- 0x01, 0x88, 0x62, 0x85, 0x79, 0x8e, 0x43, 0x99, 0x1e, 0xab, 0xa9, 0xb7, 0x9e, 0x10, 0x8a, 0x63,
- 0x14, 0xa2, 0xa4, 0xde, 0x77, 0xbc, 0xe6, 0x91, 0xdc, 0x82, 0x20, 0x7a, 0x65, 0xee, 0x2b, 0xa8,
- 0x92, 0xba, 0x3e, 0x84, 0xc5, 0x23, 0x38, 0xcc, 0x1e, 0x9c, 0xdf, 0x25, 0x4c, 0x14, 0x39, 0x51,
- 0xa4, 0xc8, 0x9e, 0xe5, 0xed, 0xa1, 0x8e, 0xe8, 0xd2, 0xa4, 0x11, 0x17, 0x6d, 0x7e, 0x04, 0x8b,
- 0xba, 0x22, 0xf3, 0x2f, 0x06, 0x5c, 0x18, 0xa9, 0xfb, 0x73, 0xe8, 0xc8, 0xde, 0x4e, 0x76, 0x64,
- 0x2f, 0xa6, 0x1c, 0x0a, 0x8f, 0xb2, 0x76, 0x4c, 0x7f, 0x36, 0x03, 0xf9, 0x5d, 0x51, 0x09, 0x9b,
- 0x9f, 0x18, 0x30, 0x2b, 0x7f, 0x4d, 0x32, 0x93, 0xaf, 0x26, 0x9f, 0x6a, 0x8a, 0x8f, 0xef, 0x99,
- 0xe6, 0x71, 0x0c, 0xed, 0xdf, 0x37, 0x20, 0x39, 0x0d, 0x47, 0x2f, 0xab, 0x10, 0x30, 0xc2, 0x71,
- 0xf5, 0x84, 0xee, 0xff, 0xd2, 0xb8, 0x96, 0xf4, 0x5c, 0xaa, 0x69, 0xe5, 0xb3, 0x50, 0xc4, 0x9e,
- 0xe7, 0xef, 0x12, 0xff, 0x90, 0x8b, 0xbd, 0xeb, 0x88, 0x1f, 0x7a, 0x7b, 0xe5, 0xde, 0x49, 0x0c,
- 0x56, 0x70, 0xf3, 0xa7, 0x06, 0x5c, 0x18, 0xfb, 0x02, 0x27, 0xb2, 0x48, 0x33, 0xfc, 0xd2, 0x2b,
- 0x0a, 0x1d, 0x39, 0xa2, 0xc3, 0x31, 0x2a, 0xd1, 0x4b, 0x26, 0x9e, 0xed, 0x06, 0x7b, 0xc9, 0x84,
- 0x36, 0x9c, 0xa4, 0x35, 0xff, 0x91, 0x01, 0xfd, 0xe4, 0xf5, 0x5f, 0x76, 0xfa, 0xa7, 0x07, 0x1e,
- 0xdc, 0xe6, 0x92, 0x0f, 0x6e, 0xe1, 0xeb, 0x5a, 0xec, 0xc5, 0x29, 0xfb, 0xe0, 0x17, 0x27, 0xf4,
- 0x7c, 0xf8, 0x88, 0xa5, 0x7c, 0x68, 0x25, 0xf9, 0x88, 0x75, 0xda, 0xaf, 0xce, 0x6a, 0xe1, 0xc9,
- 0x47, 0xad, 0x37, 0x61, 0xc6, 0xa2, 0x3e, 0xb1, 0x1d, 0xd5, 0x17, 0xa6, 0x7e, 0x96, 0x51, 0xc2,
- 0x1a, 0x8a, 0xb5, 0x5e, 0x12, 0x36, 0xe9, 0x0f, 0x1c, 0x08, 0x14, 0x09, 0xbb, 0xe9, 0x59, 0xaa,
- 0x23, 0xc9, 0x47, 0x09, 0x7b, 0xc3, 0xb3, 0x28, 0x96, 0x18, 0xf3, 0x03, 0x03, 0x4a, 0x4a, 0xd2,
- 0x06, 0xe9, 0x72, 0x8a, 0x2e, 0x87, 0xab, 0x50, 0xc7, 0x7d, 0x21, 0xfe, 0x5a, 0x79, 0xda, 0xaf,
- 0x16, 0x25, 0x99, 0x6c, 0x66, 0x46, 0xbc, 0xca, 0x65, 0xce, 0xd8, 0xa3, 0x27, 0x21, 0x2f, 0x03,
- 0x48, 0x6f, 0x66, 0xf4, 0xec, 0x2a, 0x80, 0x58, 0xe1, 0xcc, 0xcf, 0x32, 0x50, 0x4e, 0x2c, 0x2e,
- 0x45, 0x5f, 0x10, 0x8e, 0x50, 0x33, 0x29, 0xc6, 0xf2, 0xe3, 0xff, 0xe4, 0xa0, 0xaf, 0xaf, 0xe9,
- 0x47, 0xb9, 0xbe, 0xbe, 0x05, 0xd3, 0x4d, 0xb1, 0x47, 0xc1, 0x7f, 0x66, 0x2e, 0x4f, 0x72, 0x9c,
- 0x72, 0x77, 0x23, 0x6f, 0x94, 0x9f, 0x1c, 0x6b, 0x81, 0xe8, 0x26, 0x2c, 0x32, 0xea, 0xb3, 0xde,
- 0xfa, 0x81, 0x4f, 0x59, 0x7c, 0x98, 0x90, 0x8f, 0xaa, 0x6f, 0x3c, 0x48, 0x80, 0x87, 0x79, 0xcc,
- 0x7d, 0x98, 0xbd, 0x4d, 0xf6, 0x9d, 0xf0, 0xa1, 0x11, 0x43, 0xd9, 0x76, 0x9b, 0x4e, 0xd7, 0xa2,
- 0x2a, 0xa1, 0x07, 0xd9, 0x2b, 0x08, 0xda, 0xad, 0x38, 0xf2, 0xb4, 0x5f, 0x3d, 0x97, 0x00, 0xa8,
- 0x97, 0x35, 0x9c, 0x14, 0x61, 0x3a, 0x90, 0xfb, 0x1c, 0x3b, 0xc9, 0x6f, 0x43, 0x31, 0xaa, 0xf5,
- 0x1f, 0xb3, 0x4a, 0xf3, 0x6d, 0x28, 0x08, 0x8f, 0x0f, 0x7a, 0xd4, 0x33, 0xaa, 0xa4, 0x64, 0xed,
- 0x95, 0x49, 0x53, 0x7b, 0xc9, 0xe7, 0xea, 0x3b, 0x1d, 0xeb, 0x11, 0x9f, 0xab, 0x33, 0x8f, 0x72,
- 0xf3, 0x65, 0x27, 0xbc, 0xf9, 0xae, 0x80, 0xfa, 0x4b, 0x8f, 0xb8, 0x64, 0x54, 0x01, 0x11, 0xbb,
- 0x64, 0xe2, 0xf7, 0x7f, 0xec, 0x85, 0xe1, 0x47, 0x06, 0x80, 0x1c, 0xe5, 0xc9, 0x31, 0x52, 0x8a,
- 0x3f, 0x46, 0xdc, 0x81, 0x69, 0x4f, 0x79, 0xa4, 0x7a, 0xb2, 0x9e, 0x70, 0x5e, 0x1c, 0x06, 0x92,
- 0xf2, 0x49, 0xac, 0x85, 0xd5, 0x5f, 0xfd, 0xf8, 0xfe, 0xca, 0xd4, 0x27, 0xf7, 0x57, 0xa6, 0x3e,
- 0xbd, 0xbf, 0x32, 0xf5, 0xde, 0xc9, 0x8a, 0xf1, 0xf1, 0xc9, 0x8a, 0xf1, 0xc9, 0xc9, 0x8a, 0xf1,
- 0xe9, 0xc9, 0x8a, 0xf1, 0xd9, 0xc9, 0x8a, 0xf1, 0xc1, 0xdf, 0x56, 0xa6, 0xde, 0x7c, 0x2a, 0xcd,
- 0x5f, 0x25, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0xf8, 0xda, 0x63, 0x4c, 0x51, 0x29, 0x00, 0x00,
-}
+func (m *WatchEvent) Reset() { *m = WatchEvent{} }
func (m *APIGroup) Marshal() (dAtA []byte, err error) {
size := m.Size()
@@ -2415,7 +999,7 @@ func (m *LabelSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.MatchLabels {
keysForMatchLabels = append(keysForMatchLabels, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForMatchLabels)
+ sort.Strings(keysForMatchLabels)
for iNdEx := len(keysForMatchLabels) - 1; iNdEx >= 0; iNdEx-- {
v := m.MatchLabels[string(keysForMatchLabels[iNdEx])]
baseI := i
@@ -2787,7 +1371,7 @@ func (m *ObjectMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.Annotations {
keysForAnnotations = append(keysForAnnotations, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations)
+ sort.Strings(keysForAnnotations)
for iNdEx := len(keysForAnnotations) - 1; iNdEx >= 0; iNdEx-- {
v := m.Annotations[string(keysForAnnotations[iNdEx])]
baseI := i
@@ -2811,7 +1395,7 @@ func (m *ObjectMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) {
for k := range m.Labels {
keysForLabels = append(keysForLabels, string(k))
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForLabels)
+ sort.Strings(keysForLabels)
for iNdEx := len(keysForLabels) - 1; iNdEx >= 0; iNdEx-- {
v := m.Labels[string(keysForLabels[iNdEx])]
baseI := i
@@ -4583,7 +3167,7 @@ func (this *LabelSelector) String() string {
for k := range this.MatchLabels {
keysForMatchLabels = append(keysForMatchLabels, k)
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForMatchLabels)
+ sort.Strings(keysForMatchLabels)
mapStringForMatchLabels := "map[string]string{"
for _, k := range keysForMatchLabels {
mapStringForMatchLabels += fmt.Sprintf("%v: %v,", k, this.MatchLabels[k])
@@ -4690,7 +3274,7 @@ func (this *ObjectMeta) String() string {
for k := range this.Labels {
keysForLabels = append(keysForLabels, k)
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForLabels)
+ sort.Strings(keysForLabels)
mapStringForLabels := "map[string]string{"
for _, k := range keysForLabels {
mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k])
@@ -4700,7 +3284,7 @@ func (this *ObjectMeta) String() string {
for k := range this.Annotations {
keysForAnnotations = append(keysForAnnotations, k)
}
- github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations)
+ sort.Strings(keysForAnnotations)
mapStringForAnnotations := "map[string]string{"
for _, k := range keysForAnnotations {
mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k])
diff --git a/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto b/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto
index 865d3e7caacb..fb21b7236868 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto
+++ b/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto
@@ -1038,7 +1038,6 @@ message Status {
// is not guaranteed to conform to any schema except that defined by
// the reason type.
// +optional
- // +listType=atomic
optional StatusDetails details = 5;
// Suggested HTTP return code for this status, 0 if not set.
@@ -1114,6 +1113,7 @@ message StatusDetails {
}
// TableOptions are used when a Table is requested by the caller.
+// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
message TableOptions {
// includeObject decides whether to include each object along with its columnar information.
diff --git a/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.protomessage.pb.go b/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.protomessage.pb.go
new file mode 100644
index 000000000000..459ae1ad873d
--- /dev/null
+++ b/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.protomessage.pb.go
@@ -0,0 +1,112 @@
+//go:build kubernetes_protomessage_one_more_release
+// +build kubernetes_protomessage_one_more_release
+
+/*
+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 go-to-protobuf. DO NOT EDIT.
+
+package v1
+
+func (*APIGroup) ProtoMessage() {}
+
+func (*APIGroupList) ProtoMessage() {}
+
+func (*APIResource) ProtoMessage() {}
+
+func (*APIResourceList) ProtoMessage() {}
+
+func (*APIVersions) ProtoMessage() {}
+
+func (*ApplyOptions) ProtoMessage() {}
+
+func (*Condition) ProtoMessage() {}
+
+func (*CreateOptions) ProtoMessage() {}
+
+func (*DeleteOptions) ProtoMessage() {}
+
+func (*Duration) ProtoMessage() {}
+
+func (*FieldSelectorRequirement) ProtoMessage() {}
+
+func (*FieldsV1) ProtoMessage() {}
+
+func (*GetOptions) ProtoMessage() {}
+
+func (*GroupKind) ProtoMessage() {}
+
+func (*GroupResource) ProtoMessage() {}
+
+func (*GroupVersion) ProtoMessage() {}
+
+func (*GroupVersionForDiscovery) ProtoMessage() {}
+
+func (*GroupVersionKind) ProtoMessage() {}
+
+func (*GroupVersionResource) ProtoMessage() {}
+
+func (*LabelSelector) ProtoMessage() {}
+
+func (*LabelSelectorRequirement) ProtoMessage() {}
+
+func (*List) ProtoMessage() {}
+
+func (*ListMeta) ProtoMessage() {}
+
+func (*ListOptions) ProtoMessage() {}
+
+func (*ManagedFieldsEntry) ProtoMessage() {}
+
+func (*MicroTime) ProtoMessage() {}
+
+func (*ObjectMeta) ProtoMessage() {}
+
+func (*OwnerReference) ProtoMessage() {}
+
+func (*PartialObjectMetadata) ProtoMessage() {}
+
+func (*PartialObjectMetadataList) ProtoMessage() {}
+
+func (*Patch) ProtoMessage() {}
+
+func (*PatchOptions) ProtoMessage() {}
+
+func (*Preconditions) ProtoMessage() {}
+
+func (*RootPaths) ProtoMessage() {}
+
+func (*ServerAddressByClientCIDR) ProtoMessage() {}
+
+func (*Status) ProtoMessage() {}
+
+func (*StatusCause) ProtoMessage() {}
+
+func (*StatusDetails) ProtoMessage() {}
+
+func (*TableOptions) ProtoMessage() {}
+
+func (*Time) ProtoMessage() {}
+
+func (*Timestamp) ProtoMessage() {}
+
+func (*TypeMeta) ProtoMessage() {}
+
+func (*UpdateOptions) ProtoMessage() {}
+
+func (*Verbs) ProtoMessage() {}
+
+func (*WatchEvent) ProtoMessage() {}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go b/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
index 2a669062cabe..9970e877d096 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
+++ b/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
@@ -784,7 +784,6 @@ type Status struct {
// is not guaranteed to conform to any schema except that defined by
// the reason type.
// +optional
- // +listType=atomic
Details *StatusDetails `json:"details,omitempty" protobuf:"bytes,5,opt,name=details"`
// Suggested HTTP return code for this status, 0 if not set.
// +optional
diff --git a/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.model_name.go b/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.model_name.go
new file mode 100644
index 000000000000..fd6e876ece28
--- /dev/null
+++ b/api/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.model_name.go
@@ -0,0 +1,267 @@
+//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 openapi-gen. DO NOT EDIT.
+
+package v1
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in APIGroup) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.APIGroup"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in APIGroupList) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.APIGroupList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in APIResource) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.APIResource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in APIResourceList) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in APIVersions) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.APIVersions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ApplyOptions) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.ApplyOptions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Condition) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.Condition"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in CreateOptions) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.CreateOptions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in DeleteOptions) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Duration) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.Duration"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in FieldSelectorRequirement) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.FieldSelectorRequirement"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in FieldsV1) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in GetOptions) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.GetOptions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in GroupKind) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.GroupKind"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in GroupResource) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.GroupResource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in GroupVersion) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.GroupVersion"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in GroupVersionForDiscovery) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.GroupVersionForDiscovery"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in GroupVersionKind) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.GroupVersionKind"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in GroupVersionResource) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.GroupVersionResource"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in InternalEvent) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.InternalEvent"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in LabelSelector) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in LabelSelectorRequirement) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in List) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.List"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ListMeta) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ListOptions) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.ListOptions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ManagedFieldsEntry) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in MicroTime) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ObjectMeta) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in OwnerReference) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PartialObjectMetadata) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.PartialObjectMetadata"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PartialObjectMetadataList) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.PartialObjectMetadataList"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Patch) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.Patch"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in PatchOptions) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.PatchOptions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Preconditions) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in RootPaths) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.RootPaths"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in ServerAddressByClientCIDR) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.ServerAddressByClientCIDR"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Status) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.Status"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in StatusCause) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in StatusDetails) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Table) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.Table"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in TableColumnDefinition) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.TableColumnDefinition"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in TableOptions) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.TableOptions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in TableRow) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.TableRow"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in TableRowCondition) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.TableRowCondition"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Time) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.Time"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Timestamp) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.Timestamp"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in TypeMeta) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.TypeMeta"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in UpdateOptions) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.UpdateOptions"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in WatchEvent) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent"
+}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/labels/selector.go b/api/vendor/k8s.io/apimachinery/pkg/labels/selector.go
index 067bcac0a0db..031dcd21be46 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/labels/selector.go
+++ b/api/vendor/k8s.io/apimachinery/pkg/labels/selector.go
@@ -25,6 +25,7 @@ import (
"k8s.io/klog/v2"
+ "k8s.io/apimachinery/pkg/api/validate/content"
"k8s.io/apimachinery/pkg/selection"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/validation"
@@ -848,7 +849,6 @@ func (p *Parser) parseIdentifiersList() (sets.String, error) {
return s, nil
}
if tok2 == CommaToken {
- p.consume(Values)
s.Insert("") // to handle ,, Double "" removed by StringSet
}
default: // it can be operator
@@ -927,7 +927,7 @@ func parse(selector string, path *field.Path) (internalSelector, error) {
}
func validateLabelKey(k string, path *field.Path) *field.Error {
- if errs := validation.IsQualifiedName(k); len(errs) != 0 {
+ if errs := content.IsLabelKey(k); len(errs) != 0 {
return field.Invalid(path, k, strings.Join(errs, "; "))
}
return nil
diff --git a/api/vendor/k8s.io/apimachinery/pkg/runtime/doc.go b/api/vendor/k8s.io/apimachinery/pkg/runtime/doc.go
index b54429bd89c1..fd012dbc7973 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/runtime/doc.go
+++ b/api/vendor/k8s.io/apimachinery/pkg/runtime/doc.go
@@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// +k8s:openapi-model-package=io.k8s.apimachinery.pkg.runtime
+
// Package runtime includes helper functions for working with API objects
// that follow the kubernetes API object conventions, which are:
//
diff --git a/api/vendor/k8s.io/apimachinery/pkg/runtime/generated.pb.go b/api/vendor/k8s.io/apimachinery/pkg/runtime/generated.pb.go
index 2e40e140aec4..f5e78d4b3626 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/runtime/generated.pb.go
+++ b/api/vendor/k8s.io/apimachinery/pkg/runtime/generated.pb.go
@@ -23,145 +23,16 @@ import (
fmt "fmt"
io "io"
- math "math"
math_bits "math/bits"
reflect "reflect"
strings "strings"
-
- proto "github.com/gogo/protobuf/proto"
)
-// 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 *RawExtension) Reset() { *m = RawExtension{} }
-func (*RawExtension) ProtoMessage() {}
-func (*RawExtension) Descriptor() ([]byte, []int) {
- return fileDescriptor_2e0e4b920403a48c, []int{0}
-}
-func (m *RawExtension) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *RawExtension) 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 *RawExtension) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RawExtension.Merge(m, src)
-}
-func (m *RawExtension) XXX_Size() int {
- return m.Size()
-}
-func (m *RawExtension) XXX_DiscardUnknown() {
- xxx_messageInfo_RawExtension.DiscardUnknown(m)
-}
+func (m *RawExtension) Reset() { *m = RawExtension{} }
-var xxx_messageInfo_RawExtension proto.InternalMessageInfo
+func (m *TypeMeta) Reset() { *m = TypeMeta{} }
-func (m *TypeMeta) Reset() { *m = TypeMeta{} }
-func (*TypeMeta) ProtoMessage() {}
-func (*TypeMeta) Descriptor() ([]byte, []int) {
- return fileDescriptor_2e0e4b920403a48c, []int{1}
-}
-func (m *TypeMeta) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TypeMeta) 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 *TypeMeta) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TypeMeta.Merge(m, src)
-}
-func (m *TypeMeta) XXX_Size() int {
- return m.Size()
-}
-func (m *TypeMeta) XXX_DiscardUnknown() {
- xxx_messageInfo_TypeMeta.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TypeMeta proto.InternalMessageInfo
-
-func (m *Unknown) Reset() { *m = Unknown{} }
-func (*Unknown) ProtoMessage() {}
-func (*Unknown) Descriptor() ([]byte, []int) {
- return fileDescriptor_2e0e4b920403a48c, []int{2}
-}
-func (m *Unknown) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Unknown) 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 *Unknown) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Unknown.Merge(m, src)
-}
-func (m *Unknown) XXX_Size() int {
- return m.Size()
-}
-func (m *Unknown) XXX_DiscardUnknown() {
- xxx_messageInfo_Unknown.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Unknown proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*RawExtension)(nil), "k8s.io.apimachinery.pkg.runtime.RawExtension")
- proto.RegisterType((*TypeMeta)(nil), "k8s.io.apimachinery.pkg.runtime.TypeMeta")
- proto.RegisterType((*Unknown)(nil), "k8s.io.apimachinery.pkg.runtime.Unknown")
-}
-
-func init() {
- proto.RegisterFile("k8s.io/apimachinery/pkg/runtime/generated.proto", fileDescriptor_2e0e4b920403a48c)
-}
-
-var fileDescriptor_2e0e4b920403a48c = []byte{
- // 365 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x4f, 0x6b, 0x22, 0x31,
- 0x18, 0xc6, 0x27, 0x2a, 0xe8, 0x46, 0xc1, 0x25, 0x7b, 0xd8, 0xd9, 0x3d, 0x64, 0xc4, 0xd3, 0x7a,
- 0xd8, 0x0c, 0x08, 0x85, 0x5e, 0x1d, 0xf1, 0x50, 0x4a, 0xa1, 0x84, 0xfe, 0x81, 0x9e, 0x1a, 0x67,
- 0xd2, 0x31, 0x0c, 0x26, 0xc3, 0x18, 0x99, 0x7a, 0xeb, 0x47, 0xe8, 0xc7, 0xf2, 0xe8, 0xd1, 0x93,
- 0xd4, 0xe9, 0x87, 0xe8, 0xb5, 0x18, 0xa3, 0xb5, 0xed, 0xc1, 0x5b, 0xde, 0xf7, 0x79, 0x7e, 0xcf,
- 0xfb, 0xbe, 0x10, 0xe8, 0x27, 0xa7, 0x13, 0x22, 0x94, 0xcf, 0x52, 0x31, 0x66, 0xe1, 0x48, 0x48,
- 0x9e, 0xcd, 0xfc, 0x34, 0x89, 0xfd, 0x6c, 0x2a, 0xb5, 0x18, 0x73, 0x3f, 0xe6, 0x92, 0x67, 0x4c,
- 0xf3, 0x88, 0xa4, 0x99, 0xd2, 0x0a, 0x79, 0x5b, 0x80, 0x1c, 0x02, 0x24, 0x4d, 0x62, 0x62, 0x81,
- 0xbf, 0xff, 0x63, 0xa1, 0x47, 0xd3, 0x21, 0x09, 0xd5, 0xd8, 0x8f, 0x55, 0xac, 0x7c, 0xc3, 0x0d,
- 0xa7, 0x0f, 0xa6, 0x32, 0x85, 0x79, 0x6d, 0xf3, 0xda, 0x1d, 0xd8, 0xa0, 0x2c, 0x1f, 0x3c, 0x6a,
- 0x2e, 0x27, 0x42, 0x49, 0xf4, 0x07, 0x96, 0x33, 0x96, 0xbb, 0xa0, 0x05, 0xfe, 0x35, 0x82, 0x6a,
- 0xb1, 0xf2, 0xca, 0x94, 0xe5, 0x74, 0xd3, 0x6b, 0xdf, 0xc3, 0xda, 0xd5, 0x2c, 0xe5, 0x17, 0x5c,
- 0x33, 0xd4, 0x85, 0x90, 0xa5, 0xe2, 0x86, 0x67, 0x1b, 0xc8, 0xb8, 0x7f, 0x04, 0x68, 0xbe, 0xf2,
- 0x9c, 0x62, 0xe5, 0xc1, 0xde, 0xe5, 0x99, 0x55, 0xe8, 0x81, 0x0b, 0xb5, 0x60, 0x25, 0x11, 0x32,
- 0x72, 0x4b, 0xc6, 0xdd, 0xb0, 0xee, 0xca, 0xb9, 0x90, 0x11, 0x35, 0x4a, 0xfb, 0x0d, 0xc0, 0xea,
- 0xb5, 0x4c, 0xa4, 0xca, 0x25, 0xba, 0x85, 0x35, 0x6d, 0xa7, 0x99, 0xfc, 0x7a, 0xb7, 0x43, 0x8e,
- 0xdc, 0x4e, 0x76, 0xeb, 0x05, 0x3f, 0x6d, 0xf8, 0x7e, 0x61, 0xba, 0x0f, 0xdb, 0x5d, 0x58, 0xfa,
- 0x7e, 0x21, 0xea, 0xc1, 0x66, 0xa8, 0xa4, 0xe6, 0x52, 0x0f, 0x64, 0xa8, 0x22, 0x21, 0x63, 0xb7,
- 0x6c, 0x96, 0xfd, 0x6d, 0xf3, 0x9a, 0xfd, 0xcf, 0x32, 0xfd, 0xea, 0x47, 0x27, 0xb0, 0x6e, 0x5b,
- 0x9b, 0xd1, 0x6e, 0xc5, 0xe0, 0xbf, 0x2c, 0x5e, 0xef, 0x7f, 0x48, 0xf4, 0xd0, 0x17, 0x0c, 0xe6,
- 0x6b, 0xec, 0x2c, 0xd6, 0xd8, 0x59, 0xae, 0xb1, 0xf3, 0x54, 0x60, 0x30, 0x2f, 0x30, 0x58, 0x14,
- 0x18, 0x2c, 0x0b, 0x0c, 0x5e, 0x0a, 0x0c, 0x9e, 0x5f, 0xb1, 0x73, 0xe7, 0x1d, 0xf9, 0x2d, 0xef,
- 0x01, 0x00, 0x00, 0xff, 0xff, 0x2a, 0x9b, 0x09, 0xb3, 0x4f, 0x02, 0x00, 0x00,
-}
+func (m *Unknown) Reset() { *m = Unknown{} }
func (m *RawExtension) Marshal() (dAtA []byte, err error) {
size := m.Size()
diff --git a/api/vendor/k8s.io/apimachinery/pkg/runtime/generated.protomessage.pb.go b/api/vendor/k8s.io/apimachinery/pkg/runtime/generated.protomessage.pb.go
new file mode 100644
index 000000000000..1716853ff17c
--- /dev/null
+++ b/api/vendor/k8s.io/apimachinery/pkg/runtime/generated.protomessage.pb.go
@@ -0,0 +1,28 @@
+//go:build kubernetes_protomessage_one_more_release
+// +build kubernetes_protomessage_one_more_release
+
+/*
+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 go-to-protobuf. DO NOT EDIT.
+
+package runtime
+
+func (*RawExtension) ProtoMessage() {}
+
+func (*TypeMeta) ProtoMessage() {}
+
+func (*Unknown) ProtoMessage() {}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.pb.go b/api/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.pb.go
index 7a26d2798ed7..ed57e08afe92 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.pb.go
+++ b/api/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.pb.go
@@ -18,41 +18,3 @@ limitations under the License.
// source: k8s.io/apimachinery/pkg/runtime/schema/generated.proto
package schema
-
-import (
- fmt "fmt"
-
- math "math"
-
- proto "github.com/gogo/protobuf/proto"
-)
-
-// 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 init() {
- proto.RegisterFile("k8s.io/apimachinery/pkg/runtime/schema/generated.proto", fileDescriptor_25f8f0eed21c6089)
-}
-
-var fileDescriptor_25f8f0eed21c6089 = []byte{
- // 170 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0xce, 0xa1, 0x0e, 0xc2, 0x30,
- 0x10, 0xc6, 0xf1, 0xd6, 0x22, 0x91, 0x88, 0x93, 0x73, 0xdc, 0x39, 0x82, 0x46, 0xf3, 0x04, 0xb8,
- 0x6e, 0x94, 0xae, 0x59, 0xba, 0x6b, 0xba, 0x4e, 0xe0, 0x78, 0x04, 0x1e, 0x6b, 0x72, 0x72, 0x92,
- 0x95, 0x17, 0x21, 0x69, 0x11, 0x48, 0xdc, 0xfd, 0xc5, 0xef, 0xf2, 0x6d, 0x0e, 0xdd, 0x71, 0x40,
- 0xcb, 0xa4, 0xbc, 0x75, 0xaa, 0x69, 0x6d, 0xaf, 0xc3, 0x9d, 0x7c, 0x67, 0x28, 0x8c, 0x7d, 0xb4,
- 0x4e, 0xd3, 0xd0, 0xb4, 0xda, 0x29, 0x32, 0xba, 0xd7, 0x41, 0x45, 0x7d, 0x45, 0x1f, 0x38, 0xf2,
- 0xb6, 0x2a, 0x0e, 0x7f, 0x1d, 0xfa, 0xce, 0xe0, 0xd7, 0x61, 0x71, 0xbb, 0xbd, 0xb1, 0xb1, 0x1d,
- 0x6b, 0x6c, 0xd8, 0x91, 0x61, 0xc3, 0x94, 0x79, 0x3d, 0xde, 0x72, 0xe5, 0xc8, 0x57, 0x79, 0x7b,
- 0x3a, 0x4f, 0x2b, 0x88, 0x79, 0x05, 0xb1, 0xac, 0x20, 0x1e, 0x09, 0xe4, 0x94, 0x40, 0xce, 0x09,
- 0xe4, 0x92, 0x40, 0xbe, 0x12, 0xc8, 0xe7, 0x1b, 0xc4, 0xa5, 0xfa, 0x6f, 0xf4, 0x27, 0x00, 0x00,
- 0xff, 0xff, 0x97, 0xb8, 0x4d, 0x1f, 0xdd, 0x00, 0x00, 0x00,
-}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.protomessage.pb.go b/api/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.protomessage.pb.go
new file mode 100644
index 000000000000..047437377fb3
--- /dev/null
+++ b/api/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.protomessage.pb.go
@@ -0,0 +1,22 @@
+//go:build kubernetes_protomessage_one_more_release
+// +build kubernetes_protomessage_one_more_release
+
+/*
+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 go-to-protobuf. DO NOT EDIT.
+
+package schema
diff --git a/api/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go b/api/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go
index b0e22c5e30c0..e2fbeabdd0dd 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go
+++ b/api/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go
@@ -29,6 +29,7 @@ import (
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/validation/field"
+ "k8s.io/kube-openapi/pkg/util"
)
// Scheme defines methods for serializing and deserializing API objects, a type
@@ -752,6 +753,9 @@ var internalPackages = []string{"k8s.io/apimachinery/pkg/runtime/scheme.go"}
// The OpenAPI definition name is the canonical name of the type, with the group and version removed.
// For example, the OpenAPI definition name of Pod is `io.k8s.api.core.v1.Pod`.
//
+// This respects the util.OpenAPIModelNamer interface and will return the name returned by
+// OpenAPIModelName() if it is defined on the type.
+//
// A known type that is registered as an unstructured.Unstructured type is treated as a custom resource and
// which has an OpenAPI definition name of the form `.`.
// For example, the OpenAPI definition name of `group: stable.example.com, version: v1, kind: Pod` is
@@ -764,6 +768,12 @@ func (s *Scheme) ToOpenAPIDefinitionName(groupVersionKind schema.GroupVersionKin
if err != nil {
return "", err
}
+
+ // Use a namer if provided
+ if namer, ok := example.(util.OpenAPIModelNamer); ok {
+ return namer.OpenAPIModelName(), nil
+ }
+
if _, ok := example.(Unstructured); ok {
if groupVersionKind.Group == "" || groupVersionKind.Kind == "" {
return "", fmt.Errorf("unable to convert GroupVersionKind with empty fields to unstructured type to an OpenAPI definition name: %v", groupVersionKind)
diff --git a/api/vendor/k8s.io/apimachinery/pkg/runtime/types_proto.go b/api/vendor/k8s.io/apimachinery/pkg/runtime/types_proto.go
index 27a2064c4163..70c4ea8c56d1 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/runtime/types_proto.go
+++ b/api/vendor/k8s.io/apimachinery/pkg/runtime/types_proto.go
@@ -21,11 +21,21 @@ import (
"io"
)
+// ProtobufReverseMarshaller can precompute size, and marshals to the start of the provided data buffer.
type ProtobufMarshaller interface {
+ // Size returns the number of bytes a call to MarshalTo would consume.
+ Size() int
+ // MarshalTo marshals to the start of the data buffer, which must be at least as big as Size(),
+ // and returns the number of bytes written, which must be identical to the return value of Size().
MarshalTo(data []byte) (int, error)
}
+// ProtobufReverseMarshaller can precompute size, and marshals to the end of the provided data buffer.
type ProtobufReverseMarshaller interface {
+ // Size returns the number of bytes a call to MarshalToSizedBuffer would consume.
+ Size() int
+ // MarshalToSizedBuffer marshals to the end of the data buffer, which must be at least as big as Size(),
+ // and returns the number of bytes written, which must be identical to the return value of Size().
MarshalToSizedBuffer(data []byte) (int, error)
}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/runtime/zz_generated.model_name.go b/api/vendor/k8s.io/apimachinery/pkg/runtime/zz_generated.model_name.go
new file mode 100644
index 000000000000..cf3ec4dcebba
--- /dev/null
+++ b/api/vendor/k8s.io/apimachinery/pkg/runtime/zz_generated.model_name.go
@@ -0,0 +1,92 @@
+//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 openapi-gen. DO NOT EDIT.
+
+package runtime
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Allocator) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.runtime.Allocator"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NegotiateError) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.runtime.NegotiateError"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NoopDecoder) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.runtime.NoopDecoder"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in NoopEncoder) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.runtime.NoopEncoder"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Pair) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.runtime.Pair"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in RawExtension) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.runtime.RawExtension"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Scheme) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.runtime.Scheme"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SerializerInfo) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.runtime.SerializerInfo"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in SimpleAllocator) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.runtime.SimpleAllocator"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in StreamSerializerInfo) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.runtime.StreamSerializerInfo"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in TypeMeta) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.runtime.TypeMeta"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in Unknown) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.runtime.Unknown"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in WithVersionEncoder) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.runtime.WithVersionEncoder"
+}
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in WithoutVersionDecoder) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.runtime.WithoutVersionDecoder"
+}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.pb.go b/api/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.pb.go
index 1f2877399fc1..5be552e1eb6c 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.pb.go
+++ b/api/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.pb.go
@@ -23,80 +23,10 @@ import (
fmt "fmt"
io "io"
- math "math"
math_bits "math/bits"
-
- proto "github.com/gogo/protobuf/proto"
)
-// 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 *IntOrString) Reset() { *m = IntOrString{} }
-func (*IntOrString) ProtoMessage() {}
-func (*IntOrString) Descriptor() ([]byte, []int) {
- return fileDescriptor_771bacc35a5ec189, []int{0}
-}
-func (m *IntOrString) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *IntOrString) 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 *IntOrString) XXX_Merge(src proto.Message) {
- xxx_messageInfo_IntOrString.Merge(m, src)
-}
-func (m *IntOrString) XXX_Size() int {
- return m.Size()
-}
-func (m *IntOrString) XXX_DiscardUnknown() {
- xxx_messageInfo_IntOrString.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_IntOrString proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*IntOrString)(nil), "k8s.io.apimachinery.pkg.util.intstr.IntOrString")
-}
-
-func init() {
- proto.RegisterFile("k8s.io/apimachinery/pkg/util/intstr/generated.proto", fileDescriptor_771bacc35a5ec189)
-}
-
-var fileDescriptor_771bacc35a5ec189 = []byte{
- // 277 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0xce, 0xb6, 0x28, 0xd6,
- 0xcb, 0xcc, 0xd7, 0x4f, 0x2c, 0xc8, 0xcc, 0x4d, 0x4c, 0xce, 0xc8, 0xcc, 0x4b, 0x2d, 0xaa, 0xd4,
- 0x2f, 0xc8, 0x4e, 0xd7, 0x2f, 0x2d, 0xc9, 0xcc, 0xd1, 0xcf, 0xcc, 0x2b, 0x29, 0x2e, 0x29, 0xd2,
- 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0x4a, 0x2c, 0x49, 0x4d, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17,
- 0x52, 0x86, 0x68, 0xd2, 0x43, 0xd6, 0xa4, 0x57, 0x90, 0x9d, 0xae, 0x07, 0xd2, 0xa4, 0x07, 0xd1,
- 0x24, 0xa5, 0x9b, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f, 0x9e, 0x9f,
- 0x9e, 0xaf, 0x0f, 0xd6, 0x9b, 0x54, 0x9a, 0x06, 0xe6, 0x81, 0x39, 0x60, 0x16, 0xc4, 0x4c, 0xa5,
- 0x89, 0x8c, 0x5c, 0xdc, 0x9e, 0x79, 0x25, 0xfe, 0x45, 0xc1, 0x25, 0x45, 0x99, 0x79, 0xe9, 0x42,
- 0x1a, 0x5c, 0x2c, 0x25, 0x95, 0x05, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xcc, 0x4e, 0x22, 0x27,
- 0xee, 0xc9, 0x33, 0x3c, 0xba, 0x27, 0xcf, 0x12, 0x52, 0x59, 0x90, 0xfa, 0x0b, 0x4a, 0x07, 0x81,
- 0x55, 0x08, 0xa9, 0x71, 0xb1, 0x65, 0xe6, 0x95, 0x84, 0x25, 0xe6, 0x48, 0x30, 0x29, 0x30, 0x6a,
- 0xb0, 0x3a, 0xf1, 0x41, 0xd5, 0xb2, 0x79, 0x82, 0x45, 0x83, 0xa0, 0xb2, 0x20, 0x75, 0xc5, 0x25,
- 0x45, 0x20, 0x75, 0xcc, 0x0a, 0x8c, 0x1a, 0x9c, 0x08, 0x75, 0xc1, 0x60, 0xd1, 0x20, 0xa8, 0xac,
- 0x15, 0xc7, 0x8c, 0x05, 0xf2, 0x0c, 0x0d, 0x77, 0x14, 0x18, 0x9c, 0x3c, 0x4f, 0x3c, 0x94, 0x63,
- 0xb8, 0xf0, 0x50, 0x8e, 0xe1, 0xc6, 0x43, 0x39, 0x86, 0x86, 0x47, 0x72, 0x8c, 0x27, 0x1e, 0xc9,
- 0x31, 0x5e, 0x78, 0x24, 0xc7, 0x78, 0xe3, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e,
- 0xcb, 0x31, 0x44, 0x29, 0x13, 0x11, 0x84, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x63, 0xa1, 0x0b,
- 0x1e, 0x68, 0x01, 0x00, 0x00,
-}
+func (m *IntOrString) Reset() { *m = IntOrString{} }
func (m *IntOrString) Marshal() (dAtA []byte, err error) {
size := m.Size()
diff --git a/api/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.proto b/api/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.proto
index 7c63c5e45af5..e3d26a59a589 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.proto
+++ b/api/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.proto
@@ -33,6 +33,7 @@ option go_package = "k8s.io/apimachinery/pkg/util/intstr";
// +protobuf=true
// +protobuf.options.(gogoproto.goproto_stringer)=false
// +k8s:openapi-gen=true
+// +k8s:openapi-model-package=io.k8s.apimachinery.pkg.util.intstr
message IntOrString {
optional int64 type = 1;
diff --git a/api/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.protomessage.pb.go b/api/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.protomessage.pb.go
new file mode 100644
index 000000000000..2853a0183004
--- /dev/null
+++ b/api/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.protomessage.pb.go
@@ -0,0 +1,24 @@
+//go:build kubernetes_protomessage_one_more_release
+// +build kubernetes_protomessage_one_more_release
+
+/*
+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 go-to-protobuf. DO NOT EDIT.
+
+package intstr
+
+func (*IntOrString) ProtoMessage() {}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go b/api/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go
index 5fd2e16c842f..f372ae589c0f 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go
+++ b/api/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go
@@ -38,6 +38,7 @@ import (
// +protobuf=true
// +protobuf.options.(gogoproto.goproto_stringer)=false
// +k8s:openapi-gen=true
+// +k8s:openapi-model-package=io.k8s.apimachinery.pkg.util.intstr
type IntOrString struct {
Type Type `protobuf:"varint,1,opt,name=type,casttype=Type"`
IntVal int32 `protobuf:"varint,2,opt,name=intVal"`
diff --git a/api/vendor/k8s.io/apimachinery/pkg/util/intstr/zz_generated.model_name.go b/api/vendor/k8s.io/apimachinery/pkg/util/intstr/zz_generated.model_name.go
new file mode 100644
index 000000000000..b2d6e0ae3c87
--- /dev/null
+++ b/api/vendor/k8s.io/apimachinery/pkg/util/intstr/zz_generated.model_name.go
@@ -0,0 +1,27 @@
+//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 openapi-gen. DO NOT EDIT.
+
+package intstr
+
+// OpenAPIModelName returns the OpenAPI model name for this type.
+func (in IntOrString) OpenAPIModelName() string {
+ return "io.k8s.apimachinery.pkg.util.intstr.IntOrString"
+}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/util/sets/set.go b/api/vendor/k8s.io/apimachinery/pkg/util/sets/set.go
index cd961c8c5939..ae3d15eb25f1 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/util/sets/set.go
+++ b/api/vendor/k8s.io/apimachinery/pkg/util/sets/set.go
@@ -18,7 +18,7 @@ package sets
import (
"cmp"
- "sort"
+ "slices"
)
// Set is a set of the same type elements, implemented via map[comparable]struct{} for minimal memory consumption.
@@ -188,22 +188,13 @@ func (s1 Set[T]) Equal(s2 Set[T]) bool {
return len(s1) == len(s2) && s1.IsSuperset(s2)
}
-type sortableSliceOfGeneric[T cmp.Ordered] []T
-
-func (g sortableSliceOfGeneric[T]) Len() int { return len(g) }
-func (g sortableSliceOfGeneric[T]) Less(i, j int) bool { return less[T](g[i], g[j]) }
-func (g sortableSliceOfGeneric[T]) Swap(i, j int) { g[i], g[j] = g[j], g[i] }
-
// List returns the contents as a sorted T slice.
//
// This is a separate function and not a method because not all types supported
// by Generic are ordered and only those can be sorted.
func List[T cmp.Ordered](s Set[T]) []T {
- res := make(sortableSliceOfGeneric[T], 0, len(s))
- for key := range s {
- res = append(res, key)
- }
- sort.Sort(res)
+ res := s.UnsortedList()
+ slices.Sort(res)
return res
}
@@ -230,7 +221,3 @@ func (s Set[T]) PopAny() (T, bool) {
func (s Set[T]) Len() int {
return len(s)
}
-
-func less[T cmp.Ordered](lhs, rhs T) bool {
- return lhs < rhs
-}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/util/validation/field/error_matcher.go b/api/vendor/k8s.io/apimachinery/pkg/util/validation/field/error_matcher.go
index afb5f1b07b30..f0264e50c7df 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/util/validation/field/error_matcher.go
+++ b/api/vendor/k8s.io/apimachinery/pkg/util/validation/field/error_matcher.go
@@ -23,6 +23,13 @@ import (
"strings"
)
+// NormalizationRule holds a pre-compiled regular expression and its replacement string
+// for normalizing field paths.
+type NormalizationRule struct {
+ Regexp *regexp.Regexp
+ Replacement string
+}
+
// ErrorMatcher is a helper for comparing Error objects.
type ErrorMatcher struct {
// TODO(thockin): consider whether type is ever NOT required, maybe just
@@ -32,22 +39,37 @@ type ErrorMatcher struct {
// "want" error has a nil field, don't match on field.
matchField bool
// TODO(thockin): consider whether value could be assumed - if the
- // "want" error has a nil value, don't match on field.
+ // "want" error has a nil value, don't match on value.
matchValue bool
matchOrigin bool
matchDetail func(want, got string) bool
requireOriginWhenInvalid bool
+ // normalizationRules holds the pre-compiled regex patterns for path normalization.
+ normalizationRules []NormalizationRule
}
// Matches returns true if the two Error objects match according to the
-// configured criteria.
+// configured criteria. When field normalization is configured, only the
+// "got" error's field path is normalized (to bring older API versions up
+// to the internal/latest format), while "want" is assumed to already be
+// in the canonical internal API format.
func (m ErrorMatcher) Matches(want, got *Error) bool {
if m.matchType && want.Type != got.Type {
return false
}
- if m.matchField && want.Field != got.Field {
- return false
+ if m.matchField {
+ // Try direct match first (common case)
+ if want.Field != got.Field {
+ // Fields don't match, try normalization if rules are configured.
+ // Only normalize "got" - it may be from an older API version that
+ // needs to be brought up to the internal/latest format that "want"
+ // is already in.
+ if want.Field != m.normalizePath(got.Field) {
+ return false
+ }
+ }
}
+
if m.matchValue && !reflect.DeepEqual(want.BadValue, got.BadValue) {
return false
}
@@ -67,6 +89,18 @@ func (m ErrorMatcher) Matches(want, got *Error) bool {
return true
}
+// normalizePath applies configured path normalization rules.
+func (m ErrorMatcher) normalizePath(path string) string {
+ for _, rule := range m.normalizationRules {
+ normalized := rule.Regexp.ReplaceAllString(path, rule.Replacement)
+ if normalized != path {
+ // Only apply the first matching rule.
+ return normalized
+ }
+ }
+ return path
+}
+
// Render returns a string representation of the specified Error object,
// according to the criteria configured in the ErrorMatcher.
func (m ErrorMatcher) Render(e *Error) string {
@@ -84,7 +118,11 @@ func (m ErrorMatcher) Render(e *Error) string {
}
if m.matchField {
comma()
- buf.WriteString(fmt.Sprintf("Field=%q", e.Field))
+ if normalized := m.normalizePath(e.Field); normalized != e.Field {
+ buf.WriteString(fmt.Sprintf("Field=%q (aka %q)", normalized, e.Field))
+ } else {
+ buf.WriteString(fmt.Sprintf("Field=%q", e.Field))
+ }
}
if m.matchValue {
comma()
@@ -125,11 +163,39 @@ func (m ErrorMatcher) ByType() ErrorMatcher {
}
// ByField returns a derived ErrorMatcher which also matches by field path.
+// If you need to mutate the field path (e.g. to normalize across versions),
+// see ByFieldNormalized.
func (m ErrorMatcher) ByField() ErrorMatcher {
m.matchField = true
return m
}
+// ByFieldNormalized returns a derived ErrorMatcher which also matches by field path
+// after applying normalization rules to the actual (got) error's field path.
+// This allows matching field paths from older API versions against the canonical
+// internal API format.
+//
+// The normalization rules are applied ONLY to the "got" error's field path, bringing
+// older API version field paths up to the latest/internal format. The "want" error
+// is assumed to always be in the internal API format (latest).
+//
+// The rules slice holds pre-compiled regular expressions and their replacement strings.
+//
+// Example:
+//
+// rules := []NormalizationRule{
+// {
+// Regexp: regexp.MustCompile(`spec\.devices\.requests\[(\d+)\]\.allocationMode`),
+// Replacement: "spec.devices.requests[$1].exactly.allocationMode",
+// },
+// }
+// matcher := ErrorMatcher{}.ByFieldNormalized(rules)
+func (m ErrorMatcher) ByFieldNormalized(rules []NormalizationRule) ErrorMatcher {
+ m.matchField = true
+ m.normalizationRules = rules
+ return m
+}
+
// ByValue returns a derived ErrorMatcher which also matches by the errant
// value.
func (m ErrorMatcher) ByValue() ErrorMatcher {
@@ -138,6 +204,13 @@ func (m ErrorMatcher) ByValue() ErrorMatcher {
}
// ByOrigin returns a derived ErrorMatcher which also matches by the origin.
+// When this is used and an origin is set in the error, the matcher will
+// consider all expected errors with the same origin to be a match. The only
+// expception to this is when it finds two errors which are exactly identical,
+// which is too suspicious to ignore. This multi-matching allows tests to
+// express a single expectation ("I set the X field to an invalid value, and I
+// expect an error from origin Y") without having to know exactly how many
+// errors might be returned, or in what order, or with what wording.
func (m ErrorMatcher) ByOrigin() ErrorMatcher {
m.matchOrigin = true
return m
@@ -184,40 +257,64 @@ func (m ErrorMatcher) ByDetailRegexp() ErrorMatcher {
type TestIntf interface {
Helper()
Errorf(format string, args ...any)
- Logf(format string, args ...any)
}
// Test compares two ErrorLists by the criteria configured in this matcher, and
-// fails the test if they don't match. If a given "want" error matches multiple
-// "got" errors, they will all be consumed. This might be OK (e.g. if there are
-// multiple errors on the same field from the same origin) or it might be an
-// insufficiently specific matcher, so these will be logged.
+// fails the test if they don't match. The "want" errors are expected to be in
+// the internal API format (latest), while "got" errors may be from any API version
+// and will be normalized if field normalization rules are configured.
+//
+// If matching by origin is enabled and the error has a non-empty origin, a given
+// "want" error can match multiple "got" errors, and they will all be consumed.
+// The only exception to this is if the matcher got multiple identical (in every way,
+// even those not being matched on) errors, which is likely to indicate a bug.
func (m ErrorMatcher) Test(tb TestIntf, want, got ErrorList) {
tb.Helper()
+ exactly := m.Exactly() // makes a copy
+
+ // If we ever find an EXACT duplicate error, it's almost certainly a bug
+ // worth reporting. If we ever find a use-case where this is not a bug, we
+ // can revisit this assumption.
+ seen := map[string]bool{}
+ for _, g := range got {
+ key := exactly.Render(g)
+ if seen[key] {
+ tb.Errorf("exact duplicate error:\n%s", key)
+ }
+ seen[key] = true
+ }
+
remaining := got
for _, w := range want {
tmp := make(ErrorList, 0, len(remaining))
- n := 0
- for _, g := range remaining {
+ matched := false
+ for i, g := range remaining {
if m.Matches(w, g) {
- n++
+ matched = true
+ if m.matchOrigin && w.Origin != "" {
+ // When origin is included in the match, we allow multiple
+ // matches against the same wanted error, so that tests
+ // can be insulated from the exact number, order, and
+ // wording of cases that might return more than one error.
+ continue
+ } else {
+ // Single-match, save the rest of the "got" errors and move
+ // on to the next "want" error.
+ tmp = append(tmp, remaining[i+1:]...)
+ break
+ }
} else {
tmp = append(tmp, g)
}
}
- if n == 0 {
+ if !matched {
tb.Errorf("expected an error matching:\n%s", m.Render(w))
- } else if n > 1 {
- // This is not necessarily and error, but it's worth logging in
- // case it's not what the test author intended.
- tb.Logf("multiple errors matched:\n%s", m.Render(w))
}
remaining = tmp
}
if len(remaining) > 0 {
for _, e := range remaining {
- exactly := m.Exactly() // makes a copy
tb.Errorf("unmatched error:\n%s", exactly.Render(e))
}
}
diff --git a/api/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go b/api/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go
index f2a983aebf66..950d83868234 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go
+++ b/api/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go
@@ -341,6 +341,14 @@ func (list ErrorList) MarkCoveredByDeclarative() ErrorList {
return list
}
+// PrefixDetail adds a prefix to the Detail for all errors in the list and returns the updated list.
+func (list ErrorList) PrefixDetail(prefix string) ErrorList {
+ for _, err := range list {
+ err.Detail = prefix + err.Detail
+ }
+ return list
+}
+
// ToAggregate converts the ErrorList into an errors.Aggregate.
func (list ErrorList) ToAggregate() utilerrors.Aggregate {
if len(list) == 0 {
diff --git a/api/vendor/k8s.io/apimachinery/pkg/util/validation/validation.go b/api/vendor/k8s.io/apimachinery/pkg/util/validation/validation.go
index bc4521c392bf..352ff19ae5c2 100644
--- a/api/vendor/k8s.io/apimachinery/pkg/util/validation/validation.go
+++ b/api/vendor/k8s.io/apimachinery/pkg/util/validation/validation.go
@@ -23,51 +23,17 @@ import (
"strings"
"unicode"
+ "k8s.io/apimachinery/pkg/api/validate/content"
+
"k8s.io/apimachinery/pkg/util/validation/field"
)
-const qnameCharFmt string = "[A-Za-z0-9]"
-const qnameExtCharFmt string = "[-A-Za-z0-9_.]"
-const qualifiedNameFmt string = "(" + qnameCharFmt + qnameExtCharFmt + "*)?" + qnameCharFmt
-const qualifiedNameErrMsg string = "must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character"
-const qualifiedNameMaxLength int = 63
-
-var qualifiedNameRegexp = regexp.MustCompile("^" + qualifiedNameFmt + "$")
-
// IsQualifiedName tests whether the value passed is what Kubernetes calls a
// "qualified name". This is a format used in various places throughout the
// system. If the value is not valid, a list of error strings is returned.
// Otherwise an empty list (or nil) is returned.
-func IsQualifiedName(value string) []string {
- var errs []string
- parts := strings.Split(value, "/")
- var name string
- switch len(parts) {
- case 1:
- name = parts[0]
- case 2:
- var prefix string
- prefix, name = parts[0], parts[1]
- if len(prefix) == 0 {
- errs = append(errs, "prefix part "+EmptyError())
- } else if msgs := IsDNS1123Subdomain(prefix); len(msgs) != 0 {
- errs = append(errs, prefixEach(msgs, "prefix part ")...)
- }
- default:
- return append(errs, "a qualified name "+RegexError(qualifiedNameErrMsg, qualifiedNameFmt, "MyName", "my.name", "123-abc")+
- " with an optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')")
- }
-
- if len(name) == 0 {
- errs = append(errs, "name part "+EmptyError())
- } else if len(name) > qualifiedNameMaxLength {
- errs = append(errs, "name part "+MaxLenError(qualifiedNameMaxLength))
- }
- if !qualifiedNameRegexp.MatchString(name) {
- errs = append(errs, "name part "+RegexError(qualifiedNameErrMsg, qualifiedNameFmt, "MyName", "my.name", "123-abc"))
- }
- return errs
-}
+// Deprecated: Use k8s.io/apimachinery/pkg/api/validate/content.IsQualifiedName instead.
+var IsQualifiedName = content.IsLabelKey
// IsFullyQualifiedName checks if the name is fully qualified. This is similar
// to IsFullyQualifiedDomainName but requires a minimum of 3 segments instead of
@@ -151,27 +117,40 @@ func IsDomainPrefixedPath(fldPath *field.Path, dpPath string) field.ErrorList {
return allErrs
}
-const labelValueFmt string = "(" + qualifiedNameFmt + ")?"
-const labelValueErrMsg string = "a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character"
+// IsDomainPrefixedKey checks if the given key string is a domain-prefixed key
+// (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 non-empty and match the regex ^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$.
+func IsDomainPrefixedKey(fldPath *field.Path, key string) field.ErrorList {
+ var allErrs field.ErrorList
+ if len(key) == 0 {
+ return append(allErrs, field.Required(fldPath, ""))
+ }
+ for _, errMessages := range content.IsLabelKey(key) {
+ allErrs = append(allErrs, field.Invalid(fldPath, key, errMessages))
+ }
-// LabelValueMaxLength is a label's max length
-const LabelValueMaxLength int = 63
+ if len(allErrs) > 0 {
+ return allErrs
+ }
-var labelValueRegexp = regexp.MustCompile("^" + labelValueFmt + "$")
+ segments := strings.Split(key, "/")
+ if len(segments) != 2 {
+ return append(allErrs, field.Invalid(fldPath, key, "must be a domain-prefixed key (such as \"acme.io/foo\")"))
+ }
+
+ return allErrs
+}
+
+// LabelValueMaxLength is a label's max length
+// Deprecated: Use k8s.io/apimachinery/pkg/api/validate/content.LabelValueMaxLength instead.
+const LabelValueMaxLength int = content.LabelValueMaxLength
// IsValidLabelValue tests whether the value passed is a valid label value. If
// the value is not valid, a list of error strings is returned. Otherwise an
// empty list (or nil) is returned.
-func IsValidLabelValue(value string) []string {
- var errs []string
- if len(value) > LabelValueMaxLength {
- errs = append(errs, MaxLenError(LabelValueMaxLength))
- }
- if !labelValueRegexp.MatchString(value) {
- errs = append(errs, RegexError(labelValueErrMsg, labelValueFmt, "MyValue", "my_value", "12345"))
- }
- return errs
-}
+// Deprecated: Use k8s.io/apimachinery/pkg/api/validate/content.IsLabelValue instead.
+var IsValidLabelValue = content.IsLabelValue
const dns1123LabelFmt string = "[a-z0-9]([-a-z0-9]*[a-z0-9])?"
const dns1123LabelFmtWithUnderscore string = "_?[a-z0-9]([-_a-z0-9]*[a-z0-9])?"
@@ -283,19 +262,10 @@ func IsWildcardDNS1123Subdomain(value string) []string {
return errs
}
-const cIdentifierFmt string = "[A-Za-z_][A-Za-z0-9_]*"
-const identifierErrMsg string = "a valid C identifier must start with alphabetic character or '_', followed by a string of alphanumeric characters or '_'"
-
-var cIdentifierRegexp = regexp.MustCompile("^" + cIdentifierFmt + "$")
-
// IsCIdentifier tests for a string that conforms the definition of an identifier
// in C. This checks the format, but not the length.
-func IsCIdentifier(value string) []string {
- if !cIdentifierRegexp.MatchString(value) {
- return []string{RegexError(identifierErrMsg, cIdentifierFmt, "my_name", "MY_NAME", "MyName")}
- }
- return nil
-}
+// Deprecated: Use k8s.io/apimachinery/pkg/api/validate/content.IsCIdentifier instead.
+var IsCIdentifier = content.IsCIdentifier
// IsValidPortNum tests that the argument is a valid, non-zero port number.
func IsValidPortNum(port int) []string {
@@ -478,13 +448,6 @@ func EmptyError() string {
return "must be non-empty"
}
-func prefixEach(msgs []string, prefix string) []string {
- for i := range msgs {
- msgs[i] = prefix + msgs[i]
- }
- return msgs
-}
-
// InclusiveRangeError returns a string explanation of a numeric "must be
// between" validation failure.
func InclusiveRangeError(lo, hi int) string {
diff --git a/vendor/github.com/google/gofuzz/LICENSE b/api/vendor/k8s.io/kube-openapi/LICENSE
similarity index 100%
rename from vendor/github.com/google/gofuzz/LICENSE
rename to api/vendor/k8s.io/kube-openapi/LICENSE
diff --git a/api/vendor/k8s.io/kube-openapi/pkg/util/trie.go b/api/vendor/k8s.io/kube-openapi/pkg/util/trie.go
new file mode 100644
index 000000000000..a9a76c179142
--- /dev/null
+++ b/api/vendor/k8s.io/kube-openapi/pkg/util/trie.go
@@ -0,0 +1,79 @@
+/*
+Copyright 2016 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 util
+
+// A simple trie implementation with Add and HasPrefix methods only.
+type Trie struct {
+ children map[byte]*Trie
+ wordTail bool
+ word string
+}
+
+// NewTrie creates a Trie and add all strings in the provided list to it.
+func NewTrie(list []string) Trie {
+ ret := Trie{
+ children: make(map[byte]*Trie),
+ wordTail: false,
+ }
+ for _, v := range list {
+ ret.Add(v)
+ }
+ return ret
+}
+
+// Add adds a word to this trie
+func (t *Trie) Add(v string) {
+ root := t
+ for _, b := range []byte(v) {
+ child, exists := root.children[b]
+ if !exists {
+ child = &Trie{
+ children: make(map[byte]*Trie),
+ wordTail: false,
+ }
+ root.children[b] = child
+ }
+ root = child
+ }
+ root.wordTail = true
+ root.word = v
+}
+
+// HasPrefix returns true of v has any of the prefixes stored in this trie.
+func (t *Trie) HasPrefix(v string) bool {
+ _, has := t.GetPrefix(v)
+ return has
+}
+
+// GetPrefix is like HasPrefix but return the prefix in case of match or empty string otherwise.
+func (t *Trie) GetPrefix(v string) (string, bool) {
+ root := t
+ if root.wordTail {
+ return root.word, true
+ }
+ for _, b := range []byte(v) {
+ child, exists := root.children[b]
+ if !exists {
+ return "", false
+ }
+ if child.wordTail {
+ return child.word, true
+ }
+ root = child
+ }
+ return "", false
+}
diff --git a/api/vendor/k8s.io/kube-openapi/pkg/util/util.go b/api/vendor/k8s.io/kube-openapi/pkg/util/util.go
new file mode 100644
index 000000000000..830ec3ca091a
--- /dev/null
+++ b/api/vendor/k8s.io/kube-openapi/pkg/util/util.go
@@ -0,0 +1,126 @@
+/*
+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 util
+
+import (
+ "reflect"
+ "strings"
+)
+
+// [DEPRECATED] ToCanonicalName converts Golang package/type canonical name into REST friendly OpenAPI name.
+// This method is deprecated because it has a misleading name. Please use ToRESTFriendlyName
+// instead
+//
+// NOTE: actually the "canonical name" in this method should be named "REST friendly OpenAPI name",
+// which is different from "canonical name" defined in GetCanonicalTypeName. The "canonical name" defined
+// in GetCanonicalTypeName means Go type names with full package path.
+//
+// Examples of REST friendly OpenAPI name:
+//
+// Input: k8s.io/api/core/v1.Pod
+// Output: io.k8s.api.core.v1.Pod
+//
+// Input: k8s.io/api/core/v1
+// Output: io.k8s.api.core.v1
+//
+// Input: csi.storage.k8s.io/v1alpha1.CSINodeInfo
+// Output: io.k8s.storage.csi.v1alpha1.CSINodeInfo
+func ToCanonicalName(name string) string {
+ return ToRESTFriendlyName(name)
+}
+
+// ToRESTFriendlyName converts Golang package/type canonical name into REST friendly OpenAPI name.
+//
+// Examples of REST friendly OpenAPI name:
+//
+// Input: k8s.io/api/core/v1.Pod
+// Output: io.k8s.api.core.v1.Pod
+//
+// Input: k8s.io/api/core/v1
+// Output: io.k8s.api.core.v1
+//
+// Input: csi.storage.k8s.io/v1alpha1.CSINodeInfo
+// Output: io.k8s.storage.csi.v1alpha1.CSINodeInfo
+func ToRESTFriendlyName(name string) string {
+ nameParts := strings.Split(name, "/")
+ // Reverse first part. e.g., io.k8s... instead of k8s.io...
+ if len(nameParts) > 0 && strings.Contains(nameParts[0], ".") {
+ parts := strings.Split(nameParts[0], ".")
+ for i, j := 0, len(parts)-1; i < j; i, j = i+1, j-1 {
+ parts[i], parts[j] = parts[j], parts[i]
+ }
+ nameParts[0] = strings.Join(parts, ".")
+ }
+ return strings.Join(nameParts, ".")
+}
+
+// OpenAPICanonicalTypeNamer is an interface for models without Go type to seed model name.
+//
+// OpenAPI canonical names are Go type names with full package path, for uniquely indentifying
+// a model / Go type. If a Go type is vendored from another package, only the path after "/vendor/"
+// should be used. For custom resource definition (CRD), the canonical name is expected to be
+//
+// group/version.kind
+//
+// Examples of canonical name:
+//
+// Go type: k8s.io/kubernetes/pkg/apis/core.Pod
+// CRD: csi.storage.k8s.io/v1alpha1.CSINodeInfo
+//
+// Example for vendored Go type:
+//
+// Original full path: k8s.io/kubernetes/vendor/k8s.io/api/core/v1.Pod
+// Canonical name: k8s.io/api/core/v1.Pod
+//
+// Original full path: vendor/k8s.io/api/core/v1.Pod
+// Canonical name: k8s.io/api/core/v1.Pod
+type OpenAPICanonicalTypeNamer interface {
+ OpenAPICanonicalTypeName() string
+}
+
+// OpenAPIModelNamer is an interface Go types may implement to provide an OpenAPI model name.
+//
+// This takes precedence over OpenAPICanonicalTypeNamer, and should be used when a Go type has a model
+// name that differs from its canonical type name as determined by Go package name reflection.
+type OpenAPIModelNamer interface {
+ OpenAPIModelName() string
+}
+
+// GetCanonicalTypeName will find the canonical type name of a sample object, removing
+// the "vendor" part of the path
+func GetCanonicalTypeName(model interface{}) string {
+ switch namer := model.(type) {
+ case OpenAPIModelNamer:
+ return namer.OpenAPIModelName()
+ case OpenAPICanonicalTypeNamer:
+ return namer.OpenAPICanonicalTypeName()
+ }
+ t := reflect.TypeOf(model)
+ if t.Kind() == reflect.Ptr {
+ t = t.Elem()
+ }
+ if t.PkgPath() == "" {
+ return t.Name()
+ }
+ path := t.PkgPath()
+ if strings.Contains(path, "/vendor/") {
+ path = path[strings.Index(path, "/vendor/")+len("/vendor/"):]
+ } else if strings.HasPrefix(path, "vendor/") {
+ path = strings.TrimPrefix(path, "vendor/")
+ }
+ return path + "." + t.Name()
+}
diff --git a/api/vendor/modules.txt b/api/vendor/modules.txt
index 6fbcd73f1354..8f9c7953480c 100644
--- a/api/vendor/modules.txt
+++ b/api/vendor/modules.txt
@@ -7,8 +7,8 @@ github.com/fxamacker/cbor/v2
# github.com/go-logr/logr v1.4.3
## explicit; go 1.18
github.com/go-logr/logr
-# github.com/go-openapi/analysis v0.21.4
-## explicit; go 1.13
+# github.com/go-openapi/analysis v0.23.0
+## explicit; go 1.20
github.com/go-openapi/analysis
github.com/go-openapi/analysis/internal/debug
github.com/go-openapi/analysis/internal/flatten/normalize
@@ -16,35 +16,34 @@ github.com/go-openapi/analysis/internal/flatten/operations
github.com/go-openapi/analysis/internal/flatten/replace
github.com/go-openapi/analysis/internal/flatten/schutils
github.com/go-openapi/analysis/internal/flatten/sortref
-# github.com/go-openapi/errors v0.20.4
-## explicit; go 1.14
+# github.com/go-openapi/errors v0.22.1
+## explicit; go 1.20
github.com/go-openapi/errors
-# github.com/go-openapi/jsonpointer v0.21.0
+# github.com/go-openapi/jsonpointer v0.21.1
## explicit; go 1.20
github.com/go-openapi/jsonpointer
-# github.com/go-openapi/jsonreference v0.20.2
-## explicit; go 1.13
+# github.com/go-openapi/jsonreference v0.21.0
+## explicit; go 1.20
github.com/go-openapi/jsonreference
github.com/go-openapi/jsonreference/internal
-# github.com/go-openapi/loads v0.21.2
-## explicit; go 1.13
+# github.com/go-openapi/loads v0.22.0
+## explicit; go 1.20
github.com/go-openapi/loads
-# github.com/go-openapi/spec v0.20.9
-## explicit; go 1.13
+# github.com/go-openapi/spec v0.21.0
+## explicit; go 1.20
github.com/go-openapi/spec
-# github.com/go-openapi/strfmt v0.21.7
-## explicit; go 1.19
+# github.com/go-openapi/strfmt v0.23.0
+## explicit; go 1.20
github.com/go-openapi/strfmt
-# github.com/go-openapi/swag v0.23.0
+# github.com/go-openapi/swag v0.23.1
## explicit; go 1.20
github.com/go-openapi/swag
-# github.com/go-openapi/validate v0.22.2
-## explicit; go 1.18
+# github.com/go-openapi/validate v0.24.0
+## explicit; go 1.20
github.com/go-openapi/validate
-# github.com/gogo/protobuf v1.3.2
-## explicit; go 1.15
-github.com/gogo/protobuf/proto
-github.com/gogo/protobuf/sortkeys
+# github.com/google/uuid v1.6.0
+## explicit
+github.com/google/uuid
# github.com/jinzhu/inflection v1.0.0
## explicit
github.com/jinzhu/inflection
@@ -62,8 +61,8 @@ github.com/json-iterator/go
github.com/lib/pq
github.com/lib/pq/oid
github.com/lib/pq/scram
-# github.com/mailru/easyjson v0.7.7
-## explicit; go 1.12
+# github.com/mailru/easyjson v0.9.0
+## explicit; go 1.20
github.com/mailru/easyjson/buffer
github.com/mailru/easyjson/jlexer
github.com/mailru/easyjson/jwriter
@@ -79,8 +78,8 @@ github.com/modern-go/reflect2
# github.com/oklog/ulid v1.3.1
## explicit
github.com/oklog/ulid
-# github.com/openshift/api v0.0.0-20251120220512-cb382c9eaf42
-## explicit; go 1.24.0
+# github.com/openshift/api v0.0.0-20260318185450-1f2fa3f09f4e
+## explicit; go 1.25.0
github.com/openshift/api/config/v1
github.com/openshift/api/machine/v1
github.com/openshift/api/machine/v1beta1
@@ -92,8 +91,8 @@ github.com/openshift/assisted-service/models/validations
# github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87
## explicit; go 1.12
github.com/openshift/custom-resource-status/conditions/v1
-# github.com/openshift/hive/apis v0.0.0-20260415205034-aa1db747a6ba
-## explicit; go 1.24.0
+# github.com/openshift/hive/apis v0.0.0-20260729204917-c0b802fe5402
+## explicit; go 1.26.0
github.com/openshift/hive/apis/hive/v1
github.com/openshift/hive/apis/hive/v1/agent
github.com/openshift/hive/apis/hive/v1/aws
@@ -107,11 +106,14 @@ github.com/openshift/hive/apis/hive/v1/nutanix
github.com/openshift/hive/apis/hive/v1/openstack
github.com/openshift/hive/apis/hive/v1/vsphere
github.com/openshift/hive/apis/scheme
+# github.com/openshift/installer v1.4.22-ec5
+## explicit; go 1.25.0
+github.com/openshift/installer/pkg/types/vsphere
# github.com/x448/float16 v0.8.4
## explicit; go 1.11
github.com/x448/float16
-# go.mongodb.org/mongo-driver v1.12.0
-## explicit; go 1.13
+# go.mongodb.org/mongo-driver v1.17.4
+## explicit; go 1.18
go.mongodb.org/mongo-driver/bson
go.mongodb.org/mongo-driver/bson/bsoncodec
go.mongodb.org/mongo-driver/bson/bsonoptions
@@ -122,7 +124,7 @@ go.mongodb.org/mongo-driver/x/bsonx/bsoncore
# go.yaml.in/yaml/v2 v2.4.3
## explicit; go 1.15
go.yaml.in/yaml/v2
-# golang.org/x/net v0.54.0 => golang.org/x/net v0.24.0
+# golang.org/x/net v0.55.0 => golang.org/x/net v0.24.0
## explicit; go 1.18
golang.org/x/net/http/httpguts
golang.org/x/net/http2
@@ -147,15 +149,17 @@ gorm.io/gorm/clause
gorm.io/gorm/logger
gorm.io/gorm/schema
gorm.io/gorm/utils
-# k8s.io/api v0.34.2
-## explicit; go 1.24.0
+# k8s.io/api v0.35.6
+## explicit; go 1.25.0
k8s.io/api/authorization/v1
k8s.io/api/core/v1
k8s.io/api/rbac/v1
-# k8s.io/apimachinery v0.34.2
-## explicit; go 1.24.0
+# k8s.io/apimachinery v0.35.6
+## explicit; go 1.25.0
k8s.io/apimachinery/pkg/api/operation
k8s.io/apimachinery/pkg/api/resource
+k8s.io/apimachinery/pkg/api/validate/constraints
+k8s.io/apimachinery/pkg/api/validate/content
k8s.io/apimachinery/pkg/apis/meta/v1
k8s.io/apimachinery/pkg/conversion
k8s.io/apimachinery/pkg/conversion/queryparams
@@ -187,6 +191,9 @@ k8s.io/klog/v2/internal/dbg
k8s.io/klog/v2/internal/serialize
k8s.io/klog/v2/internal/severity
k8s.io/klog/v2/internal/sloghandler
+# k8s.io/kube-openapi v0.0.0-20260304202019-5b3e3fdb0acf
+## explicit; go 1.23.0
+k8s.io/kube-openapi/pkg/util
# k8s.io/utils v0.0.0-20251002143259-bc988d571ff4
## explicit; go 1.18
k8s.io/utils/internal/third_party/forked/golang/net
diff --git a/go.mod b/go.mod
index 59c730f3a7e8..f5bef6de92ae 100644
--- a/go.mod
+++ b/go.mod
@@ -7,27 +7,27 @@ toolchain go1.26.2
require (
github.com/IBM/netaddr v1.5.0
github.com/NYTimes/gziphandler v1.1.1
- github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137
+ github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
github.com/aws/aws-sdk-go v1.49.13
github.com/bombsimon/logrusr/v3 v3.0.0
github.com/buger/jsonparser v1.1.2
github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e
github.com/cert-manager/cert-manager v1.14.7
- github.com/coreos/ignition/v2 v2.14.0
- github.com/coreos/vcontext v0.0.0-20211021162308-f1dbbca7bef4
+ github.com/coreos/ignition/v2 v2.24.0
+ github.com/coreos/vcontext v0.0.0-20230201181013-d72178a18687
github.com/danielerez/go-dns-client v0.0.0-20200630114514-0b60d1703f0b
github.com/distribution/reference v0.6.0
github.com/filanov/stateswitch v1.0.1-0.20221122134945-bfa198e3a83a
github.com/go-gormigrate/gormigrate/v2 v2.1.2
github.com/go-jose/go-jose/v4 v4.1.4
github.com/go-logr/logr v1.4.3
- github.com/go-openapi/errors v0.22.0
+ github.com/go-openapi/errors v0.22.1
github.com/go-openapi/loads v0.22.0
- github.com/go-openapi/runtime v0.19.24
+ github.com/go-openapi/runtime v0.28.0
github.com/go-openapi/spec v0.21.0
github.com/go-openapi/strfmt v0.23.0
- github.com/go-openapi/swag v0.23.0
+ github.com/go-openapi/swag v0.25.4
github.com/go-openapi/validate v0.24.0
github.com/golang-collections/go-datastructures v0.0.0-20150211160725-59788d5eb259
github.com/golang-jwt/jwt/v4 v4.5.2
@@ -35,41 +35,41 @@ require (
github.com/google/renameio v1.0.1
github.com/google/uuid v1.6.0
github.com/hashicorp/go-multierror v1.1.1
- github.com/hashicorp/go-version v1.6.0
+ github.com/hashicorp/go-version v1.7.0
github.com/iancoleman/strcase v0.2.0
- github.com/itchyny/gojq v0.12.8
+ github.com/itchyny/gojq v0.12.9
github.com/jackc/pgx/v5 v5.6.0
github.com/jinzhu/copier v0.3.5
github.com/kelseyhightower/envconfig v1.4.0
github.com/kennygrant/sanitize v1.2.4
github.com/krishicks/yaml-patch v0.0.10
- github.com/metal3-io/baremetal-operator/apis v0.2.0
+ github.com/metal3-io/baremetal-operator/apis v0.4.0
github.com/moby/moby v27.2.1+incompatible
github.com/nmstate/nmstate/rust/src/go/nmstate v0.0.0-20220811151154-801022633c42
github.com/onsi/ginkgo v1.16.5
- github.com/onsi/gomega v1.35.1
+ github.com/onsi/gomega v1.38.2
github.com/openshift-online/ocm-sdk-go v0.1.499
- github.com/openshift/api v0.0.0-20251203133830-85216507eada
- github.com/openshift/assisted-image-service v0.0.0-20231023144959-c402402f52bf
+ github.com/openshift/api v0.0.0-20260619095050-5346161d1bf2
+ github.com/openshift/assisted-image-service v0.0.0-20250917153356-4ca9ff81f712
github.com/openshift/assisted-service/api v0.0.0
github.com/openshift/assisted-service/client v0.0.0
github.com/openshift/assisted-service/models v0.0.0
- github.com/openshift/client-go v0.0.0-20230926161409-848405da69e1
- github.com/openshift/cluster-baremetal-operator v0.0.0-20240207191432-82df158cd2e9
+ github.com/openshift/client-go v0.0.0-20260618131434-17fd91ed6167
+ github.com/openshift/cluster-baremetal-operator v0.0.0-20260730100446-c9028b5c892c
github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87
- github.com/openshift/generic-admission-server v1.14.1-0.20231020105858-8dcc3c9b298f
- github.com/openshift/hive/apis v0.0.0-20260415205034-aa1db747a6ba
+ github.com/openshift/generic-admission-server v1.14.1-0.20260305203524-5df3cca1e3cd
+ github.com/openshift/hive/apis v0.0.0-20260729204917-c0b802fe5402
github.com/openshift/image-customization-controller v0.0.0-20240307203510-394809633b6b
- github.com/openshift/library-go v0.0.0-20231110170715-08d73a9c798b
+ github.com/openshift/library-go v0.0.0-20260714195535-84bc6054e9a0
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pelletier/go-toml v1.9.5
github.com/pkg/errors v0.9.1
- github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.57.0
- github.com/prometheus/client_golang v1.18.0
+ github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.74.0
+ github.com/prometheus/client_golang v1.23.2
github.com/rs/cors v1.11.1
github.com/samber/lo v1.47.0
github.com/segmentio/kafka-go v0.4.38
- github.com/sirupsen/logrus v1.9.3
+ github.com/sirupsen/logrus v1.9.4-0.20230606125235-dd1b4c2e81af
github.com/slok/go-http-metrics v0.11.0
github.com/stretchr/testify v1.11.1
github.com/thedevsaddam/retry v1.2.1
@@ -77,31 +77,31 @@ require (
github.com/vincent-petithory/dataurl v1.0.0
go.uber.org/mock v0.6.0
golang.org/x/crypto v0.52.0
- golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
+ golang.org/x/exp v0.0.0-20250305212735-054e65f0b394
golang.org/x/sync v0.20.0
golang.org/x/sys v0.45.0
gopkg.in/ini.v1 v1.67.0
gopkg.in/yaml.v2 v2.4.0
gorm.io/driver/postgres v1.6.0
gorm.io/gorm v1.25.10
- k8s.io/api v0.34.2
- k8s.io/apiextensions-apiserver v0.29.5
- k8s.io/apimachinery v0.34.2
- k8s.io/client-go v0.29.9
- k8s.io/klog/v2 v2.130.1
- k8s.io/kube-aggregator v0.29.5
- k8s.io/kubectl v0.29.9
- k8s.io/utils v0.0.0-20251002143259-bc988d571ff4
+ k8s.io/api v0.35.6
+ k8s.io/apiextensions-apiserver v0.35.6
+ k8s.io/apimachinery v0.35.6
+ k8s.io/client-go v0.35.6
+ k8s.io/klog/v2 v2.140.0
+ k8s.io/kube-aggregator v0.35.6
+ k8s.io/kubectl v0.35.6
+ k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2
open-cluster-management.io/api v0.12.0
- sigs.k8s.io/controller-runtime v0.16.3
+ sigs.k8s.io/controller-runtime v0.23.3
sigs.k8s.io/yaml v1.6.0
)
require (
- cloud.google.com/go/compute/metadata v0.9.0 // indirect
+ cel.dev/expr v0.25.1 // indirect
dario.cat/mergo v1.0.2 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
- github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect
+ github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
github.com/chai2010/gettext-go v1.0.2 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
@@ -109,69 +109,81 @@ require (
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/platforms v0.2.1 // indirect
github.com/cpuguy83/dockercfg v0.3.2 // indirect
+ github.com/djherbis/times v1.6.0 // indirect
github.com/ebitengine/purego v0.10.0 // indirect
github.com/elliotwutingfeng/asciiset v0.0.0-20230602022725-51bbb787efab // indirect
- github.com/emicklei/go-restful/v3 v3.12.2 // indirect
- github.com/evanphx/json-patch/v5 v5.8.0 // indirect
- github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
- github.com/go-errors/errors v1.4.2 // indirect
+ github.com/emicklei/go-restful/v3 v3.13.0 // indirect
+ github.com/evanphx/json-patch/v5 v5.9.11 // indirect
+ github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
+ github.com/fxamacker/cbor/v2 v2.9.0 // indirect
+ github.com/go-errors/errors v1.5.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
- github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
- github.com/golang/mock v1.6.0 // indirect
+ github.com/go-openapi/swag/cmdutils v0.25.4 // indirect
+ github.com/go-openapi/swag/conv v0.25.4 // indirect
+ github.com/go-openapi/swag/fileutils v0.25.4 // indirect
+ github.com/go-openapi/swag/jsonname v0.25.4 // indirect
+ github.com/go-openapi/swag/jsonutils v0.25.4 // indirect
+ github.com/go-openapi/swag/loading v0.25.4 // indirect
+ github.com/go-openapi/swag/mangling v0.25.4 // indirect
+ github.com/go-openapi/swag/netutils v0.25.4 // indirect
+ github.com/go-openapi/swag/stringutils v0.25.4 // indirect
+ github.com/go-openapi/swag/typeutils v0.25.4 // indirect
+ github.com/go-openapi/swag/yamlutils v0.25.4 // indirect
+ github.com/golang/mock v1.7.0-rc.1 // indirect
github.com/google/btree v1.1.3 // indirect
- github.com/google/cel-go v0.17.7 // indirect
+ github.com/google/cel-go v0.26.0 // indirect
github.com/google/gnostic-models v0.7.0 // indirect
- github.com/google/gofuzz v1.2.0 // indirect
- github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
- github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // indirect
+ github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
+ github.com/kylelemons/godebug v1.1.0 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.10 // indirect
- github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/go-archive v0.2.0 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
- github.com/moby/spdystream v0.5.1 // indirect
github.com/moby/sys/sequential v0.6.0 // indirect
github.com/moby/sys/user v0.4.0 // indirect
github.com/moby/sys/userns v0.1.0 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/morikuni/aec v1.0.0 // indirect
- github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/openshift-online/ocm-api-model/clientapi v0.0.453 // indirect
github.com/openshift-online/ocm-api-model/model v0.0.453 // indirect
+ github.com/openshift/installer v1.4.22-ec5 // indirect
+ github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
- github.com/sergi/go-diff v1.2.0 // indirect
github.com/shirou/gopsutil/v4 v4.26.2 // indirect
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/tklauser/go-sysconf v0.3.16 // indirect
github.com/tklauser/numcpus v0.11.0 // indirect
+ github.com/x448/float16 v0.8.4 // indirect
github.com/xdg/scram v1.0.5 // indirect
github.com/xdg/stringprep v1.0.3 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
- go.etcd.io/bbolt v1.3.10 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 // indirect
- go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
- google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
- k8s.io/apiserver v0.29.5 // indirect
- k8s.io/cli-runtime v0.29.9 // indirect
- k8s.io/component-base v0.29.9 // indirect
- k8s.io/kms v0.29.5 // indirect
+ go.yaml.in/yaml/v3 v3.0.4 // indirect
+ google.golang.org/genproto/googleapis/api v0.0.0-20260120221211-b8f7ae30c516 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20260120221211-b8f7ae30c516 // indirect
+ gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
+ k8s.io/apiserver v0.35.6 // indirect
+ k8s.io/cli-runtime v0.35.6 // indirect
+ k8s.io/component-base v0.35.6 // indirect
+ k8s.io/kms v0.35.6 // indirect
sigs.k8s.io/gateway-api v1.0.0 // 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.20.1 // indirect
+ sigs.k8s.io/kustomize/kyaml v0.20.1 // indirect
+ sigs.k8s.io/randfill v1.0.0 // indirect
+ sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect
)
require (
@@ -182,43 +194,36 @@ require (
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
- github.com/coreos/go-json v0.0.0-20211020211907-c63f628265de // indirect
+ github.com/coreos/go-json v0.0.0-20230131223807-18775e0fb4fb // indirect
github.com/coreos/go-semver v0.3.1 // indirect
- github.com/coreos/go-systemd/v22 v22.5.0 // indirect
+ github.com/coreos/go-systemd/v22 v22.6.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
- github.com/diskfs/go-diskfs v1.4.0 // indirect
+ github.com/diskfs/go-diskfs v1.4.1 // indirect
github.com/docker/docker v28.5.2+incompatible // indirect
github.com/docker/go-connections v0.6.0
github.com/docker/go-units v0.5.0 // indirect
- github.com/evanphx/json-patch v5.7.0+incompatible // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
- github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/ghodss/yaml v1.0.0 // indirect
+ github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/go-openapi/analysis v0.23.0 // indirect
- github.com/go-openapi/jsonpointer v0.21.0 // indirect
+ github.com/go-openapi/jsonpointer v0.21.1 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.2.5 // indirect
github.com/golang/protobuf v1.5.4 // indirect
- github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
- github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
- github.com/itchyny/timefmt-go v0.1.3 // indirect
+ github.com/itchyny/timefmt-go v0.1.4 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24 // indirect
- github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.18.2 // indirect
github.com/lib/pq v1.10.9
- github.com/mailru/easyjson v0.7.7 // indirect
- github.com/metal3-io/baremetal-operator/pkg/hardwareutils v0.2.0 // indirect
github.com/microcosm-cc/bluemonday v1.0.26 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/term v0.5.2 // indirect
@@ -233,62 +238,55 @@ require (
github.com/pierrec/lz4/v4 v4.1.17 // indirect
github.com/pkg/xattr v0.4.10
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
- github.com/prometheus/client_model v0.5.0 // indirect
- github.com/prometheus/common v0.45.0 // indirect
- github.com/prometheus/procfs v0.12.0 // indirect
- github.com/spf13/cobra v1.8.0 // indirect
+ github.com/prometheus/client_model v0.6.2 // indirect
+ github.com/prometheus/common v0.67.4 // indirect
+ github.com/prometheus/procfs v0.19.2 // indirect
+ github.com/spf13/cobra v1.10.1 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/testcontainers/testcontainers-go v0.41.0
github.com/ulikunitz/xz v0.5.15 // indirect
- go.etcd.io/etcd/api/v3 v3.5.11 // indirect
- go.etcd.io/etcd/client/pkg/v3 v3.5.11 // indirect
- go.etcd.io/etcd/client/v3 v3.5.11 // indirect
- go.mongodb.org/mongo-driver v1.14.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
+ go.etcd.io/etcd/api/v3 v3.6.5 // indirect
+ go.etcd.io/etcd/client/pkg/v3 v3.6.5 // indirect
+ go.etcd.io/etcd/client/v3 v3.6.5 // indirect
+ go.mongodb.org/mongo-driver v1.17.4 // indirect
+ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.62.0 // indirect
+ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 // indirect
go.opentelemetry.io/otel v1.43.0 // indirect
go.opentelemetry.io/otel/metric v1.43.0 // indirect
go.opentelemetry.io/otel/sdk v1.43.0 // indirect
go.opentelemetry.io/otel/trace v1.43.0 // indirect
- go.opentelemetry.io/proto/otlp v1.0.0 // indirect
+ go.opentelemetry.io/proto/otlp v1.5.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- go.uber.org/zap v1.26.0 // indirect
- golang.org/x/net v0.55.0 // indirect
+ go.uber.org/zap v1.27.0 // indirect
+ golang.org/x/net v0.55.1-0.20260602153038-42abb857022c // indirect
golang.org/x/oauth2 v0.34.0 // indirect
golang.org/x/term v0.43.0 // indirect
golang.org/x/text v0.37.0 // indirect
- golang.org/x/time v0.12.0 // indirect
- gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
- google.golang.org/grpc v1.79.3 // indirect
- google.golang.org/protobuf v1.36.10 // indirect
- gopkg.in/djherbis/times.v1 v1.3.0 // indirect
+ golang.org/x/time v0.15.0 // indirect
+ gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
+ google.golang.org/grpc v1.80.0 // indirect
+ google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v3 v3.0.1
- k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
- sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 // indirect
+ k8s.io/kube-openapi v0.0.0-20260519202549-bbf5c5577288 // indirect
+ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.35.0 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 // indirect
- sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect
)
replace (
- github.com/google/gnostic-models => github.com/google/gnostic-models v0.6.8
- github.com/metal3-io/baremetal-operator => github.com/openshift/baremetal-operator v0.0.0-20231019133159-8643f32fea3e
- github.com/metal3-io/baremetal-operator/apis => github.com/openshift/baremetal-operator/apis v0.0.0-20231019133159-8643f32fea3e
- github.com/metal3-io/baremetal-operator/pkg/hardwareutils => github.com/openshift/baremetal-operator/pkg/hardwareutils v0.0.0-20231019133159-8643f32fea3e
+ github.com/metal3-io/baremetal-operator => github.com/openshift/baremetal-operator v0.0.0-20260730095922-f64454b94cbd
+ github.com/metal3-io/baremetal-operator/apis => github.com/openshift/baremetal-operator/apis v0.0.0-20260730095922-f64454b94cbd
+ github.com/metal3-io/baremetal-operator/pkg/hardwareutils => github.com/openshift/baremetal-operator/pkg/hardwareutils v0.0.0-20260730095922-f64454b94cbd
github.com/opencontainers/runc => github.com/opencontainers/runc v1.1.12
github.com/openshift/assisted-service/api => ./api
github.com/openshift/assisted-service/client => ./client
github.com/openshift/assisted-service/cmd/agentbasedinstaller => ./cmd/agentbasedinstaller
github.com/openshift/assisted-service/models => ./models
golang.org/x/oauth2 => github.com/openshift/golang-oauth2 v0.26.1-0.20250310184649-06a918c6239d
- // k8s.io/api, apimachinery and kube-openapi pinned for k8s.io/client-go's scheme which uses alpha API packages
- k8s.io/api => k8s.io/api v0.29.9
- k8s.io/apimachinery => k8s.io/apimachinery v0.29.9
- k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340
sigs.k8s.io/cluster-api-provider-aws => github.com/openshift/cluster-api-provider-aws v0.2.1-0.20201022175424-d30c7a274820
sigs.k8s.io/cluster-api-provider-azure => github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20201016155852-4090a6970205
)
diff --git a/go.sum b/go.sum
index 63b50517fa42..c95973b37ea1 100644
--- a/go.sum
+++ b/go.sum
@@ -1,37 +1,17 @@
+cel.dev/expr v0.25.1 h1:1KrZg61W6TWSxuNZ37Xy49ps13NUovb66QLprthtwi4=
+cel.dev/expr v0.25.1/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
-cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw=
-cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
-cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
-cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
-cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
-cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
-cloud.google.com/go v0.58.0/go.mod h1:W+9FnSUw6nhVwXlFcp1eL+krq5+HQUJeUogSeJZZiWg=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
-cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
-cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
-cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
-cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
-cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k=
-cloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdBtwLoEkH9Zs=
-cloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCBSM6qQI1yTBdEb3C10=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
-cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
-cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
-cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
-cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
-cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
-cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
-cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
-cloud.google.com/go/storage v1.9.0/go.mod h1:m+/etGaqZbylxaNT876QGXqEHp4PR2Rq5GMqICWb9bU=
dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8=
dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
@@ -62,6 +42,9 @@ github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ
github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
+github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
+github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
+github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/Masterminds/sprig v2.20.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA=
github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
@@ -74,8 +57,10 @@ github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMo
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OpenPeeDeeP/depguard v1.0.0/go.mod h1:7/4sitnI9YlQgTLLk734QlzXT8DuHVnAyztLplQjk+o=
github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM=
+github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
+github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA=
@@ -86,30 +71,26 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
-github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc=
-github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
+github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b h1:mimo19zliBX/vSQ6PWWSL9lK8qwHozUj03+zLoEB8O0=
+github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b/go.mod h1:fvzegU4vN3H1qMT+8wDmzjAcDONcgo2/SZ/TyfdUOFs=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
-github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18=
-github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/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/apparentlymart/go-cidr v1.0.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
-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-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
-github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg=
-github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg=
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/ashcrow/osrelease v0.0.0-20180626175927-9b292693c55c/go.mod h1:BRljTyotlu+6N+Qlu5MhjxpdmccCnp9lDvZjNNV8qr4=
github.com/aws/aws-sdk-go v1.19.11/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
-github.com/aws/aws-sdk-go v1.30.28/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go v1.32.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go v1.49.13 h1:f4mGztsgnx2dR9r8FQYa9YW/RsKb+N7bgef4UGrOW1Y=
github.com/aws/aws-sdk-go v1.49.13/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
+github.com/aws/aws-sdk-go-v2 v1.41.2 h1:LuT2rzqNQsauaGkPK/7813XxcZ3o3yePY0Iy891T2ls=
+github.com/aws/aws-sdk-go-v2 v1.41.2/go.mod h1:IvvlAZQXvTXznUPfRVfryiG1fbzE2NGK6m9u39YQ+S4=
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
-github.com/beevik/etree v1.1.1-0.20200718192613-4a2f8b9d084c/go.mod h1:0yGO2rna3S9DkITDWHY1bMtcY4IJ4w+4S+EooZUR0bE=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
@@ -146,9 +127,6 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn
github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA=
github.com/clarketm/json v1.14.1/go.mod h1:ynr2LRfb0fQU34l07csRNBTcivjySLLiY1YzQqKVfdo=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
-github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
-github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5 h1:6xNmx7iTtyBRev0+D/Tv1FZd4SCg8axKApyNyRsAt/w=
-github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5/go.mod h1:KdCmV+x/BuvyMxRnYBlmVaq4OLiKW6iRQfvC62cvdkI=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko=
github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
@@ -177,8 +155,8 @@ github.com/containers/storage v1.20.2/go.mod h1:oOB9Ie8OVPojvoaKWEGSEtHbXUAs+tSy
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/fcct v0.5.0/go.mod h1:cbE+j77YSQwFB2fozWVB3qsI2Pi3YiVEbDz/b6Yywdo=
-github.com/coreos/go-json v0.0.0-20211020211907-c63f628265de h1:qZvNu52Tv7Jfbgxdw3ONHf0BK9UpuSxi9FA9Y+qU5VU=
-github.com/coreos/go-json v0.0.0-20211020211907-c63f628265de/go.mod h1:lryFBkhadOfv8Jue2Vr/f/Yviw8h1DQPQojbXqEChY0=
+github.com/coreos/go-json v0.0.0-20230131223807-18775e0fb4fb h1:rmqyI19j3Z/74bIRhuC59RB442rXUazKNueVpfJPxg4=
+github.com/coreos/go-json v0.0.0-20230131223807-18775e0fb4fb/go.mod h1:rcFZM3uxVvdyNmsAV2jopgPD1cs5SPWJWU5dOz2LUnw=
github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
@@ -190,25 +168,25 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
-github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
-github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
+github.com/coreos/go-systemd/v22 v22.6.0 h1:aGVa/v8B7hpb0TKl0MWoAavPDmHvobFe5R5zn0bCJWo=
+github.com/coreos/go-systemd/v22 v22.6.0/go.mod h1:iG+pp635Fo7ZmV/j14KUcmEyWF+0X7Lua8rrTWzYgWU=
github.com/coreos/ign-converter v0.0.0-20200629171308-e40a44f244c5/go.mod h1:LNu0WTt8iVH/WJH15R/SjZw7AdyY2qAyf9ILZTCBvho=
github.com/coreos/ignition v0.35.0/go.mod h1:WJQapxzEn9DE0ryxsGvm8QnBajm/XsS/PkrDqSpz+bA=
github.com/coreos/ignition/v2 v2.1.1/go.mod h1:RqmqU64zxarUJa3l4cHtbhcSwfQLpUhv0WVziZwoXvE=
github.com/coreos/ignition/v2 v2.3.0/go.mod h1:85dmM/CERMZXNrJsXqtNLIxR/dn8G9qlL1CmEjCugp0=
-github.com/coreos/ignition/v2 v2.14.0 h1:KfkCCnA6AK0kts/1zxzzNH5lDMCQN9sqqGcGs+RJVX4=
-github.com/coreos/ignition/v2 v2.14.0/go.mod h1:wxc4qdYEIHLygzWbVVEuoD7lQGTZmMgX0VjAPYBbeEQ=
+github.com/coreos/ignition/v2 v2.24.0 h1:TVcsSWiYvhXihD8Mss3CTRuKaNZM2OIfpoKiudIhrKo=
+github.com/coreos/ignition/v2 v2.24.0/go.mod h1:HelGgFZ1WZ4ZPOIDS0a06A2JTdbbdAine5r3AkSYz5s=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/vcontext v0.0.0-20190529201340-22b159166068/go.mod h1:E+6hug9bFSe0KZ2ZAzr8M9F5JlArJjv5D1JS7KSkPKE=
github.com/coreos/vcontext v0.0.0-20191017033345-260217907eb5/go.mod h1:E+6hug9bFSe0KZ2ZAzr8M9F5JlArJjv5D1JS7KSkPKE=
-github.com/coreos/vcontext v0.0.0-20211021162308-f1dbbca7bef4 h1:pfSsrvbjUFGINaPGy0mm2QKQKTdq7IcbUa+nQwsz2UM=
-github.com/coreos/vcontext v0.0.0-20211021162308-f1dbbca7bef4/go.mod h1:HckqHnP/HI41vS0bfVjJ20u6jD0biI5+68QwZm5Xb9U=
+github.com/coreos/vcontext v0.0.0-20230201181013-d72178a18687 h1:uSmlDgJGbUB0bwQBcZomBTottKwEDF5fF8UjSwKSzWM=
+github.com/coreos/vcontext v0.0.0-20230201181013-d72178a18687/go.mod h1:Salmysdw7DAVuobBW/LwsKKgpyCPHUhjyJoMJD+ZJiI=
github.com/cpuguy83/dockercfg v0.3.2 h1:DlJTyZGBDlXqUZ2Dk2Q3xHs/FtnooJJVaad2S9GKorA=
github.com/cpuguy83/dockercfg v0.3.2/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
-github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
+github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
@@ -224,10 +202,12 @@ github.com/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd/go.mod h1
github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
-github.com/diskfs/go-diskfs v1.4.0 h1:MAybY6TPD+fmhY+a2qFhmdvMeIKvCqlgh4QIc1uCmBs=
-github.com/diskfs/go-diskfs v1.4.0/go.mod h1:G8cyy+ngM+3yKlqjweMmtqvE+TxsnIo1xumbJX1AeLg=
+github.com/diskfs/go-diskfs v1.4.1 h1:iODgkzHLmvXS+1VDztpW53T+dQm8GQzi20y9yUd5UCA=
+github.com/diskfs/go-diskfs v1.4.1/go.mod h1:+tOkQs8CMMog6Nvljg8DGIxEXrgL48iyT3OM3IlSz74=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
+github.com/djherbis/times v1.6.0 h1:w2ctJ92J8fBvWPxugmXIv7Nz7Q3iDMKNx9v5ocVH20c=
+github.com/djherbis/times v1.6.0/go.mod h1:gOHeRAz2h+VJNZ5Gmc/o7iD9k4wW7NMVqieYCY99oc0=
github.com/docker/distribution v0.0.0-20180920194744-16128bbac47f/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v1.4.2-0.20191219165747-a9416c67da9f/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
@@ -245,6 +225,7 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/libnetwork v0.0.0-20190731215715-7f13a5c99f4b/go.mod h1:93m0aTqz6z+g32wla4l4WxTrdtvBRmVzYRkYvasA5Z8=
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE=
+github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
@@ -253,32 +234,31 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/ebitengine/purego v0.10.0 h1:QIw4xfpWT6GWTzaW5XEKy3HXoqrJGx1ijYHzTF0/ISU=
github.com/ebitengine/purego v0.10.0/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
+github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/elazarl/goproxy v0.0.0-20190911111923-ecfe977594f1/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8=
github.com/elazarl/goproxy/ext v0.0.0-20190911111923-ecfe977594f1/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8=
github.com/elliotwutingfeng/asciiset v0.0.0-20230602022725-51bbb787efab h1:h1UgjJdAAhj+uPL68n7XASS6bU+07ZX1WJvVS2eyoeY=
github.com/elliotwutingfeng/asciiset v0.0.0-20230602022725-51bbb787efab/go.mod h1:GLo/8fDswSAniFG+BFIaiSPcK610jyzgEhWYPQwuQdw=
+github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emicklei/go-restful v2.10.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emicklei/go-restful v2.15.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
-github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
-github.com/emicklei/go-restful/v3 v3.12.2 h1:DhwDP0vY3k8ZzE0RunuJy8GhNpPL6zqLkDf9B/a0/xU=
-github.com/emicklei/go-restful/v3 v3.12.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
-github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes=
+github.com/emicklei/go-restful/v3 v3.13.0/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/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/envoyproxy/protoc-gen-validate v1.3.0 h1:TvGH1wof4H33rezVKWSpqKz5NXWg5VPuZ0uONDT6eb4=
-github.com/envoyproxy/protoc-gen-validate v1.3.0/go.mod h1:HvYl7zwPa5mffgyeTUHA9zHIH36nmrm7oCbo4YKoSWA=
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0=
+github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI=
github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
-github.com/evanphx/json-patch/v5 v5.8.0 h1:lRj6N9Nci7MvzrXuX6HFzU8XjmhPiXPlsKEy1u0KQro=
-github.com/evanphx/json-patch/v5 v5.8.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ=
-github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwCFad8crR9dcMQWvV9Hvulu6hwUh4tWPJnM=
+github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU=
+github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM=
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4=
+github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f h1:Wl78ApPPB2Wvf/TIe2xdyJxTlb6obmF18d8QdkxNDu4=
+github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f/go.mod h1:OSYXu++VVOHnXeitef/D8n/6y4QV8uLHSFXX4NeXMGc=
github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc=
github.com/fatih/color v1.6.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
@@ -289,22 +269,23 @@ github.com/filanov/stateswitch v1.0.1-0.20221122134945-bfa198e3a83a/go.mod h1:GY
github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
-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/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
+github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/fsouza/go-dockerclient v0.0.0-20171004212419-da3951ba2e9e/go.mod h1:KpcjM623fQYE9MZiTGzKhjfxXAV9wbyX2C1cyRHfhl0=
github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA=
+github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM=
+github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
+github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg=
github.com/getsentry/raven-go v0.0.0-20190513200303-c977f96e1095/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ=
-github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
+github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo=
github.com/go-critic/go-critic v0.3.5-0.20190526074819-1df300866540/go.mod h1:+sE8vrLDS2M0pZkBk0wy6+nLdKexVDrl/jBqQOTDThA=
-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-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
+github.com/go-errors/errors v1.5.1 h1:ZwEMSLRCapFLflTpT7NKaAc7ukJ8ZPEjzlxt8rPN8bk=
+github.com/go-errors/errors v1.5.1/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
-github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gormigrate/gormigrate/v2 v2.1.2 h1:F/d1hpHbRAvKezziV2CC5KUE82cVe9zTgHSBoOOZ4CY=
github.com/go-gormigrate/gormigrate/v2 v2.1.2/go.mod h1:9nHVX6z3FCMCQPA7PThGcA55t22yKQfK/Dnsf5i7hUo=
github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA=
@@ -318,10 +299,6 @@ github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7
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.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
-github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
@@ -335,83 +312,97 @@ github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70t
github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik=
github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik=
github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk=
-github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk=
github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU=
-github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ=
github.com/go-openapi/analysis v0.23.0 h1:aGday7OWupfMs+LbmLZG4k0MYXIANxcuBTYUC03zFCU=
github.com/go-openapi/analysis v0.23.0/go.mod h1:9mz9ZWaSlV8TvjQHLl2mUW2PbZtemkE8yA5v22ohupo=
github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0=
github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0=
github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94=
-github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94=
-github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M=
-github.com/go-openapi/errors v0.22.0 h1:c4xY/OLxUBSTiepAg3j/MHuAv5mJhnf53LLMWFB+u/w=
-github.com/go-openapi/errors v0.22.0/go.mod h1:J3DmZScxCDufmIMsdOuDHxJbdOGC0xtUynjIx092vXE=
+github.com/go-openapi/errors v0.22.1 h1:kslMRRnK7NCb/CvR1q1VWuEQCEIsBGn5GgKD9e+HYhU=
+github.com/go-openapi/errors v0.22.1/go.mod h1:+n/5UdIqdVnLIJ6Q9Se8HNGUXYaY6CN8ImWzfi/Gzp0=
+github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
-github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
-github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
-github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
+github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
+github.com/go-openapi/jsonpointer v0.21.1 h1:whnzv/pNXtK2FbX/W9yJfRmE2gsmkfahjMKB0fZvcic=
+github.com/go-openapi/jsonpointer v0.21.1/go.mod h1:50I1STOfbY1ycR8jGz8DaMeLCdXiI6aDteEdRNNzpdk=
+github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg=
github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns=
-github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
-github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs=
-github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI=
github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk=
-github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY=
github.com/go-openapi/loads v0.22.0 h1:ECPGd4jX1U6NApCGG1We+uEozOAvXvJSF4nnwHZ8Aco=
github.com/go-openapi/loads v0.22.0/go.mod h1:yLsaTCS92mnSAZX5WWoxszLj0u+Ojl+Zs5Stn1oF+rs=
github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA=
github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64=
github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4=
-github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo=
-github.com/go-openapi/runtime v0.19.24 h1:TqagMVlRAOTwllE/7hNKx6rQ10O6T8ZzeJdMjSTKaD4=
-github.com/go-openapi/runtime v0.19.24/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk=
+github.com/go-openapi/runtime v0.28.0 h1:gpPPmWSNGo214l6n8hzdXYhPuJcGtziTOgUpvsFWGIQ=
+github.com/go-openapi/runtime v0.28.0/go.mod h1:QN7OzcS+XuYmkQLw05akXk0jRH/eZ3kb18+1KwW9gyc=
+github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY=
github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
-github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk=
-github.com/go-openapi/spec v0.19.8/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk=
github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY=
github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk=
github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU=
github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU=
github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY=
-github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU=
github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU=
-github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk=
-github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk=
github.com/go-openapi/strfmt v0.23.0 h1:nlUS6BCqcnAk0pyhi9Y+kdDVZdZMHfEKQiS4HaMgO/c=
github.com/go-openapi/strfmt v0.23.0/go.mod h1:NrtIpfKtWIygRkKVsxh7XQMDQW5HKQl6S5ik2elW+K4=
+github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
-github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY=
github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY=
github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
-github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
-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-openapi/swag v0.25.4 h1:OyUPUFYDPDBMkqyxOTkqDYFnrhuhi9NR6QVUvIochMU=
+github.com/go-openapi/swag v0.25.4/go.mod h1:zNfJ9WZABGHCFg2RnY0S4IOkAcVTzJ6z2Bi+Q4i6qFQ=
+github.com/go-openapi/swag/cmdutils v0.25.4 h1:8rYhB5n6WawR192/BfUu2iVlxqVR9aRgGJP6WaBoW+4=
+github.com/go-openapi/swag/cmdutils v0.25.4/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0=
+github.com/go-openapi/swag/conv v0.25.4 h1:/Dd7p0LZXczgUcC/Ikm1+YqVzkEeCc9LnOWjfkpkfe4=
+github.com/go-openapi/swag/conv v0.25.4/go.mod h1:3LXfie/lwoAv0NHoEuY1hjoFAYkvlqI/Bn5EQDD3PPU=
+github.com/go-openapi/swag/fileutils v0.25.4 h1:2oI0XNW5y6UWZTC7vAxC8hmsK/tOkWXHJQH4lKjqw+Y=
+github.com/go-openapi/swag/fileutils v0.25.4/go.mod h1:cdOT/PKbwcysVQ9Tpr0q20lQKH7MGhOEb6EwmHOirUk=
+github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI=
+github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag=
+github.com/go-openapi/swag/jsonutils v0.25.4 h1:VSchfbGhD4UTf4vCdR2F4TLBdLwHyUDTd1/q4i+jGZA=
+github.com/go-openapi/swag/jsonutils v0.25.4/go.mod h1:7OYGXpvVFPn4PpaSdPHJBtF0iGnbEaTk8AvBkoWnaAY=
+github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4 h1:IACsSvBhiNJwlDix7wq39SS2Fh7lUOCJRmx/4SN4sVo=
+github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4/go.mod h1:Mt0Ost9l3cUzVv4OEZG+WSeoHwjWLnarzMePNDAOBiM=
+github.com/go-openapi/swag/loading v0.25.4 h1:jN4MvLj0X6yhCDduRsxDDw1aHe+ZWoLjW+9ZQWIKn2s=
+github.com/go-openapi/swag/loading v0.25.4/go.mod h1:rpUM1ZiyEP9+mNLIQUdMiD7dCETXvkkC30z53i+ftTE=
+github.com/go-openapi/swag/mangling v0.25.4 h1:2b9kBJk9JvPgxr36V23FxJLdwBrpijI26Bx5JH4Hp48=
+github.com/go-openapi/swag/mangling v0.25.4/go.mod h1:6dxwu6QyORHpIIApsdZgb6wBk/DPU15MdyYj/ikn0Hg=
+github.com/go-openapi/swag/netutils v0.25.4 h1:Gqe6K71bGRb3ZQLusdI8p/y1KLgV4M/k+/HzVSqT8H0=
+github.com/go-openapi/swag/netutils v0.25.4/go.mod h1:m2W8dtdaoX7oj9rEttLyTeEFFEBvnAx9qHd5nJEBzYg=
+github.com/go-openapi/swag/stringutils v0.25.4 h1:O6dU1Rd8bej4HPA3/CLPciNBBDwZj9HiEpdVsb8B5A8=
+github.com/go-openapi/swag/stringutils v0.25.4/go.mod h1:GTsRvhJW5xM5gkgiFe0fV3PUlFm0dr8vki6/VSRaZK0=
+github.com/go-openapi/swag/typeutils v0.25.4 h1:1/fbZOUN472NTc39zpa+YGHn3jzHWhv42wAJSN91wRw=
+github.com/go-openapi/swag/typeutils v0.25.4/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE=
+github.com/go-openapi/swag/yamlutils v0.25.4 h1:6jdaeSItEUb7ioS9lFoCZ65Cne1/RZtPBZ9A56h92Sw=
+github.com/go-openapi/swag/yamlutils v0.25.4/go.mod h1:MNzq1ulQu+yd8Kl7wPOut/YHAAU/H6hL91fF+E2RFwc=
+github.com/go-openapi/testify/enable/yaml/v2 v2.0.2 h1:0+Y41Pz1NkbTHz8NngxTuAXxEodtNSI1WG1c/m5Akw4=
+github.com/go-openapi/testify/enable/yaml/v2 v2.0.2/go.mod h1:kme83333GCtJQHXQ8UKX3IBZu6z8T5Dvy5+CW3NLUUg=
+github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls=
+github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54=
github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4=
github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA=
-github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo=
github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4=
-github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8=
github.com/go-openapi/validate v0.24.0 h1:LdfDKwNbpB6Vn40xhTdNZAnfLECL81w+VX3BumrGD58=
github.com/go-openapi/validate v0.24.0/go.mod h1:iyeX1sEufmv3nPbBdX3ieNviWnOZaJ1+zquzJEf2BAQ=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
@@ -419,7 +410,6 @@ github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LB
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
-github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
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/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM=
@@ -437,30 +427,6 @@ github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8/go.mod h1:WoM
github.com/go-toolsmith/pkgload v1.0.0/go.mod h1:5eFArkbO80v7Z0kdngIxsRXRMTaX4Ilcwuh3clNrQJc=
github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8=
github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU=
-github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0=
-github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY=
-github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg=
-github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI=
-github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI=
-github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs=
-github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI=
-github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI=
-github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk=
-github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28=
-github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo=
-github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk=
-github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw=
-github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360=
-github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg=
-github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE=
-github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8=
-github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc=
-github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc=
-github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4=
-github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4=
-github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ=
-github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0=
-github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/godbus/dbus v0.0.0-20181025153459-66d97aec3384/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw=
github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
@@ -476,6 +442,8 @@ github.com/golang-collections/go-datastructures v0.0.0-20150211160725-59788d5eb2
github.com/golang-collections/go-datastructures v0.0.0-20150211160725-59788d5eb259/go.mod h1:9Qcha0gTWLw//0VNka1Cbnjvg3pNKGFdAm7E9sBabxE=
github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI=
github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
+github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo=
+github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/glog v1.2.5 h1:DrW6hGnjIhtvhOIiAKT6Psh/Kd/ldepEa81DKeiRJ5I=
@@ -484,24 +452,17 @@ github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4er
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
-github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
-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.0.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
-github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
-github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
+github.com/golang/mock v1.7.0-rc.1 h1:YojYx61/OLFsiv6Rw1Z96LpldJIy31o+UHmwAUMJ6/U=
+github.com/golang/mock v1.7.0-rc.1/go.mod h1:s42URUywIqd+OcERslBJvOjepvNymP31m3q8d/GkuRs=
+github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
-github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
-github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
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=
@@ -511,10 +472,8 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
-github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
-github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4=
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk=
github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0=
@@ -545,23 +504,18 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg=
github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
-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/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
-github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
+github.com/google/cel-go v0.26.0 h1:DPGjXackMpJWH680oGY4lZhYjIameYmR+/6RBdDGmaI=
+github.com/google/cel-go v0.26.0/go.mod h1:A9O8OU9rdvrK5MQyrqfIxo1a0u4g3sF8KB6PUIaryMM=
+github.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo=
+github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ=
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.4.1/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.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
@@ -572,34 +526,30 @@ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXi
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200507031123-427632fa3b1c/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA=
-github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
+github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8=
+github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/renameio v1.0.1 h1:Lh/jXZmvZxb0BBeSY5VKEfidcbcbenKjZFzM/q0fSeU=
github.com/google/renameio v1.0.1/go.mod h1:t/HQoYBZSsWSNK35C6CO/TpPLDVWvxOHboWUAweKUpk=
-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.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/google/uuid v1.3.0/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/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
+github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
+github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg=
+github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU=
github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY=
github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c=
github.com/gorilla/mux v0.0.0-20191024121256-f395758b854c/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
+github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
@@ -611,25 +561,26 @@ github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:Fecb
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA=
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
+github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4 h1:z53tR0945TRRQO/fLEVPI6SMv7ZflF0TEaTAoU7tOzg=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
-github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=
-github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y=
+github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 h1:qnpSQwGEnkcRpTqNOIR6bJbR0gAorgP9CSALpRcKoAA=
+github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1/go.mod h1:lXGCsh6c22WGtjr+qGHj1otzZpV/1kwTMAqkwZsnWRU=
+github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.0 h1:FbSCl+KggFl+Ocym490i/EyXF4lPgLoUtcSWquBM0Rs=
+github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.0/go.mod h1:qOchhhIlmRcqk/O9uCo/puJlyo07YINaIqdZfZG3Jkc=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
-github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
-github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
-github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
-github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
+github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
+github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
@@ -644,15 +595,13 @@ github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
-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.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
-github.com/itchyny/gojq v0.12.8 h1:Zxcwq8w4IeR8JJYEtoG2MWJZUv0RGY6QqJcO1cqV8+A=
-github.com/itchyny/gojq v0.12.8/go.mod h1:gE2kZ9fVRU0+JAksaTzjIlgnCa2akU+a1V0WXgJQN5c=
-github.com/itchyny/timefmt-go v0.1.3 h1:7M3LGVDsqcd0VZH2U+x393obrzZisp7C0uEe921iRkU=
-github.com/itchyny/timefmt-go v0.1.3/go.mod h1:0osSSCQSASBJMsIZnhAaF1C2fCBTJZXrnj37mG8/c+A=
+github.com/itchyny/gojq v0.12.9 h1:biKpbKwMxVYhCU1d6mR7qMr3f0Hn9F5k5YykCVb3gmM=
+github.com/itchyny/gojq v0.12.9/go.mod h1:T4Ip7AETUXeGpD+436m+UEl3m3tokRgajd5pRfsR5oE=
+github.com/itchyny/timefmt-go v0.1.4 h1:hFEfWVdwsEi+CY8xY2FtgWHGQaBaC3JeHd+cve0ynVM=
+github.com/itchyny/timefmt-go v0.1.4/go.mod h1:nEP7L+2YmAbT2kZ2HfSs1d8Xtw9LY8D2stDBckWakZ8=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
@@ -675,11 +624,9 @@ github.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24 h1:liMMTbpW
github.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
-github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
-github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ=
-github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
-github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
+github.com/jonboulle/clockwork v0.5.0 h1:Hyh9A8u51kptdkR+cqRpT1EebBwTn1oK9YfGYbdFz6I=
+github.com/jonboulle/clockwork v0.5.0/go.mod h1:3mZlmanh0g2NDKO5TWZVJAfofYk64M7XN3SzBPjZF60=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
@@ -691,8 +638,6 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
-github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4=
-github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA=
github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8=
github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg=
github.com/kennygrant/sanitize v1.2.4 h1:gN25/otpP5vAsO2djbMhF/LQX6R7+O1TB4yv8NzpJ3o=
@@ -704,7 +649,6 @@ github.com/kisielk/gotool v0.0.0-20161130080628-0de1eaf82fa3/go.mod h1:jxZFDH7IL
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
-github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.10.8/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
@@ -714,7 +658,6 @@ github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM52
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/pgzip v1.2.4/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
-github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
@@ -731,6 +674,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/krishicks/yaml-patch v0.0.10 h1:H4FcHpnNwVmw8u0MjPRjWyIXtco6zM2F78t+57oNM3E=
github.com/krishicks/yaml-patch v0.0.10/go.mod h1:Sm5TchwZS6sm7RJoyg87tzxm2ZcKzdRE4Q7TjNhPrME=
github.com/kubernetes-sigs/kube-storage-version-migrator v0.0.0-20191127225502-51849bc15f17/go.mod h1:enH0BVV+4+DAgWdwSlMefG8bBzTfVMTr1lApzdLZ/cc=
+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/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
@@ -746,32 +691,25 @@ github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8SYxI99mE=
github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
+github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
-github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
-github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
-github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE=
-github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
-github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
-github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/mattn/go-sqlite3 v2.0.1+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
-github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg=
-github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k=
github.com/microcosm-cc/bluemonday v1.0.26 h1:xbqSvqzQMeEHCqMi64VAs4d8uy6Mequs3rQ0k/Khz58=
github.com/microcosm-cc/bluemonday v1.0.26/go.mod h1:JyzOCs9gkyQyjs+6h10UEVSe02CGwkhd72Xdqh78TWs=
github.com/mistifyio/go-zfs v2.1.1+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4=
@@ -783,7 +721,6 @@ github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQ
github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=
github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
-github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
@@ -795,8 +732,6 @@ github.com/moby/moby v27.2.1+incompatible/go.mod h1:fDXVQ6+S340veQPv35CzDahGBmHs
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c=
-github.com/moby/spdystream v0.5.1 h1:9sNYeYZUcci9R6/w7KDaFWEWeV4LStVG78Mpyq/Zm/Y=
-github.com/moby/spdystream v0.5.1/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI=
github.com/moby/sys/atomicwriter v0.1.0 h1:kw5D/EqkBwsBFi0ss9v1VG3wIkVhzGvLklJ+w3A14Sw=
github.com/moby/sys/atomicwriter v0.1.0/go.mod h1:Ul8oqv2ZMNHOceF643P6FKPXeCmYtlQMvpizfsSoaWs=
github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU=
@@ -819,7 +754,6 @@ github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFd
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/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/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/mozilla/tls-observatory v0.0.0-20180409132520-8791a200eb40/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk=
@@ -830,7 +764,6 @@ github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8m
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/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
-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/nbutton23/zxcvbn-go v0.0.0-20160627004424-a22cb81b2ecd/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU=
github.com/nbutton23/zxcvbn-go v0.0.0-20171102151520-eafdab6b0663/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU=
@@ -854,23 +787,8 @@ github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vv
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.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
-github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
-github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU=
-github.com/onsi/ginkgo/v2 v2.1.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk=
-github.com/onsi/ginkgo/v2 v2.3.0/go.mod h1:Eew0uilEqZmIEZr8JrvYlvOM7Rr6xzTmMV8AyFNU9d0=
-github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo=
-github.com/onsi/ginkgo/v2 v2.5.0/go.mod h1:Luc4sArBICYCS8THh8v3i3i5CuSZO+RaQRaJoeNwomw=
-github.com/onsi/ginkgo/v2 v2.7.0/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1LFVcsAo=
-github.com/onsi/ginkgo/v2 v2.8.1/go.mod h1:N1/NbDngAFcSLdyZ+/aYTYGSlq9qMCS/cNKGJjy+csc=
-github.com/onsi/ginkgo/v2 v2.9.0/go.mod h1:4xkjoL/tZv4SMWeww56BU5kAt19mVB47gTWxmrTcxyk=
-github.com/onsi/ginkgo/v2 v2.9.1/go.mod h1:FEcmzVcCHl+4o9bQZVab+4dC9+j+91t2FHSzmGAPfuo=
-github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts=
-github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3RonqW57k=
-github.com/onsi/ginkgo/v2 v2.9.7/go.mod h1:cxrmXWykAwTwhQsJOPfdIDiJ+l2RYq7U8hFU+M/1uw0=
-github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM=
-github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
-github.com/onsi/ginkgo/v2 v2.20.1 h1:YlVIbqct+ZmnEph770q9Q7NVAz4wwIiVNahee6JyUzo=
-github.com/onsi/ginkgo/v2 v2.20.1/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI=
+github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns=
+github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
@@ -878,23 +796,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
-github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
-github.com/onsi/gomega v1.20.1/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo=
-github.com/onsi/gomega v1.21.1/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc=
-github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ1tuM=
-github.com/onsi/gomega v1.24.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg=
-github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM=
-github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM=
-github.com/onsi/gomega v1.27.1/go.mod h1:aHX5xOykVYzWOV4WqQy0sy8BQptgukenXpCXfadcIAw=
-github.com/onsi/gomega v1.27.3/go.mod h1:5vG284IBtfDAmDyrK+eGyZmUgUlmi+Wngqo557cZ6Gw=
-github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ=
-github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg=
-github.com/onsi/gomega v1.27.7/go.mod h1:1p8OOlwo2iUUDsHnOrjE5UKYJ+e3W8eQ3qSlRahPmr4=
-github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ=
-github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
-github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
-github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4=
-github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
+github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A=
+github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k=
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
@@ -917,45 +820,46 @@ github.com/openshift-online/ocm-sdk-go v0.1.499/go.mod h1:eKqLMWEeZ6vadCHjlRPseP
github.com/openshift/api v0.0.0-20200326160804-ecb9283fe820/go.mod h1:RKMJ5CBnljLfnej+BJ/xnOWc3kZDvJUaIAEq2oKSPtE=
github.com/openshift/api v0.0.0-20200827090112-c05698d102cf/go.mod h1:M3xexPhgM8DISzzRpuFUy+jfPjQPIcs9yqEYj17mXV8=
github.com/openshift/api v0.0.0-20200829102639-8a3a835f1acf/go.mod h1:M3xexPhgM8DISzzRpuFUy+jfPjQPIcs9yqEYj17mXV8=
-github.com/openshift/api v0.0.0-20251203133830-85216507eada h1:Bo2v12aq3pj+kMger/lPONlq7vBJpLz4B9cZnLdZdks=
-github.com/openshift/api v0.0.0-20251203133830-85216507eada/go.mod h1:d5uzF0YN2nQQFA0jIEWzzOZ+edmo6wzlGLvx5Fhz4uY=
-github.com/openshift/assisted-image-service v0.0.0-20231023144959-c402402f52bf h1:cBRHiPeMKGWX1ml1rLvMm1ILTJQqLC0AVhTDSJIaIDY=
-github.com/openshift/assisted-image-service v0.0.0-20231023144959-c402402f52bf/go.mod h1:C/h+zRheayk9F6NxH7t2D26p++o4bRpMf/CV4Lovp9E=
-github.com/openshift/baremetal-operator/apis v0.0.0-20231019133159-8643f32fea3e h1:wxkrIEx1lA6vdGAuBAgXmOVDJ+vX+4nhc7Cgu2jszSg=
-github.com/openshift/baremetal-operator/apis v0.0.0-20231019133159-8643f32fea3e/go.mod h1:124MbDDT1AWBpBNcnAPII2H+6p1Q7MIBF67egVtjYbc=
-github.com/openshift/baremetal-operator/pkg/hardwareutils v0.0.0-20231019133159-8643f32fea3e h1:IHlr/057j/i3LkyaI4lLPYixNXMBMPaaJAe9/GPYnZU=
-github.com/openshift/baremetal-operator/pkg/hardwareutils v0.0.0-20231019133159-8643f32fea3e/go.mod h1:Dck2B6BQX3L+AE2Xe+LzrVPP1A/zQkhCU/aSVbsi7Nw=
+github.com/openshift/api v0.0.0-20260619095050-5346161d1bf2 h1:oZkYkIvQHkQV8pN0oe8AfPfc7y9+svwmsQHwbOWyJBw=
+github.com/openshift/api v0.0.0-20260619095050-5346161d1bf2/go.mod h1:Jm45pE7O6/G0tYYhiLzNyZykTjmf9BfhsKYuGfLLwTE=
+github.com/openshift/assisted-image-service v0.0.0-20250917153356-4ca9ff81f712 h1:UJVh+I/AWZcOJASGdiLcTXkWB1OYNhS/383DHMcRvCQ=
+github.com/openshift/assisted-image-service v0.0.0-20250917153356-4ca9ff81f712/go.mod h1:WGdSeSnK0voEWWwA4ar5eApNjGBLmGTpFurEKw/FXJc=
+github.com/openshift/baremetal-operator/apis v0.0.0-20260730095922-f64454b94cbd h1:DVRQCYDWrbPBWUJKsWnnlV1mCV5KTvl1uagS66noMWo=
+github.com/openshift/baremetal-operator/apis v0.0.0-20260730095922-f64454b94cbd/go.mod h1:OyXzgO9dvGlUf2sfnrowyu0mO3O8guFEdd2hcSufHEs=
github.com/openshift/build-machinery-go v0.0.0-20200211121458-5e3d6e570160/go.mod h1:1CkcsT3aVebzRBzVTSbiKSkJMsC/CASqxesfqEMfJEc=
github.com/openshift/build-machinery-go v0.0.0-20200819073603-48aa266c95f7/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE=
github.com/openshift/client-go v0.0.0-20200827190008-3062137373b5/go.mod h1:5rGmrkQ8DJEUXA+AR3rEjfH+HFyg4/apY9iCQFgvPfE=
-github.com/openshift/client-go v0.0.0-20230926161409-848405da69e1 h1:W1N/3nVciqmjPjn2xldHjb0AwwCQzlGxLvX5BCgE8H4=
-github.com/openshift/client-go v0.0.0-20230926161409-848405da69e1/go.mod h1:ihUJrhBcYAGYQrJu/gP2OMgfVds5f5z5kbeLNBqjHLo=
-github.com/openshift/cluster-baremetal-operator v0.0.0-20240207191432-82df158cd2e9 h1:5M8gBJpo3B7BZTnd+hB4mYtgfeWFzSWIWcXyuGHRaw0=
-github.com/openshift/cluster-baremetal-operator v0.0.0-20240207191432-82df158cd2e9/go.mod h1:RJShHY6ZNnI4dLZFLJsfSd8gGYHJhWIIgO98ZarSo9Q=
+github.com/openshift/client-go v0.0.0-20260618131434-17fd91ed6167 h1:TfqgEkvjjdzmVW3wkXWjh65rF+cjahnrBMbRdraT4Wo=
+github.com/openshift/client-go v0.0.0-20260618131434-17fd91ed6167/go.mod h1:SYV1Wn6Pd27K9olD4WbUtjn4RWU83b9UjG1rbaQsTRE=
+github.com/openshift/cluster-baremetal-operator v0.0.0-20260730100446-c9028b5c892c h1:bLeSZRQuLRyVL2/8eMq/9ebfCmW/0Q3CdMOf0dwgJVQ=
+github.com/openshift/cluster-baremetal-operator v0.0.0-20260730100446-c9028b5c892c/go.mod h1:y/YpD8FV+p+Q9TkQoSmWtAMno8TfjWrtdkUgee2D3D0=
github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87 h1:cHyxR+Y8rAMT6m1jQCaYGRwikqahI0OjjUDhFNf3ySQ=
github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87/go.mod h1:DB/Mf2oTeiAmVVX1gN+NEqweonAPY0TKUwADizj8+ZA=
-github.com/openshift/generic-admission-server v1.14.1-0.20231020105858-8dcc3c9b298f h1:LzKRLvLJkWW4+4KsuvMmXJQ81ZZJSm2xxu6jwtn5gN0=
-github.com/openshift/generic-admission-server v1.14.1-0.20231020105858-8dcc3c9b298f/go.mod h1:/CLsleDcQ6AFTGKJe9VL3Y4rB9DqX3fQwQv47q2/ZJc=
+github.com/openshift/generic-admission-server v1.14.1-0.20260305203524-5df3cca1e3cd h1:vmJQouRzbrWIh/klml4SHYpB7U4FEDu6eKt9oqhIVBQ=
+github.com/openshift/generic-admission-server v1.14.1-0.20260305203524-5df3cca1e3cd/go.mod h1:DMfTM7LGbW1IF+h1K3stXiomJmu4l5dTKgrfItEIWrU=
github.com/openshift/golang-oauth2 v0.26.1-0.20250310184649-06a918c6239d h1:iQfTKBmMcwFTxxVWV7U/C6GqgIIWTKD8l5HXslvn53s=
github.com/openshift/golang-oauth2 v0.26.1-0.20250310184649-06a918c6239d/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
-github.com/openshift/hive/apis v0.0.0-20260415205034-aa1db747a6ba h1:GXPfNjWwWpi65XNnsDKqgVKiQ4EM2A3uuHgXNgtSK/4=
-github.com/openshift/hive/apis v0.0.0-20260415205034-aa1db747a6ba/go.mod h1:98U/kA+A9nenhu0mCqaxaKyYJ+C/YEZoAUkPYDT/m+c=
+github.com/openshift/hive/apis v0.0.0-20260729204917-c0b802fe5402 h1:irvOhERXc7TgNTvNVyfaLBV/+Wvx0/G07cMPaQB+FPQ=
+github.com/openshift/hive/apis v0.0.0-20260729204917-c0b802fe5402/go.mod h1:OfDFUHvU2+Caq6HPEtISSR2g+j3GhdxJNRquhhhNjww=
github.com/openshift/image-customization-controller v0.0.0-20240307203510-394809633b6b h1:SDdbzE3oW2qs7AJj4DT5gk8HDkZYR8DTT1ZfyBhECZ8=
github.com/openshift/image-customization-controller v0.0.0-20240307203510-394809633b6b/go.mod h1:G9yHOogitMOA0R5UWFmFup00E6nik8Sns/tCYYBU7jE=
+github.com/openshift/installer v1.4.22-ec5 h1:NG9X2iZG5mbUVZIBhpMtMrGNK7Tbm9dDGAI6aXh/QZc=
+github.com/openshift/installer v1.4.22-ec5/go.mod h1:PbGvWlLRbmmSsaTQBAjhXPzliz9XJAYUdXcY0t/3UiY=
github.com/openshift/library-go v0.0.0-20191003152030-97c62d8a2901/go.mod h1:NBttNjZpWwup/nthuLbPAPSYC8Qyo+BBK5bCtFoyYjo=
github.com/openshift/library-go v0.0.0-20200831114015-2ab0c61c15de/go.mod h1:6vwp+YhYOIlj8MpkQKkebTTSn2TuYyvgiAFQ206jIEQ=
-github.com/openshift/library-go v0.0.0-20231110170715-08d73a9c798b h1:BmunS/b02dKSwQ0H21+3EbXDfDr9t8UDlO54WxKkOts=
-github.com/openshift/library-go v0.0.0-20231110170715-08d73a9c798b/go.mod h1:8UzmrBMCn7+GzouL8DVYkL9COBQTB1Ggd13/mHJQCUg=
+github.com/openshift/library-go v0.0.0-20260714195535-84bc6054e9a0 h1:od97vn0lrIcHZLC6BNc75GAUBBR/4xtnUjKPQnHW/WI=
+github.com/openshift/library-go v0.0.0-20260714195535-84bc6054e9a0/go.mod h1:8d0qQEDq2kpIZmaE1tKpvZ4pLeQZT+mW2JpqAh3iZIc=
github.com/openshift/machine-config-operator v0.0.1-0.20201023110058-6c8bd9b2915c h1:IoRAW8eg94CSibrFxv0BBvsRzEC/8piFu5+sWGqy9ek=
github.com/openshift/machine-config-operator v0.0.1-0.20201023110058-6c8bd9b2915c/go.mod h1:fjKreLaKEeUKsyIkT4wlzIQwUVJ2ZKDUh3CI73ckYIY=
github.com/openshift/runtime-utils v0.0.0-20200415173359-c45d4ff3f912/go.mod h1:0OXNy7VoqFexkxKqyQbHJLPwn1MFp1/CxRJAgKHM+/o=
+github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
+github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/ostreedev/ostree-go v0.0.0-20190702140239-759a8c1ac913/go.mod h1:J6OG6YJVEWopen4avK3VNQSnALmmjvniMmni/YFYAwc=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/pelletier/go-toml v1.1.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
-github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo=
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
@@ -964,7 +868,6 @@ github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFu
github.com/pierrec/lz4/v4 v4.1.17 h1:kV4Ip+/hUBC+8T6+2EgburRtkE9ef4nbY3f4dFhGjMc=
github.com/pierrec/lz4/v4 v4.1.17/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
github.com/pin/tftp v2.1.0+incompatible/go.mod h1:xVpZOMCXTy+A5QMjEVN0Glwa1sUvaJhFXbr/aAxuxGY=
-github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
@@ -980,47 +883,43 @@ github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:Om
github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
github.com/pquerna/ffjson v0.0.0-20181028064349-e517b90714f7/go.mod h1:YARuvh7BUWHNhzDq2OM5tzR2RiCcN2D7sapiKyCel/M=
github.com/pquerna/ffjson v0.0.0-20190813045741-dac163c6c0a9/go.mod h1:YARuvh7BUWHNhzDq2OM5tzR2RiCcN2D7sapiKyCel/M=
-github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.57.0 h1:dslXhV7NbAFID2fh0ZLMjodbMYuitiJzDEpYNOoyRrg=
-github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.57.0/go.mod h1:tflNO6iwG09icVcOe2VfhC73fmtKSKT1aNXYnVtAumU=
+github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.74.0 h1:AHzMWDxNiAVscJL6+4wkvFRTpMnJqiaZFEKA/osaBXE=
+github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.74.0/go.mod h1:wAR5JopumPtAZnu0Cjv2PSqV4p4QB09LMhc6fZZTXuA=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
-github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
-github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
+github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
+github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
-github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
+github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
+github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
-github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM=
-github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY=
+github.com/prometheus/common v0.67.4 h1:yR3NqWO1/UyO1w2PhUvXlGQs/PtFmoveVO0KZ4+Lvsc=
+github.com/prometheus/common v0.67.4/go.mod h1:gP0fq6YjjNCLssJCQp0yk4M8W6ikLURwkdd/YKtTbyI=
github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
-github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
-github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
+github.com/prometheus/procfs v0.19.2 h1:zUMhqEW66Ex7OXIiDkll3tl9a1ZdilUOd/F6ZXw4Vws=
+github.com/prometheus/procfs v0.19.2/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI=
-github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc=
github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
-github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
-github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
-github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA=
@@ -1048,13 +947,12 @@ github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOms
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.0.5/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
-github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
-github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
-github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
+github.com/sirupsen/logrus v1.9.4-0.20230606125235-dd1b4c2e81af h1:Sp5TG9f7K39yfB+If0vjp97vuT74F72r8hfRpP8jLU0=
+github.com/sirupsen/logrus v1.9.4-0.20230606125235-dd1b4c2e81af/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA=
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog=
github.com/slok/go-http-metrics v0.11.0 h1:ABJUpekCZSkQT1wQrFvS4kGbhea/w6ndFJaWJeh3zL0=
@@ -1074,15 +972,16 @@ github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU
github.com/spf13/cobra v0.0.2/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
-github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
-github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
+github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=
+github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=
github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
+github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
-github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
+github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.0.2/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM=
@@ -1109,6 +1008,7 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
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/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
@@ -1153,12 +1053,11 @@ github.com/vishvananda/netlink v1.0.0/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJ
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/vmware/vmw-guestinfo v0.0.0-20170707015358-25eff159a728/go.mod h1:x9oS4Wk2s2u4tS29nEaDLdzvuHdB19CvSGJjPgkZJNk=
-github.com/vmware/vmw-guestinfo v0.0.0-20220317130741-510905f0efa3/go.mod h1:CSBTxrhePCm0cmXNKDGeu+6bOQzpaEklfCqEpn89JWk=
github.com/vmware/vmw-ovflib v0.0.0-20170608004843-1f217b9dc714/go.mod h1:jiPk45kn7klhByRvUq5i2vo1RtHKBHj+iWGFpxbXuuI=
-github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
+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/xdg/scram v1.0.5 h1:TuS0RFmt5Is5qm9Tm2SoD89OPqe4IRiFtyFY4iwWXsw=
github.com/xdg/scram v1.0.5/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
-github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
github.com/xdg/stringprep v1.0.3 h1:cmL5Enob4W83ti/ZHuZLuKD/xqJfus4fVPwE+/BDm+4=
github.com/xdg/stringprep v1.0.3/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
@@ -1166,13 +1065,13 @@ github.com/xeipuuv/gojsonpointer v0.0.0-20190809123943-df4f5c81cb3b/go.mod h1:N2
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/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=
-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/xiang90/probing v0.0.0-20221125231312-a49e3df8f510 h1:S2dVYn90KE98chqDkyE9Z4N61UnQd+KOfgp5Iu53llk=
+github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1/go.mod h1:QcJo0QPSfTONNIgpN5RA8prR7fF8nkF6cTWTcNerRO8=
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
-github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
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.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
@@ -1185,48 +1084,42 @@ go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
-go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0=
-go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ=
+go.etcd.io/bbolt v1.4.3 h1:dEadXpI6G79deX5prL3QRNP6JB8UxVkqo4UPnHaNXJo=
+go.etcd.io/bbolt v1.4.3/go.mod h1:tKQlpPaYCVFctUIgFKFnAlvbmB3tpy1vkTnDWohtc0E=
go.etcd.io/etcd v0.5.0-alpha.5.0.20200819165624-17cef6e3e9d5 h1:Gqga3zA9tdAcfqobUGjSoCob5L3f8Dt5EuOp3ihNZko=
go.etcd.io/etcd v0.5.0-alpha.5.0.20200819165624-17cef6e3e9d5/go.mod h1:skWido08r9w6Lq/w70DO5XYIKMu4QFu1+4VsqLQuJy8=
-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/etcd/client/pkg/v3 v3.5.11 h1:bT2xVspdiCj2910T0V+/KHcVKjkUrCZVtk8J2JF2z1A=
-go.etcd.io/etcd/client/pkg/v3 v3.5.11/go.mod h1:seTzl2d9APP8R5Y2hFL3NVlD6qC/dOT+3kvrqPyTas4=
-go.etcd.io/etcd/client/v2 v2.305.10 h1:MrmRktzv/XF8CvtQt+P6wLUlURaNpSDJHFZhe//2QE4=
-go.etcd.io/etcd/client/v2 v2.305.10/go.mod h1:m3CKZi69HzilhVqtPDcjhSGp+kA1OmbNn0qamH80xjA=
-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.10 h1:WPR8K0e9kWl1gAhB5A7gEa5ZBTNkT9NdNWrR8Qpo1CM=
-go.etcd.io/etcd/pkg/v3 v3.5.10/go.mod h1:TKTuCKKcF1zxmfKWDkfz5qqYaE3JncKKZPFf8c1nFUs=
-go.etcd.io/etcd/raft/v3 v3.5.10 h1:cgNAYe7xrsrn/5kXMSaH8kM/Ky8mAdMqGOxyYwpP0LA=
-go.etcd.io/etcd/raft/v3 v3.5.10/go.mod h1:odD6kr8XQXTy9oQnyMPBOr0TVe+gT0neQhElQ6jbGRc=
-go.etcd.io/etcd/server/v3 v3.5.10 h1:4NOGyOwD5sUZ22PiWYKmfxqoeh72z6EhYjNosKGLmZg=
-go.etcd.io/etcd/server/v3 v3.5.10/go.mod h1:gBplPHfs6YI0L+RpGkTQO7buDbHv5HJGG/Bst0/zIPo=
+go.etcd.io/etcd/api/v3 v3.6.5 h1:pMMc42276sgR1j1raO/Qv3QI9Af/AuyQUW6CBAWuntA=
+go.etcd.io/etcd/api/v3 v3.6.5/go.mod h1:ob0/oWA/UQQlT1BmaEkWQzI0sJ1M0Et0mMpaABxguOQ=
+go.etcd.io/etcd/client/pkg/v3 v3.6.5 h1:Duz9fAzIZFhYWgRjp/FgNq2gO1jId9Yae/rLn3RrBP8=
+go.etcd.io/etcd/client/pkg/v3 v3.6.5/go.mod h1:8Wx3eGRPiy0qOFMZT/hfvdos+DjEaPxdIDiCDUv/FQk=
+go.etcd.io/etcd/client/v3 v3.6.5 h1:yRwZNFBx/35VKHTcLDeO7XVLbCBFbPi+XV4OC3QJf2U=
+go.etcd.io/etcd/client/v3 v3.6.5/go.mod h1:ZqwG/7TAFZ0BJ0jXRPoJjKQJtbFo/9NIY8uoFFKcCyo=
+go.etcd.io/etcd/pkg/v3 v3.6.5 h1:byxWB4AqIKI4SBmquZUG1WGtvMfMaorXFoCcFbVeoxM=
+go.etcd.io/etcd/pkg/v3 v3.6.5/go.mod h1:uqrXrzmMIJDEy5j00bCqhVLzR5jEJIwDp5wTlLwPGOU=
+go.etcd.io/etcd/server/v3 v3.6.5 h1:4RbUb1Bd4y1WkBHmuF+cZII83JNQMuNXzyjwigQ06y0=
+go.etcd.io/etcd/server/v3 v3.6.5/go.mod h1:PLuhyVXz8WWRhzXDsl3A3zv/+aK9e4A9lpQkqawIaH0=
+go.etcd.io/raft/v3 v3.6.0 h1:5NtvbDVYpnfZWcIHgGRk9DyzkBIXOi8j+DDp1IcnUWQ=
+go.etcd.io/raft/v3 v3.6.0/go.mod h1:nLvLevg6+xrVtHUmVaTcTz603gQPHfh7kUAwV6YpfGo=
go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
-go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE=
-go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE=
-go.mongodb.org/mongo-driver v1.14.0 h1:P98w8egYRjYe3XDjxhYJagTokP/H6HzlsnojRgZRd80=
-go.mongodb.org/mongo-driver v1.14.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c=
+go.mongodb.org/mongo-driver v1.17.4 h1:jUorfmVzljjr0FLzYQsGP8cgN/qzzxlY9Vh0C9KFXVw=
+go.mongodb.org/mongo-driver v1.17.4/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
-go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
-go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 h1:SpGay3w+nEwMpfVnbqOLH5gY52/foP8RE8UzTZ1pdSE=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.62.0 h1:rbRJ8BBoVMsQShESYZ0FkvcITu8X8QNwJogcLUmDNNw=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.62.0/go.mod h1:ru6KHrNtNHxM4nD/vd6QrLVWgKhxPYgblq4VAtNawTQ=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 h1:Hf9xI/XLML9ElpiHVDNwvqI0hIFlzV8dgIr35kV1kRU=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0/go.mod h1:NfchwuyNoMcZ5MLHwPrODwUF1HWCXWrL31s8gSAdIKY=
go.opentelemetry.io/otel v1.43.0 h1:mYIM03dnh5zfN7HautFE4ieIig9amkNANT+xcVxAj9I=
go.opentelemetry.io/otel v1.43.0/go.mod h1:JuG+u74mvjvcm8vj8pI5XiHy1zDeoCS2LB1spIq7Ay0=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 h1:cl5P5/GIfFh4t6xyruOgJP5QiA1pw4fYYdv6nc6CBWw=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0/go.mod h1:zgBdWWAu7oEEMC06MMKc5NLbA/1YDXV1sMpSqEeLQLg=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 h1:tIqheXEFWAZ7O8A7m+J0aPTmpJN3YQ7qetUAdkkkKpk=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0/go.mod h1:nUeKExfxAQVbiVFn32YXpXZZHZ61Cc3s3Rn1pDBGAb0=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 h1:OeNbIYk/2C15ckl7glBlOBp5+WlYsOElzTNmiPW/x60=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0/go.mod h1:7Bept48yIeqxP2OZ9/AqIpYS94h2or0aB4FypJTc8ZM=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 h1:tgJ0uaNS4c98WRNUEx5U3aDlrDOI5Rs+1Vifcw4DJ8U=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0/go.mod h1:U7HYyW0zt/a9x5J1Kjs+r1f/d4ZHnYFclhYY2+YbeoE=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.41.0 h1:inYW9ZhgqiDqh6BioM7DVHHzEGVq76Db5897WLGZ5Go=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.41.0/go.mod h1:Izur+Wt8gClgMJqO/cZ8wdeeMryJ/xxiOVgFSSfpDTY=
go.opentelemetry.io/otel/metric v1.43.0 h1:d7638QeInOnuwOONPp4JAOGfbCEpYb+K6DVWvdxGzgM=
@@ -1237,10 +1130,8 @@ go.opentelemetry.io/otel/sdk/metric v1.43.0 h1:S88dyqXjJkuBNLeMcVPRFXpRw2fuwdvfC
go.opentelemetry.io/otel/sdk/metric v1.43.0/go.mod h1:C/RJtwSEJ5hzTiUz5pXF1kILHStzb9zFlIEe85bhj6A=
go.opentelemetry.io/otel/trace v1.43.0 h1:BkNrHpup+4k4w+ZZ86CZoHHEkohws8AY+WTX09nk+3A=
go.opentelemetry.io/otel/trace v1.43.0/go.mod h1:/QJhyVBUUswCphDVxq+8mld+AvhXZLhe+8WVFxiFff0=
-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.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.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4=
+go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
@@ -1251,8 +1142,8 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
@@ -1263,9 +1154,7 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
@@ -1278,28 +1167,15 @@ golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPh
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.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
-golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
-golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio=
-golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
-golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
-golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
-golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
-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.52.0 h1:RMs7fP2rXdep0CftQlK8Uf+kibLm7qkCcradZWYz988=
golang.org/x/crypto v0.52.0/go.mod h1:1QgfPxDqh0T2M/elOJtp9RvuR95kVjir0e6/BvEmGbc=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
-golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
-golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
-golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
-golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
-golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
-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/exp v0.0.0-20250305212735-054e65f0b394 h1:nDVHiLt8aIbd/VzvPWN6kSOPE7+F/fNFDSXLVYkE/Iw=
+golang.org/x/exp v0.0.0-20250305212735-054e65f0b394/go.mod h1:sIifuuw/Yco/y6yb6+bDNfyeQ/MdPUy/hKEMYQV17cM=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@@ -1308,30 +1184,21 @@ golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTk
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
-golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
-golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
-golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
-golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
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.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
-golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
-golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI=
-golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
-golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
+golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM=
+golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU=
+golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20170915142106-8351a756f30f/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
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=
@@ -1351,24 +1218,15 @@ golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
@@ -1380,32 +1238,16 @@ golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
-golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
-golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220706163947-c90051bbdb60/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
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.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
-golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
-golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
-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.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
-golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
-golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
-golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
-golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
-golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
-golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8=
-golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww=
+golang.org/x/net v0.55.1-0.20260602153038-42abb857022c h1:hzdRVvjwthcq46T3ybsDtJpg1iZZaW3zik9P3tsYJeo=
+golang.org/x/net v0.55.1-0.20260602153038-42abb857022c/go.mod h1:Mo4aFsyVPXieTwCJ1g83a3xU8RY7PkHFQqQ7pkWnuM0=
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-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20190412183630-56d357773e84/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-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -1413,12 +1255,9 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
-golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
-golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
+golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20171026204733-164713f0dfce/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -1428,26 +1267,22 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191110163157-d32e6e3b99c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -1455,22 +1290,12 @@ golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200610111108-226ff32320da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -1484,7 +1309,6 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
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-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -1492,80 +1316,45 @@ golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220408201424-a24fb2fb8a0f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/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-20220615213510-4f61da869c0c/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.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.3.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=
-golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.15.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.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY=
golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
-golang.org/x/telemetry v0.0.0-20240208230135-b75ee8823808/go.mod h1:KG1lNk5ZFNssSZLrpVb4sMXKMpGwGXOxSG3rnu2gZQQ=
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.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
-golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
-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.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
-golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
-golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
-golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
-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.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4=
golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk=
-golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.0.0-20170915090833-1cbadb444a80/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
-golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
-golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
-golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
-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.12.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.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc=
golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
-golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
+golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U=
+golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno=
golang.org/x/tools v0.0.0-20170915040203-e531a2a1c15f/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -1578,14 +1367,10 @@ golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
-golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
@@ -1598,82 +1383,41 @@ golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190930201159-7c411dea38b0/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200115044656-831fdb1e1868/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
-golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
-golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
-golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200601175630-2caf76543d99/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200606014950-c42cb6316fb6/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200610160956-3e83d1e96d0e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/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-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
+golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff/go.mod h1:YD9qOF0M9xpSpdWTBbzEl5e/RnCefISl8E5Noe10jFM=
+golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
-golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
-golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA=
-golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
-golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
-golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
-golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
-golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM=
-golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
-golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
-golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg=
golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c=
golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI=
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-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
-gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
-gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
-gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
-gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
+gomodules.xyz/jsonpatch/v2 v2.5.0 h1:JELs8RLM12qJGXU4u/TO3V25KW8GreMKl9pdkk14RM0=
+gomodules.xyz/jsonpatch/v2 v2.5.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
+gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4=
+gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
-google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
-google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
-google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
-google.golang.org/api v0.26.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
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/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
-google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
@@ -1682,33 +1426,13 @@ google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRn
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
-google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
-google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
-google.golang.org/genproto v0.0.0-20200603110839-e855014d5736/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
-google.golang.org/genproto v0.0.0-20200608115520-7c474a2e3482/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
-google.golang.org/genproto v0.0.0-20200610104632-a5b850bcf112/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 h1:nz5NESFLZbJGPFxDT/HCn+V1mZ8JGNoY4nUpmW/Y2eg=
-google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917/go.mod h1:pZqR+glSb11aJ+JQcczCvgf47+duRuzNSKqE8YAQnV0=
-google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=
-google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:+rXWjjaukWZun3mLfjmVnQi18E1AsFbDN9QdJ5YXLto=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk=
+google.golang.org/genproto/googleapis/api v0.0.0-20260120221211-b8f7ae30c516 h1:vmC/ws+pLzWjj/gzApyoZuSVrDtF1aod4u/+bbj8hgM=
+google.golang.org/genproto/googleapis/api v0.0.0-20260120221211-b8f7ae30c516/go.mod h1:p3MLuOwURrGBRoEyFHBT3GjUwaCQVKeNqqWxlcISGdw=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20260120221211-b8f7ae30c516 h1:sNrWoksmOyF5bvJUcnmbeAmQi8baNhqg5IWaI3llQqU=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20260120221211-b8f7ae30c516/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
@@ -1716,14 +1440,10 @@ google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ij
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA=
-google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
-google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
-google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
-google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
-google.golang.org/grpc v1.79.3 h1:sybAEdRIEtvcD68Gx7dmnwjZKlyfuc61Dyo9pGXXkKE=
-google.golang.org/grpc v1.79.3/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ=
+google.golang.org/grpc v1.80.0 h1:Xr6m2WmWZLETvUNvIUmeD5OAagMw3FiKmMlTdViWsHM=
+google.golang.org/grpc v1.80.0/go.mod h1:ho/dLnxwi3EDJA4Zghp7k2Ec1+c2jqup0bFkw07bwF4=
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=
@@ -1733,14 +1453,11 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
google.golang.org/protobuf v1.23.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.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
-google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
-google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
-google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=
-google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
+google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af h1:+5/Sw3GsDNlEmu7TfklWKPdQ0Ykja5VEmq2i817+jbI=
+google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw=
@@ -1751,9 +1468,9 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8
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/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
-gopkg.in/djherbis/times.v1 v1.3.0 h1:uxMS4iMtH6Pwsxog094W0FYldiNnfY/xba00vq6C2+o=
-gopkg.in/djherbis/times.v1 v1.3.0/go.mod h1:AQlg6unIsrsCEdQYhTzERy542dz6SFdQFZFv6mUY0P8=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
+gopkg.in/evanphx/json-patch.v4 v4.13.0 h1:czT3CmqEaQ1aanPc5SdlgQrrEIb8w/wwCvWWnfEbYzo=
+gopkg.in/evanphx/json-patch.v4 v4.13.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
@@ -1781,7 +1498,6 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20190502103701-55513cacd4ae/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20191010095647-fc94e3f71652/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
@@ -1800,100 +1516,105 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
-honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-k8s.io/api v0.29.9 h1:FwdflpNsfMUYUOblMZNWJ4K/q0OSL5A4jGa0iOgcJco=
-k8s.io/api v0.29.9/go.mod h1:fNhmzRfKaSEHCmczA/jRx6CiDKhYOnFLJBERMJAXEk8=
+k8s.io/api v0.18.0/go.mod h1:q2HRQkfDzHMBZL9l/y9rH63PkQl4vae0xRT+8prbrK8=
+k8s.io/api v0.19.0/go.mod h1:I1K45XlvTrDjmj5LoM5LuP/KYrhWbjUKT/SoPG0qTjw=
+k8s.io/api v0.23.3/go.mod h1:w258XdGyvCmnBj/vGzQMj6kzdufJZVUwEM1U2fRJwSQ=
+k8s.io/api v0.35.6 h1:phPzP79F3kcONsD2TzmDiITNCV6/1Z5U3CCEcjtsXzI=
+k8s.io/api v0.35.6/go.mod h1:GWKUaIp24fuDFigAgnhr9EJOKDqspnwPjYlpDca5B4U=
k8s.io/apiextensions-apiserver v0.19.0/go.mod h1:znfQxNpjqz/ZehvbfMg5N6fvBJW5Lqu5HVLTJQdP4Fs=
-k8s.io/apiextensions-apiserver v0.29.5 h1:njDywexhE6n+1NEl3A4axT0TMQHREnndrk3/ztdWcNE=
-k8s.io/apiextensions-apiserver v0.29.5/go.mod h1:pfIvij+MH9a8NQKtW7MD4EFnzvUjJ1ZQsDL8wuP8fnc=
-k8s.io/apimachinery v0.29.9 h1:YZ8HUid1TzQVz94cnNlsQjLdH0VoAhWSqz7t0q6B12A=
-k8s.io/apimachinery v0.29.9/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y=
+k8s.io/apiextensions-apiserver v0.35.6 h1:fyzp3i+PAbB/jSNau9LF0rMuUTUUyybR02BpYhT1YKI=
+k8s.io/apiextensions-apiserver v0.35.6/go.mod h1:kkCbFS495cT53wOqNwWnQei759bkvgn6OqE0R8b3DEA=
+k8s.io/apimachinery v0.18.0/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA=
+k8s.io/apimachinery v0.19.0/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA=
+k8s.io/apimachinery v0.23.3/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM=
+k8s.io/apimachinery v0.35.6 h1:ASSpfmmsOArKb2Hsu8gGlIcbIcEMVTboI3FfsfYuQ8k=
+k8s.io/apimachinery v0.35.6/go.mod h1:NNi1taPOpep0jOj+oRha3mBJPqvi0hGdaV8TCqGQ+cc=
k8s.io/apiserver v0.19.0/go.mod h1:XvzqavYj73931x7FLtyagh8WibHpePJ1QwWrSJs2CLk=
-k8s.io/apiserver v0.29.5 h1:223C+JkRnGmudEU00GfpX6quDSrzwwP0DuXOYTyUYb0=
-k8s.io/apiserver v0.29.5/go.mod h1:zN9xdatz5g7XwL1Xoz9hD4QQON1GN0c+1kV5e/NHejM=
+k8s.io/apiserver v0.35.6 h1:VWYg2S0wlAmN3URFpVeuLa4PP2RCpTFg1nvlUHOy2C8=
+k8s.io/apiserver v0.35.6/go.mod h1:wajGSrXO9w+lx69jYq4SaE4Xxw5KxxwvVD1zbttYA2E=
k8s.io/cli-runtime v0.19.0/go.mod h1:tun9l0eUklT8IHIM0jors17KmUjcrAxn0myoBYwuNuo=
-k8s.io/cli-runtime v0.29.9 h1:rryHH2SZtZePv0gj9RM5ftXYcK8v2jbMLOzbORnzzw4=
-k8s.io/cli-runtime v0.29.9/go.mod h1:IHgU0jdyAOcrfkpvaDXZRqPe+RJYlUgbufl88Z6EUyo=
+k8s.io/cli-runtime v0.35.6 h1:sYNSTyoskZTS+qgk5oI/XFTn1c68wjezLYOlxp5I+5A=
+k8s.io/cli-runtime v0.35.6/go.mod h1:kQRd/92HPWwjoZaz0RsNRMeRT0snbqmKP67i5+TKI44=
k8s.io/client-go v0.19.0/go.mod h1:H9E/VT95blcFQnlyShFgnFT9ZnJOAceiUHM3MlRC+mU=
-k8s.io/client-go v0.29.9 h1:4f/Wz6li3rEyIPFj32XAQMtOGMM1tg7KQi1oeS6ibPg=
-k8s.io/client-go v0.29.9/go.mod h1:2N1drQEZ5yiYrWVaE2Un8JiISUhl47D8pyZlYLszke4=
+k8s.io/client-go v0.35.6 h1:qZQv9a5B4YlIpXhFBwsI9qPOOJC6Z8lk9lkEWmrmus8=
+k8s.io/client-go v0.35.6/go.mod h1:LOO6N1EhxdQAzYIZ/73cJVyb3gixrMY6ZDJcJ/ANfsY=
k8s.io/code-generator v0.18.0/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc=
k8s.io/code-generator v0.19.0/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk=
k8s.io/code-generator v0.23.3/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk=
k8s.io/component-base v0.19.0/go.mod h1:dKsY8BxkA+9dZIAh2aWJLL/UdASFDNtGYTCItL4LM7Y=
-k8s.io/component-base v0.29.9 h1:lPENvp3CCwdeMEWGjiTfn5b287qQYuK7gX32OBOovmA=
-k8s.io/component-base v0.29.9/go.mod h1:NGDa6Ih0EdcLA2G4K2ZYySoiB+2Tn+rmSqPyudCPgDY=
+k8s.io/component-base v0.35.6 h1:dTkck9uefkIrKn7wRCEYiDWNUvHd8UdwZCcVafmHgL4=
+k8s.io/component-base v0.35.6/go.mod h1:qcNKrspACsqR+vgUJXkWzwtgUGkURcnrus41o92jjpk=
+k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
+k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
-k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8=
+k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/klog/v2 v2.3.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/klog/v2 v2.40.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
-k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
-k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo=
-k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
-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.5 h1:DcR0hBeEcuLmKTpriezu7kyR4sJcHeeYle/WGdQWi2o=
-k8s.io/kms v0.29.5/go.mod h1:vWVImKkJd+1BQY4tBwdfSwjQBiLrnbNtHADcDEDQFtk=
+k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc=
+k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0=
+k8s.io/kms v0.35.6 h1:Mw7rWUJ8sGgXy+5GxBdv/NsuvjUzeUoJ6JvEOcfl3MI=
+k8s.io/kms v0.35.6/go.mod h1:c/uQe/eKrWdBkvizLFW+ThLA6tTzR0RkkwJJyzDRT1g=
k8s.io/kube-aggregator v0.19.0/go.mod h1:1Ln45PQggFAG8xOqWPIYMxUq8WNtpPnYsbUJ39DpF/A=
-k8s.io/kube-aggregator v0.29.5 h1:+ko7OE8HoXjPPxcQTXbo1ctkymYIohI/E0dYDnFM1vU=
-k8s.io/kube-aggregator v0.29.5/go.mod h1:4MPs9uKrm5VgxXsoaSU0QJbgIuxvNCnVTYlCVz7VWzY=
-k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
-k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98=
+k8s.io/kube-aggregator v0.35.6 h1:tl8L5VaGEEV9GwQJ1vKGZAbSbh6zrgkBprSIKmZOGSs=
+k8s.io/kube-aggregator v0.35.6/go.mod h1:iuKVInWJ5Dv0OC6wPD19rxvnviFJQPUEO9JEVDVLId0=
+k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E=
+k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o=
+k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk=
+k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk=
+k8s.io/kube-openapi v0.0.0-20260519202549-bbf5c5577288 h1:A7Lby6ekC6nv+6oO38huCMFBRP0Os+tIeq1GkwxOQes=
+k8s.io/kube-openapi v0.0.0-20260519202549-bbf5c5577288/go.mod h1:V/QaCUYDa+0QpcHhVVc5l99Uz56wEMEXBSj9oCDkNDY=
k8s.io/kubectl v0.19.0/go.mod h1:gPCjjsmE6unJzgaUNXIFGZGafiUp5jh0If3F/x7/rRg=
-k8s.io/kubectl v0.29.9 h1:8DJIPkRk5a6WonxRAbicJIn0DNwacOxaLxO4EDwf/hc=
-k8s.io/kubectl v0.29.9/go.mod h1:ylJbHUuPTYiwxAKx97nAyU3TKh3vHlEW+Pp44Usolvw=
+k8s.io/kubectl v0.35.6 h1:0zdVbdxy4rS0B/NWFDJeIasOLByh3c3U9qEOcKZDSgY=
+k8s.io/kubectl v0.35.6/go.mod h1:w7zUHoN4NZYQ5MWEVH1eNKWvqbzDm7TtkUlT8QEGbCc=
k8s.io/kubelet v0.19.0/go.mod h1:cGds22piF/LnFzfAaIT+efvOYBHVYdunqka6NVuNw9g=
k8s.io/metrics v0.19.0/go.mod h1:WykpW8B60OeAJx1imdwUgyOID2kDljr/Q+1zrPJ98Wo=
k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
-k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
-k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck=
-k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
+k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
+k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
+k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 h1:AZYQSJemyQB5eRxqcPky+/7EdBj0xi3g0ZcxxJ7vbWU=
+k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk=
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4=
mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34/go.mod h1:H6SUd1XjIs+qQCyskXg5OFSrilMRUkD8ePJpHKDPaeY=
open-cluster-management.io/api v0.12.0 h1:sNkj4k2XyWA/GLsTiFg82bLIZ7JDZKkLLLyZjJUlJMs=
open-cluster-management.io/api v0.12.0/go.mod h1:/CZhelEH+30/pX7vXGSZOzLMX0zvjthYOkT/5ZTzVTQ=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
-rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
-rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.9/go.mod h1:dzAXnQbTRyDlZPJX2SUPEqvnB+j7AJjtlox7PEwigU0=
-sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 h1:/U5vjBbQn3RChhv7P11uhYvCSm5G2GaIi5AIGBS6r4c=
-sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0/go.mod h1:z7+wmGM2dfIiLRfrC6jb5kV2Mq/sK1ZP303cxzkV5Y4=
-sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigwG62c4=
-sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0=
+sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.35.0 h1:u3Ls3Y5KMAJXGPYiLMblEsT/9pCgwyElgIqKuFumqCA=
+sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.35.0/go.mod h1:tJo1aepTXyR+8Xs3sUsGBDk4Ub2AM5dPAPKJx0mpm5c=
+sigs.k8s.io/controller-runtime v0.23.3 h1:VjB/vhoPoA9l1kEKZHBMnQF33tdCLQKJtydy4iqwZ80=
+sigs.k8s.io/controller-runtime v0.23.3/go.mod h1:B6COOxKptp+YaUT5q4l6LqUJTRpizbgf9KSRNdQGns0=
sigs.k8s.io/gateway-api v1.0.0 h1:iPTStSv41+d9p0xFydll6d7f7MOBGuqXM6p2/zVYMAs=
sigs.k8s.io/gateway-api v1.0.0/go.mod h1:4cUgr0Lnp5FZ0Cdq8FdRwCvpiWws7LVhLHGIudLlf4c=
-sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
+sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs=
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg=
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 h1:PFWFSkpArPNJxFX4ZKWAk9NSeRoZaXschn+ULa4xVek=
sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96/go.mod h1:EOBQyBowOUsd7U4CJnMHNE0ri+zCXyouGdLwC/jZU+I=
sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU=
-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/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
+sigs.k8s.io/kustomize/api v0.20.1 h1:iWP1Ydh3/lmldBnH/S5RXgT98vWYMaTUL1ADcr+Sv7I=
+sigs.k8s.io/kustomize/api v0.20.1/go.mod h1:t6hUFxO+Ph0VxIk1sKp1WS0dOjbPCtLJ4p8aADLwqjM=
+sigs.k8s.io/kustomize/kyaml v0.20.1 h1:PCMnA2mrVbRP3NIB6v9kYCAc38uvFLVs8j/CD567A78=
+sigs.k8s.io/kustomize/kyaml v0.20.1/go.mod h1:0EmkQHRUsJxY8Ug9Niig1pUMSCGHxQ5RklbpV/Ri6po=
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
+sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=
+sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=
sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
+sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4=
-sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E=
-sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
-sigs.k8s.io/structured-merge-diff/v4 v4.7.0 h1:qPeWmscJcXP0snki5IYF79Z8xrl8ETFxgMd7wez1XkI=
-sigs.k8s.io/structured-merge-diff/v4 v4.7.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps=
+sigs.k8s.io/structured-merge-diff/v6 v6.3.2 h1:kwVWMx5yS1CrnFWA/2QHyRVJ8jM6dBA80uLmm0wJkk8=
+sigs.k8s.io/structured-merge-diff/v6 v6.3.2/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
-sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=
sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
diff --git a/vendor/cel.dev/expr/.bazelversion b/vendor/cel.dev/expr/.bazelversion
new file mode 100644
index 000000000000..13c50892bde5
--- /dev/null
+++ b/vendor/cel.dev/expr/.bazelversion
@@ -0,0 +1,2 @@
+7.3.2
+# Keep this pinned version in parity with cel-go
diff --git a/vendor/cel.dev/expr/.gitattributes b/vendor/cel.dev/expr/.gitattributes
new file mode 100644
index 000000000000..3de1ec213aee
--- /dev/null
+++ b/vendor/cel.dev/expr/.gitattributes
@@ -0,0 +1,2 @@
+*.pb.go linguist-generated=true
+*.pb.go -diff -merge
diff --git a/vendor/cel.dev/expr/.gitignore b/vendor/cel.dev/expr/.gitignore
new file mode 100644
index 000000000000..0d4fed27c9f0
--- /dev/null
+++ b/vendor/cel.dev/expr/.gitignore
@@ -0,0 +1,2 @@
+bazel-*
+MODULE.bazel.lock
diff --git a/vendor/cel.dev/expr/BUILD.bazel b/vendor/cel.dev/expr/BUILD.bazel
new file mode 100644
index 000000000000..f5bda3bb171b
--- /dev/null
+++ b/vendor/cel.dev/expr/BUILD.bazel
@@ -0,0 +1,33 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"]) # Apache 2.0
+
+go_library(
+ name = "expr",
+ srcs = [
+ "checked.pb.go",
+ "eval.pb.go",
+ "explain.pb.go",
+ "syntax.pb.go",
+ "value.pb.go",
+ ],
+ importpath = "cel.dev/expr",
+ visibility = ["//visibility:public"],
+ deps = [
+ "@org_golang_google_protobuf//reflect/protoreflect",
+ "@org_golang_google_protobuf//runtime/protoimpl",
+ "@org_golang_google_protobuf//types/known/anypb",
+ "@org_golang_google_protobuf//types/known/durationpb",
+ "@org_golang_google_protobuf//types/known/emptypb",
+ "@org_golang_google_protobuf//types/known/structpb",
+ "@org_golang_google_protobuf//types/known/timestamppb",
+ ],
+)
+
+alias(
+ name = "go_default_library",
+ actual = ":expr",
+ visibility = ["//visibility:public"],
+)
diff --git a/vendor/cel.dev/expr/CODE_OF_CONDUCT.md b/vendor/cel.dev/expr/CODE_OF_CONDUCT.md
new file mode 100644
index 000000000000..59908e2d8e8d
--- /dev/null
+++ b/vendor/cel.dev/expr/CODE_OF_CONDUCT.md
@@ -0,0 +1,25 @@
+# Contributor Code of Conduct
+## Version 0.1.1 (adapted from 0.3b-angular)
+
+As contributors and maintainers of the Common Expression Language
+(CEL) project, we pledge to respect everyone who contributes by
+posting issues, updating documentation, submitting pull requests,
+providing feedback in comments, and any other activities.
+
+Communication through any of CEL's channels (GitHub, Gitter, IRC,
+mailing lists, Google+, Twitter, etc.) must be constructive and never
+resort to personal attacks, trolling, public or private harassment,
+insults, or other unprofessional conduct.
+
+We promise to extend courtesy and respect to everyone involved in this
+project regardless of gender, gender identity, sexual orientation,
+disability, age, race, ethnicity, religion, or level of experience. We
+expect anyone contributing to the project to do the same.
+
+If any member of the community violates this code of conduct, the
+maintainers of the CEL project may take action, removing issues,
+comments, and PRs or blocking accounts as deemed appropriate.
+
+If you are subject to or witness unacceptable behavior, or have any
+other concerns, please email us at
+[cel-conduct@google.com](mailto:cel-conduct@google.com).
diff --git a/vendor/cel.dev/expr/CONTRIBUTING.md b/vendor/cel.dev/expr/CONTRIBUTING.md
new file mode 100644
index 000000000000..8f5fd5c31fde
--- /dev/null
+++ b/vendor/cel.dev/expr/CONTRIBUTING.md
@@ -0,0 +1,32 @@
+# How to Contribute
+
+We'd love to accept your patches and contributions to this project. There are a
+few guidelines you need to follow.
+
+## Contributor License Agreement
+
+Contributions to this project must be accompanied by a Contributor License
+Agreement. You (or your employer) retain the copyright to your contribution,
+this simply gives us permission to use and redistribute your contributions as
+part of the project. Head over to to see
+your current agreements on file or to sign a new one.
+
+You generally only need to submit a CLA once, so if you've already submitted one
+(even if it was for a different project), you probably don't need to do it
+again.
+
+## Code reviews
+
+All submissions, including submissions by project members, require review. We
+use GitHub pull requests for this purpose. Consult
+[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
+information on using pull requests.
+
+## What to expect from maintainers
+
+Expect maintainers to respond to new issues or pull requests within a week.
+For outstanding and ongoing issues and particularly for long-running
+pull requests, expect the maintainers to review within a week of a
+contributor asking for a new review. There is no commitment to resolution --
+merging or closing a pull request, or fixing or closing an issue -- because some
+issues will require more discussion than others.
diff --git a/vendor/cel.dev/expr/GOVERNANCE.md b/vendor/cel.dev/expr/GOVERNANCE.md
new file mode 100644
index 000000000000..0a525bc17dea
--- /dev/null
+++ b/vendor/cel.dev/expr/GOVERNANCE.md
@@ -0,0 +1,43 @@
+# Project Governance
+
+This document defines the governance process for the CEL language. CEL is
+Google-developed, but openly governed. Major contributors to the CEL
+specification and its corresponding implementations constitute the CEL
+Language Council. New members may be added by a unanimous vote of the
+Council.
+
+The MAINTAINERS.md file lists the members of the CEL Language Council, and
+unofficially indicates the "areas of expertise" of each member with respect
+to the publicly available CEL repos.
+
+## Code Changes
+
+Code changes must follow the standard pull request (PR) model documented in the
+CONTRIBUTING.md for each CEL repo. All fixes and features must be reviewed by a
+maintainer. The maintainer reserves the right to request that any feature
+request (FR) or PR be reviewed by the language council.
+
+## Syntax and Semantic Changes
+
+Syntactic and semantic changes must be reviewed by the CEL Language Council.
+Maintainers may also request language council review at their discretion.
+
+The review process is as follows:
+
+- Create a Feature Request in the CEL-Spec repo. The feature description will
+ serve as an abstract for the detailed design document.
+- Co-develop a design document with the Language Council.
+- Once the proposer gives the design document approval, the document will be
+ linked to the FR in the CEL-Spec repo and opened for comments to members of
+ the cel-lang-discuss@googlegroups.com.
+- The Language Council will review the design doc at the next council meeting
+ (once every three weeks) and the council decision included in the document.
+
+If the proposal is approved, the spec will be updated by a maintainer (if
+applicable) and a rationale will be included in the CEL-Spec wiki to ensure
+future developers may follow CEL's growth and direction over time.
+
+Approved proposals may be implemented by the proposer or by the maintainers as
+the parties see fit. At the discretion of the maintainer, changes from the
+approved design are permitted during implementation if they improve the user
+experience and clarity of the feature.
diff --git a/vendor/github.com/moby/spdystream/LICENSE b/vendor/cel.dev/expr/LICENSE
similarity index 100%
rename from vendor/github.com/moby/spdystream/LICENSE
rename to vendor/cel.dev/expr/LICENSE
diff --git a/vendor/cel.dev/expr/MAINTAINERS.md b/vendor/cel.dev/expr/MAINTAINERS.md
new file mode 100644
index 000000000000..1ed2eb8ab353
--- /dev/null
+++ b/vendor/cel.dev/expr/MAINTAINERS.md
@@ -0,0 +1,13 @@
+# CEL Language Council
+
+| Name | Company | Area of Expertise |
+|-----------------|--------------|-------------------|
+| Alfred Fuller | Facebook | cel-cpp, cel-spec |
+| Jim Larson | Google | cel-go, cel-spec |
+| Matthais Blume | Google | cel-spec |
+| Tristan Swadell | Google | cel-go, cel-spec |
+
+## Emeritus
+
+* Sanjay Ghemawat (Google)
+* Wolfgang Grieskamp (Facebook)
diff --git a/vendor/cel.dev/expr/MODULE.bazel b/vendor/cel.dev/expr/MODULE.bazel
new file mode 100644
index 000000000000..cb98ed5991b1
--- /dev/null
+++ b/vendor/cel.dev/expr/MODULE.bazel
@@ -0,0 +1,56 @@
+module(
+ name = "cel-spec",
+)
+
+bazel_dep(
+ name = "bazel_skylib",
+ version = "1.7.1",
+)
+bazel_dep(
+ name = "gazelle",
+ version = "0.39.1",
+ repo_name = "bazel_gazelle",
+)
+bazel_dep(
+ name = "protobuf",
+ version = "27.1",
+ repo_name = "com_google_protobuf",
+)
+bazel_dep(
+ name = "rules_cc",
+ version = "0.0.17",
+)
+bazel_dep(
+ name = "rules_go",
+ version = "0.53.0",
+ repo_name = "io_bazel_rules_go",
+)
+bazel_dep(
+ name = "rules_java",
+ version = "7.6.5",
+)
+bazel_dep(
+ name = "rules_proto",
+ version = "7.0.2",
+)
+bazel_dep(
+ name = "rules_python",
+ version = "0.35.0",
+)
+
+### PYTHON ###
+python = use_extension("@rules_python//python/extensions:python.bzl", "python")
+python.toolchain(
+ ignore_root_user_error = True,
+ python_version = "3.11",
+)
+
+go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
+go_sdk.download(version = "1.23.0")
+
+go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps")
+go_deps.from_file(go_mod = "//:go.mod")
+use_repo(
+ go_deps,
+ "org_golang_google_protobuf",
+)
diff --git a/vendor/cel.dev/expr/README.md b/vendor/cel.dev/expr/README.md
new file mode 100644
index 000000000000..42d67f87c262
--- /dev/null
+++ b/vendor/cel.dev/expr/README.md
@@ -0,0 +1,71 @@
+# Common Expression Language
+
+The Common Expression Language (CEL) implements common semantics for expression
+evaluation, enabling different applications to more easily interoperate.
+
+Key Applications
+
+* Security policy: organizations have complex infrastructure and need common
+ tooling to reason about the system as a whole
+* Protocols: expressions are a useful data type and require interoperability
+ across programming languages and platforms.
+
+
+Guiding philosophy:
+
+1. Keep it small & fast.
+ * CEL evaluates in linear time, is mutation free, and not Turing-complete.
+ This limitation is a feature of the language design, which allows the
+ implementation to evaluate orders of magnitude faster than equivalently
+ sandboxed JavaScript.
+2. Make it extensible.
+ * CEL is designed to be embedded in applications, and allows for
+ extensibility via its context which allows for functions and data to be
+ provided by the software that embeds it.
+3. Developer-friendly.
+ * The language is approachable to developers. The initial spec was based
+ on the experience of developing Firebase Rules and usability testing
+ many prior iterations.
+ * The library itself and accompanying toolings should be easy to adopt by
+ teams that seek to integrate CEL into their platforms.
+
+The required components of a system that supports CEL are:
+
+* The textual representation of an expression as written by a developer. It is
+ of similar syntax to expressions in C/C++/Java/JavaScript
+* A representation of the program's abstract syntax tree (AST).
+* A compiler library that converts the textual representation to the binary
+ representation. This can be done ahead of time (in the control plane) or
+ just before evaluation (in the data plane).
+* A context containing one or more typed variables, often protobuf messages.
+ Most use-cases will use `attribute_context.proto`
+* An evaluator library that takes the binary format in the context and
+ produces a result, usually a Boolean.
+
+For use cases which require persistence or cross-process communcation, it is
+highly recommended to serialize the type-checked expression as a protocol
+buffer. The CEL team will maintains canonical protocol buffers for ASTs and
+will keep these versions identical and wire-compatible in perpetuity:
+
+* [CEL canonical](https://github.com/google/cel-spec/tree/master/proto/cel/expr)
+* [CEL v1alpha1](https://github.com/googleapis/googleapis/tree/master/google/api/expr/v1alpha1)
+
+
+Example of boolean conditions and object construction:
+
+``` c
+// Condition
+account.balance >= transaction.withdrawal
+ || (account.overdraftProtection
+ && account.overdraftLimit >= transaction.withdrawal - account.balance)
+
+// Object construction
+common.GeoPoint{ latitude: 10.0, longitude: -5.5 }
+```
+
+For more detail, see:
+
+* [Introduction](doc/intro.md)
+* [Language Definition](doc/langdef.md)
+
+Released under the [Apache License](LICENSE).
diff --git a/vendor/cel.dev/expr/WORKSPACE b/vendor/cel.dev/expr/WORKSPACE
new file mode 100644
index 000000000000..b6dc9ed67304
--- /dev/null
+++ b/vendor/cel.dev/expr/WORKSPACE
@@ -0,0 +1,145 @@
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+
+http_archive(
+ name = "io_bazel_rules_go",
+ sha256 = "099a9fb96a376ccbbb7d291ed4ecbdfd42f6bc822ab77ae6f1b5cb9e914e94fa",
+ urls = [
+ "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip",
+ "https://github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip",
+ ],
+)
+
+http_archive(
+ name = "bazel_gazelle",
+ sha256 = "ecba0f04f96b4960a5b250c8e8eeec42281035970aa8852dda73098274d14a1d",
+ urls = [
+ "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
+ "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
+ ],
+)
+
+http_archive(
+ name = "rules_proto",
+ sha256 = "e017528fd1c91c5a33f15493e3a398181a9e821a804eb7ff5acdd1d2d6c2b18d",
+ strip_prefix = "rules_proto-4.0.0-3.20.0",
+ urls = [
+ "https://github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0-3.20.0.tar.gz",
+ ],
+)
+
+# googleapis as of 09/16/2024
+http_archive(
+ name = "com_google_googleapis",
+ strip_prefix = "googleapis-4082d5e51e8481f6ccc384cacd896f4e78f19dee",
+ sha256 = "57319889d47578b3c89bf1b3f34888d796a8913d63b32d750a4cd12ed303c4e8",
+ urls = [
+ "https://github.com/googleapis/googleapis/archive/4082d5e51e8481f6ccc384cacd896f4e78f19dee.tar.gz",
+ ],
+)
+
+# protobuf
+http_archive(
+ name = "com_google_protobuf",
+ sha256 = "8242327e5df8c80ba49e4165250b8f79a76bd11765facefaaecfca7747dc8da2",
+ strip_prefix = "protobuf-3.21.5",
+ urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.21.5.zip"],
+)
+
+# googletest
+http_archive(
+ name = "com_google_googletest",
+ urls = ["https://github.com/google/googletest/archive/master.zip"],
+ strip_prefix = "googletest-master",
+)
+
+# gflags
+http_archive(
+ name = "com_github_gflags_gflags",
+ sha256 = "6e16c8bc91b1310a44f3965e616383dbda48f83e8c1eaa2370a215057b00cabe",
+ strip_prefix = "gflags-77592648e3f3be87d6c7123eb81cbad75f9aef5a",
+ urls = [
+ "https://mirror.bazel.build/github.com/gflags/gflags/archive/77592648e3f3be87d6c7123eb81cbad75f9aef5a.tar.gz",
+ "https://github.com/gflags/gflags/archive/77592648e3f3be87d6c7123eb81cbad75f9aef5a.tar.gz",
+ ],
+)
+
+# glog
+http_archive(
+ name = "com_google_glog",
+ sha256 = "1ee310e5d0a19b9d584a855000434bb724aa744745d5b8ab1855c85bff8a8e21",
+ strip_prefix = "glog-028d37889a1e80e8a07da1b8945ac706259e5fd8",
+ urls = [
+ "https://mirror.bazel.build/github.com/google/glog/archive/028d37889a1e80e8a07da1b8945ac706259e5fd8.tar.gz",
+ "https://github.com/google/glog/archive/028d37889a1e80e8a07da1b8945ac706259e5fd8.tar.gz",
+ ],
+)
+
+# absl
+http_archive(
+ name = "com_google_absl",
+ strip_prefix = "abseil-cpp-master",
+ urls = ["https://github.com/abseil/abseil-cpp/archive/master.zip"],
+)
+
+load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains")
+load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
+load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
+load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
+load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
+
+switched_rules_by_language(
+ name = "com_google_googleapis_imports",
+ cc = True,
+)
+
+# Do *not* call *_dependencies(), etc, yet. See comment at the end.
+
+# Generated Google APIs protos for Golang
+# Generated Google APIs protos for Golang 08/26/2024
+go_repository(
+ name = "org_golang_google_genproto_googleapis_api",
+ build_file_proto_mode = "disable_global",
+ importpath = "google.golang.org/genproto/googleapis/api",
+ sum = "h1:YcyjlL1PRr2Q17/I0dPk2JmYS5CDXfcdb2Z3YRioEbw=",
+ version = "v0.0.0-20240826202546-f6391c0de4c7",
+)
+
+# Generated Google APIs protos for Golang 08/26/2024
+go_repository(
+ name = "org_golang_google_genproto_googleapis_rpc",
+ build_file_proto_mode = "disable_global",
+ importpath = "google.golang.org/genproto/googleapis/rpc",
+ sum = "h1:2035KHhUv+EpyB+hWgJnaWKJOdX1E95w2S8Rr4uWKTs=",
+ version = "v0.0.0-20240826202546-f6391c0de4c7",
+)
+
+# gRPC deps
+go_repository(
+ name = "org_golang_google_grpc",
+ build_file_proto_mode = "disable_global",
+ importpath = "google.golang.org/grpc",
+ tag = "v1.49.0",
+)
+
+go_repository(
+ name = "org_golang_x_net",
+ importpath = "golang.org/x/net",
+ sum = "h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=",
+ version = "v0.0.0-20190311183353-d8887717615a",
+)
+
+go_repository(
+ name = "org_golang_x_text",
+ importpath = "golang.org/x/text",
+ sum = "h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=",
+ version = "v0.3.2",
+)
+
+# Run the dependencies at the end. These will silently try to import some
+# of the above repositories but at different versions, so ours must come first.
+go_rules_dependencies()
+go_register_toolchains(version = "1.19.1")
+gazelle_dependencies()
+rules_proto_dependencies()
+rules_proto_toolchains()
+protobuf_deps()
diff --git a/vendor/cel.dev/expr/WORKSPACE.bzlmod b/vendor/cel.dev/expr/WORKSPACE.bzlmod
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/vendor/cel.dev/expr/checked.pb.go b/vendor/cel.dev/expr/checked.pb.go
new file mode 100644
index 000000000000..b18085e9b6f2
--- /dev/null
+++ b/vendor/cel.dev/expr/checked.pb.go
@@ -0,0 +1,1231 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.36.10
+// protoc v5.27.1
+// source: cel/expr/checked.proto
+
+package expr
+
+import (
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ emptypb "google.golang.org/protobuf/types/known/emptypb"
+ structpb "google.golang.org/protobuf/types/known/structpb"
+ reflect "reflect"
+ sync "sync"
+ unsafe "unsafe"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type Type_PrimitiveType int32
+
+const (
+ Type_PRIMITIVE_TYPE_UNSPECIFIED Type_PrimitiveType = 0
+ Type_BOOL Type_PrimitiveType = 1
+ Type_INT64 Type_PrimitiveType = 2
+ Type_UINT64 Type_PrimitiveType = 3
+ Type_DOUBLE Type_PrimitiveType = 4
+ Type_STRING Type_PrimitiveType = 5
+ Type_BYTES Type_PrimitiveType = 6
+)
+
+// Enum value maps for Type_PrimitiveType.
+var (
+ Type_PrimitiveType_name = map[int32]string{
+ 0: "PRIMITIVE_TYPE_UNSPECIFIED",
+ 1: "BOOL",
+ 2: "INT64",
+ 3: "UINT64",
+ 4: "DOUBLE",
+ 5: "STRING",
+ 6: "BYTES",
+ }
+ Type_PrimitiveType_value = map[string]int32{
+ "PRIMITIVE_TYPE_UNSPECIFIED": 0,
+ "BOOL": 1,
+ "INT64": 2,
+ "UINT64": 3,
+ "DOUBLE": 4,
+ "STRING": 5,
+ "BYTES": 6,
+ }
+)
+
+func (x Type_PrimitiveType) Enum() *Type_PrimitiveType {
+ p := new(Type_PrimitiveType)
+ *p = x
+ return p
+}
+
+func (x Type_PrimitiveType) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Type_PrimitiveType) Descriptor() protoreflect.EnumDescriptor {
+ return file_cel_expr_checked_proto_enumTypes[0].Descriptor()
+}
+
+func (Type_PrimitiveType) Type() protoreflect.EnumType {
+ return &file_cel_expr_checked_proto_enumTypes[0]
+}
+
+func (x Type_PrimitiveType) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Type_PrimitiveType.Descriptor instead.
+func (Type_PrimitiveType) EnumDescriptor() ([]byte, []int) {
+ return file_cel_expr_checked_proto_rawDescGZIP(), []int{1, 0}
+}
+
+type Type_WellKnownType int32
+
+const (
+ Type_WELL_KNOWN_TYPE_UNSPECIFIED Type_WellKnownType = 0
+ Type_ANY Type_WellKnownType = 1
+ Type_TIMESTAMP Type_WellKnownType = 2
+ Type_DURATION Type_WellKnownType = 3
+)
+
+// Enum value maps for Type_WellKnownType.
+var (
+ Type_WellKnownType_name = map[int32]string{
+ 0: "WELL_KNOWN_TYPE_UNSPECIFIED",
+ 1: "ANY",
+ 2: "TIMESTAMP",
+ 3: "DURATION",
+ }
+ Type_WellKnownType_value = map[string]int32{
+ "WELL_KNOWN_TYPE_UNSPECIFIED": 0,
+ "ANY": 1,
+ "TIMESTAMP": 2,
+ "DURATION": 3,
+ }
+)
+
+func (x Type_WellKnownType) Enum() *Type_WellKnownType {
+ p := new(Type_WellKnownType)
+ *p = x
+ return p
+}
+
+func (x Type_WellKnownType) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Type_WellKnownType) Descriptor() protoreflect.EnumDescriptor {
+ return file_cel_expr_checked_proto_enumTypes[1].Descriptor()
+}
+
+func (Type_WellKnownType) Type() protoreflect.EnumType {
+ return &file_cel_expr_checked_proto_enumTypes[1]
+}
+
+func (x Type_WellKnownType) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Type_WellKnownType.Descriptor instead.
+func (Type_WellKnownType) EnumDescriptor() ([]byte, []int) {
+ return file_cel_expr_checked_proto_rawDescGZIP(), []int{1, 1}
+}
+
+type CheckedExpr struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ ReferenceMap map[int64]*Reference `protobuf:"bytes,2,rep,name=reference_map,json=referenceMap,proto3" json:"reference_map,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
+ TypeMap map[int64]*Type `protobuf:"bytes,3,rep,name=type_map,json=typeMap,proto3" json:"type_map,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
+ SourceInfo *SourceInfo `protobuf:"bytes,5,opt,name=source_info,json=sourceInfo,proto3" json:"source_info,omitempty"`
+ ExprVersion string `protobuf:"bytes,6,opt,name=expr_version,json=exprVersion,proto3" json:"expr_version,omitempty"`
+ Expr *Expr `protobuf:"bytes,4,opt,name=expr,proto3" json:"expr,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *CheckedExpr) Reset() {
+ *x = CheckedExpr{}
+ mi := &file_cel_expr_checked_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *CheckedExpr) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CheckedExpr) ProtoMessage() {}
+
+func (x *CheckedExpr) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_checked_proto_msgTypes[0]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use CheckedExpr.ProtoReflect.Descriptor instead.
+func (*CheckedExpr) Descriptor() ([]byte, []int) {
+ return file_cel_expr_checked_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *CheckedExpr) GetReferenceMap() map[int64]*Reference {
+ if x != nil {
+ return x.ReferenceMap
+ }
+ return nil
+}
+
+func (x *CheckedExpr) GetTypeMap() map[int64]*Type {
+ if x != nil {
+ return x.TypeMap
+ }
+ return nil
+}
+
+func (x *CheckedExpr) GetSourceInfo() *SourceInfo {
+ if x != nil {
+ return x.SourceInfo
+ }
+ return nil
+}
+
+func (x *CheckedExpr) GetExprVersion() string {
+ if x != nil {
+ return x.ExprVersion
+ }
+ return ""
+}
+
+func (x *CheckedExpr) GetExpr() *Expr {
+ if x != nil {
+ return x.Expr
+ }
+ return nil
+}
+
+type Type struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // Types that are valid to be assigned to TypeKind:
+ //
+ // *Type_Dyn
+ // *Type_Null
+ // *Type_Primitive
+ // *Type_Wrapper
+ // *Type_WellKnown
+ // *Type_ListType_
+ // *Type_MapType_
+ // *Type_Function
+ // *Type_MessageType
+ // *Type_TypeParam
+ // *Type_Type
+ // *Type_Error
+ // *Type_AbstractType_
+ TypeKind isType_TypeKind `protobuf_oneof:"type_kind"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Type) Reset() {
+ *x = Type{}
+ mi := &file_cel_expr_checked_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Type) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Type) ProtoMessage() {}
+
+func (x *Type) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_checked_proto_msgTypes[1]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Type.ProtoReflect.Descriptor instead.
+func (*Type) Descriptor() ([]byte, []int) {
+ return file_cel_expr_checked_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *Type) GetTypeKind() isType_TypeKind {
+ if x != nil {
+ return x.TypeKind
+ }
+ return nil
+}
+
+func (x *Type) GetDyn() *emptypb.Empty {
+ if x != nil {
+ if x, ok := x.TypeKind.(*Type_Dyn); ok {
+ return x.Dyn
+ }
+ }
+ return nil
+}
+
+func (x *Type) GetNull() structpb.NullValue {
+ if x != nil {
+ if x, ok := x.TypeKind.(*Type_Null); ok {
+ return x.Null
+ }
+ }
+ return structpb.NullValue(0)
+}
+
+func (x *Type) GetPrimitive() Type_PrimitiveType {
+ if x != nil {
+ if x, ok := x.TypeKind.(*Type_Primitive); ok {
+ return x.Primitive
+ }
+ }
+ return Type_PRIMITIVE_TYPE_UNSPECIFIED
+}
+
+func (x *Type) GetWrapper() Type_PrimitiveType {
+ if x != nil {
+ if x, ok := x.TypeKind.(*Type_Wrapper); ok {
+ return x.Wrapper
+ }
+ }
+ return Type_PRIMITIVE_TYPE_UNSPECIFIED
+}
+
+func (x *Type) GetWellKnown() Type_WellKnownType {
+ if x != nil {
+ if x, ok := x.TypeKind.(*Type_WellKnown); ok {
+ return x.WellKnown
+ }
+ }
+ return Type_WELL_KNOWN_TYPE_UNSPECIFIED
+}
+
+func (x *Type) GetListType() *Type_ListType {
+ if x != nil {
+ if x, ok := x.TypeKind.(*Type_ListType_); ok {
+ return x.ListType
+ }
+ }
+ return nil
+}
+
+func (x *Type) GetMapType() *Type_MapType {
+ if x != nil {
+ if x, ok := x.TypeKind.(*Type_MapType_); ok {
+ return x.MapType
+ }
+ }
+ return nil
+}
+
+func (x *Type) GetFunction() *Type_FunctionType {
+ if x != nil {
+ if x, ok := x.TypeKind.(*Type_Function); ok {
+ return x.Function
+ }
+ }
+ return nil
+}
+
+func (x *Type) GetMessageType() string {
+ if x != nil {
+ if x, ok := x.TypeKind.(*Type_MessageType); ok {
+ return x.MessageType
+ }
+ }
+ return ""
+}
+
+func (x *Type) GetTypeParam() string {
+ if x != nil {
+ if x, ok := x.TypeKind.(*Type_TypeParam); ok {
+ return x.TypeParam
+ }
+ }
+ return ""
+}
+
+func (x *Type) GetType() *Type {
+ if x != nil {
+ if x, ok := x.TypeKind.(*Type_Type); ok {
+ return x.Type
+ }
+ }
+ return nil
+}
+
+func (x *Type) GetError() *emptypb.Empty {
+ if x != nil {
+ if x, ok := x.TypeKind.(*Type_Error); ok {
+ return x.Error
+ }
+ }
+ return nil
+}
+
+func (x *Type) GetAbstractType() *Type_AbstractType {
+ if x != nil {
+ if x, ok := x.TypeKind.(*Type_AbstractType_); ok {
+ return x.AbstractType
+ }
+ }
+ return nil
+}
+
+type isType_TypeKind interface {
+ isType_TypeKind()
+}
+
+type Type_Dyn struct {
+ Dyn *emptypb.Empty `protobuf:"bytes,1,opt,name=dyn,proto3,oneof"`
+}
+
+type Type_Null struct {
+ Null structpb.NullValue `protobuf:"varint,2,opt,name=null,proto3,enum=google.protobuf.NullValue,oneof"`
+}
+
+type Type_Primitive struct {
+ Primitive Type_PrimitiveType `protobuf:"varint,3,opt,name=primitive,proto3,enum=cel.expr.Type_PrimitiveType,oneof"`
+}
+
+type Type_Wrapper struct {
+ Wrapper Type_PrimitiveType `protobuf:"varint,4,opt,name=wrapper,proto3,enum=cel.expr.Type_PrimitiveType,oneof"`
+}
+
+type Type_WellKnown struct {
+ WellKnown Type_WellKnownType `protobuf:"varint,5,opt,name=well_known,json=wellKnown,proto3,enum=cel.expr.Type_WellKnownType,oneof"`
+}
+
+type Type_ListType_ struct {
+ ListType *Type_ListType `protobuf:"bytes,6,opt,name=list_type,json=listType,proto3,oneof"`
+}
+
+type Type_MapType_ struct {
+ MapType *Type_MapType `protobuf:"bytes,7,opt,name=map_type,json=mapType,proto3,oneof"`
+}
+
+type Type_Function struct {
+ Function *Type_FunctionType `protobuf:"bytes,8,opt,name=function,proto3,oneof"`
+}
+
+type Type_MessageType struct {
+ MessageType string `protobuf:"bytes,9,opt,name=message_type,json=messageType,proto3,oneof"`
+}
+
+type Type_TypeParam struct {
+ TypeParam string `protobuf:"bytes,10,opt,name=type_param,json=typeParam,proto3,oneof"`
+}
+
+type Type_Type struct {
+ Type *Type `protobuf:"bytes,11,opt,name=type,proto3,oneof"`
+}
+
+type Type_Error struct {
+ Error *emptypb.Empty `protobuf:"bytes,12,opt,name=error,proto3,oneof"`
+}
+
+type Type_AbstractType_ struct {
+ AbstractType *Type_AbstractType `protobuf:"bytes,14,opt,name=abstract_type,json=abstractType,proto3,oneof"`
+}
+
+func (*Type_Dyn) isType_TypeKind() {}
+
+func (*Type_Null) isType_TypeKind() {}
+
+func (*Type_Primitive) isType_TypeKind() {}
+
+func (*Type_Wrapper) isType_TypeKind() {}
+
+func (*Type_WellKnown) isType_TypeKind() {}
+
+func (*Type_ListType_) isType_TypeKind() {}
+
+func (*Type_MapType_) isType_TypeKind() {}
+
+func (*Type_Function) isType_TypeKind() {}
+
+func (*Type_MessageType) isType_TypeKind() {}
+
+func (*Type_TypeParam) isType_TypeKind() {}
+
+func (*Type_Type) isType_TypeKind() {}
+
+func (*Type_Error) isType_TypeKind() {}
+
+func (*Type_AbstractType_) isType_TypeKind() {}
+
+type Decl struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // Types that are valid to be assigned to DeclKind:
+ //
+ // *Decl_Ident
+ // *Decl_Function
+ DeclKind isDecl_DeclKind `protobuf_oneof:"decl_kind"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Decl) Reset() {
+ *x = Decl{}
+ mi := &file_cel_expr_checked_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Decl) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Decl) ProtoMessage() {}
+
+func (x *Decl) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_checked_proto_msgTypes[2]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Decl.ProtoReflect.Descriptor instead.
+func (*Decl) Descriptor() ([]byte, []int) {
+ return file_cel_expr_checked_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *Decl) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *Decl) GetDeclKind() isDecl_DeclKind {
+ if x != nil {
+ return x.DeclKind
+ }
+ return nil
+}
+
+func (x *Decl) GetIdent() *Decl_IdentDecl {
+ if x != nil {
+ if x, ok := x.DeclKind.(*Decl_Ident); ok {
+ return x.Ident
+ }
+ }
+ return nil
+}
+
+func (x *Decl) GetFunction() *Decl_FunctionDecl {
+ if x != nil {
+ if x, ok := x.DeclKind.(*Decl_Function); ok {
+ return x.Function
+ }
+ }
+ return nil
+}
+
+type isDecl_DeclKind interface {
+ isDecl_DeclKind()
+}
+
+type Decl_Ident struct {
+ Ident *Decl_IdentDecl `protobuf:"bytes,2,opt,name=ident,proto3,oneof"`
+}
+
+type Decl_Function struct {
+ Function *Decl_FunctionDecl `protobuf:"bytes,3,opt,name=function,proto3,oneof"`
+}
+
+func (*Decl_Ident) isDecl_DeclKind() {}
+
+func (*Decl_Function) isDecl_DeclKind() {}
+
+type Reference struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ OverloadId []string `protobuf:"bytes,3,rep,name=overload_id,json=overloadId,proto3" json:"overload_id,omitempty"`
+ Value *Constant `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Reference) Reset() {
+ *x = Reference{}
+ mi := &file_cel_expr_checked_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Reference) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Reference) ProtoMessage() {}
+
+func (x *Reference) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_checked_proto_msgTypes[3]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Reference.ProtoReflect.Descriptor instead.
+func (*Reference) Descriptor() ([]byte, []int) {
+ return file_cel_expr_checked_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *Reference) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *Reference) GetOverloadId() []string {
+ if x != nil {
+ return x.OverloadId
+ }
+ return nil
+}
+
+func (x *Reference) GetValue() *Constant {
+ if x != nil {
+ return x.Value
+ }
+ return nil
+}
+
+type Type_ListType struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ ElemType *Type `protobuf:"bytes,1,opt,name=elem_type,json=elemType,proto3" json:"elem_type,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Type_ListType) Reset() {
+ *x = Type_ListType{}
+ mi := &file_cel_expr_checked_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Type_ListType) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Type_ListType) ProtoMessage() {}
+
+func (x *Type_ListType) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_checked_proto_msgTypes[6]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Type_ListType.ProtoReflect.Descriptor instead.
+func (*Type_ListType) Descriptor() ([]byte, []int) {
+ return file_cel_expr_checked_proto_rawDescGZIP(), []int{1, 0}
+}
+
+func (x *Type_ListType) GetElemType() *Type {
+ if x != nil {
+ return x.ElemType
+ }
+ return nil
+}
+
+type Type_MapType struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ KeyType *Type `protobuf:"bytes,1,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"`
+ ValueType *Type `protobuf:"bytes,2,opt,name=value_type,json=valueType,proto3" json:"value_type,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Type_MapType) Reset() {
+ *x = Type_MapType{}
+ mi := &file_cel_expr_checked_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Type_MapType) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Type_MapType) ProtoMessage() {}
+
+func (x *Type_MapType) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_checked_proto_msgTypes[7]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Type_MapType.ProtoReflect.Descriptor instead.
+func (*Type_MapType) Descriptor() ([]byte, []int) {
+ return file_cel_expr_checked_proto_rawDescGZIP(), []int{1, 1}
+}
+
+func (x *Type_MapType) GetKeyType() *Type {
+ if x != nil {
+ return x.KeyType
+ }
+ return nil
+}
+
+func (x *Type_MapType) GetValueType() *Type {
+ if x != nil {
+ return x.ValueType
+ }
+ return nil
+}
+
+type Type_FunctionType struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ ResultType *Type `protobuf:"bytes,1,opt,name=result_type,json=resultType,proto3" json:"result_type,omitempty"`
+ ArgTypes []*Type `protobuf:"bytes,2,rep,name=arg_types,json=argTypes,proto3" json:"arg_types,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Type_FunctionType) Reset() {
+ *x = Type_FunctionType{}
+ mi := &file_cel_expr_checked_proto_msgTypes[8]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Type_FunctionType) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Type_FunctionType) ProtoMessage() {}
+
+func (x *Type_FunctionType) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_checked_proto_msgTypes[8]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Type_FunctionType.ProtoReflect.Descriptor instead.
+func (*Type_FunctionType) Descriptor() ([]byte, []int) {
+ return file_cel_expr_checked_proto_rawDescGZIP(), []int{1, 2}
+}
+
+func (x *Type_FunctionType) GetResultType() *Type {
+ if x != nil {
+ return x.ResultType
+ }
+ return nil
+}
+
+func (x *Type_FunctionType) GetArgTypes() []*Type {
+ if x != nil {
+ return x.ArgTypes
+ }
+ return nil
+}
+
+type Type_AbstractType struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ ParameterTypes []*Type `protobuf:"bytes,2,rep,name=parameter_types,json=parameterTypes,proto3" json:"parameter_types,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Type_AbstractType) Reset() {
+ *x = Type_AbstractType{}
+ mi := &file_cel_expr_checked_proto_msgTypes[9]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Type_AbstractType) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Type_AbstractType) ProtoMessage() {}
+
+func (x *Type_AbstractType) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_checked_proto_msgTypes[9]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Type_AbstractType.ProtoReflect.Descriptor instead.
+func (*Type_AbstractType) Descriptor() ([]byte, []int) {
+ return file_cel_expr_checked_proto_rawDescGZIP(), []int{1, 3}
+}
+
+func (x *Type_AbstractType) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *Type_AbstractType) GetParameterTypes() []*Type {
+ if x != nil {
+ return x.ParameterTypes
+ }
+ return nil
+}
+
+type Decl_IdentDecl struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Type *Type `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
+ Value *Constant `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
+ Doc string `protobuf:"bytes,3,opt,name=doc,proto3" json:"doc,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Decl_IdentDecl) Reset() {
+ *x = Decl_IdentDecl{}
+ mi := &file_cel_expr_checked_proto_msgTypes[10]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Decl_IdentDecl) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Decl_IdentDecl) ProtoMessage() {}
+
+func (x *Decl_IdentDecl) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_checked_proto_msgTypes[10]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Decl_IdentDecl.ProtoReflect.Descriptor instead.
+func (*Decl_IdentDecl) Descriptor() ([]byte, []int) {
+ return file_cel_expr_checked_proto_rawDescGZIP(), []int{2, 0}
+}
+
+func (x *Decl_IdentDecl) GetType() *Type {
+ if x != nil {
+ return x.Type
+ }
+ return nil
+}
+
+func (x *Decl_IdentDecl) GetValue() *Constant {
+ if x != nil {
+ return x.Value
+ }
+ return nil
+}
+
+func (x *Decl_IdentDecl) GetDoc() string {
+ if x != nil {
+ return x.Doc
+ }
+ return ""
+}
+
+type Decl_FunctionDecl struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Overloads []*Decl_FunctionDecl_Overload `protobuf:"bytes,1,rep,name=overloads,proto3" json:"overloads,omitempty"`
+ Doc string `protobuf:"bytes,2,opt,name=doc,proto3" json:"doc,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Decl_FunctionDecl) Reset() {
+ *x = Decl_FunctionDecl{}
+ mi := &file_cel_expr_checked_proto_msgTypes[11]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Decl_FunctionDecl) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Decl_FunctionDecl) ProtoMessage() {}
+
+func (x *Decl_FunctionDecl) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_checked_proto_msgTypes[11]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Decl_FunctionDecl.ProtoReflect.Descriptor instead.
+func (*Decl_FunctionDecl) Descriptor() ([]byte, []int) {
+ return file_cel_expr_checked_proto_rawDescGZIP(), []int{2, 1}
+}
+
+func (x *Decl_FunctionDecl) GetOverloads() []*Decl_FunctionDecl_Overload {
+ if x != nil {
+ return x.Overloads
+ }
+ return nil
+}
+
+func (x *Decl_FunctionDecl) GetDoc() string {
+ if x != nil {
+ return x.Doc
+ }
+ return ""
+}
+
+type Decl_FunctionDecl_Overload struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ OverloadId string `protobuf:"bytes,1,opt,name=overload_id,json=overloadId,proto3" json:"overload_id,omitempty"`
+ Params []*Type `protobuf:"bytes,2,rep,name=params,proto3" json:"params,omitempty"`
+ TypeParams []string `protobuf:"bytes,3,rep,name=type_params,json=typeParams,proto3" json:"type_params,omitempty"`
+ ResultType *Type `protobuf:"bytes,4,opt,name=result_type,json=resultType,proto3" json:"result_type,omitempty"`
+ IsInstanceFunction bool `protobuf:"varint,5,opt,name=is_instance_function,json=isInstanceFunction,proto3" json:"is_instance_function,omitempty"`
+ Doc string `protobuf:"bytes,6,opt,name=doc,proto3" json:"doc,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Decl_FunctionDecl_Overload) Reset() {
+ *x = Decl_FunctionDecl_Overload{}
+ mi := &file_cel_expr_checked_proto_msgTypes[12]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Decl_FunctionDecl_Overload) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Decl_FunctionDecl_Overload) ProtoMessage() {}
+
+func (x *Decl_FunctionDecl_Overload) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_checked_proto_msgTypes[12]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Decl_FunctionDecl_Overload.ProtoReflect.Descriptor instead.
+func (*Decl_FunctionDecl_Overload) Descriptor() ([]byte, []int) {
+ return file_cel_expr_checked_proto_rawDescGZIP(), []int{2, 1, 0}
+}
+
+func (x *Decl_FunctionDecl_Overload) GetOverloadId() string {
+ if x != nil {
+ return x.OverloadId
+ }
+ return ""
+}
+
+func (x *Decl_FunctionDecl_Overload) GetParams() []*Type {
+ if x != nil {
+ return x.Params
+ }
+ return nil
+}
+
+func (x *Decl_FunctionDecl_Overload) GetTypeParams() []string {
+ if x != nil {
+ return x.TypeParams
+ }
+ return nil
+}
+
+func (x *Decl_FunctionDecl_Overload) GetResultType() *Type {
+ if x != nil {
+ return x.ResultType
+ }
+ return nil
+}
+
+func (x *Decl_FunctionDecl_Overload) GetIsInstanceFunction() bool {
+ if x != nil {
+ return x.IsInstanceFunction
+ }
+ return false
+}
+
+func (x *Decl_FunctionDecl_Overload) GetDoc() string {
+ if x != nil {
+ return x.Doc
+ }
+ return ""
+}
+
+var File_cel_expr_checked_proto protoreflect.FileDescriptor
+
+const file_cel_expr_checked_proto_rawDesc = "" +
+ "\n" +
+ "\x16cel/expr/checked.proto\x12\bcel.expr\x1a\x15cel/expr/syntax.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xba\x03\n" +
+ "\vCheckedExpr\x12L\n" +
+ "\rreference_map\x18\x02 \x03(\v2'.cel.expr.CheckedExpr.ReferenceMapEntryR\freferenceMap\x12=\n" +
+ "\btype_map\x18\x03 \x03(\v2\".cel.expr.CheckedExpr.TypeMapEntryR\atypeMap\x125\n" +
+ "\vsource_info\x18\x05 \x01(\v2\x14.cel.expr.SourceInfoR\n" +
+ "sourceInfo\x12!\n" +
+ "\fexpr_version\x18\x06 \x01(\tR\vexprVersion\x12\"\n" +
+ "\x04expr\x18\x04 \x01(\v2\x0e.cel.expr.ExprR\x04expr\x1aT\n" +
+ "\x11ReferenceMapEntry\x12\x10\n" +
+ "\x03key\x18\x01 \x01(\x03R\x03key\x12)\n" +
+ "\x05value\x18\x02 \x01(\v2\x13.cel.expr.ReferenceR\x05value:\x028\x01\x1aJ\n" +
+ "\fTypeMapEntry\x12\x10\n" +
+ "\x03key\x18\x01 \x01(\x03R\x03key\x12$\n" +
+ "\x05value\x18\x02 \x01(\v2\x0e.cel.expr.TypeR\x05value:\x028\x01\"\xe6\t\n" +
+ "\x04Type\x12*\n" +
+ "\x03dyn\x18\x01 \x01(\v2\x16.google.protobuf.EmptyH\x00R\x03dyn\x120\n" +
+ "\x04null\x18\x02 \x01(\x0e2\x1a.google.protobuf.NullValueH\x00R\x04null\x12<\n" +
+ "\tprimitive\x18\x03 \x01(\x0e2\x1c.cel.expr.Type.PrimitiveTypeH\x00R\tprimitive\x128\n" +
+ "\awrapper\x18\x04 \x01(\x0e2\x1c.cel.expr.Type.PrimitiveTypeH\x00R\awrapper\x12=\n" +
+ "\n" +
+ "well_known\x18\x05 \x01(\x0e2\x1c.cel.expr.Type.WellKnownTypeH\x00R\twellKnown\x126\n" +
+ "\tlist_type\x18\x06 \x01(\v2\x17.cel.expr.Type.ListTypeH\x00R\blistType\x123\n" +
+ "\bmap_type\x18\a \x01(\v2\x16.cel.expr.Type.MapTypeH\x00R\amapType\x129\n" +
+ "\bfunction\x18\b \x01(\v2\x1b.cel.expr.Type.FunctionTypeH\x00R\bfunction\x12#\n" +
+ "\fmessage_type\x18\t \x01(\tH\x00R\vmessageType\x12\x1f\n" +
+ "\n" +
+ "type_param\x18\n" +
+ " \x01(\tH\x00R\ttypeParam\x12$\n" +
+ "\x04type\x18\v \x01(\v2\x0e.cel.expr.TypeH\x00R\x04type\x12.\n" +
+ "\x05error\x18\f \x01(\v2\x16.google.protobuf.EmptyH\x00R\x05error\x12B\n" +
+ "\rabstract_type\x18\x0e \x01(\v2\x1b.cel.expr.Type.AbstractTypeH\x00R\fabstractType\x1a7\n" +
+ "\bListType\x12+\n" +
+ "\telem_type\x18\x01 \x01(\v2\x0e.cel.expr.TypeR\belemType\x1ac\n" +
+ "\aMapType\x12)\n" +
+ "\bkey_type\x18\x01 \x01(\v2\x0e.cel.expr.TypeR\akeyType\x12-\n" +
+ "\n" +
+ "value_type\x18\x02 \x01(\v2\x0e.cel.expr.TypeR\tvalueType\x1al\n" +
+ "\fFunctionType\x12/\n" +
+ "\vresult_type\x18\x01 \x01(\v2\x0e.cel.expr.TypeR\n" +
+ "resultType\x12+\n" +
+ "\targ_types\x18\x02 \x03(\v2\x0e.cel.expr.TypeR\bargTypes\x1a[\n" +
+ "\fAbstractType\x12\x12\n" +
+ "\x04name\x18\x01 \x01(\tR\x04name\x127\n" +
+ "\x0fparameter_types\x18\x02 \x03(\v2\x0e.cel.expr.TypeR\x0eparameterTypes\"s\n" +
+ "\rPrimitiveType\x12\x1e\n" +
+ "\x1aPRIMITIVE_TYPE_UNSPECIFIED\x10\x00\x12\b\n" +
+ "\x04BOOL\x10\x01\x12\t\n" +
+ "\x05INT64\x10\x02\x12\n" +
+ "\n" +
+ "\x06UINT64\x10\x03\x12\n" +
+ "\n" +
+ "\x06DOUBLE\x10\x04\x12\n" +
+ "\n" +
+ "\x06STRING\x10\x05\x12\t\n" +
+ "\x05BYTES\x10\x06\"V\n" +
+ "\rWellKnownType\x12\x1f\n" +
+ "\x1bWELL_KNOWN_TYPE_UNSPECIFIED\x10\x00\x12\a\n" +
+ "\x03ANY\x10\x01\x12\r\n" +
+ "\tTIMESTAMP\x10\x02\x12\f\n" +
+ "\bDURATION\x10\x03B\v\n" +
+ "\ttype_kind\"\xd4\x04\n" +
+ "\x04Decl\x12\x12\n" +
+ "\x04name\x18\x01 \x01(\tR\x04name\x120\n" +
+ "\x05ident\x18\x02 \x01(\v2\x18.cel.expr.Decl.IdentDeclH\x00R\x05ident\x129\n" +
+ "\bfunction\x18\x03 \x01(\v2\x1b.cel.expr.Decl.FunctionDeclH\x00R\bfunction\x1ak\n" +
+ "\tIdentDecl\x12\"\n" +
+ "\x04type\x18\x01 \x01(\v2\x0e.cel.expr.TypeR\x04type\x12(\n" +
+ "\x05value\x18\x02 \x01(\v2\x12.cel.expr.ConstantR\x05value\x12\x10\n" +
+ "\x03doc\x18\x03 \x01(\tR\x03doc\x1a\xd0\x02\n" +
+ "\fFunctionDecl\x12B\n" +
+ "\toverloads\x18\x01 \x03(\v2$.cel.expr.Decl.FunctionDecl.OverloadR\toverloads\x12\x10\n" +
+ "\x03doc\x18\x02 \x01(\tR\x03doc\x1a\xe9\x01\n" +
+ "\bOverload\x12\x1f\n" +
+ "\voverload_id\x18\x01 \x01(\tR\n" +
+ "overloadId\x12&\n" +
+ "\x06params\x18\x02 \x03(\v2\x0e.cel.expr.TypeR\x06params\x12\x1f\n" +
+ "\vtype_params\x18\x03 \x03(\tR\n" +
+ "typeParams\x12/\n" +
+ "\vresult_type\x18\x04 \x01(\v2\x0e.cel.expr.TypeR\n" +
+ "resultType\x120\n" +
+ "\x14is_instance_function\x18\x05 \x01(\bR\x12isInstanceFunction\x12\x10\n" +
+ "\x03doc\x18\x06 \x01(\tR\x03docB\v\n" +
+ "\tdecl_kind\"j\n" +
+ "\tReference\x12\x12\n" +
+ "\x04name\x18\x01 \x01(\tR\x04name\x12\x1f\n" +
+ "\voverload_id\x18\x03 \x03(\tR\n" +
+ "overloadId\x12(\n" +
+ "\x05value\x18\x04 \x01(\v2\x12.cel.expr.ConstantR\x05valueB,\n" +
+ "\fdev.cel.exprB\tDeclProtoP\x01Z\fcel.dev/expr\xf8\x01\x01b\x06proto3"
+
+var (
+ file_cel_expr_checked_proto_rawDescOnce sync.Once
+ file_cel_expr_checked_proto_rawDescData []byte
+)
+
+func file_cel_expr_checked_proto_rawDescGZIP() []byte {
+ file_cel_expr_checked_proto_rawDescOnce.Do(func() {
+ file_cel_expr_checked_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cel_expr_checked_proto_rawDesc), len(file_cel_expr_checked_proto_rawDesc)))
+ })
+ return file_cel_expr_checked_proto_rawDescData
+}
+
+var file_cel_expr_checked_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
+var file_cel_expr_checked_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
+var file_cel_expr_checked_proto_goTypes = []any{
+ (Type_PrimitiveType)(0), // 0: cel.expr.Type.PrimitiveType
+ (Type_WellKnownType)(0), // 1: cel.expr.Type.WellKnownType
+ (*CheckedExpr)(nil), // 2: cel.expr.CheckedExpr
+ (*Type)(nil), // 3: cel.expr.Type
+ (*Decl)(nil), // 4: cel.expr.Decl
+ (*Reference)(nil), // 5: cel.expr.Reference
+ nil, // 6: cel.expr.CheckedExpr.ReferenceMapEntry
+ nil, // 7: cel.expr.CheckedExpr.TypeMapEntry
+ (*Type_ListType)(nil), // 8: cel.expr.Type.ListType
+ (*Type_MapType)(nil), // 9: cel.expr.Type.MapType
+ (*Type_FunctionType)(nil), // 10: cel.expr.Type.FunctionType
+ (*Type_AbstractType)(nil), // 11: cel.expr.Type.AbstractType
+ (*Decl_IdentDecl)(nil), // 12: cel.expr.Decl.IdentDecl
+ (*Decl_FunctionDecl)(nil), // 13: cel.expr.Decl.FunctionDecl
+ (*Decl_FunctionDecl_Overload)(nil), // 14: cel.expr.Decl.FunctionDecl.Overload
+ (*SourceInfo)(nil), // 15: cel.expr.SourceInfo
+ (*Expr)(nil), // 16: cel.expr.Expr
+ (*emptypb.Empty)(nil), // 17: google.protobuf.Empty
+ (structpb.NullValue)(0), // 18: google.protobuf.NullValue
+ (*Constant)(nil), // 19: cel.expr.Constant
+}
+var file_cel_expr_checked_proto_depIdxs = []int32{
+ 6, // 0: cel.expr.CheckedExpr.reference_map:type_name -> cel.expr.CheckedExpr.ReferenceMapEntry
+ 7, // 1: cel.expr.CheckedExpr.type_map:type_name -> cel.expr.CheckedExpr.TypeMapEntry
+ 15, // 2: cel.expr.CheckedExpr.source_info:type_name -> cel.expr.SourceInfo
+ 16, // 3: cel.expr.CheckedExpr.expr:type_name -> cel.expr.Expr
+ 17, // 4: cel.expr.Type.dyn:type_name -> google.protobuf.Empty
+ 18, // 5: cel.expr.Type.null:type_name -> google.protobuf.NullValue
+ 0, // 6: cel.expr.Type.primitive:type_name -> cel.expr.Type.PrimitiveType
+ 0, // 7: cel.expr.Type.wrapper:type_name -> cel.expr.Type.PrimitiveType
+ 1, // 8: cel.expr.Type.well_known:type_name -> cel.expr.Type.WellKnownType
+ 8, // 9: cel.expr.Type.list_type:type_name -> cel.expr.Type.ListType
+ 9, // 10: cel.expr.Type.map_type:type_name -> cel.expr.Type.MapType
+ 10, // 11: cel.expr.Type.function:type_name -> cel.expr.Type.FunctionType
+ 3, // 12: cel.expr.Type.type:type_name -> cel.expr.Type
+ 17, // 13: cel.expr.Type.error:type_name -> google.protobuf.Empty
+ 11, // 14: cel.expr.Type.abstract_type:type_name -> cel.expr.Type.AbstractType
+ 12, // 15: cel.expr.Decl.ident:type_name -> cel.expr.Decl.IdentDecl
+ 13, // 16: cel.expr.Decl.function:type_name -> cel.expr.Decl.FunctionDecl
+ 19, // 17: cel.expr.Reference.value:type_name -> cel.expr.Constant
+ 5, // 18: cel.expr.CheckedExpr.ReferenceMapEntry.value:type_name -> cel.expr.Reference
+ 3, // 19: cel.expr.CheckedExpr.TypeMapEntry.value:type_name -> cel.expr.Type
+ 3, // 20: cel.expr.Type.ListType.elem_type:type_name -> cel.expr.Type
+ 3, // 21: cel.expr.Type.MapType.key_type:type_name -> cel.expr.Type
+ 3, // 22: cel.expr.Type.MapType.value_type:type_name -> cel.expr.Type
+ 3, // 23: cel.expr.Type.FunctionType.result_type:type_name -> cel.expr.Type
+ 3, // 24: cel.expr.Type.FunctionType.arg_types:type_name -> cel.expr.Type
+ 3, // 25: cel.expr.Type.AbstractType.parameter_types:type_name -> cel.expr.Type
+ 3, // 26: cel.expr.Decl.IdentDecl.type:type_name -> cel.expr.Type
+ 19, // 27: cel.expr.Decl.IdentDecl.value:type_name -> cel.expr.Constant
+ 14, // 28: cel.expr.Decl.FunctionDecl.overloads:type_name -> cel.expr.Decl.FunctionDecl.Overload
+ 3, // 29: cel.expr.Decl.FunctionDecl.Overload.params:type_name -> cel.expr.Type
+ 3, // 30: cel.expr.Decl.FunctionDecl.Overload.result_type:type_name -> cel.expr.Type
+ 31, // [31:31] is the sub-list for method output_type
+ 31, // [31:31] is the sub-list for method input_type
+ 31, // [31:31] is the sub-list for extension type_name
+ 31, // [31:31] is the sub-list for extension extendee
+ 0, // [0:31] is the sub-list for field type_name
+}
+
+func init() { file_cel_expr_checked_proto_init() }
+func file_cel_expr_checked_proto_init() {
+ if File_cel_expr_checked_proto != nil {
+ return
+ }
+ file_cel_expr_syntax_proto_init()
+ file_cel_expr_checked_proto_msgTypes[1].OneofWrappers = []any{
+ (*Type_Dyn)(nil),
+ (*Type_Null)(nil),
+ (*Type_Primitive)(nil),
+ (*Type_Wrapper)(nil),
+ (*Type_WellKnown)(nil),
+ (*Type_ListType_)(nil),
+ (*Type_MapType_)(nil),
+ (*Type_Function)(nil),
+ (*Type_MessageType)(nil),
+ (*Type_TypeParam)(nil),
+ (*Type_Type)(nil),
+ (*Type_Error)(nil),
+ (*Type_AbstractType_)(nil),
+ }
+ file_cel_expr_checked_proto_msgTypes[2].OneofWrappers = []any{
+ (*Decl_Ident)(nil),
+ (*Decl_Function)(nil),
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_cel_expr_checked_proto_rawDesc), len(file_cel_expr_checked_proto_rawDesc)),
+ NumEnums: 2,
+ NumMessages: 13,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_cel_expr_checked_proto_goTypes,
+ DependencyIndexes: file_cel_expr_checked_proto_depIdxs,
+ EnumInfos: file_cel_expr_checked_proto_enumTypes,
+ MessageInfos: file_cel_expr_checked_proto_msgTypes,
+ }.Build()
+ File_cel_expr_checked_proto = out.File
+ file_cel_expr_checked_proto_goTypes = nil
+ file_cel_expr_checked_proto_depIdxs = nil
+}
diff --git a/vendor/cel.dev/expr/cloudbuild.yaml b/vendor/cel.dev/expr/cloudbuild.yaml
new file mode 100644
index 000000000000..e3e533a04abd
--- /dev/null
+++ b/vendor/cel.dev/expr/cloudbuild.yaml
@@ -0,0 +1,9 @@
+steps:
+- name: 'gcr.io/cloud-builders/bazel:7.3.2'
+ entrypoint: bazel
+ args: ['build', '...']
+ id: bazel-build
+ waitFor: ['-']
+timeout: 15m
+options:
+ machineType: 'N1_HIGHCPU_32'
diff --git a/vendor/cel.dev/expr/eval.pb.go b/vendor/cel.dev/expr/eval.pb.go
new file mode 100644
index 000000000000..83acb8935bf4
--- /dev/null
+++ b/vendor/cel.dev/expr/eval.pb.go
@@ -0,0 +1,468 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.36.10
+// protoc v5.27.1
+// source: cel/expr/eval.proto
+
+package expr
+
+import (
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ anypb "google.golang.org/protobuf/types/known/anypb"
+ reflect "reflect"
+ sync "sync"
+ unsafe "unsafe"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type EvalState struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Values []*ExprValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
+ Results []*EvalState_Result `protobuf:"bytes,3,rep,name=results,proto3" json:"results,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *EvalState) Reset() {
+ *x = EvalState{}
+ mi := &file_cel_expr_eval_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *EvalState) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EvalState) ProtoMessage() {}
+
+func (x *EvalState) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_eval_proto_msgTypes[0]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use EvalState.ProtoReflect.Descriptor instead.
+func (*EvalState) Descriptor() ([]byte, []int) {
+ return file_cel_expr_eval_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *EvalState) GetValues() []*ExprValue {
+ if x != nil {
+ return x.Values
+ }
+ return nil
+}
+
+func (x *EvalState) GetResults() []*EvalState_Result {
+ if x != nil {
+ return x.Results
+ }
+ return nil
+}
+
+type ExprValue struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // Types that are valid to be assigned to Kind:
+ //
+ // *ExprValue_Value
+ // *ExprValue_Error
+ // *ExprValue_Unknown
+ Kind isExprValue_Kind `protobuf_oneof:"kind"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *ExprValue) Reset() {
+ *x = ExprValue{}
+ mi := &file_cel_expr_eval_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *ExprValue) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ExprValue) ProtoMessage() {}
+
+func (x *ExprValue) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_eval_proto_msgTypes[1]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ExprValue.ProtoReflect.Descriptor instead.
+func (*ExprValue) Descriptor() ([]byte, []int) {
+ return file_cel_expr_eval_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *ExprValue) GetKind() isExprValue_Kind {
+ if x != nil {
+ return x.Kind
+ }
+ return nil
+}
+
+func (x *ExprValue) GetValue() *Value {
+ if x != nil {
+ if x, ok := x.Kind.(*ExprValue_Value); ok {
+ return x.Value
+ }
+ }
+ return nil
+}
+
+func (x *ExprValue) GetError() *ErrorSet {
+ if x != nil {
+ if x, ok := x.Kind.(*ExprValue_Error); ok {
+ return x.Error
+ }
+ }
+ return nil
+}
+
+func (x *ExprValue) GetUnknown() *UnknownSet {
+ if x != nil {
+ if x, ok := x.Kind.(*ExprValue_Unknown); ok {
+ return x.Unknown
+ }
+ }
+ return nil
+}
+
+type isExprValue_Kind interface {
+ isExprValue_Kind()
+}
+
+type ExprValue_Value struct {
+ Value *Value `protobuf:"bytes,1,opt,name=value,proto3,oneof"`
+}
+
+type ExprValue_Error struct {
+ Error *ErrorSet `protobuf:"bytes,2,opt,name=error,proto3,oneof"`
+}
+
+type ExprValue_Unknown struct {
+ Unknown *UnknownSet `protobuf:"bytes,3,opt,name=unknown,proto3,oneof"`
+}
+
+func (*ExprValue_Value) isExprValue_Kind() {}
+
+func (*ExprValue_Error) isExprValue_Kind() {}
+
+func (*ExprValue_Unknown) isExprValue_Kind() {}
+
+type ErrorSet struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Errors []*Status `protobuf:"bytes,1,rep,name=errors,proto3" json:"errors,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *ErrorSet) Reset() {
+ *x = ErrorSet{}
+ mi := &file_cel_expr_eval_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *ErrorSet) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ErrorSet) ProtoMessage() {}
+
+func (x *ErrorSet) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_eval_proto_msgTypes[2]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ErrorSet.ProtoReflect.Descriptor instead.
+func (*ErrorSet) Descriptor() ([]byte, []int) {
+ return file_cel_expr_eval_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *ErrorSet) GetErrors() []*Status {
+ if x != nil {
+ return x.Errors
+ }
+ return nil
+}
+
+type Status struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
+ Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
+ Details []*anypb.Any `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Status) Reset() {
+ *x = Status{}
+ mi := &file_cel_expr_eval_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Status) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Status) ProtoMessage() {}
+
+func (x *Status) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_eval_proto_msgTypes[3]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Status.ProtoReflect.Descriptor instead.
+func (*Status) Descriptor() ([]byte, []int) {
+ return file_cel_expr_eval_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *Status) GetCode() int32 {
+ if x != nil {
+ return x.Code
+ }
+ return 0
+}
+
+func (x *Status) GetMessage() string {
+ if x != nil {
+ return x.Message
+ }
+ return ""
+}
+
+func (x *Status) GetDetails() []*anypb.Any {
+ if x != nil {
+ return x.Details
+ }
+ return nil
+}
+
+type UnknownSet struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Exprs []int64 `protobuf:"varint,1,rep,packed,name=exprs,proto3" json:"exprs,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *UnknownSet) Reset() {
+ *x = UnknownSet{}
+ mi := &file_cel_expr_eval_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *UnknownSet) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UnknownSet) ProtoMessage() {}
+
+func (x *UnknownSet) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_eval_proto_msgTypes[4]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use UnknownSet.ProtoReflect.Descriptor instead.
+func (*UnknownSet) Descriptor() ([]byte, []int) {
+ return file_cel_expr_eval_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *UnknownSet) GetExprs() []int64 {
+ if x != nil {
+ return x.Exprs
+ }
+ return nil
+}
+
+type EvalState_Result struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Expr int64 `protobuf:"varint,1,opt,name=expr,proto3" json:"expr,omitempty"`
+ Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *EvalState_Result) Reset() {
+ *x = EvalState_Result{}
+ mi := &file_cel_expr_eval_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *EvalState_Result) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EvalState_Result) ProtoMessage() {}
+
+func (x *EvalState_Result) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_eval_proto_msgTypes[5]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use EvalState_Result.ProtoReflect.Descriptor instead.
+func (*EvalState_Result) Descriptor() ([]byte, []int) {
+ return file_cel_expr_eval_proto_rawDescGZIP(), []int{0, 0}
+}
+
+func (x *EvalState_Result) GetExpr() int64 {
+ if x != nil {
+ return x.Expr
+ }
+ return 0
+}
+
+func (x *EvalState_Result) GetValue() int64 {
+ if x != nil {
+ return x.Value
+ }
+ return 0
+}
+
+var File_cel_expr_eval_proto protoreflect.FileDescriptor
+
+const file_cel_expr_eval_proto_rawDesc = "" +
+ "\n" +
+ "\x13cel/expr/eval.proto\x12\bcel.expr\x1a\x19google/protobuf/any.proto\x1a\x14cel/expr/value.proto\"\xa2\x01\n" +
+ "\tEvalState\x12+\n" +
+ "\x06values\x18\x01 \x03(\v2\x13.cel.expr.ExprValueR\x06values\x124\n" +
+ "\aresults\x18\x03 \x03(\v2\x1a.cel.expr.EvalState.ResultR\aresults\x1a2\n" +
+ "\x06Result\x12\x12\n" +
+ "\x04expr\x18\x01 \x01(\x03R\x04expr\x12\x14\n" +
+ "\x05value\x18\x02 \x01(\x03R\x05value\"\x9a\x01\n" +
+ "\tExprValue\x12'\n" +
+ "\x05value\x18\x01 \x01(\v2\x0f.cel.expr.ValueH\x00R\x05value\x12*\n" +
+ "\x05error\x18\x02 \x01(\v2\x12.cel.expr.ErrorSetH\x00R\x05error\x120\n" +
+ "\aunknown\x18\x03 \x01(\v2\x14.cel.expr.UnknownSetH\x00R\aunknownB\x06\n" +
+ "\x04kind\"4\n" +
+ "\bErrorSet\x12(\n" +
+ "\x06errors\x18\x01 \x03(\v2\x10.cel.expr.StatusR\x06errors\"f\n" +
+ "\x06Status\x12\x12\n" +
+ "\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" +
+ "\amessage\x18\x02 \x01(\tR\amessage\x12.\n" +
+ "\adetails\x18\x03 \x03(\v2\x14.google.protobuf.AnyR\adetails\"\"\n" +
+ "\n" +
+ "UnknownSet\x12\x14\n" +
+ "\x05exprs\x18\x01 \x03(\x03R\x05exprsB,\n" +
+ "\fdev.cel.exprB\tEvalProtoP\x01Z\fcel.dev/expr\xf8\x01\x01b\x06proto3"
+
+var (
+ file_cel_expr_eval_proto_rawDescOnce sync.Once
+ file_cel_expr_eval_proto_rawDescData []byte
+)
+
+func file_cel_expr_eval_proto_rawDescGZIP() []byte {
+ file_cel_expr_eval_proto_rawDescOnce.Do(func() {
+ file_cel_expr_eval_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cel_expr_eval_proto_rawDesc), len(file_cel_expr_eval_proto_rawDesc)))
+ })
+ return file_cel_expr_eval_proto_rawDescData
+}
+
+var file_cel_expr_eval_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
+var file_cel_expr_eval_proto_goTypes = []any{
+ (*EvalState)(nil), // 0: cel.expr.EvalState
+ (*ExprValue)(nil), // 1: cel.expr.ExprValue
+ (*ErrorSet)(nil), // 2: cel.expr.ErrorSet
+ (*Status)(nil), // 3: cel.expr.Status
+ (*UnknownSet)(nil), // 4: cel.expr.UnknownSet
+ (*EvalState_Result)(nil), // 5: cel.expr.EvalState.Result
+ (*Value)(nil), // 6: cel.expr.Value
+ (*anypb.Any)(nil), // 7: google.protobuf.Any
+}
+var file_cel_expr_eval_proto_depIdxs = []int32{
+ 1, // 0: cel.expr.EvalState.values:type_name -> cel.expr.ExprValue
+ 5, // 1: cel.expr.EvalState.results:type_name -> cel.expr.EvalState.Result
+ 6, // 2: cel.expr.ExprValue.value:type_name -> cel.expr.Value
+ 2, // 3: cel.expr.ExprValue.error:type_name -> cel.expr.ErrorSet
+ 4, // 4: cel.expr.ExprValue.unknown:type_name -> cel.expr.UnknownSet
+ 3, // 5: cel.expr.ErrorSet.errors:type_name -> cel.expr.Status
+ 7, // 6: cel.expr.Status.details:type_name -> google.protobuf.Any
+ 7, // [7:7] is the sub-list for method output_type
+ 7, // [7:7] is the sub-list for method input_type
+ 7, // [7:7] is the sub-list for extension type_name
+ 7, // [7:7] is the sub-list for extension extendee
+ 0, // [0:7] is the sub-list for field type_name
+}
+
+func init() { file_cel_expr_eval_proto_init() }
+func file_cel_expr_eval_proto_init() {
+ if File_cel_expr_eval_proto != nil {
+ return
+ }
+ file_cel_expr_value_proto_init()
+ file_cel_expr_eval_proto_msgTypes[1].OneofWrappers = []any{
+ (*ExprValue_Value)(nil),
+ (*ExprValue_Error)(nil),
+ (*ExprValue_Unknown)(nil),
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_cel_expr_eval_proto_rawDesc), len(file_cel_expr_eval_proto_rawDesc)),
+ NumEnums: 0,
+ NumMessages: 6,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_cel_expr_eval_proto_goTypes,
+ DependencyIndexes: file_cel_expr_eval_proto_depIdxs,
+ MessageInfos: file_cel_expr_eval_proto_msgTypes,
+ }.Build()
+ File_cel_expr_eval_proto = out.File
+ file_cel_expr_eval_proto_goTypes = nil
+ file_cel_expr_eval_proto_depIdxs = nil
+}
diff --git a/vendor/cel.dev/expr/explain.pb.go b/vendor/cel.dev/expr/explain.pb.go
new file mode 100644
index 000000000000..423993397836
--- /dev/null
+++ b/vendor/cel.dev/expr/explain.pb.go
@@ -0,0 +1,195 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.36.10
+// protoc v5.27.1
+// source: cel/expr/explain.proto
+
+package expr
+
+import (
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ reflect "reflect"
+ sync "sync"
+ unsafe "unsafe"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// Deprecated: Marked as deprecated in cel/expr/explain.proto.
+type Explain struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
+ ExprSteps []*Explain_ExprStep `protobuf:"bytes,2,rep,name=expr_steps,json=exprSteps,proto3" json:"expr_steps,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Explain) Reset() {
+ *x = Explain{}
+ mi := &file_cel_expr_explain_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Explain) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Explain) ProtoMessage() {}
+
+func (x *Explain) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_explain_proto_msgTypes[0]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Explain.ProtoReflect.Descriptor instead.
+func (*Explain) Descriptor() ([]byte, []int) {
+ return file_cel_expr_explain_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *Explain) GetValues() []*Value {
+ if x != nil {
+ return x.Values
+ }
+ return nil
+}
+
+func (x *Explain) GetExprSteps() []*Explain_ExprStep {
+ if x != nil {
+ return x.ExprSteps
+ }
+ return nil
+}
+
+type Explain_ExprStep struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
+ ValueIndex int32 `protobuf:"varint,2,opt,name=value_index,json=valueIndex,proto3" json:"value_index,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Explain_ExprStep) Reset() {
+ *x = Explain_ExprStep{}
+ mi := &file_cel_expr_explain_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Explain_ExprStep) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Explain_ExprStep) ProtoMessage() {}
+
+func (x *Explain_ExprStep) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_explain_proto_msgTypes[1]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Explain_ExprStep.ProtoReflect.Descriptor instead.
+func (*Explain_ExprStep) Descriptor() ([]byte, []int) {
+ return file_cel_expr_explain_proto_rawDescGZIP(), []int{0, 0}
+}
+
+func (x *Explain_ExprStep) GetId() int64 {
+ if x != nil {
+ return x.Id
+ }
+ return 0
+}
+
+func (x *Explain_ExprStep) GetValueIndex() int32 {
+ if x != nil {
+ return x.ValueIndex
+ }
+ return 0
+}
+
+var File_cel_expr_explain_proto protoreflect.FileDescriptor
+
+const file_cel_expr_explain_proto_rawDesc = "" +
+ "\n" +
+ "\x16cel/expr/explain.proto\x12\bcel.expr\x1a\x14cel/expr/value.proto\"\xae\x01\n" +
+ "\aExplain\x12'\n" +
+ "\x06values\x18\x01 \x03(\v2\x0f.cel.expr.ValueR\x06values\x129\n" +
+ "\n" +
+ "expr_steps\x18\x02 \x03(\v2\x1a.cel.expr.Explain.ExprStepR\texprSteps\x1a;\n" +
+ "\bExprStep\x12\x0e\n" +
+ "\x02id\x18\x01 \x01(\x03R\x02id\x12\x1f\n" +
+ "\vvalue_index\x18\x02 \x01(\x05R\n" +
+ "valueIndex:\x02\x18\x01B/\n" +
+ "\fdev.cel.exprB\fExplainProtoP\x01Z\fcel.dev/expr\xf8\x01\x01b\x06proto3"
+
+var (
+ file_cel_expr_explain_proto_rawDescOnce sync.Once
+ file_cel_expr_explain_proto_rawDescData []byte
+)
+
+func file_cel_expr_explain_proto_rawDescGZIP() []byte {
+ file_cel_expr_explain_proto_rawDescOnce.Do(func() {
+ file_cel_expr_explain_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cel_expr_explain_proto_rawDesc), len(file_cel_expr_explain_proto_rawDesc)))
+ })
+ return file_cel_expr_explain_proto_rawDescData
+}
+
+var file_cel_expr_explain_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
+var file_cel_expr_explain_proto_goTypes = []any{
+ (*Explain)(nil), // 0: cel.expr.Explain
+ (*Explain_ExprStep)(nil), // 1: cel.expr.Explain.ExprStep
+ (*Value)(nil), // 2: cel.expr.Value
+}
+var file_cel_expr_explain_proto_depIdxs = []int32{
+ 2, // 0: cel.expr.Explain.values:type_name -> cel.expr.Value
+ 1, // 1: cel.expr.Explain.expr_steps:type_name -> cel.expr.Explain.ExprStep
+ 2, // [2:2] is the sub-list for method output_type
+ 2, // [2:2] is the sub-list for method input_type
+ 2, // [2:2] is the sub-list for extension type_name
+ 2, // [2:2] is the sub-list for extension extendee
+ 0, // [0:2] is the sub-list for field type_name
+}
+
+func init() { file_cel_expr_explain_proto_init() }
+func file_cel_expr_explain_proto_init() {
+ if File_cel_expr_explain_proto != nil {
+ return
+ }
+ file_cel_expr_value_proto_init()
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_cel_expr_explain_proto_rawDesc), len(file_cel_expr_explain_proto_rawDesc)),
+ NumEnums: 0,
+ NumMessages: 2,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_cel_expr_explain_proto_goTypes,
+ DependencyIndexes: file_cel_expr_explain_proto_depIdxs,
+ MessageInfos: file_cel_expr_explain_proto_msgTypes,
+ }.Build()
+ File_cel_expr_explain_proto = out.File
+ file_cel_expr_explain_proto_goTypes = nil
+ file_cel_expr_explain_proto_depIdxs = nil
+}
diff --git a/vendor/cel.dev/expr/regen_go_proto.sh b/vendor/cel.dev/expr/regen_go_proto.sh
new file mode 100644
index 000000000000..fdcbb3ce2567
--- /dev/null
+++ b/vendor/cel.dev/expr/regen_go_proto.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+bazel build //proto/cel/expr/conformance/...
+files=($(bazel aquery 'kind(proto, //proto/cel/expr/conformance/...)' | grep Outputs | grep "[.]pb[.]go" | sed 's/Outputs: \[//' | sed 's/\]//' | tr "," "\n"))
+for src in ${files[@]};
+do
+ dst=$(echo $src | sed 's/\(.*\/cel.dev\/expr\/\(.*\)\)/\2/')
+ echo "copying $dst"
+ $(cp $src $dst)
+done
diff --git a/vendor/cel.dev/expr/regen_go_proto_canonical_protos.sh b/vendor/cel.dev/expr/regen_go_proto_canonical_protos.sh
new file mode 100644
index 000000000000..9a13479e4019
--- /dev/null
+++ b/vendor/cel.dev/expr/regen_go_proto_canonical_protos.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+bazel build //proto/cel/expr:all
+
+rm -vf ./*.pb.go
+
+files=( $(bazel cquery //proto/cel/expr:expr_go_proto --output=starlark --starlark:expr="'\n'.join([f.path for f in target.output_groups.go_generated_srcs.to_list()])") )
+for src in "${files[@]}";
+do
+ cp -v "${src}" ./
+done
diff --git a/vendor/cel.dev/expr/syntax.pb.go b/vendor/cel.dev/expr/syntax.pb.go
new file mode 100644
index 000000000000..72d19b20d416
--- /dev/null
+++ b/vendor/cel.dev/expr/syntax.pb.go
@@ -0,0 +1,1394 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.36.10
+// protoc v5.27.1
+// source: cel/expr/syntax.proto
+
+package expr
+
+import (
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ durationpb "google.golang.org/protobuf/types/known/durationpb"
+ structpb "google.golang.org/protobuf/types/known/structpb"
+ timestamppb "google.golang.org/protobuf/types/known/timestamppb"
+ reflect "reflect"
+ sync "sync"
+ unsafe "unsafe"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type SourceInfo_Extension_Component int32
+
+const (
+ SourceInfo_Extension_COMPONENT_UNSPECIFIED SourceInfo_Extension_Component = 0
+ SourceInfo_Extension_COMPONENT_PARSER SourceInfo_Extension_Component = 1
+ SourceInfo_Extension_COMPONENT_TYPE_CHECKER SourceInfo_Extension_Component = 2
+ SourceInfo_Extension_COMPONENT_RUNTIME SourceInfo_Extension_Component = 3
+)
+
+// Enum value maps for SourceInfo_Extension_Component.
+var (
+ SourceInfo_Extension_Component_name = map[int32]string{
+ 0: "COMPONENT_UNSPECIFIED",
+ 1: "COMPONENT_PARSER",
+ 2: "COMPONENT_TYPE_CHECKER",
+ 3: "COMPONENT_RUNTIME",
+ }
+ SourceInfo_Extension_Component_value = map[string]int32{
+ "COMPONENT_UNSPECIFIED": 0,
+ "COMPONENT_PARSER": 1,
+ "COMPONENT_TYPE_CHECKER": 2,
+ "COMPONENT_RUNTIME": 3,
+ }
+)
+
+func (x SourceInfo_Extension_Component) Enum() *SourceInfo_Extension_Component {
+ p := new(SourceInfo_Extension_Component)
+ *p = x
+ return p
+}
+
+func (x SourceInfo_Extension_Component) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (SourceInfo_Extension_Component) Descriptor() protoreflect.EnumDescriptor {
+ return file_cel_expr_syntax_proto_enumTypes[0].Descriptor()
+}
+
+func (SourceInfo_Extension_Component) Type() protoreflect.EnumType {
+ return &file_cel_expr_syntax_proto_enumTypes[0]
+}
+
+func (x SourceInfo_Extension_Component) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use SourceInfo_Extension_Component.Descriptor instead.
+func (SourceInfo_Extension_Component) EnumDescriptor() ([]byte, []int) {
+ return file_cel_expr_syntax_proto_rawDescGZIP(), []int{3, 2, 0}
+}
+
+type ParsedExpr struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Expr *Expr `protobuf:"bytes,2,opt,name=expr,proto3" json:"expr,omitempty"`
+ SourceInfo *SourceInfo `protobuf:"bytes,3,opt,name=source_info,json=sourceInfo,proto3" json:"source_info,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *ParsedExpr) Reset() {
+ *x = ParsedExpr{}
+ mi := &file_cel_expr_syntax_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *ParsedExpr) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ParsedExpr) ProtoMessage() {}
+
+func (x *ParsedExpr) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_syntax_proto_msgTypes[0]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ParsedExpr.ProtoReflect.Descriptor instead.
+func (*ParsedExpr) Descriptor() ([]byte, []int) {
+ return file_cel_expr_syntax_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *ParsedExpr) GetExpr() *Expr {
+ if x != nil {
+ return x.Expr
+ }
+ return nil
+}
+
+func (x *ParsedExpr) GetSourceInfo() *SourceInfo {
+ if x != nil {
+ return x.SourceInfo
+ }
+ return nil
+}
+
+type Expr struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
+ // Types that are valid to be assigned to ExprKind:
+ //
+ // *Expr_ConstExpr
+ // *Expr_IdentExpr
+ // *Expr_SelectExpr
+ // *Expr_CallExpr
+ // *Expr_ListExpr
+ // *Expr_StructExpr
+ // *Expr_ComprehensionExpr
+ ExprKind isExpr_ExprKind `protobuf_oneof:"expr_kind"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Expr) Reset() {
+ *x = Expr{}
+ mi := &file_cel_expr_syntax_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Expr) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Expr) ProtoMessage() {}
+
+func (x *Expr) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_syntax_proto_msgTypes[1]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Expr.ProtoReflect.Descriptor instead.
+func (*Expr) Descriptor() ([]byte, []int) {
+ return file_cel_expr_syntax_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *Expr) GetId() int64 {
+ if x != nil {
+ return x.Id
+ }
+ return 0
+}
+
+func (x *Expr) GetExprKind() isExpr_ExprKind {
+ if x != nil {
+ return x.ExprKind
+ }
+ return nil
+}
+
+func (x *Expr) GetConstExpr() *Constant {
+ if x != nil {
+ if x, ok := x.ExprKind.(*Expr_ConstExpr); ok {
+ return x.ConstExpr
+ }
+ }
+ return nil
+}
+
+func (x *Expr) GetIdentExpr() *Expr_Ident {
+ if x != nil {
+ if x, ok := x.ExprKind.(*Expr_IdentExpr); ok {
+ return x.IdentExpr
+ }
+ }
+ return nil
+}
+
+func (x *Expr) GetSelectExpr() *Expr_Select {
+ if x != nil {
+ if x, ok := x.ExprKind.(*Expr_SelectExpr); ok {
+ return x.SelectExpr
+ }
+ }
+ return nil
+}
+
+func (x *Expr) GetCallExpr() *Expr_Call {
+ if x != nil {
+ if x, ok := x.ExprKind.(*Expr_CallExpr); ok {
+ return x.CallExpr
+ }
+ }
+ return nil
+}
+
+func (x *Expr) GetListExpr() *Expr_CreateList {
+ if x != nil {
+ if x, ok := x.ExprKind.(*Expr_ListExpr); ok {
+ return x.ListExpr
+ }
+ }
+ return nil
+}
+
+func (x *Expr) GetStructExpr() *Expr_CreateStruct {
+ if x != nil {
+ if x, ok := x.ExprKind.(*Expr_StructExpr); ok {
+ return x.StructExpr
+ }
+ }
+ return nil
+}
+
+func (x *Expr) GetComprehensionExpr() *Expr_Comprehension {
+ if x != nil {
+ if x, ok := x.ExprKind.(*Expr_ComprehensionExpr); ok {
+ return x.ComprehensionExpr
+ }
+ }
+ return nil
+}
+
+type isExpr_ExprKind interface {
+ isExpr_ExprKind()
+}
+
+type Expr_ConstExpr struct {
+ ConstExpr *Constant `protobuf:"bytes,3,opt,name=const_expr,json=constExpr,proto3,oneof"`
+}
+
+type Expr_IdentExpr struct {
+ IdentExpr *Expr_Ident `protobuf:"bytes,4,opt,name=ident_expr,json=identExpr,proto3,oneof"`
+}
+
+type Expr_SelectExpr struct {
+ SelectExpr *Expr_Select `protobuf:"bytes,5,opt,name=select_expr,json=selectExpr,proto3,oneof"`
+}
+
+type Expr_CallExpr struct {
+ CallExpr *Expr_Call `protobuf:"bytes,6,opt,name=call_expr,json=callExpr,proto3,oneof"`
+}
+
+type Expr_ListExpr struct {
+ ListExpr *Expr_CreateList `protobuf:"bytes,7,opt,name=list_expr,json=listExpr,proto3,oneof"`
+}
+
+type Expr_StructExpr struct {
+ StructExpr *Expr_CreateStruct `protobuf:"bytes,8,opt,name=struct_expr,json=structExpr,proto3,oneof"`
+}
+
+type Expr_ComprehensionExpr struct {
+ ComprehensionExpr *Expr_Comprehension `protobuf:"bytes,9,opt,name=comprehension_expr,json=comprehensionExpr,proto3,oneof"`
+}
+
+func (*Expr_ConstExpr) isExpr_ExprKind() {}
+
+func (*Expr_IdentExpr) isExpr_ExprKind() {}
+
+func (*Expr_SelectExpr) isExpr_ExprKind() {}
+
+func (*Expr_CallExpr) isExpr_ExprKind() {}
+
+func (*Expr_ListExpr) isExpr_ExprKind() {}
+
+func (*Expr_StructExpr) isExpr_ExprKind() {}
+
+func (*Expr_ComprehensionExpr) isExpr_ExprKind() {}
+
+type Constant struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // Types that are valid to be assigned to ConstantKind:
+ //
+ // *Constant_NullValue
+ // *Constant_BoolValue
+ // *Constant_Int64Value
+ // *Constant_Uint64Value
+ // *Constant_DoubleValue
+ // *Constant_StringValue
+ // *Constant_BytesValue
+ // *Constant_DurationValue
+ // *Constant_TimestampValue
+ ConstantKind isConstant_ConstantKind `protobuf_oneof:"constant_kind"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Constant) Reset() {
+ *x = Constant{}
+ mi := &file_cel_expr_syntax_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Constant) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Constant) ProtoMessage() {}
+
+func (x *Constant) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_syntax_proto_msgTypes[2]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Constant.ProtoReflect.Descriptor instead.
+func (*Constant) Descriptor() ([]byte, []int) {
+ return file_cel_expr_syntax_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *Constant) GetConstantKind() isConstant_ConstantKind {
+ if x != nil {
+ return x.ConstantKind
+ }
+ return nil
+}
+
+func (x *Constant) GetNullValue() structpb.NullValue {
+ if x != nil {
+ if x, ok := x.ConstantKind.(*Constant_NullValue); ok {
+ return x.NullValue
+ }
+ }
+ return structpb.NullValue(0)
+}
+
+func (x *Constant) GetBoolValue() bool {
+ if x != nil {
+ if x, ok := x.ConstantKind.(*Constant_BoolValue); ok {
+ return x.BoolValue
+ }
+ }
+ return false
+}
+
+func (x *Constant) GetInt64Value() int64 {
+ if x != nil {
+ if x, ok := x.ConstantKind.(*Constant_Int64Value); ok {
+ return x.Int64Value
+ }
+ }
+ return 0
+}
+
+func (x *Constant) GetUint64Value() uint64 {
+ if x != nil {
+ if x, ok := x.ConstantKind.(*Constant_Uint64Value); ok {
+ return x.Uint64Value
+ }
+ }
+ return 0
+}
+
+func (x *Constant) GetDoubleValue() float64 {
+ if x != nil {
+ if x, ok := x.ConstantKind.(*Constant_DoubleValue); ok {
+ return x.DoubleValue
+ }
+ }
+ return 0
+}
+
+func (x *Constant) GetStringValue() string {
+ if x != nil {
+ if x, ok := x.ConstantKind.(*Constant_StringValue); ok {
+ return x.StringValue
+ }
+ }
+ return ""
+}
+
+func (x *Constant) GetBytesValue() []byte {
+ if x != nil {
+ if x, ok := x.ConstantKind.(*Constant_BytesValue); ok {
+ return x.BytesValue
+ }
+ }
+ return nil
+}
+
+// Deprecated: Marked as deprecated in cel/expr/syntax.proto.
+func (x *Constant) GetDurationValue() *durationpb.Duration {
+ if x != nil {
+ if x, ok := x.ConstantKind.(*Constant_DurationValue); ok {
+ return x.DurationValue
+ }
+ }
+ return nil
+}
+
+// Deprecated: Marked as deprecated in cel/expr/syntax.proto.
+func (x *Constant) GetTimestampValue() *timestamppb.Timestamp {
+ if x != nil {
+ if x, ok := x.ConstantKind.(*Constant_TimestampValue); ok {
+ return x.TimestampValue
+ }
+ }
+ return nil
+}
+
+type isConstant_ConstantKind interface {
+ isConstant_ConstantKind()
+}
+
+type Constant_NullValue struct {
+ NullValue structpb.NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"`
+}
+
+type Constant_BoolValue struct {
+ BoolValue bool `protobuf:"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof"`
+}
+
+type Constant_Int64Value struct {
+ Int64Value int64 `protobuf:"varint,3,opt,name=int64_value,json=int64Value,proto3,oneof"`
+}
+
+type Constant_Uint64Value struct {
+ Uint64Value uint64 `protobuf:"varint,4,opt,name=uint64_value,json=uint64Value,proto3,oneof"`
+}
+
+type Constant_DoubleValue struct {
+ DoubleValue float64 `protobuf:"fixed64,5,opt,name=double_value,json=doubleValue,proto3,oneof"`
+}
+
+type Constant_StringValue struct {
+ StringValue string `protobuf:"bytes,6,opt,name=string_value,json=stringValue,proto3,oneof"`
+}
+
+type Constant_BytesValue struct {
+ BytesValue []byte `protobuf:"bytes,7,opt,name=bytes_value,json=bytesValue,proto3,oneof"`
+}
+
+type Constant_DurationValue struct {
+ // Deprecated: Marked as deprecated in cel/expr/syntax.proto.
+ DurationValue *durationpb.Duration `protobuf:"bytes,8,opt,name=duration_value,json=durationValue,proto3,oneof"`
+}
+
+type Constant_TimestampValue struct {
+ // Deprecated: Marked as deprecated in cel/expr/syntax.proto.
+ TimestampValue *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=timestamp_value,json=timestampValue,proto3,oneof"`
+}
+
+func (*Constant_NullValue) isConstant_ConstantKind() {}
+
+func (*Constant_BoolValue) isConstant_ConstantKind() {}
+
+func (*Constant_Int64Value) isConstant_ConstantKind() {}
+
+func (*Constant_Uint64Value) isConstant_ConstantKind() {}
+
+func (*Constant_DoubleValue) isConstant_ConstantKind() {}
+
+func (*Constant_StringValue) isConstant_ConstantKind() {}
+
+func (*Constant_BytesValue) isConstant_ConstantKind() {}
+
+func (*Constant_DurationValue) isConstant_ConstantKind() {}
+
+func (*Constant_TimestampValue) isConstant_ConstantKind() {}
+
+type SourceInfo struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ SyntaxVersion string `protobuf:"bytes,1,opt,name=syntax_version,json=syntaxVersion,proto3" json:"syntax_version,omitempty"`
+ Location string `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"`
+ LineOffsets []int32 `protobuf:"varint,3,rep,packed,name=line_offsets,json=lineOffsets,proto3" json:"line_offsets,omitempty"`
+ Positions map[int64]int32 `protobuf:"bytes,4,rep,name=positions,proto3" json:"positions,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
+ MacroCalls map[int64]*Expr `protobuf:"bytes,5,rep,name=macro_calls,json=macroCalls,proto3" json:"macro_calls,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
+ Extensions []*SourceInfo_Extension `protobuf:"bytes,6,rep,name=extensions,proto3" json:"extensions,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *SourceInfo) Reset() {
+ *x = SourceInfo{}
+ mi := &file_cel_expr_syntax_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *SourceInfo) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SourceInfo) ProtoMessage() {}
+
+func (x *SourceInfo) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_syntax_proto_msgTypes[3]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use SourceInfo.ProtoReflect.Descriptor instead.
+func (*SourceInfo) Descriptor() ([]byte, []int) {
+ return file_cel_expr_syntax_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *SourceInfo) GetSyntaxVersion() string {
+ if x != nil {
+ return x.SyntaxVersion
+ }
+ return ""
+}
+
+func (x *SourceInfo) GetLocation() string {
+ if x != nil {
+ return x.Location
+ }
+ return ""
+}
+
+func (x *SourceInfo) GetLineOffsets() []int32 {
+ if x != nil {
+ return x.LineOffsets
+ }
+ return nil
+}
+
+func (x *SourceInfo) GetPositions() map[int64]int32 {
+ if x != nil {
+ return x.Positions
+ }
+ return nil
+}
+
+func (x *SourceInfo) GetMacroCalls() map[int64]*Expr {
+ if x != nil {
+ return x.MacroCalls
+ }
+ return nil
+}
+
+func (x *SourceInfo) GetExtensions() []*SourceInfo_Extension {
+ if x != nil {
+ return x.Extensions
+ }
+ return nil
+}
+
+type Expr_Ident struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Expr_Ident) Reset() {
+ *x = Expr_Ident{}
+ mi := &file_cel_expr_syntax_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Expr_Ident) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Expr_Ident) ProtoMessage() {}
+
+func (x *Expr_Ident) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_syntax_proto_msgTypes[4]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Expr_Ident.ProtoReflect.Descriptor instead.
+func (*Expr_Ident) Descriptor() ([]byte, []int) {
+ return file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 0}
+}
+
+func (x *Expr_Ident) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+type Expr_Select struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Operand *Expr `protobuf:"bytes,1,opt,name=operand,proto3" json:"operand,omitempty"`
+ Field string `protobuf:"bytes,2,opt,name=field,proto3" json:"field,omitempty"`
+ TestOnly bool `protobuf:"varint,3,opt,name=test_only,json=testOnly,proto3" json:"test_only,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Expr_Select) Reset() {
+ *x = Expr_Select{}
+ mi := &file_cel_expr_syntax_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Expr_Select) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Expr_Select) ProtoMessage() {}
+
+func (x *Expr_Select) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_syntax_proto_msgTypes[5]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Expr_Select.ProtoReflect.Descriptor instead.
+func (*Expr_Select) Descriptor() ([]byte, []int) {
+ return file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 1}
+}
+
+func (x *Expr_Select) GetOperand() *Expr {
+ if x != nil {
+ return x.Operand
+ }
+ return nil
+}
+
+func (x *Expr_Select) GetField() string {
+ if x != nil {
+ return x.Field
+ }
+ return ""
+}
+
+func (x *Expr_Select) GetTestOnly() bool {
+ if x != nil {
+ return x.TestOnly
+ }
+ return false
+}
+
+type Expr_Call struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Target *Expr `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"`
+ Function string `protobuf:"bytes,2,opt,name=function,proto3" json:"function,omitempty"`
+ Args []*Expr `protobuf:"bytes,3,rep,name=args,proto3" json:"args,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Expr_Call) Reset() {
+ *x = Expr_Call{}
+ mi := &file_cel_expr_syntax_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Expr_Call) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Expr_Call) ProtoMessage() {}
+
+func (x *Expr_Call) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_syntax_proto_msgTypes[6]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Expr_Call.ProtoReflect.Descriptor instead.
+func (*Expr_Call) Descriptor() ([]byte, []int) {
+ return file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 2}
+}
+
+func (x *Expr_Call) GetTarget() *Expr {
+ if x != nil {
+ return x.Target
+ }
+ return nil
+}
+
+func (x *Expr_Call) GetFunction() string {
+ if x != nil {
+ return x.Function
+ }
+ return ""
+}
+
+func (x *Expr_Call) GetArgs() []*Expr {
+ if x != nil {
+ return x.Args
+ }
+ return nil
+}
+
+type Expr_CreateList struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Elements []*Expr `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"`
+ OptionalIndices []int32 `protobuf:"varint,2,rep,packed,name=optional_indices,json=optionalIndices,proto3" json:"optional_indices,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Expr_CreateList) Reset() {
+ *x = Expr_CreateList{}
+ mi := &file_cel_expr_syntax_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Expr_CreateList) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Expr_CreateList) ProtoMessage() {}
+
+func (x *Expr_CreateList) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_syntax_proto_msgTypes[7]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Expr_CreateList.ProtoReflect.Descriptor instead.
+func (*Expr_CreateList) Descriptor() ([]byte, []int) {
+ return file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 3}
+}
+
+func (x *Expr_CreateList) GetElements() []*Expr {
+ if x != nil {
+ return x.Elements
+ }
+ return nil
+}
+
+func (x *Expr_CreateList) GetOptionalIndices() []int32 {
+ if x != nil {
+ return x.OptionalIndices
+ }
+ return nil
+}
+
+type Expr_CreateStruct struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ MessageName string `protobuf:"bytes,1,opt,name=message_name,json=messageName,proto3" json:"message_name,omitempty"`
+ Entries []*Expr_CreateStruct_Entry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Expr_CreateStruct) Reset() {
+ *x = Expr_CreateStruct{}
+ mi := &file_cel_expr_syntax_proto_msgTypes[8]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Expr_CreateStruct) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Expr_CreateStruct) ProtoMessage() {}
+
+func (x *Expr_CreateStruct) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_syntax_proto_msgTypes[8]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Expr_CreateStruct.ProtoReflect.Descriptor instead.
+func (*Expr_CreateStruct) Descriptor() ([]byte, []int) {
+ return file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 4}
+}
+
+func (x *Expr_CreateStruct) GetMessageName() string {
+ if x != nil {
+ return x.MessageName
+ }
+ return ""
+}
+
+func (x *Expr_CreateStruct) GetEntries() []*Expr_CreateStruct_Entry {
+ if x != nil {
+ return x.Entries
+ }
+ return nil
+}
+
+type Expr_Comprehension struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ IterVar string `protobuf:"bytes,1,opt,name=iter_var,json=iterVar,proto3" json:"iter_var,omitempty"`
+ IterVar2 string `protobuf:"bytes,8,opt,name=iter_var2,json=iterVar2,proto3" json:"iter_var2,omitempty"`
+ IterRange *Expr `protobuf:"bytes,2,opt,name=iter_range,json=iterRange,proto3" json:"iter_range,omitempty"`
+ AccuVar string `protobuf:"bytes,3,opt,name=accu_var,json=accuVar,proto3" json:"accu_var,omitempty"`
+ AccuInit *Expr `protobuf:"bytes,4,opt,name=accu_init,json=accuInit,proto3" json:"accu_init,omitempty"`
+ LoopCondition *Expr `protobuf:"bytes,5,opt,name=loop_condition,json=loopCondition,proto3" json:"loop_condition,omitempty"`
+ LoopStep *Expr `protobuf:"bytes,6,opt,name=loop_step,json=loopStep,proto3" json:"loop_step,omitempty"`
+ Result *Expr `protobuf:"bytes,7,opt,name=result,proto3" json:"result,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Expr_Comprehension) Reset() {
+ *x = Expr_Comprehension{}
+ mi := &file_cel_expr_syntax_proto_msgTypes[9]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Expr_Comprehension) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Expr_Comprehension) ProtoMessage() {}
+
+func (x *Expr_Comprehension) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_syntax_proto_msgTypes[9]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Expr_Comprehension.ProtoReflect.Descriptor instead.
+func (*Expr_Comprehension) Descriptor() ([]byte, []int) {
+ return file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 5}
+}
+
+func (x *Expr_Comprehension) GetIterVar() string {
+ if x != nil {
+ return x.IterVar
+ }
+ return ""
+}
+
+func (x *Expr_Comprehension) GetIterVar2() string {
+ if x != nil {
+ return x.IterVar2
+ }
+ return ""
+}
+
+func (x *Expr_Comprehension) GetIterRange() *Expr {
+ if x != nil {
+ return x.IterRange
+ }
+ return nil
+}
+
+func (x *Expr_Comprehension) GetAccuVar() string {
+ if x != nil {
+ return x.AccuVar
+ }
+ return ""
+}
+
+func (x *Expr_Comprehension) GetAccuInit() *Expr {
+ if x != nil {
+ return x.AccuInit
+ }
+ return nil
+}
+
+func (x *Expr_Comprehension) GetLoopCondition() *Expr {
+ if x != nil {
+ return x.LoopCondition
+ }
+ return nil
+}
+
+func (x *Expr_Comprehension) GetLoopStep() *Expr {
+ if x != nil {
+ return x.LoopStep
+ }
+ return nil
+}
+
+func (x *Expr_Comprehension) GetResult() *Expr {
+ if x != nil {
+ return x.Result
+ }
+ return nil
+}
+
+type Expr_CreateStruct_Entry struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
+ // Types that are valid to be assigned to KeyKind:
+ //
+ // *Expr_CreateStruct_Entry_FieldKey
+ // *Expr_CreateStruct_Entry_MapKey
+ KeyKind isExpr_CreateStruct_Entry_KeyKind `protobuf_oneof:"key_kind"`
+ Value *Expr `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
+ OptionalEntry bool `protobuf:"varint,5,opt,name=optional_entry,json=optionalEntry,proto3" json:"optional_entry,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Expr_CreateStruct_Entry) Reset() {
+ *x = Expr_CreateStruct_Entry{}
+ mi := &file_cel_expr_syntax_proto_msgTypes[10]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Expr_CreateStruct_Entry) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Expr_CreateStruct_Entry) ProtoMessage() {}
+
+func (x *Expr_CreateStruct_Entry) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_syntax_proto_msgTypes[10]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Expr_CreateStruct_Entry.ProtoReflect.Descriptor instead.
+func (*Expr_CreateStruct_Entry) Descriptor() ([]byte, []int) {
+ return file_cel_expr_syntax_proto_rawDescGZIP(), []int{1, 4, 0}
+}
+
+func (x *Expr_CreateStruct_Entry) GetId() int64 {
+ if x != nil {
+ return x.Id
+ }
+ return 0
+}
+
+func (x *Expr_CreateStruct_Entry) GetKeyKind() isExpr_CreateStruct_Entry_KeyKind {
+ if x != nil {
+ return x.KeyKind
+ }
+ return nil
+}
+
+func (x *Expr_CreateStruct_Entry) GetFieldKey() string {
+ if x != nil {
+ if x, ok := x.KeyKind.(*Expr_CreateStruct_Entry_FieldKey); ok {
+ return x.FieldKey
+ }
+ }
+ return ""
+}
+
+func (x *Expr_CreateStruct_Entry) GetMapKey() *Expr {
+ if x != nil {
+ if x, ok := x.KeyKind.(*Expr_CreateStruct_Entry_MapKey); ok {
+ return x.MapKey
+ }
+ }
+ return nil
+}
+
+func (x *Expr_CreateStruct_Entry) GetValue() *Expr {
+ if x != nil {
+ return x.Value
+ }
+ return nil
+}
+
+func (x *Expr_CreateStruct_Entry) GetOptionalEntry() bool {
+ if x != nil {
+ return x.OptionalEntry
+ }
+ return false
+}
+
+type isExpr_CreateStruct_Entry_KeyKind interface {
+ isExpr_CreateStruct_Entry_KeyKind()
+}
+
+type Expr_CreateStruct_Entry_FieldKey struct {
+ FieldKey string `protobuf:"bytes,2,opt,name=field_key,json=fieldKey,proto3,oneof"`
+}
+
+type Expr_CreateStruct_Entry_MapKey struct {
+ MapKey *Expr `protobuf:"bytes,3,opt,name=map_key,json=mapKey,proto3,oneof"`
+}
+
+func (*Expr_CreateStruct_Entry_FieldKey) isExpr_CreateStruct_Entry_KeyKind() {}
+
+func (*Expr_CreateStruct_Entry_MapKey) isExpr_CreateStruct_Entry_KeyKind() {}
+
+type SourceInfo_Extension struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
+ AffectedComponents []SourceInfo_Extension_Component `protobuf:"varint,2,rep,packed,name=affected_components,json=affectedComponents,proto3,enum=cel.expr.SourceInfo_Extension_Component" json:"affected_components,omitempty"`
+ Version *SourceInfo_Extension_Version `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *SourceInfo_Extension) Reset() {
+ *x = SourceInfo_Extension{}
+ mi := &file_cel_expr_syntax_proto_msgTypes[13]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *SourceInfo_Extension) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SourceInfo_Extension) ProtoMessage() {}
+
+func (x *SourceInfo_Extension) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_syntax_proto_msgTypes[13]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use SourceInfo_Extension.ProtoReflect.Descriptor instead.
+func (*SourceInfo_Extension) Descriptor() ([]byte, []int) {
+ return file_cel_expr_syntax_proto_rawDescGZIP(), []int{3, 2}
+}
+
+func (x *SourceInfo_Extension) GetId() string {
+ if x != nil {
+ return x.Id
+ }
+ return ""
+}
+
+func (x *SourceInfo_Extension) GetAffectedComponents() []SourceInfo_Extension_Component {
+ if x != nil {
+ return x.AffectedComponents
+ }
+ return nil
+}
+
+func (x *SourceInfo_Extension) GetVersion() *SourceInfo_Extension_Version {
+ if x != nil {
+ return x.Version
+ }
+ return nil
+}
+
+type SourceInfo_Extension_Version struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Major int64 `protobuf:"varint,1,opt,name=major,proto3" json:"major,omitempty"`
+ Minor int64 `protobuf:"varint,2,opt,name=minor,proto3" json:"minor,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *SourceInfo_Extension_Version) Reset() {
+ *x = SourceInfo_Extension_Version{}
+ mi := &file_cel_expr_syntax_proto_msgTypes[14]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *SourceInfo_Extension_Version) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SourceInfo_Extension_Version) ProtoMessage() {}
+
+func (x *SourceInfo_Extension_Version) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_syntax_proto_msgTypes[14]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use SourceInfo_Extension_Version.ProtoReflect.Descriptor instead.
+func (*SourceInfo_Extension_Version) Descriptor() ([]byte, []int) {
+ return file_cel_expr_syntax_proto_rawDescGZIP(), []int{3, 2, 0}
+}
+
+func (x *SourceInfo_Extension_Version) GetMajor() int64 {
+ if x != nil {
+ return x.Major
+ }
+ return 0
+}
+
+func (x *SourceInfo_Extension_Version) GetMinor() int64 {
+ if x != nil {
+ return x.Minor
+ }
+ return 0
+}
+
+var File_cel_expr_syntax_proto protoreflect.FileDescriptor
+
+const file_cel_expr_syntax_proto_rawDesc = "" +
+ "\n" +
+ "\x15cel/expr/syntax.proto\x12\bcel.expr\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"g\n" +
+ "\n" +
+ "ParsedExpr\x12\"\n" +
+ "\x04expr\x18\x02 \x01(\v2\x0e.cel.expr.ExprR\x04expr\x125\n" +
+ "\vsource_info\x18\x03 \x01(\v2\x14.cel.expr.SourceInfoR\n" +
+ "sourceInfo\"\x9a\v\n" +
+ "\x04Expr\x12\x0e\n" +
+ "\x02id\x18\x02 \x01(\x03R\x02id\x123\n" +
+ "\n" +
+ "const_expr\x18\x03 \x01(\v2\x12.cel.expr.ConstantH\x00R\tconstExpr\x125\n" +
+ "\n" +
+ "ident_expr\x18\x04 \x01(\v2\x14.cel.expr.Expr.IdentH\x00R\tidentExpr\x128\n" +
+ "\vselect_expr\x18\x05 \x01(\v2\x15.cel.expr.Expr.SelectH\x00R\n" +
+ "selectExpr\x122\n" +
+ "\tcall_expr\x18\x06 \x01(\v2\x13.cel.expr.Expr.CallH\x00R\bcallExpr\x128\n" +
+ "\tlist_expr\x18\a \x01(\v2\x19.cel.expr.Expr.CreateListH\x00R\blistExpr\x12>\n" +
+ "\vstruct_expr\x18\b \x01(\v2\x1b.cel.expr.Expr.CreateStructH\x00R\n" +
+ "structExpr\x12M\n" +
+ "\x12comprehension_expr\x18\t \x01(\v2\x1c.cel.expr.Expr.ComprehensionH\x00R\x11comprehensionExpr\x1a\x1b\n" +
+ "\x05Ident\x12\x12\n" +
+ "\x04name\x18\x01 \x01(\tR\x04name\x1ae\n" +
+ "\x06Select\x12(\n" +
+ "\aoperand\x18\x01 \x01(\v2\x0e.cel.expr.ExprR\aoperand\x12\x14\n" +
+ "\x05field\x18\x02 \x01(\tR\x05field\x12\x1b\n" +
+ "\ttest_only\x18\x03 \x01(\bR\btestOnly\x1an\n" +
+ "\x04Call\x12&\n" +
+ "\x06target\x18\x01 \x01(\v2\x0e.cel.expr.ExprR\x06target\x12\x1a\n" +
+ "\bfunction\x18\x02 \x01(\tR\bfunction\x12\"\n" +
+ "\x04args\x18\x03 \x03(\v2\x0e.cel.expr.ExprR\x04args\x1ac\n" +
+ "\n" +
+ "CreateList\x12*\n" +
+ "\belements\x18\x01 \x03(\v2\x0e.cel.expr.ExprR\belements\x12)\n" +
+ "\x10optional_indices\x18\x02 \x03(\x05R\x0foptionalIndices\x1a\xab\x02\n" +
+ "\fCreateStruct\x12!\n" +
+ "\fmessage_name\x18\x01 \x01(\tR\vmessageName\x12;\n" +
+ "\aentries\x18\x02 \x03(\v2!.cel.expr.Expr.CreateStruct.EntryR\aentries\x1a\xba\x01\n" +
+ "\x05Entry\x12\x0e\n" +
+ "\x02id\x18\x01 \x01(\x03R\x02id\x12\x1d\n" +
+ "\tfield_key\x18\x02 \x01(\tH\x00R\bfieldKey\x12)\n" +
+ "\amap_key\x18\x03 \x01(\v2\x0e.cel.expr.ExprH\x00R\x06mapKey\x12$\n" +
+ "\x05value\x18\x04 \x01(\v2\x0e.cel.expr.ExprR\x05value\x12%\n" +
+ "\x0eoptional_entry\x18\x05 \x01(\bR\roptionalEntryB\n" +
+ "\n" +
+ "\bkey_kind\x1a\xca\x02\n" +
+ "\rComprehension\x12\x19\n" +
+ "\biter_var\x18\x01 \x01(\tR\aiterVar\x12\x1b\n" +
+ "\titer_var2\x18\b \x01(\tR\biterVar2\x12-\n" +
+ "\n" +
+ "iter_range\x18\x02 \x01(\v2\x0e.cel.expr.ExprR\titerRange\x12\x19\n" +
+ "\baccu_var\x18\x03 \x01(\tR\aaccuVar\x12+\n" +
+ "\taccu_init\x18\x04 \x01(\v2\x0e.cel.expr.ExprR\baccuInit\x125\n" +
+ "\x0eloop_condition\x18\x05 \x01(\v2\x0e.cel.expr.ExprR\rloopCondition\x12+\n" +
+ "\tloop_step\x18\x06 \x01(\v2\x0e.cel.expr.ExprR\bloopStep\x12&\n" +
+ "\x06result\x18\a \x01(\v2\x0e.cel.expr.ExprR\x06resultB\v\n" +
+ "\texpr_kind\"\xc1\x03\n" +
+ "\bConstant\x12;\n" +
+ "\n" +
+ "null_value\x18\x01 \x01(\x0e2\x1a.google.protobuf.NullValueH\x00R\tnullValue\x12\x1f\n" +
+ "\n" +
+ "bool_value\x18\x02 \x01(\bH\x00R\tboolValue\x12!\n" +
+ "\vint64_value\x18\x03 \x01(\x03H\x00R\n" +
+ "int64Value\x12#\n" +
+ "\fuint64_value\x18\x04 \x01(\x04H\x00R\vuint64Value\x12#\n" +
+ "\fdouble_value\x18\x05 \x01(\x01H\x00R\vdoubleValue\x12#\n" +
+ "\fstring_value\x18\x06 \x01(\tH\x00R\vstringValue\x12!\n" +
+ "\vbytes_value\x18\a \x01(\fH\x00R\n" +
+ "bytesValue\x12F\n" +
+ "\x0eduration_value\x18\b \x01(\v2\x19.google.protobuf.DurationB\x02\x18\x01H\x00R\rdurationValue\x12I\n" +
+ "\x0ftimestamp_value\x18\t \x01(\v2\x1a.google.protobuf.TimestampB\x02\x18\x01H\x00R\x0etimestampValueB\x0f\n" +
+ "\rconstant_kind\"\xac\x06\n" +
+ "\n" +
+ "SourceInfo\x12%\n" +
+ "\x0esyntax_version\x18\x01 \x01(\tR\rsyntaxVersion\x12\x1a\n" +
+ "\blocation\x18\x02 \x01(\tR\blocation\x12!\n" +
+ "\fline_offsets\x18\x03 \x03(\x05R\vlineOffsets\x12A\n" +
+ "\tpositions\x18\x04 \x03(\v2#.cel.expr.SourceInfo.PositionsEntryR\tpositions\x12E\n" +
+ "\vmacro_calls\x18\x05 \x03(\v2$.cel.expr.SourceInfo.MacroCallsEntryR\n" +
+ "macroCalls\x12>\n" +
+ "\n" +
+ "extensions\x18\x06 \x03(\v2\x1e.cel.expr.SourceInfo.ExtensionR\n" +
+ "extensions\x1a<\n" +
+ "\x0ePositionsEntry\x12\x10\n" +
+ "\x03key\x18\x01 \x01(\x03R\x03key\x12\x14\n" +
+ "\x05value\x18\x02 \x01(\x05R\x05value:\x028\x01\x1aM\n" +
+ "\x0fMacroCallsEntry\x12\x10\n" +
+ "\x03key\x18\x01 \x01(\x03R\x03key\x12$\n" +
+ "\x05value\x18\x02 \x01(\v2\x0e.cel.expr.ExprR\x05value:\x028\x01\x1a\xe0\x02\n" +
+ "\tExtension\x12\x0e\n" +
+ "\x02id\x18\x01 \x01(\tR\x02id\x12Y\n" +
+ "\x13affected_components\x18\x02 \x03(\x0e2(.cel.expr.SourceInfo.Extension.ComponentR\x12affectedComponents\x12@\n" +
+ "\aversion\x18\x03 \x01(\v2&.cel.expr.SourceInfo.Extension.VersionR\aversion\x1a5\n" +
+ "\aVersion\x12\x14\n" +
+ "\x05major\x18\x01 \x01(\x03R\x05major\x12\x14\n" +
+ "\x05minor\x18\x02 \x01(\x03R\x05minor\"o\n" +
+ "\tComponent\x12\x19\n" +
+ "\x15COMPONENT_UNSPECIFIED\x10\x00\x12\x14\n" +
+ "\x10COMPONENT_PARSER\x10\x01\x12\x1a\n" +
+ "\x16COMPONENT_TYPE_CHECKER\x10\x02\x12\x15\n" +
+ "\x11COMPONENT_RUNTIME\x10\x03B.\n" +
+ "\fdev.cel.exprB\vSyntaxProtoP\x01Z\fcel.dev/expr\xf8\x01\x01b\x06proto3"
+
+var (
+ file_cel_expr_syntax_proto_rawDescOnce sync.Once
+ file_cel_expr_syntax_proto_rawDescData []byte
+)
+
+func file_cel_expr_syntax_proto_rawDescGZIP() []byte {
+ file_cel_expr_syntax_proto_rawDescOnce.Do(func() {
+ file_cel_expr_syntax_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cel_expr_syntax_proto_rawDesc), len(file_cel_expr_syntax_proto_rawDesc)))
+ })
+ return file_cel_expr_syntax_proto_rawDescData
+}
+
+var file_cel_expr_syntax_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
+var file_cel_expr_syntax_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
+var file_cel_expr_syntax_proto_goTypes = []any{
+ (SourceInfo_Extension_Component)(0), // 0: cel.expr.SourceInfo.Extension.Component
+ (*ParsedExpr)(nil), // 1: cel.expr.ParsedExpr
+ (*Expr)(nil), // 2: cel.expr.Expr
+ (*Constant)(nil), // 3: cel.expr.Constant
+ (*SourceInfo)(nil), // 4: cel.expr.SourceInfo
+ (*Expr_Ident)(nil), // 5: cel.expr.Expr.Ident
+ (*Expr_Select)(nil), // 6: cel.expr.Expr.Select
+ (*Expr_Call)(nil), // 7: cel.expr.Expr.Call
+ (*Expr_CreateList)(nil), // 8: cel.expr.Expr.CreateList
+ (*Expr_CreateStruct)(nil), // 9: cel.expr.Expr.CreateStruct
+ (*Expr_Comprehension)(nil), // 10: cel.expr.Expr.Comprehension
+ (*Expr_CreateStruct_Entry)(nil), // 11: cel.expr.Expr.CreateStruct.Entry
+ nil, // 12: cel.expr.SourceInfo.PositionsEntry
+ nil, // 13: cel.expr.SourceInfo.MacroCallsEntry
+ (*SourceInfo_Extension)(nil), // 14: cel.expr.SourceInfo.Extension
+ (*SourceInfo_Extension_Version)(nil), // 15: cel.expr.SourceInfo.Extension.Version
+ (structpb.NullValue)(0), // 16: google.protobuf.NullValue
+ (*durationpb.Duration)(nil), // 17: google.protobuf.Duration
+ (*timestamppb.Timestamp)(nil), // 18: google.protobuf.Timestamp
+}
+var file_cel_expr_syntax_proto_depIdxs = []int32{
+ 2, // 0: cel.expr.ParsedExpr.expr:type_name -> cel.expr.Expr
+ 4, // 1: cel.expr.ParsedExpr.source_info:type_name -> cel.expr.SourceInfo
+ 3, // 2: cel.expr.Expr.const_expr:type_name -> cel.expr.Constant
+ 5, // 3: cel.expr.Expr.ident_expr:type_name -> cel.expr.Expr.Ident
+ 6, // 4: cel.expr.Expr.select_expr:type_name -> cel.expr.Expr.Select
+ 7, // 5: cel.expr.Expr.call_expr:type_name -> cel.expr.Expr.Call
+ 8, // 6: cel.expr.Expr.list_expr:type_name -> cel.expr.Expr.CreateList
+ 9, // 7: cel.expr.Expr.struct_expr:type_name -> cel.expr.Expr.CreateStruct
+ 10, // 8: cel.expr.Expr.comprehension_expr:type_name -> cel.expr.Expr.Comprehension
+ 16, // 9: cel.expr.Constant.null_value:type_name -> google.protobuf.NullValue
+ 17, // 10: cel.expr.Constant.duration_value:type_name -> google.protobuf.Duration
+ 18, // 11: cel.expr.Constant.timestamp_value:type_name -> google.protobuf.Timestamp
+ 12, // 12: cel.expr.SourceInfo.positions:type_name -> cel.expr.SourceInfo.PositionsEntry
+ 13, // 13: cel.expr.SourceInfo.macro_calls:type_name -> cel.expr.SourceInfo.MacroCallsEntry
+ 14, // 14: cel.expr.SourceInfo.extensions:type_name -> cel.expr.SourceInfo.Extension
+ 2, // 15: cel.expr.Expr.Select.operand:type_name -> cel.expr.Expr
+ 2, // 16: cel.expr.Expr.Call.target:type_name -> cel.expr.Expr
+ 2, // 17: cel.expr.Expr.Call.args:type_name -> cel.expr.Expr
+ 2, // 18: cel.expr.Expr.CreateList.elements:type_name -> cel.expr.Expr
+ 11, // 19: cel.expr.Expr.CreateStruct.entries:type_name -> cel.expr.Expr.CreateStruct.Entry
+ 2, // 20: cel.expr.Expr.Comprehension.iter_range:type_name -> cel.expr.Expr
+ 2, // 21: cel.expr.Expr.Comprehension.accu_init:type_name -> cel.expr.Expr
+ 2, // 22: cel.expr.Expr.Comprehension.loop_condition:type_name -> cel.expr.Expr
+ 2, // 23: cel.expr.Expr.Comprehension.loop_step:type_name -> cel.expr.Expr
+ 2, // 24: cel.expr.Expr.Comprehension.result:type_name -> cel.expr.Expr
+ 2, // 25: cel.expr.Expr.CreateStruct.Entry.map_key:type_name -> cel.expr.Expr
+ 2, // 26: cel.expr.Expr.CreateStruct.Entry.value:type_name -> cel.expr.Expr
+ 2, // 27: cel.expr.SourceInfo.MacroCallsEntry.value:type_name -> cel.expr.Expr
+ 0, // 28: cel.expr.SourceInfo.Extension.affected_components:type_name -> cel.expr.SourceInfo.Extension.Component
+ 15, // 29: cel.expr.SourceInfo.Extension.version:type_name -> cel.expr.SourceInfo.Extension.Version
+ 30, // [30:30] is the sub-list for method output_type
+ 30, // [30:30] is the sub-list for method input_type
+ 30, // [30:30] is the sub-list for extension type_name
+ 30, // [30:30] is the sub-list for extension extendee
+ 0, // [0:30] is the sub-list for field type_name
+}
+
+func init() { file_cel_expr_syntax_proto_init() }
+func file_cel_expr_syntax_proto_init() {
+ if File_cel_expr_syntax_proto != nil {
+ return
+ }
+ file_cel_expr_syntax_proto_msgTypes[1].OneofWrappers = []any{
+ (*Expr_ConstExpr)(nil),
+ (*Expr_IdentExpr)(nil),
+ (*Expr_SelectExpr)(nil),
+ (*Expr_CallExpr)(nil),
+ (*Expr_ListExpr)(nil),
+ (*Expr_StructExpr)(nil),
+ (*Expr_ComprehensionExpr)(nil),
+ }
+ file_cel_expr_syntax_proto_msgTypes[2].OneofWrappers = []any{
+ (*Constant_NullValue)(nil),
+ (*Constant_BoolValue)(nil),
+ (*Constant_Int64Value)(nil),
+ (*Constant_Uint64Value)(nil),
+ (*Constant_DoubleValue)(nil),
+ (*Constant_StringValue)(nil),
+ (*Constant_BytesValue)(nil),
+ (*Constant_DurationValue)(nil),
+ (*Constant_TimestampValue)(nil),
+ }
+ file_cel_expr_syntax_proto_msgTypes[10].OneofWrappers = []any{
+ (*Expr_CreateStruct_Entry_FieldKey)(nil),
+ (*Expr_CreateStruct_Entry_MapKey)(nil),
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_cel_expr_syntax_proto_rawDesc), len(file_cel_expr_syntax_proto_rawDesc)),
+ NumEnums: 1,
+ NumMessages: 15,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_cel_expr_syntax_proto_goTypes,
+ DependencyIndexes: file_cel_expr_syntax_proto_depIdxs,
+ EnumInfos: file_cel_expr_syntax_proto_enumTypes,
+ MessageInfos: file_cel_expr_syntax_proto_msgTypes,
+ }.Build()
+ File_cel_expr_syntax_proto = out.File
+ file_cel_expr_syntax_proto_goTypes = nil
+ file_cel_expr_syntax_proto_depIdxs = nil
+}
diff --git a/vendor/cel.dev/expr/value.pb.go b/vendor/cel.dev/expr/value.pb.go
new file mode 100644
index 000000000000..1f53a6a2965e
--- /dev/null
+++ b/vendor/cel.dev/expr/value.pb.go
@@ -0,0 +1,575 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.36.10
+// protoc v5.27.1
+// source: cel/expr/value.proto
+
+package expr
+
+import (
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ anypb "google.golang.org/protobuf/types/known/anypb"
+ structpb "google.golang.org/protobuf/types/known/structpb"
+ reflect "reflect"
+ sync "sync"
+ unsafe "unsafe"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type Value struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // Types that are valid to be assigned to Kind:
+ //
+ // *Value_NullValue
+ // *Value_BoolValue
+ // *Value_Int64Value
+ // *Value_Uint64Value
+ // *Value_DoubleValue
+ // *Value_StringValue
+ // *Value_BytesValue
+ // *Value_EnumValue
+ // *Value_ObjectValue
+ // *Value_MapValue
+ // *Value_ListValue
+ // *Value_TypeValue
+ Kind isValue_Kind `protobuf_oneof:"kind"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Value) Reset() {
+ *x = Value{}
+ mi := &file_cel_expr_value_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Value) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Value) ProtoMessage() {}
+
+func (x *Value) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_value_proto_msgTypes[0]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Value.ProtoReflect.Descriptor instead.
+func (*Value) Descriptor() ([]byte, []int) {
+ return file_cel_expr_value_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *Value) GetKind() isValue_Kind {
+ if x != nil {
+ return x.Kind
+ }
+ return nil
+}
+
+func (x *Value) GetNullValue() structpb.NullValue {
+ if x != nil {
+ if x, ok := x.Kind.(*Value_NullValue); ok {
+ return x.NullValue
+ }
+ }
+ return structpb.NullValue(0)
+}
+
+func (x *Value) GetBoolValue() bool {
+ if x != nil {
+ if x, ok := x.Kind.(*Value_BoolValue); ok {
+ return x.BoolValue
+ }
+ }
+ return false
+}
+
+func (x *Value) GetInt64Value() int64 {
+ if x != nil {
+ if x, ok := x.Kind.(*Value_Int64Value); ok {
+ return x.Int64Value
+ }
+ }
+ return 0
+}
+
+func (x *Value) GetUint64Value() uint64 {
+ if x != nil {
+ if x, ok := x.Kind.(*Value_Uint64Value); ok {
+ return x.Uint64Value
+ }
+ }
+ return 0
+}
+
+func (x *Value) GetDoubleValue() float64 {
+ if x != nil {
+ if x, ok := x.Kind.(*Value_DoubleValue); ok {
+ return x.DoubleValue
+ }
+ }
+ return 0
+}
+
+func (x *Value) GetStringValue() string {
+ if x != nil {
+ if x, ok := x.Kind.(*Value_StringValue); ok {
+ return x.StringValue
+ }
+ }
+ return ""
+}
+
+func (x *Value) GetBytesValue() []byte {
+ if x != nil {
+ if x, ok := x.Kind.(*Value_BytesValue); ok {
+ return x.BytesValue
+ }
+ }
+ return nil
+}
+
+func (x *Value) GetEnumValue() *EnumValue {
+ if x != nil {
+ if x, ok := x.Kind.(*Value_EnumValue); ok {
+ return x.EnumValue
+ }
+ }
+ return nil
+}
+
+func (x *Value) GetObjectValue() *anypb.Any {
+ if x != nil {
+ if x, ok := x.Kind.(*Value_ObjectValue); ok {
+ return x.ObjectValue
+ }
+ }
+ return nil
+}
+
+func (x *Value) GetMapValue() *MapValue {
+ if x != nil {
+ if x, ok := x.Kind.(*Value_MapValue); ok {
+ return x.MapValue
+ }
+ }
+ return nil
+}
+
+func (x *Value) GetListValue() *ListValue {
+ if x != nil {
+ if x, ok := x.Kind.(*Value_ListValue); ok {
+ return x.ListValue
+ }
+ }
+ return nil
+}
+
+func (x *Value) GetTypeValue() string {
+ if x != nil {
+ if x, ok := x.Kind.(*Value_TypeValue); ok {
+ return x.TypeValue
+ }
+ }
+ return ""
+}
+
+type isValue_Kind interface {
+ isValue_Kind()
+}
+
+type Value_NullValue struct {
+ NullValue structpb.NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"`
+}
+
+type Value_BoolValue struct {
+ BoolValue bool `protobuf:"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof"`
+}
+
+type Value_Int64Value struct {
+ Int64Value int64 `protobuf:"varint,3,opt,name=int64_value,json=int64Value,proto3,oneof"`
+}
+
+type Value_Uint64Value struct {
+ Uint64Value uint64 `protobuf:"varint,4,opt,name=uint64_value,json=uint64Value,proto3,oneof"`
+}
+
+type Value_DoubleValue struct {
+ DoubleValue float64 `protobuf:"fixed64,5,opt,name=double_value,json=doubleValue,proto3,oneof"`
+}
+
+type Value_StringValue struct {
+ StringValue string `protobuf:"bytes,6,opt,name=string_value,json=stringValue,proto3,oneof"`
+}
+
+type Value_BytesValue struct {
+ BytesValue []byte `protobuf:"bytes,7,opt,name=bytes_value,json=bytesValue,proto3,oneof"`
+}
+
+type Value_EnumValue struct {
+ EnumValue *EnumValue `protobuf:"bytes,9,opt,name=enum_value,json=enumValue,proto3,oneof"`
+}
+
+type Value_ObjectValue struct {
+ ObjectValue *anypb.Any `protobuf:"bytes,10,opt,name=object_value,json=objectValue,proto3,oneof"`
+}
+
+type Value_MapValue struct {
+ MapValue *MapValue `protobuf:"bytes,11,opt,name=map_value,json=mapValue,proto3,oneof"`
+}
+
+type Value_ListValue struct {
+ ListValue *ListValue `protobuf:"bytes,12,opt,name=list_value,json=listValue,proto3,oneof"`
+}
+
+type Value_TypeValue struct {
+ TypeValue string `protobuf:"bytes,15,opt,name=type_value,json=typeValue,proto3,oneof"`
+}
+
+func (*Value_NullValue) isValue_Kind() {}
+
+func (*Value_BoolValue) isValue_Kind() {}
+
+func (*Value_Int64Value) isValue_Kind() {}
+
+func (*Value_Uint64Value) isValue_Kind() {}
+
+func (*Value_DoubleValue) isValue_Kind() {}
+
+func (*Value_StringValue) isValue_Kind() {}
+
+func (*Value_BytesValue) isValue_Kind() {}
+
+func (*Value_EnumValue) isValue_Kind() {}
+
+func (*Value_ObjectValue) isValue_Kind() {}
+
+func (*Value_MapValue) isValue_Kind() {}
+
+func (*Value_ListValue) isValue_Kind() {}
+
+func (*Value_TypeValue) isValue_Kind() {}
+
+type EnumValue struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
+ Value int32 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *EnumValue) Reset() {
+ *x = EnumValue{}
+ mi := &file_cel_expr_value_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *EnumValue) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EnumValue) ProtoMessage() {}
+
+func (x *EnumValue) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_value_proto_msgTypes[1]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use EnumValue.ProtoReflect.Descriptor instead.
+func (*EnumValue) Descriptor() ([]byte, []int) {
+ return file_cel_expr_value_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *EnumValue) GetType() string {
+ if x != nil {
+ return x.Type
+ }
+ return ""
+}
+
+func (x *EnumValue) GetValue() int32 {
+ if x != nil {
+ return x.Value
+ }
+ return 0
+}
+
+type ListValue struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *ListValue) Reset() {
+ *x = ListValue{}
+ mi := &file_cel_expr_value_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *ListValue) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListValue) ProtoMessage() {}
+
+func (x *ListValue) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_value_proto_msgTypes[2]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ListValue.ProtoReflect.Descriptor instead.
+func (*ListValue) Descriptor() ([]byte, []int) {
+ return file_cel_expr_value_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *ListValue) GetValues() []*Value {
+ if x != nil {
+ return x.Values
+ }
+ return nil
+}
+
+type MapValue struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Entries []*MapValue_Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *MapValue) Reset() {
+ *x = MapValue{}
+ mi := &file_cel_expr_value_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *MapValue) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*MapValue) ProtoMessage() {}
+
+func (x *MapValue) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_value_proto_msgTypes[3]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use MapValue.ProtoReflect.Descriptor instead.
+func (*MapValue) Descriptor() ([]byte, []int) {
+ return file_cel_expr_value_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *MapValue) GetEntries() []*MapValue_Entry {
+ if x != nil {
+ return x.Entries
+ }
+ return nil
+}
+
+type MapValue_Entry struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Key *Value `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
+ Value *Value `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *MapValue_Entry) Reset() {
+ *x = MapValue_Entry{}
+ mi := &file_cel_expr_value_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *MapValue_Entry) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*MapValue_Entry) ProtoMessage() {}
+
+func (x *MapValue_Entry) ProtoReflect() protoreflect.Message {
+ mi := &file_cel_expr_value_proto_msgTypes[4]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use MapValue_Entry.ProtoReflect.Descriptor instead.
+func (*MapValue_Entry) Descriptor() ([]byte, []int) {
+ return file_cel_expr_value_proto_rawDescGZIP(), []int{3, 0}
+}
+
+func (x *MapValue_Entry) GetKey() *Value {
+ if x != nil {
+ return x.Key
+ }
+ return nil
+}
+
+func (x *MapValue_Entry) GetValue() *Value {
+ if x != nil {
+ return x.Value
+ }
+ return nil
+}
+
+var File_cel_expr_value_proto protoreflect.FileDescriptor
+
+const file_cel_expr_value_proto_rawDesc = "" +
+ "\n" +
+ "\x14cel/expr/value.proto\x12\bcel.expr\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\"\x9d\x04\n" +
+ "\x05Value\x12;\n" +
+ "\n" +
+ "null_value\x18\x01 \x01(\x0e2\x1a.google.protobuf.NullValueH\x00R\tnullValue\x12\x1f\n" +
+ "\n" +
+ "bool_value\x18\x02 \x01(\bH\x00R\tboolValue\x12!\n" +
+ "\vint64_value\x18\x03 \x01(\x03H\x00R\n" +
+ "int64Value\x12#\n" +
+ "\fuint64_value\x18\x04 \x01(\x04H\x00R\vuint64Value\x12#\n" +
+ "\fdouble_value\x18\x05 \x01(\x01H\x00R\vdoubleValue\x12#\n" +
+ "\fstring_value\x18\x06 \x01(\tH\x00R\vstringValue\x12!\n" +
+ "\vbytes_value\x18\a \x01(\fH\x00R\n" +
+ "bytesValue\x124\n" +
+ "\n" +
+ "enum_value\x18\t \x01(\v2\x13.cel.expr.EnumValueH\x00R\tenumValue\x129\n" +
+ "\fobject_value\x18\n" +
+ " \x01(\v2\x14.google.protobuf.AnyH\x00R\vobjectValue\x121\n" +
+ "\tmap_value\x18\v \x01(\v2\x12.cel.expr.MapValueH\x00R\bmapValue\x124\n" +
+ "\n" +
+ "list_value\x18\f \x01(\v2\x13.cel.expr.ListValueH\x00R\tlistValue\x12\x1f\n" +
+ "\n" +
+ "type_value\x18\x0f \x01(\tH\x00R\ttypeValueB\x06\n" +
+ "\x04kind\"5\n" +
+ "\tEnumValue\x12\x12\n" +
+ "\x04type\x18\x01 \x01(\tR\x04type\x12\x14\n" +
+ "\x05value\x18\x02 \x01(\x05R\x05value\"4\n" +
+ "\tListValue\x12'\n" +
+ "\x06values\x18\x01 \x03(\v2\x0f.cel.expr.ValueR\x06values\"\x91\x01\n" +
+ "\bMapValue\x122\n" +
+ "\aentries\x18\x01 \x03(\v2\x18.cel.expr.MapValue.EntryR\aentries\x1aQ\n" +
+ "\x05Entry\x12!\n" +
+ "\x03key\x18\x01 \x01(\v2\x0f.cel.expr.ValueR\x03key\x12%\n" +
+ "\x05value\x18\x02 \x01(\v2\x0f.cel.expr.ValueR\x05valueB-\n" +
+ "\fdev.cel.exprB\n" +
+ "ValueProtoP\x01Z\fcel.dev/expr\xf8\x01\x01b\x06proto3"
+
+var (
+ file_cel_expr_value_proto_rawDescOnce sync.Once
+ file_cel_expr_value_proto_rawDescData []byte
+)
+
+func file_cel_expr_value_proto_rawDescGZIP() []byte {
+ file_cel_expr_value_proto_rawDescOnce.Do(func() {
+ file_cel_expr_value_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cel_expr_value_proto_rawDesc), len(file_cel_expr_value_proto_rawDesc)))
+ })
+ return file_cel_expr_value_proto_rawDescData
+}
+
+var file_cel_expr_value_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
+var file_cel_expr_value_proto_goTypes = []any{
+ (*Value)(nil), // 0: cel.expr.Value
+ (*EnumValue)(nil), // 1: cel.expr.EnumValue
+ (*ListValue)(nil), // 2: cel.expr.ListValue
+ (*MapValue)(nil), // 3: cel.expr.MapValue
+ (*MapValue_Entry)(nil), // 4: cel.expr.MapValue.Entry
+ (structpb.NullValue)(0), // 5: google.protobuf.NullValue
+ (*anypb.Any)(nil), // 6: google.protobuf.Any
+}
+var file_cel_expr_value_proto_depIdxs = []int32{
+ 5, // 0: cel.expr.Value.null_value:type_name -> google.protobuf.NullValue
+ 1, // 1: cel.expr.Value.enum_value:type_name -> cel.expr.EnumValue
+ 6, // 2: cel.expr.Value.object_value:type_name -> google.protobuf.Any
+ 3, // 3: cel.expr.Value.map_value:type_name -> cel.expr.MapValue
+ 2, // 4: cel.expr.Value.list_value:type_name -> cel.expr.ListValue
+ 0, // 5: cel.expr.ListValue.values:type_name -> cel.expr.Value
+ 4, // 6: cel.expr.MapValue.entries:type_name -> cel.expr.MapValue.Entry
+ 0, // 7: cel.expr.MapValue.Entry.key:type_name -> cel.expr.Value
+ 0, // 8: cel.expr.MapValue.Entry.value:type_name -> cel.expr.Value
+ 9, // [9:9] is the sub-list for method output_type
+ 9, // [9:9] is the sub-list for method input_type
+ 9, // [9:9] is the sub-list for extension type_name
+ 9, // [9:9] is the sub-list for extension extendee
+ 0, // [0:9] is the sub-list for field type_name
+}
+
+func init() { file_cel_expr_value_proto_init() }
+func file_cel_expr_value_proto_init() {
+ if File_cel_expr_value_proto != nil {
+ return
+ }
+ file_cel_expr_value_proto_msgTypes[0].OneofWrappers = []any{
+ (*Value_NullValue)(nil),
+ (*Value_BoolValue)(nil),
+ (*Value_Int64Value)(nil),
+ (*Value_Uint64Value)(nil),
+ (*Value_DoubleValue)(nil),
+ (*Value_StringValue)(nil),
+ (*Value_BytesValue)(nil),
+ (*Value_EnumValue)(nil),
+ (*Value_ObjectValue)(nil),
+ (*Value_MapValue)(nil),
+ (*Value_ListValue)(nil),
+ (*Value_TypeValue)(nil),
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_cel_expr_value_proto_rawDesc), len(file_cel_expr_value_proto_rawDesc)),
+ NumEnums: 0,
+ NumMessages: 5,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_cel_expr_value_proto_goTypes,
+ DependencyIndexes: file_cel_expr_value_proto_depIdxs,
+ MessageInfos: file_cel_expr_value_proto_msgTypes,
+ }.Build()
+ File_cel_expr_value_proto = out.File
+ file_cel_expr_value_proto_goTypes = nil
+ file_cel_expr_value_proto_depIdxs = nil
+}
diff --git a/vendor/github.com/alecthomas/units/renovate.json5 b/vendor/github.com/alecthomas/units/renovate.json5
new file mode 100644
index 000000000000..6bb4acde94a8
--- /dev/null
+++ b/vendor/github.com/alecthomas/units/renovate.json5
@@ -0,0 +1,15 @@
+{
+ $schema: "https://docs.renovatebot.com/renovate-schema.json",
+ extends: [
+ "config:recommended",
+ ":semanticCommits",
+ ":semanticCommitTypeAll(chore)",
+ ":semanticCommitScope(deps)",
+ "group:allNonMajor",
+ "schedule:earlyMondays", // Run once a week.
+ ],
+ postUpdateOptions: [
+ "gomodTidy",
+ "gomodUpdateImportPaths"
+ ]
+}
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 52cf18e425ea..000000000000
--- 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 ab51212676f9..000000000000
--- 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 7619fa172edc..000000000000
--- 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 43e9b33f3bd2..000000000000
--- 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 a8b889cedb95..000000000000
--- 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 e5a74f0c6c49..000000000000
--- 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 ba62af361086..000000000000
--- 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 7b9b72fab1e5..000000000000
--- 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 210699ba2341..000000000000
--- 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 c9bd6751e3a7..000000000000
--- 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 000000000000..38ea34ff513d
--- /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 000000000000..a22292eb5aee
--- /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 000000000000..03e5b83eb1b6
--- /dev/null
+++ b/vendor/github.com/antlr4-go/antlr/v4/README.md
@@ -0,0 +1,54 @@
+[](https://goreportcard.com/report/github.com/antlr4-go/antlr)
+[](https://pkg.go.dev/github.com/antlr4-go/antlr)
+[](https://github.com/antlr4-go/antlr/releases/latest)
+[](https://github.com/antlr4-go/antlr/releases/latest)
+[](https://github.com/antlr4-go/antlr/commit-activity)
+[](https://opensource.org/licenses/BSD-3-Clause)
+[](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 000000000000..3bb4fd7c4e0a
--- /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 98010d2e6e68..cdeefed24789 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 000000000000..a83f25d3492e
--- /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 000000000000..52dbaf8064f0
--- /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 3c975ec7bfda..bdb30b362292 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 3888856b4b66..2dcb9ae11b6a 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 41529115fa69..afe6c9f809a2 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 1f2a56bc3118..2ae5807cdb84 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 c33f0adb5e12..bd8127b6b54f 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 c6c9485a20ae..b75da9df08e0 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 9ea3200536a5..7467e9b43db3 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 000000000000..c2b724514d4e
--- /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 bfd43e1f731d..6b63eb1589b2 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 84d0a31e5362..0e11009899c9 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 c90dec55c868..6541430745ff 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 c55bcc19b2c8..bd2cd8bc3a86 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 f679f0dcd5e1..21a0216434e2 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 5c0a637ba4aa..9db2be1c7485 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 3954c1378299..8f0f2f601fde 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 bd6ad5efe3de..5f65f809be5e 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 000000000000..b737fe85fbd0
--- /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 c1e155e8180e..cc5066067a2c 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 000000000000..ceccd96d2584
--- /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 6533f0516453..3c7896a9183d 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 111656c29529..eaa7393e06f7 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 be1ba7a7e308..dfc28c32b30e 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 c573b7521004..fe938b0259a0 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 76689615a6d0..4955ac876f97 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 000000000000..923c7b52c47c
--- /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 d26bf063920a..fb57ac15db70 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 8bcc46a0d992..ae2869692a67 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 1c8cee74795e..c249bc1385c9 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 000000000000..c1b80cc1f0fd
--- /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 000000000000..25dfb11e8ffb
--- /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 000000000000..3f85a6a520b2
--- /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 bfe542d09141..2e0b504fb3db 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 000000000000..f2ad04793e1b
--- /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 a702e99def76..68cb9061eb64 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 000000000000..70c0673a0f6b
--- /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 000000000000..4d9eb94e5fa0
--- /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 f73b06bc6a05..9670efb829e4 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 1527d43f608b..bf4ff6633e80 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 b3e38af34454..ccf59b465c57 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 36be4f733107..313b0fc127fb 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 85b4f137b5a0..c288420fb20d 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 d7dbb0322822..f44c05d81114 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 9fad5d916bcc..733d7df9dc74 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/coreos/go-json/README.md b/vendor/github.com/coreos/go-json/README.md
index 800f9c1e3cd4..ee0dafec1db6 100644
--- a/vendor/github.com/coreos/go-json/README.md
+++ b/vendor/github.com/coreos/go-json/README.md
@@ -3,15 +3,15 @@
This is a fork of Go's `encoding/json` library. It adds a third target for
unmarshalling, `json.Node`.
-Unmarshalling to a `Node` behaves similarly to unmarshalling to an
-`interface{}`, except that it also records the offsets for the start and end
+Unmarshalling to a `Node` behaves similarly to unmarshalling to
+`any`, except that it also records the offsets for the start and end
of the value that is unmarshalled and, if the value is part of a JSON
object, the offsets of the start and end of the object's key. The `Value`
-field of the `Node` is unmarshalled to the same type as if it were an
-`interface{}`, except in the case of arrays and objects:
+field of the `Node` is unmarshalled to the same type as if it were
+`any`, except in the case of arrays and objects:
-| JSON type | Go type, unmarshalled to `interface{}` | `Node.Value` type |
-| --------- | -------------------------------------- | ----------------- |
-| Array | `[]interface{}` | `[]Node` |
-| Object | `map[string]interface{}` | `map[string]Node` |
-| Other | `interface{}` | `interface{}` |
+| JSON type | Go type, unmarshalled to `any` | `Node.Value` type |
+| --------- | ------------------------------ | ----------------- |
+| Array | `[]any` | `[]Node` |
+| Object | `map[string]any` | `map[string]Node` |
+| Other | `any` | `any` |
diff --git a/vendor/github.com/coreos/go-json/decode.go b/vendor/github.com/coreos/go-json/decode.go
index 1966dcdf424d..ae0730936d58 100644
--- a/vendor/github.com/coreos/go-json/decode.go
+++ b/vendor/github.com/coreos/go-json/decode.go
@@ -93,7 +93,7 @@ import (
// Instead, they are replaced by the Unicode replacement
// character U+FFFD.
//
-func Unmarshal(data []byte, v interface{}) error {
+func Unmarshal(data []byte, v any) error {
// Check for well-formedness.
// Avoids filling out half a data structure
// before discovering a JSON syntax error.
@@ -161,7 +161,7 @@ func (e *InvalidUnmarshalError) Error() string {
return "json: Unmarshal(nil)"
}
- if e.Type.Kind() != reflect.Ptr {
+ if e.Type.Kind() != reflect.Pointer {
return "json: Unmarshal(non-pointer " + e.Type.String() + ")"
}
return "json: Unmarshal(nil " + e.Type.String() + ")"
@@ -172,21 +172,21 @@ type Node struct {
End int
KeyStart int // Only value if a member of a struct
KeyEnd int
- Value interface{}
+ Value any
}
// Recursively disintermediate any Nodes in the argument.
-func unwrapNode(in interface{}) interface{} {
+func unwrapNode(in any) any {
if node, ok := in.(Node); ok {
return unwrapNode(node.Value)
} else if arr, ok := in.([]Node); ok {
- ret := make([]interface{}, len(arr))
+ ret := make([]any, len(arr))
for i, ent := range arr {
ret[i] = unwrapNode(ent.Value)
}
return ret
} else if obj, ok := in.(map[string]Node); ok {
- ret := make(map[string]interface{})
+ ret := make(map[string]any)
for k, v := range obj {
ret[k] = unwrapNode(v.Value)
}
@@ -196,9 +196,9 @@ func unwrapNode(in interface{}) interface{} {
}
}
-func (d *decodeState) unmarshal(v interface{}) error {
+func (d *decodeState) unmarshal(v any) error {
rv := reflect.ValueOf(v)
- if rv.Kind() != reflect.Ptr || rv.IsNil() {
+ if rv.Kind() != reflect.Pointer || rv.IsNil() {
return &InvalidUnmarshalError{reflect.TypeOf(v)}
}
@@ -229,16 +229,19 @@ func (n Number) Int64() (int64, error) {
return strconv.ParseInt(string(n), 10, 64)
}
+// An errorContext provides context for type errors during decoding.
+type errorContext struct {
+ Struct reflect.Type
+ FieldStack []string
+}
+
// decodeState represents the state while decoding a JSON value.
type decodeState struct {
- data []byte
- off int // next read offset in data
- opcode int // last read result
- scan scanner
- errorContext struct { // provides context for type errors
- Struct reflect.Type
- FieldStack []string
- }
+ data []byte
+ off int // next read offset in data
+ opcode int // last read result
+ scan scanner
+ errorContext *errorContext
savedError error
useNumber bool
disallowUnknownFields bool
@@ -258,10 +261,11 @@ func (d *decodeState) init(data []byte) *decodeState {
d.data = data
d.off = 0
d.savedError = nil
- d.errorContext.Struct = nil
-
- // Reuse the allocated space for the FieldStack slice.
- d.errorContext.FieldStack = d.errorContext.FieldStack[:0]
+ if d.errorContext != nil {
+ d.errorContext.Struct = nil
+ // Reuse the allocated space for the FieldStack slice.
+ d.errorContext.FieldStack = d.errorContext.FieldStack[:0]
+ }
return d
}
@@ -275,12 +279,11 @@ func (d *decodeState) saveError(err error) {
// addErrorContext returns a new error enhanced with information from d.errorContext
func (d *decodeState) addErrorContext(err error) error {
- if d.errorContext.Struct != nil || len(d.errorContext.FieldStack) > 0 {
+ if d.errorContext != nil && (d.errorContext.Struct != nil || len(d.errorContext.FieldStack) > 0) {
switch err := err.(type) {
case *UnmarshalTypeError:
err.Struct = d.errorContext.Struct.Name()
err.Field = strings.Join(d.errorContext.FieldStack, ".")
- return err
}
}
return err
@@ -424,7 +427,7 @@ type unquotedValue struct{}
// quoted string literal or literal null into an interface value.
// If it finds anything other than a quoted string literal or null,
// valueQuoted returns unquotedValue{}.
-func (d *decodeState) valueQuoted() interface{} {
+func (d *decodeState) valueQuoted() any {
switch d.opcode {
default:
panic(phasePanicMsg)
@@ -466,7 +469,7 @@ func indirect(v reflect.Value, decodingNull bool) (Unmarshaler, encoding.TextUnm
// If v is a named type and is addressable,
// start with its address, so that if the type has pointer methods,
// we find them.
- if v.Kind() != reflect.Ptr && v.Type().Name() != "" && v.CanAddr() {
+ if v.Kind() != reflect.Pointer && v.Type().Name() != "" && v.CanAddr() {
haveAddr = true
v = v.Addr()
}
@@ -475,14 +478,14 @@ func indirect(v reflect.Value, decodingNull bool) (Unmarshaler, encoding.TextUnm
// usefully addressable.
if v.Kind() == reflect.Interface && !v.IsNil() {
e := v.Elem()
- if e.Kind() == reflect.Ptr && !e.IsNil() && (!decodingNull || e.Elem().Kind() == reflect.Ptr) {
+ if e.Kind() == reflect.Pointer && !e.IsNil() && (!decodingNull || e.Elem().Kind() == reflect.Pointer) {
haveAddr = false
v = e
continue
}
}
- if v.Kind() != reflect.Ptr {
+ if v.Kind() != reflect.Pointer {
break
}
@@ -491,7 +494,7 @@ func indirect(v reflect.Value, decodingNull bool) (Unmarshaler, encoding.TextUnm
}
// Prevent infinite loop if v is an interface pointing to its own address:
- // var v interface{}
+ // var v any
// v = &v
if v.Elem().Kind() == reflect.Interface && v.Elem().Elem() == v {
v = v.Elem()
@@ -676,7 +679,7 @@ func (d *decodeState) object(v reflect.Value) error {
reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
default:
- if !reflect.PtrTo(t.Key()).Implements(textUnmarshalerType) {
+ if !reflect.PointerTo(t.Key()).Implements(textUnmarshalerType) {
d.saveError(&UnmarshalTypeError{Value: "object", Type: t, Offset: int64(d.off)})
d.skip()
return nil
@@ -695,7 +698,10 @@ func (d *decodeState) object(v reflect.Value) error {
}
var mapElem reflect.Value
- origErrorContext := d.errorContext
+ var origErrorContext errorContext
+ if d.errorContext != nil {
+ origErrorContext = *d.errorContext
+ }
for {
// Read opening " of string key or closing }.
@@ -749,7 +755,7 @@ func (d *decodeState) object(v reflect.Value) error {
subv = v
destring = f.quoted
for _, i := range f.index {
- if subv.Kind() == reflect.Ptr {
+ if subv.Kind() == reflect.Pointer {
if subv.IsNil() {
// If a struct embeds a pointer to an unexported type,
// it is not possible to set a newly allocated value
@@ -770,6 +776,9 @@ func (d *decodeState) object(v reflect.Value) error {
}
subv = subv.Field(i)
}
+ if d.errorContext == nil {
+ d.errorContext = new(errorContext)
+ }
d.errorContext.FieldStack = append(d.errorContext.FieldStack, f.name)
d.errorContext.Struct = t
} else if d.disallowUnknownFields {
@@ -811,7 +820,7 @@ func (d *decodeState) object(v reflect.Value) error {
kt := t.Key()
var kv reflect.Value
switch {
- case reflect.PtrTo(kt).Implements(textUnmarshalerType):
+ case reflect.PointerTo(kt).Implements(textUnmarshalerType):
kv = reflect.New(kt)
if err := d.literalStore(item, kv, true); err != nil {
return err
@@ -850,11 +859,13 @@ func (d *decodeState) object(v reflect.Value) error {
if d.opcode == scanSkipSpace {
d.scanWhile(scanSkipSpace)
}
- // Reset errorContext to its original state.
- // Keep the same underlying array for FieldStack, to reuse the
- // space and avoid unnecessary allocs.
- d.errorContext.FieldStack = d.errorContext.FieldStack[:len(origErrorContext.FieldStack)]
- d.errorContext.Struct = origErrorContext.Struct
+ if d.errorContext != nil {
+ // Reset errorContext to its original state.
+ // Keep the same underlying array for FieldStack, to reuse the
+ // space and avoid unnecessary allocs.
+ d.errorContext.FieldStack = d.errorContext.FieldStack[:len(origErrorContext.FieldStack)]
+ d.errorContext.Struct = origErrorContext.Struct
+ }
if d.opcode == scanEndObject {
break
}
@@ -867,7 +878,7 @@ func (d *decodeState) object(v reflect.Value) error {
// convertNumber converts the number literal s to a float64 or a Number
// depending on the setting of d.useNumber.
-func (d *decodeState) convertNumber(s string) (interface{}, error) {
+func (d *decodeState) convertNumber(s string) (any, error) {
if d.useNumber {
return Number(s), nil
}
@@ -934,7 +945,7 @@ func (d *decodeState) literalStore(item []byte, v reflect.Value, fromQuoted bool
break
}
switch v.Kind() {
- case reflect.Interface, reflect.Ptr, reflect.Map, reflect.Slice:
+ case reflect.Interface, reflect.Pointer, reflect.Map, reflect.Slice:
v.Set(reflect.Zero(v.Type()))
// otherwise, ignore null for primitives/string
}
@@ -1064,7 +1075,7 @@ func (d *decodeState) literalStore(item []byte, v reflect.Value, fromQuoted bool
// but they avoid the weight of reflection in this common case.
// valueInterface is like value but returns interface{}
-func (d *decodeState) valueInterface() interface{} {
+func (d *decodeState) valueInterface() any {
return unwrapNode(d.valueNode())
}
@@ -1087,8 +1098,8 @@ func (d *decodeState) valueNode() (val Node) {
}
// arrayInterface is like array but returns []interface{}.
-func (d *decodeState) arrayInterface() []interface{} {
- return unwrapNode(d.arrayNode()).([]interface{})
+func (d *decodeState) arrayInterface() []any {
+ return unwrapNode(d.arrayNode()).([]any)
}
// arrayNode is like arrayInterface but returns Node.
@@ -1124,8 +1135,8 @@ func (d *decodeState) arrayNode() Node {
}
// objectInterface is like object but returns map[string]interface{}.
-func (d *decodeState) objectInterface() map[string]interface{} {
- return unwrapNode(d.objectNode()).(map[string]interface{})
+func (d *decodeState) objectInterface() map[string]any {
+ return unwrapNode(d.objectNode()).(map[string]any)
}
// objectNode is like object but returns Node.
@@ -1189,7 +1200,7 @@ func (d *decodeState) objectNode() Node {
// literalInterface consumes and returns a literal from d.data[d.off-1:] and
// it reads the following byte ahead. The first byte of the literal has been
// read already (that's how the caller knows it's a literal).
-func (d *decodeState) literalInterface() interface{} {
+func (d *decodeState) literalInterface() any {
// All bytes inside literal return scanContinue op code.
start := d.readIndex()
d.rescanLiteral()
diff --git a/vendor/github.com/coreos/go-json/encode.go b/vendor/github.com/coreos/go-json/encode.go
index 578d551102de..1f5e3e446a9c 100644
--- a/vendor/github.com/coreos/go-json/encode.go
+++ b/vendor/github.com/coreos/go-json/encode.go
@@ -155,7 +155,7 @@ import (
// handle them. Passing cyclic structures to Marshal will result in
// an error.
//
-func Marshal(v interface{}) ([]byte, error) {
+func Marshal(v any) ([]byte, error) {
e := newEncodeState()
err := e.marshal(v, encOpts{escapeHTML: true})
@@ -172,7 +172,7 @@ func Marshal(v interface{}) ([]byte, error) {
// MarshalIndent is like Marshal but applies Indent to format the output.
// Each JSON element in the output will begin on a new line beginning with prefix
// followed by one or more copies of indent according to the indentation nesting.
-func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) {
+func MarshalIndent(v any, prefix, indent string) ([]byte, error) {
b, err := Marshal(v)
if err != nil {
return nil, err
@@ -236,6 +236,8 @@ func (e *UnsupportedTypeError) Error() string {
return "json: unsupported type: " + e.Type.String()
}
+// An UnsupportedValueError is returned by Marshal when attempting
+// to encode an unsupported value.
type UnsupportedValueError struct {
Value reflect.Value
Str string
@@ -292,7 +294,7 @@ type encodeState struct {
// startDetectingCyclesAfter, so that we skip the work if we're within a
// reasonable amount of nested pointers deep.
ptrLevel uint
- ptrSeen map[interface{}]struct{}
+ ptrSeen map[any]struct{}
}
const startDetectingCyclesAfter = 1000
@@ -309,7 +311,7 @@ func newEncodeState() *encodeState {
e.ptrLevel = 0
return e
}
- return &encodeState{ptrSeen: make(map[interface{}]struct{})}
+ return &encodeState{ptrSeen: make(map[any]struct{})}
}
// jsonError is an error wrapper type for internal use only.
@@ -317,7 +319,7 @@ func newEncodeState() *encodeState {
// can distinguish intentional panics from this package.
type jsonError struct{ error }
-func (e *encodeState) marshal(v interface{}, opts encOpts) (err error) {
+func (e *encodeState) marshal(v any, opts encOpts) (err error) {
defer func() {
if r := recover(); r != nil {
if je, ok := r.(jsonError); ok {
@@ -348,7 +350,7 @@ func isEmptyValue(v reflect.Value) bool {
return v.Uint() == 0
case reflect.Float32, reflect.Float64:
return v.Float() == 0
- case reflect.Interface, reflect.Ptr:
+ case reflect.Interface, reflect.Pointer:
return v.IsNil()
}
return false
@@ -417,13 +419,13 @@ func newTypeEncoder(t reflect.Type, allowAddr bool) encoderFunc {
// Marshaler with a value receiver, then we're better off taking
// the address of the value - otherwise we end up with an
// allocation as we cast the value to an interface.
- if t.Kind() != reflect.Ptr && allowAddr && reflect.PtrTo(t).Implements(marshalerType) {
+ if t.Kind() != reflect.Pointer && allowAddr && reflect.PointerTo(t).Implements(marshalerType) {
return newCondAddrEncoder(addrMarshalerEncoder, newTypeEncoder(t, false))
}
if t.Implements(marshalerType) {
return marshalerEncoder
}
- if t.Kind() != reflect.Ptr && allowAddr && reflect.PtrTo(t).Implements(textMarshalerType) {
+ if t.Kind() != reflect.Pointer && allowAddr && reflect.PointerTo(t).Implements(textMarshalerType) {
return newCondAddrEncoder(addrTextMarshalerEncoder, newTypeEncoder(t, false))
}
if t.Implements(textMarshalerType) {
@@ -453,7 +455,7 @@ func newTypeEncoder(t reflect.Type, allowAddr bool) encoderFunc {
return newSliceEncoder(t)
case reflect.Array:
return newArrayEncoder(t)
- case reflect.Ptr:
+ case reflect.Pointer:
return newPtrEncoder(t)
default:
return unsupportedTypeEncoder
@@ -465,7 +467,7 @@ func invalidValueEncoder(e *encodeState, v reflect.Value, _ encOpts) {
}
func marshalerEncoder(e *encodeState, v reflect.Value, opts encOpts) {
- if v.Kind() == reflect.Ptr && v.IsNil() {
+ if v.Kind() == reflect.Pointer && v.IsNil() {
e.WriteString("null")
return
}
@@ -502,7 +504,7 @@ func addrMarshalerEncoder(e *encodeState, v reflect.Value, opts encOpts) {
}
func textMarshalerEncoder(e *encodeState, v reflect.Value, opts encOpts) {
- if v.Kind() == reflect.Ptr && v.IsNil() {
+ if v.Kind() == reflect.Pointer && v.IsNil() {
e.WriteString("null")
return
}
@@ -736,7 +738,7 @@ FieldLoop:
// Find the nested struct field by following f.index.
fv := v
for _, i := range f.index {
- if fv.Kind() == reflect.Ptr {
+ if fv.Kind() == reflect.Pointer {
if fv.IsNil() {
continue FieldLoop
}
@@ -779,28 +781,40 @@ func (me mapEncoder) encode(e *encodeState, v reflect.Value, opts encOpts) {
e.WriteString("null")
return
}
+ if e.ptrLevel++; e.ptrLevel > startDetectingCyclesAfter {
+ // We're a large number of nested ptrEncoder.encode calls deep;
+ // start checking if we've run into a pointer cycle.
+ ptr := v.Pointer()
+ if _, ok := e.ptrSeen[ptr]; ok {
+ e.error(&UnsupportedValueError{v, fmt.Sprintf("encountered a cycle via %s", v.Type())})
+ }
+ e.ptrSeen[ptr] = struct{}{}
+ defer delete(e.ptrSeen, ptr)
+ }
e.WriteByte('{')
// Extract and sort the keys.
- keys := v.MapKeys()
- sv := make([]reflectWithString, len(keys))
- for i, v := range keys {
- sv[i].v = v
+ sv := make([]reflectWithString, v.Len())
+ mi := v.MapRange()
+ for i := 0; mi.Next(); i++ {
+ sv[i].k = mi.Key()
+ sv[i].v = mi.Value()
if err := sv[i].resolve(); err != nil {
e.error(fmt.Errorf("json: encoding error for type %q: %q", v.Type().String(), err.Error()))
}
}
- sort.Slice(sv, func(i, j int) bool { return sv[i].s < sv[j].s })
+ sort.Slice(sv, func(i, j int) bool { return sv[i].ks < sv[j].ks })
for i, kv := range sv {
if i > 0 {
e.WriteByte(',')
}
- e.string(kv.s, opts.escapeHTML)
+ e.string(kv.ks, opts.escapeHTML)
e.WriteByte(':')
- me.elemEnc(e, v.MapIndex(kv.v), opts)
+ me.elemEnc(e, kv.v, opts)
}
e.WriteByte('}')
+ e.ptrLevel--
}
func newMapEncoder(t reflect.Type) encoderFunc {
@@ -857,13 +871,29 @@ func (se sliceEncoder) encode(e *encodeState, v reflect.Value, opts encOpts) {
e.WriteString("null")
return
}
+ if e.ptrLevel++; e.ptrLevel > startDetectingCyclesAfter {
+ // We're a large number of nested ptrEncoder.encode calls deep;
+ // start checking if we've run into a pointer cycle.
+ // Here we use a struct to memorize the pointer to the first element of the slice
+ // and its length.
+ ptr := struct {
+ ptr uintptr
+ len int
+ }{v.Pointer(), v.Len()}
+ if _, ok := e.ptrSeen[ptr]; ok {
+ e.error(&UnsupportedValueError{v, fmt.Sprintf("encountered a cycle via %s", v.Type())})
+ }
+ e.ptrSeen[ptr] = struct{}{}
+ defer delete(e.ptrSeen, ptr)
+ }
se.arrayEnc(e, v, opts)
+ e.ptrLevel--
}
func newSliceEncoder(t reflect.Type) encoderFunc {
// Byte slices get special treatment; arrays don't.
if t.Elem().Kind() == reflect.Uint8 {
- p := reflect.PtrTo(t.Elem())
+ p := reflect.PointerTo(t.Elem())
if !p.Implements(marshalerType) && !p.Implements(textMarshalerType) {
return encodeByteSlice
}
@@ -946,7 +976,7 @@ func isValidTag(s string) bool {
}
for _, c := range s {
switch {
- case strings.ContainsRune("!#$%&()*+-./:<=>?@[]^_{|}~ ", c):
+ case strings.ContainsRune("!#$%&()*+-./:;<=>?@[]^_{|}~ ", c):
// Backslash and quote chars are reserved, but
// otherwise any punctuation chars are allowed
// in a tag name.
@@ -959,7 +989,7 @@ func isValidTag(s string) bool {
func typeByIndex(t reflect.Type, index []int) reflect.Type {
for _, i := range index {
- if t.Kind() == reflect.Ptr {
+ if t.Kind() == reflect.Pointer {
t = t.Elem()
}
t = t.Field(i).Type
@@ -968,29 +998,30 @@ func typeByIndex(t reflect.Type, index []int) reflect.Type {
}
type reflectWithString struct {
- v reflect.Value
- s string
+ k reflect.Value
+ v reflect.Value
+ ks string
}
func (w *reflectWithString) resolve() error {
- if w.v.Kind() == reflect.String {
- w.s = w.v.String()
+ if w.k.Kind() == reflect.String {
+ w.ks = w.k.String()
return nil
}
- if tm, ok := w.v.Interface().(encoding.TextMarshaler); ok {
- if w.v.Kind() == reflect.Ptr && w.v.IsNil() {
+ if tm, ok := w.k.Interface().(encoding.TextMarshaler); ok {
+ if w.k.Kind() == reflect.Pointer && w.k.IsNil() {
return nil
}
buf, err := tm.MarshalText()
- w.s = string(buf)
+ w.ks = string(buf)
return err
}
- switch w.v.Kind() {
+ switch w.k.Kind() {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- w.s = strconv.FormatInt(w.v.Int(), 10)
+ w.ks = strconv.FormatInt(w.k.Int(), 10)
return nil
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
- w.s = strconv.FormatUint(w.v.Uint(), 10)
+ w.ks = strconv.FormatUint(w.k.Uint(), 10)
return nil
}
panic("unexpected map key type")
@@ -1210,19 +1241,18 @@ func typeFields(t reflect.Type) structFields {
// Scan f.typ for fields to include.
for i := 0; i < f.typ.NumField(); i++ {
sf := f.typ.Field(i)
- isUnexported := sf.PkgPath != ""
if sf.Anonymous {
t := sf.Type
- if t.Kind() == reflect.Ptr {
+ if t.Kind() == reflect.Pointer {
t = t.Elem()
}
- if isUnexported && t.Kind() != reflect.Struct {
+ if !sf.IsExported() && t.Kind() != reflect.Struct {
// Ignore embedded fields of unexported non-struct types.
continue
}
// Do not ignore embedded fields of unexported struct types
// since they may have exported fields.
- } else if isUnexported {
+ } else if !sf.IsExported() {
// Ignore unexported non-embedded fields.
continue
}
@@ -1239,7 +1269,7 @@ func typeFields(t reflect.Type) structFields {
index[len(f.index)] = i
ft := sf.Type
- if ft.Name() == "" && ft.Kind() == reflect.Ptr {
+ if ft.Name() == "" && ft.Kind() == reflect.Pointer {
// Follow pointer.
ft = ft.Elem()
}
diff --git a/vendor/github.com/coreos/go-json/fuzz.go b/vendor/github.com/coreos/go-json/fuzz.go
index be03f0d7ffc5..b8f4ff2c1d60 100644
--- a/vendor/github.com/coreos/go-json/fuzz.go
+++ b/vendor/github.com/coreos/go-json/fuzz.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build gofuzz
+//go:build gofuzz
package json
@@ -11,10 +11,10 @@ import (
)
func Fuzz(data []byte) (score int) {
- for _, ctor := range []func() interface{}{
- func() interface{} { return new(interface{}) },
- func() interface{} { return new(map[string]interface{}) },
- func() interface{} { return new([]interface{}) },
+ for _, ctor := range []func() any{
+ func() any { return new(any) },
+ func() any { return new(map[string]any) },
+ func() any { return new([]any) },
} {
v := ctor()
err := Unmarshal(data, v)
diff --git a/vendor/github.com/coreos/go-json/scanner.go b/vendor/github.com/coreos/go-json/scanner.go
index 9dc1903e2db2..dbaa821becc1 100644
--- a/vendor/github.com/coreos/go-json/scanner.go
+++ b/vendor/github.com/coreos/go-json/scanner.go
@@ -83,7 +83,7 @@ type scanner struct {
}
var scannerPool = sync.Pool{
- New: func() interface{} {
+ New: func() any {
return &scanner{}
},
}
diff --git a/vendor/github.com/coreos/go-json/stream.go b/vendor/github.com/coreos/go-json/stream.go
index 81f404f4267d..6362170d5df2 100644
--- a/vendor/github.com/coreos/go-json/stream.go
+++ b/vendor/github.com/coreos/go-json/stream.go
@@ -46,7 +46,7 @@ func (dec *Decoder) DisallowUnknownFields() { dec.d.disallowUnknownFields = true
//
// See the documentation for Unmarshal for details about
// the conversion of JSON into a Go value.
-func (dec *Decoder) Decode(v interface{}) error {
+func (dec *Decoder) Decode(v any) error {
if dec.err != nil {
return dec.err
}
@@ -198,7 +198,7 @@ func NewEncoder(w io.Writer) *Encoder {
//
// See the documentation for Marshal for details about the
// conversion of Go values to JSON.
-func (enc *Encoder) Encode(v interface{}) error {
+func (enc *Encoder) Encode(v any) error {
if enc.err != nil {
return enc.err
}
@@ -288,7 +288,7 @@ var _ Unmarshaler = (*RawMessage)(nil)
// string, for JSON string literals
// nil, for JSON null
//
-type Token interface{}
+type Token any
const (
tokenTopValue = iota
@@ -452,7 +452,7 @@ func (dec *Decoder) Token() (Token, error) {
if !dec.tokenValueAllowed() {
return dec.tokenError(c)
}
- var x interface{}
+ var x any
if err := dec.Decode(&x); err != nil {
return nil, err
}
diff --git a/vendor/github.com/coreos/go-json/tags.go b/vendor/github.com/coreos/go-json/tags.go
index c38fd5102f63..b490328f4c46 100644
--- a/vendor/github.com/coreos/go-json/tags.go
+++ b/vendor/github.com/coreos/go-json/tags.go
@@ -15,10 +15,8 @@ type tagOptions string
// parseTag splits a struct field's json tag into its name and
// comma-separated options.
func parseTag(tag string) (string, tagOptions) {
- if idx := strings.Index(tag, ","); idx != -1 {
- return tag[:idx], tagOptions(tag[idx+1:])
- }
- return tag, tagOptions("")
+ tag, opt, _ := strings.Cut(tag, ",")
+ return tag, tagOptions(opt)
}
// Contains reports whether a comma-separated list of options
@@ -30,15 +28,11 @@ func (o tagOptions) Contains(optionName string) bool {
}
s := string(o)
for s != "" {
- var next string
- i := strings.Index(s, ",")
- if i >= 0 {
- s, next = s[:i], s[i+1:]
- }
- if s == optionName {
+ var name string
+ name, s, _ = strings.Cut(s, ",")
+ if name == optionName {
return true
}
- s = next
}
return false
}
diff --git a/vendor/github.com/coreos/go-systemd/v22/journal/journal.go b/vendor/github.com/coreos/go-systemd/v22/journal/journal.go
index ac24c7767d35..16c4e47751c3 100644
--- a/vendor/github.com/coreos/go-systemd/v22/journal/journal.go
+++ b/vendor/github.com/coreos/go-systemd/v22/journal/journal.go
@@ -41,6 +41,6 @@ const (
)
// Print prints a message to the local systemd journal using Send().
-func Print(priority Priority, format string, a ...interface{}) error {
+func Print(priority Priority, format string, a ...any) error {
return Send(fmt.Sprintf(format, a...), priority, nil)
}
diff --git a/vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go b/vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go
index c5b23a81968f..6266e16e5731 100644
--- a/vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go
+++ b/vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go
@@ -13,7 +13,6 @@
// limitations under the License.
//go:build !windows
-// +build !windows
// Package journal provides write bindings to the local systemd journal.
// It is implemented in pure Go and connects to the journal directly over its
@@ -31,7 +30,6 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
"net"
"os"
"strconv"
@@ -194,7 +192,7 @@ func appendVariable(w io.Writer, name, value string) {
* - the data, followed by a newline
*/
fmt.Fprintln(w, name)
- binary.Write(w, binary.LittleEndian, uint64(len(value)))
+ _ = binary.Write(w, binary.LittleEndian, uint64(len(value)))
fmt.Fprintln(w, value)
} else {
/* just write the variable and value all on one line */
@@ -214,7 +212,7 @@ func validVarName(name string) error {
}
for _, c := range name {
- if !(('A' <= c && c <= 'Z') || ('0' <= c && c <= '9') || c == '_') {
+ if ('A' > c || c > 'Z') && ('0' > c || c > '9') && c != '_' {
return errors.New("Variable name contains invalid characters")
}
}
@@ -239,7 +237,7 @@ func isSocketSpaceError(err error) bool {
// tempFd creates a temporary, unlinked file under `/dev/shm`.
func tempFd() (*os.File, error) {
- file, err := ioutil.TempFile("/dev/shm/", "journal.XXXXX")
+ file, err := os.CreateTemp("/dev/shm/", "journal.XXXXX")
if err != nil {
return nil, err
}
diff --git a/vendor/github.com/coreos/go-systemd/v22/unit/deserialize.go b/vendor/github.com/coreos/go-systemd/v22/unit/deserialize.go
index 283c1507713c..74b9573f93f6 100644
--- a/vendor/github.com/coreos/go-systemd/v22/unit/deserialize.go
+++ b/vendor/github.com/coreos/go-systemd/v22/unit/deserialize.go
@@ -38,10 +38,8 @@ const (
SYSTEMD_NEWLINE = "\r\n"
)
-var (
- // ErrLineTooLong gets returned when a line is too long for systemd to handle.
- ErrLineTooLong = fmt.Errorf("line too long (max %d bytes)", SYSTEMD_LINE_MAX)
-)
+// ErrLineTooLong gets returned when a line is too long for systemd to handle.
+var ErrLineTooLong = fmt.Errorf("line too long (max %d bytes)", SYSTEMD_LINE_MAX)
// DeserializeOptions parses a systemd unit file into a list of UnitOptions
func DeserializeOptions(f io.Reader) (opts []*UnitOption, err error) {
@@ -79,7 +77,6 @@ type lexData struct {
// deserializeAll deserializes into UnitSections and UnitOptions.
func deserializeAll(f io.Reader) ([]*UnitSection, []*UnitOption, error) {
-
lexer, lexchan, errchan := newLexer(f)
go lexer.lex()
@@ -92,8 +89,8 @@ func deserializeAll(f io.Reader) ([]*UnitSection, []*UnitOption, error) {
case optionKind:
if ld.Option != nil {
// add to options
- opt := ld.Option
- options = append(options, &(*opt))
+ opt := *ld.Option
+ options = append(options, &opt)
// sanity check. "should not happen" as sectionKind is first in code flow.
if len(sections) == 0 {
@@ -255,7 +252,7 @@ func (l *lexer) lexNextSectionOrOptionFunc(section string) lexStep {
return l.ignoreLineFunc(l.lexNextSectionOrOptionFunc(section)), nil
}
- l.buf.UnreadRune()
+ _ = l.buf.UnreadRune() // This can't fail as we just called ReadRune.
return l.lexOptionNameFunc(section), nil
}
}
@@ -287,29 +284,23 @@ func (l *lexer) lexOptionNameFunc(section string) lexStep {
func (l *lexer) lexOptionValueFunc(section, name string, partial bytes.Buffer) lexStep {
return func() (lexStep, error) {
- for {
- line, eof, err := l.toEOL()
- if err != nil {
- return nil, err
- }
-
- if len(bytes.TrimSpace(line)) == 0 {
- break
- }
+ line, eof, err := l.toEOL()
+ if err != nil {
+ return nil, err
+ }
+ if len(bytes.TrimSpace(line)) != 0 {
partial.Write(line)
// lack of continuation means this value has been exhausted
- idx := bytes.LastIndex(line, []byte{'\\'})
- if idx == -1 || idx != (len(line)-1) {
- break
- }
+ if bytes.HasSuffix(line, []byte{'\\'}) {
+ // line ends with backslash, continue parsing
+ if !eof {
+ partial.WriteRune('\n')
+ }
- if !eof {
- partial.WriteRune('\n')
+ return l.lexOptionValueFunc(section, name, partial), nil
}
-
- return l.lexOptionValueFunc(section, name, partial), nil
}
val := partial.String()
diff --git a/vendor/github.com/coreos/go-systemd/v22/unit/doc.go b/vendor/github.com/coreos/go-systemd/v22/unit/doc.go
new file mode 100644
index 000000000000..1c265e4aa2d5
--- /dev/null
+++ b/vendor/github.com/coreos/go-systemd/v22/unit/doc.go
@@ -0,0 +1,12 @@
+// Package unit provides utilities for parsing, serializing, and manipulating
+// systemd unit files. It supports both reading unit file content into Go data
+// structures and writing Go data structures back to unit file format.
+//
+// The package provides functionality to:
+// - Parse systemd unit files into [UnitOption] and [UnitSection] structures
+// - Serialize Go structures back into unit file format
+// - Escape and unescape unit names according to systemd conventions
+//
+// Unit files are configuration files that describe how systemd should manage
+// services, sockets, devices, and other system resources.
+package unit
diff --git a/vendor/github.com/coreos/go-systemd/v22/unit/option.go b/vendor/github.com/coreos/go-systemd/v22/unit/option.go
index 98e1af5c99a7..800ecda44983 100644
--- a/vendor/github.com/coreos/go-systemd/v22/unit/option.go
+++ b/vendor/github.com/coreos/go-systemd/v22/unit/option.go
@@ -49,7 +49,7 @@ func AllMatch(u1 []*UnitOption, u2 []*UnitOption) bool {
return false
}
- for i := 0; i < length; i++ {
+ for i := range length {
if !u1[i].Match(u2[i]) {
return false
}
diff --git a/vendor/github.com/coreos/go-systemd/v22/unit/serialize.go b/vendor/github.com/coreos/go-systemd/v22/unit/serialize.go
index c1b79c02dc21..25577065935d 100644
--- a/vendor/github.com/coreos/go-systemd/v22/unit/serialize.go
+++ b/vendor/github.com/coreos/go-systemd/v22/unit/serialize.go
@@ -61,7 +61,6 @@ func Serialize(opts []*UnitOption) io.Reader {
// SerializeSections will serializes the unit file from the given
// UnitSections.
func SerializeSections(sections []*UnitSection) io.Reader {
-
var buf bytes.Buffer
for i, s := range sections {
diff --git a/vendor/github.com/coreos/ignition/v2/config/shared/errors/errors.go b/vendor/github.com/coreos/ignition/v2/config/shared/errors/errors.go
index 492fd7e6cfcc..85d110112b5c 100644
--- a/vendor/github.com/coreos/ignition/v2/config/shared/errors/errors.go
+++ b/vendor/github.com/coreos/ignition/v2/config/shared/errors/errors.go
@@ -39,6 +39,7 @@ var (
ErrLinkUsedSymlink = errors.New("link path includes link in config")
ErrLinkTargetRequired = errors.New("link target is required")
ErrHardLinkToDirectory = errors.New("hard link target is a directory")
+ ErrHardLinkSpecifiesOwner = errors.New("user/group ignored for hard link")
ErrDiskDeviceRequired = errors.New("disk device is required")
ErrPartitionNumbersCollide = errors.New("partition numbers collide")
ErrPartitionsOverlap = errors.New("partitions overlap")
@@ -61,8 +62,9 @@ var (
ErrClevisConfigRequired = errors.New("missing required custom clevis config")
ErrClevisCustomWithOthers = errors.New("cannot use custom clevis config with tpm2, tang, or threshold")
ErrTangThumbprintRequired = errors.New("thumbprint is required")
+ ErrInvalidTangAdvertisement = errors.New("advertisement is not valid JSON")
ErrFileIllegalMode = errors.New("illegal file mode")
- ErrModeSpecialBits = errors.New("setuid/setgid/sticky bits are not supported in spec versions older than 3.4.0")
+ ErrModeSpecialBits = errors.New("setuid/setgid/sticky bits are not supported or functional in spec versions older than 3.6.0")
ErrBothIDAndNameSet = errors.New("cannot set both id and name")
ErrLabelTooLong = errors.New("partition labels may not exceed 36 characters")
ErrDoesntMatchGUIDRegex = errors.New("doesn't match the form \"01234567-89AB-CDEF-EDCB-A98765432101\"")
@@ -70,6 +72,8 @@ var (
ErrNoPath = errors.New("path not specified")
ErrPathRelative = errors.New("path not absolute")
ErrDirtyPath = errors.New("path is not fully simplified")
+ ErrPartitionsOverwritten = errors.New("filesystem overwrites partitioned device")
+ ErrFilesystemImplicitWipe = errors.New("device matches disk with wipeTable enabled; filesystem will be wiped")
ErrRaidLevelRequired = errors.New("raid level is required")
ErrSparesUnsupportedForLevel = errors.New("spares unsupported for linear and raid0 arrays")
ErrUnrecognizedRaidLevel = errors.New("unrecognized raid level")
@@ -80,6 +84,9 @@ var (
ErrDuplicateLabels = errors.New("cannot use the same partition label twice")
ErrInvalidProxy = errors.New("proxies must be http(s)")
ErrInsecureProxy = errors.New("insecure plaintext HTTP proxy specified for HTTPS resources")
+ ErrPathConflictsSystemd = errors.New("path conflicts with systemd unit or dropin")
+ ErrCexWithClevis = errors.New("cannot use cex with clevis")
+ ErrCexWithKeyFile = errors.New("cannot use key file with cex")
// Systemd section errors
ErrInvalidSystemdExt = errors.New("invalid systemd unit extension")
@@ -113,3 +120,9 @@ var (
func NewNoInstallSectionError(name string) error {
return fmt.Errorf("unit %q is enabled, but has no install section so enable does nothing", name)
}
+
+// NewNoInstallSectionForInstantiableUnitError produces an error indicating the
+// given instantiable unit for an instance unit is missing an Install section.
+func NewNoInstallSectionForInstantiableUnitError(instantiable, instance string) error {
+ return fmt.Errorf("template unit %q for %q doesn't have Install section", instantiable, instance)
+}
diff --git a/vendor/github.com/coreos/ignition/v2/config/shared/parse/unit.go b/vendor/github.com/coreos/ignition/v2/config/shared/parse/unit.go
new file mode 100644
index 000000000000..7dcd189106ac
--- /dev/null
+++ b/vendor/github.com/coreos/ignition/v2/config/shared/parse/unit.go
@@ -0,0 +1,37 @@
+// Copyright 2022 Red Hat, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 parse contains a function for parsing unit contents shared between
+// multiple config versions.
+package parse
+
+import (
+ "fmt"
+ "strings"
+
+ "github.com/coreos/go-systemd/v22/unit"
+)
+
+// ParseUnitContents parses the content of a given unit
+func ParseUnitContents(content *string) ([]*unit.UnitOption, error) {
+ if content == nil {
+ return []*unit.UnitOption{}, nil
+ }
+ c := strings.NewReader(*content)
+ opts, err := unit.Deserialize(c)
+ if err != nil {
+ return nil, fmt.Errorf("invalid unit content: %s", err)
+ }
+ return opts, nil
+}
diff --git a/vendor/github.com/coreos/ignition/v2/config/util/config.go b/vendor/github.com/coreos/ignition/v2/config/util/config.go
index 85cd7fa7c4be..0b6766985fa8 100644
--- a/vendor/github.com/coreos/ignition/v2/config/util/config.go
+++ b/vendor/github.com/coreos/ignition/v2/config/util/config.go
@@ -11,6 +11,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.
+
package util
import (
diff --git a/vendor/github.com/coreos/ignition/v2/config/v3_0/types/config.go b/vendor/github.com/coreos/ignition/v2/config/v3_0/types/config.go
index a98062a1b4ca..1ac295948cf8 100644
--- a/vendor/github.com/coreos/ignition/v2/config/v3_0/types/config.go
+++ b/vendor/github.com/coreos/ignition/v2/config/v3_0/types/config.go
@@ -15,7 +15,12 @@
package types
import (
+ "github.com/coreos/ignition/v2/config/shared/errors"
+ "github.com/coreos/ignition/v2/config/util"
+
"github.com/coreos/go-semver/semver"
+ "github.com/coreos/vcontext/path"
+ "github.com/coreos/vcontext/report"
)
var (
@@ -24,3 +29,36 @@ var (
Minor: 0,
}
)
+
+func (cfg Config) Validate(c path.ContextPath) (r report.Report) {
+ systemdPath := "/etc/systemd/system/"
+ unitPaths := map[string]struct{}{}
+ for _, unit := range cfg.Systemd.Units {
+ if !util.NilOrEmpty(unit.Contents) {
+ pathString := systemdPath + unit.Name
+ unitPaths[pathString] = struct{}{}
+ }
+ for _, dropin := range unit.Dropins {
+ if !util.NilOrEmpty(dropin.Contents) {
+ pathString := systemdPath + unit.Name + ".d/" + dropin.Name
+ unitPaths[pathString] = struct{}{}
+ }
+ }
+ }
+ for i, f := range cfg.Storage.Files {
+ if _, exists := unitPaths[f.Path]; exists {
+ r.AddOnError(c.Append("storage", "files", i, "path"), errors.ErrPathConflictsSystemd)
+ }
+ }
+ for i, d := range cfg.Storage.Directories {
+ if _, exists := unitPaths[d.Path]; exists {
+ r.AddOnError(c.Append("storage", "directories", i, "path"), errors.ErrPathConflictsSystemd)
+ }
+ }
+ for i, l := range cfg.Storage.Links {
+ if _, exists := unitPaths[l.Path]; exists {
+ r.AddOnError(c.Append("storage", "links", i, "path"), errors.ErrPathConflictsSystemd)
+ }
+ }
+ return
+}
diff --git a/vendor/github.com/coreos/ignition/v2/config/v3_0/types/storage.go b/vendor/github.com/coreos/ignition/v2/config/v3_0/types/storage.go
index eac98e74b5be..24668954b788 100644
--- a/vendor/github.com/coreos/ignition/v2/config/v3_0/types/storage.go
+++ b/vendor/github.com/coreos/ignition/v2/config/v3_0/types/storage.go
@@ -34,6 +34,14 @@ func (s Storage) MergedKeys() map[string]string {
}
func (s Storage) Validate(c vpath.ContextPath) (r report.Report) {
+ s.validateDirectories(c, &r)
+ s.validateFiles(c, &r)
+ s.validateLinks(c, &r)
+ s.validateFilesystems(c, &r)
+ return
+}
+
+func (s Storage) validateDirectories(c vpath.ContextPath, r *report.Report) {
for i, d := range s.Directories {
for _, l := range s.Links {
if strings.HasPrefix(d.Path, l.Path+"/") {
@@ -41,6 +49,9 @@ func (s Storage) Validate(c vpath.ContextPath) (r report.Report) {
}
}
}
+}
+
+func (s Storage) validateFiles(c vpath.ContextPath, r *report.Report) {
for i, f := range s.Files {
for _, l := range s.Links {
if strings.HasPrefix(f.Path, l.Path+"/") {
@@ -48,6 +59,9 @@ func (s Storage) Validate(c vpath.ContextPath) (r report.Report) {
}
}
}
+}
+
+func (s Storage) validateLinks(c vpath.ContextPath, r *report.Report) {
for i, l1 := range s.Links {
for _, l2 := range s.Links {
if strings.HasPrefix(l1.Path, l2.Path+"/") {
@@ -66,6 +80,32 @@ func (s Storage) Validate(c vpath.ContextPath) (r report.Report) {
r.AddOnError(c.Append("links", i), errors.ErrHardLinkToDirectory)
}
}
+ ownerCheck := func(ok bool, path vpath.ContextPath) {
+ if !ok {
+ r.AddOnWarn(path, errors.ErrHardLinkSpecifiesOwner)
+ }
+ }
+ ownerCheck(l1.User.ID == nil, c.Append("links", i, "user", "id"))
+ ownerCheck(l1.User.Name == nil, c.Append("links", i, "user", "name"))
+ ownerCheck(l1.Group.ID == nil, c.Append("links", i, "group", "id"))
+ ownerCheck(l1.Group.Name == nil, c.Append("links", i, "group", "name"))
+ }
+}
+
+func (s Storage) validateFilesystems(c vpath.ContextPath, r *report.Report) {
+ disks := make(map[string]Disk)
+ for _, d := range s.Disks {
+ disks[d.Device] = d
+ }
+
+ for i, f := range s.Filesystems {
+ disk, exist := disks[f.Device]
+ if exist {
+ if len(disk.Partitions) > 0 {
+ r.AddOnWarn(c.Append("filesystems", i, "device"), errors.ErrPartitionsOverwritten)
+ } else if !util.IsTrue(f.WipeFilesystem) && util.IsTrue(disk.WipeTable) {
+ r.AddOnWarn(c.Append("filesystems", i, "device"), errors.ErrFilesystemImplicitWipe)
+ }
+ }
}
- return
}
diff --git a/vendor/github.com/coreos/ignition/v2/config/v3_0/types/systemd.go b/vendor/github.com/coreos/ignition/v2/config/v3_0/types/systemd.go
new file mode 100644
index 000000000000..ac521ba73f73
--- /dev/null
+++ b/vendor/github.com/coreos/ignition/v2/config/v3_0/types/systemd.go
@@ -0,0 +1,61 @@
+// Copyright 2022 Red Hat, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 types
+
+import (
+ "regexp"
+
+ "github.com/coreos/ignition/v2/config/shared/errors"
+ "github.com/coreos/ignition/v2/config/shared/parse"
+ "github.com/coreos/ignition/v2/config/util"
+
+ vpath "github.com/coreos/vcontext/path"
+ "github.com/coreos/vcontext/report"
+)
+
+func (s Systemd) Validate(c vpath.ContextPath) (r report.Report) {
+ units := make(map[string]Unit)
+ checkInstanceUnit := regexp.MustCompile(`^(.+?)@(.+?)\.service$`)
+ for _, d := range s.Units {
+ units[d.Name] = d
+ }
+ for index, unit := range s.Units {
+ if checkInstanceUnit.MatchString(unit.Name) && util.IsTrue(unit.Enabled) {
+ instUnitSlice := checkInstanceUnit.FindSubmatch([]byte(unit.Name))
+ instantiableUnit := string(instUnitSlice[1]) + "@.service"
+ if _, ok := units[instantiableUnit]; ok && util.NotEmpty(units[instantiableUnit].Contents) {
+ foundInstallSection := false
+ // we're doing a separate validation pass on each unit to identify
+ // if an instantiable unit has the install section. So logging an
+ // `AddOnError` will produce duplicate errors on bad unit contents
+ // because we're already doing that while validating a unit separately.
+ opts, err := parse.ParseUnitContents(units[instantiableUnit].Contents)
+ if err != nil {
+ continue
+ }
+ for _, section := range opts {
+ if section.Section == "Install" {
+ foundInstallSection = true
+ break
+ }
+ }
+ if !foundInstallSection {
+ r.AddOnWarn(c.Append("units", index, "contents"), errors.NewNoInstallSectionForInstantiableUnitError(instantiableUnit, unit.Name))
+ }
+ }
+ }
+ }
+ return
+}
diff --git a/vendor/github.com/coreos/ignition/v2/config/v3_0/types/unit.go b/vendor/github.com/coreos/ignition/v2/config/v3_0/types/unit.go
index e0e5c50a3097..786debaeef03 100644
--- a/vendor/github.com/coreos/ignition/v2/config/v3_0/types/unit.go
+++ b/vendor/github.com/coreos/ignition/v2/config/v3_0/types/unit.go
@@ -15,15 +15,13 @@
package types
import (
- "fmt"
"path"
- "strings"
"github.com/coreos/ignition/v2/config/shared/errors"
+ "github.com/coreos/ignition/v2/config/shared/parse"
"github.com/coreos/ignition/v2/config/shared/validations"
"github.com/coreos/ignition/v2/config/util"
- "github.com/coreos/go-systemd/v22/unit"
cpath "github.com/coreos/vcontext/path"
"github.com/coreos/vcontext/report"
)
@@ -39,7 +37,7 @@ func (d Dropin) Key() string {
func (u Unit) Validate(c cpath.ContextPath) (r report.Report) {
r.AddOnError(c.Append("name"), validateName(u.Name))
c = c.Append("contents")
- opts, err := validateUnitContent(u.Contents)
+ opts, err := parse.ParseUnitContents(u.Contents)
r.AddOnError(c, err)
r.AddOnWarn(c, validations.ValidateInstallSection(u.Name, util.IsTrue(u.Enabled), util.NilOrEmpty(u.Contents), opts))
@@ -57,7 +55,7 @@ func validateName(name string) error {
}
func (d Dropin) Validate(c cpath.ContextPath) (r report.Report) {
- _, err := validateUnitContent(d.Contents)
+ _, err := parse.ParseUnitContents(d.Contents)
r.AddOnError(c.Append("contents"), err)
switch path.Ext(d.Name) {
@@ -68,15 +66,3 @@ func (d Dropin) Validate(c cpath.ContextPath) (r report.Report) {
return
}
-
-func validateUnitContent(content *string) ([]*unit.UnitOption, error) {
- if content == nil {
- return []*unit.UnitOption{}, nil
- }
- c := strings.NewReader(*content)
- opts, err := unit.Deserialize(c)
- if err != nil {
- return nil, fmt.Errorf("invalid unit content: %s", err)
- }
- return opts, nil
-}
diff --git a/vendor/github.com/coreos/ignition/v2/config/v3_1/types/config.go b/vendor/github.com/coreos/ignition/v2/config/v3_1/types/config.go
index 23ba8dd188bc..3cebde7fb0a4 100644
--- a/vendor/github.com/coreos/ignition/v2/config/v3_1/types/config.go
+++ b/vendor/github.com/coreos/ignition/v2/config/v3_1/types/config.go
@@ -15,7 +15,12 @@
package types
import (
+ "github.com/coreos/ignition/v2/config/shared/errors"
+ "github.com/coreos/ignition/v2/config/util"
+
"github.com/coreos/go-semver/semver"
+ "github.com/coreos/vcontext/path"
+ "github.com/coreos/vcontext/report"
)
var (
@@ -24,3 +29,36 @@ var (
Minor: 1,
}
)
+
+func (cfg Config) Validate(c path.ContextPath) (r report.Report) {
+ systemdPath := "/etc/systemd/system/"
+ unitPaths := map[string]struct{}{}
+ for _, unit := range cfg.Systemd.Units {
+ if !util.NilOrEmpty(unit.Contents) {
+ pathString := systemdPath + unit.Name
+ unitPaths[pathString] = struct{}{}
+ }
+ for _, dropin := range unit.Dropins {
+ if !util.NilOrEmpty(dropin.Contents) {
+ pathString := systemdPath + unit.Name + ".d/" + dropin.Name
+ unitPaths[pathString] = struct{}{}
+ }
+ }
+ }
+ for i, f := range cfg.Storage.Files {
+ if _, exists := unitPaths[f.Path]; exists {
+ r.AddOnError(c.Append("storage", "files", i, "path"), errors.ErrPathConflictsSystemd)
+ }
+ }
+ for i, d := range cfg.Storage.Directories {
+ if _, exists := unitPaths[d.Path]; exists {
+ r.AddOnError(c.Append("storage", "directories", i, "path"), errors.ErrPathConflictsSystemd)
+ }
+ }
+ for i, l := range cfg.Storage.Links {
+ if _, exists := unitPaths[l.Path]; exists {
+ r.AddOnError(c.Append("storage", "links", i, "path"), errors.ErrPathConflictsSystemd)
+ }
+ }
+ return
+}
diff --git a/vendor/github.com/coreos/ignition/v2/config/v3_1/types/storage.go b/vendor/github.com/coreos/ignition/v2/config/v3_1/types/storage.go
index eac98e74b5be..24668954b788 100644
--- a/vendor/github.com/coreos/ignition/v2/config/v3_1/types/storage.go
+++ b/vendor/github.com/coreos/ignition/v2/config/v3_1/types/storage.go
@@ -34,6 +34,14 @@ func (s Storage) MergedKeys() map[string]string {
}
func (s Storage) Validate(c vpath.ContextPath) (r report.Report) {
+ s.validateDirectories(c, &r)
+ s.validateFiles(c, &r)
+ s.validateLinks(c, &r)
+ s.validateFilesystems(c, &r)
+ return
+}
+
+func (s Storage) validateDirectories(c vpath.ContextPath, r *report.Report) {
for i, d := range s.Directories {
for _, l := range s.Links {
if strings.HasPrefix(d.Path, l.Path+"/") {
@@ -41,6 +49,9 @@ func (s Storage) Validate(c vpath.ContextPath) (r report.Report) {
}
}
}
+}
+
+func (s Storage) validateFiles(c vpath.ContextPath, r *report.Report) {
for i, f := range s.Files {
for _, l := range s.Links {
if strings.HasPrefix(f.Path, l.Path+"/") {
@@ -48,6 +59,9 @@ func (s Storage) Validate(c vpath.ContextPath) (r report.Report) {
}
}
}
+}
+
+func (s Storage) validateLinks(c vpath.ContextPath, r *report.Report) {
for i, l1 := range s.Links {
for _, l2 := range s.Links {
if strings.HasPrefix(l1.Path, l2.Path+"/") {
@@ -66,6 +80,32 @@ func (s Storage) Validate(c vpath.ContextPath) (r report.Report) {
r.AddOnError(c.Append("links", i), errors.ErrHardLinkToDirectory)
}
}
+ ownerCheck := func(ok bool, path vpath.ContextPath) {
+ if !ok {
+ r.AddOnWarn(path, errors.ErrHardLinkSpecifiesOwner)
+ }
+ }
+ ownerCheck(l1.User.ID == nil, c.Append("links", i, "user", "id"))
+ ownerCheck(l1.User.Name == nil, c.Append("links", i, "user", "name"))
+ ownerCheck(l1.Group.ID == nil, c.Append("links", i, "group", "id"))
+ ownerCheck(l1.Group.Name == nil, c.Append("links", i, "group", "name"))
+ }
+}
+
+func (s Storage) validateFilesystems(c vpath.ContextPath, r *report.Report) {
+ disks := make(map[string]Disk)
+ for _, d := range s.Disks {
+ disks[d.Device] = d
+ }
+
+ for i, f := range s.Filesystems {
+ disk, exist := disks[f.Device]
+ if exist {
+ if len(disk.Partitions) > 0 {
+ r.AddOnWarn(c.Append("filesystems", i, "device"), errors.ErrPartitionsOverwritten)
+ } else if !util.IsTrue(f.WipeFilesystem) && util.IsTrue(disk.WipeTable) {
+ r.AddOnWarn(c.Append("filesystems", i, "device"), errors.ErrFilesystemImplicitWipe)
+ }
+ }
}
- return
}
diff --git a/vendor/github.com/coreos/ignition/v2/config/v3_1/types/systemd.go b/vendor/github.com/coreos/ignition/v2/config/v3_1/types/systemd.go
new file mode 100644
index 000000000000..ac521ba73f73
--- /dev/null
+++ b/vendor/github.com/coreos/ignition/v2/config/v3_1/types/systemd.go
@@ -0,0 +1,61 @@
+// Copyright 2022 Red Hat, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 types
+
+import (
+ "regexp"
+
+ "github.com/coreos/ignition/v2/config/shared/errors"
+ "github.com/coreos/ignition/v2/config/shared/parse"
+ "github.com/coreos/ignition/v2/config/util"
+
+ vpath "github.com/coreos/vcontext/path"
+ "github.com/coreos/vcontext/report"
+)
+
+func (s Systemd) Validate(c vpath.ContextPath) (r report.Report) {
+ units := make(map[string]Unit)
+ checkInstanceUnit := regexp.MustCompile(`^(.+?)@(.+?)\.service$`)
+ for _, d := range s.Units {
+ units[d.Name] = d
+ }
+ for index, unit := range s.Units {
+ if checkInstanceUnit.MatchString(unit.Name) && util.IsTrue(unit.Enabled) {
+ instUnitSlice := checkInstanceUnit.FindSubmatch([]byte(unit.Name))
+ instantiableUnit := string(instUnitSlice[1]) + "@.service"
+ if _, ok := units[instantiableUnit]; ok && util.NotEmpty(units[instantiableUnit].Contents) {
+ foundInstallSection := false
+ // we're doing a separate validation pass on each unit to identify
+ // if an instantiable unit has the install section. So logging an
+ // `AddOnError` will produce duplicate errors on bad unit contents
+ // because we're already doing that while validating a unit separately.
+ opts, err := parse.ParseUnitContents(units[instantiableUnit].Contents)
+ if err != nil {
+ continue
+ }
+ for _, section := range opts {
+ if section.Section == "Install" {
+ foundInstallSection = true
+ break
+ }
+ }
+ if !foundInstallSection {
+ r.AddOnWarn(c.Append("units", index, "contents"), errors.NewNoInstallSectionForInstantiableUnitError(instantiableUnit, unit.Name))
+ }
+ }
+ }
+ }
+ return
+}
diff --git a/vendor/github.com/coreos/ignition/v2/config/v3_1/types/unit.go b/vendor/github.com/coreos/ignition/v2/config/v3_1/types/unit.go
index e0e5c50a3097..786debaeef03 100644
--- a/vendor/github.com/coreos/ignition/v2/config/v3_1/types/unit.go
+++ b/vendor/github.com/coreos/ignition/v2/config/v3_1/types/unit.go
@@ -15,15 +15,13 @@
package types
import (
- "fmt"
"path"
- "strings"
"github.com/coreos/ignition/v2/config/shared/errors"
+ "github.com/coreos/ignition/v2/config/shared/parse"
"github.com/coreos/ignition/v2/config/shared/validations"
"github.com/coreos/ignition/v2/config/util"
- "github.com/coreos/go-systemd/v22/unit"
cpath "github.com/coreos/vcontext/path"
"github.com/coreos/vcontext/report"
)
@@ -39,7 +37,7 @@ func (d Dropin) Key() string {
func (u Unit) Validate(c cpath.ContextPath) (r report.Report) {
r.AddOnError(c.Append("name"), validateName(u.Name))
c = c.Append("contents")
- opts, err := validateUnitContent(u.Contents)
+ opts, err := parse.ParseUnitContents(u.Contents)
r.AddOnError(c, err)
r.AddOnWarn(c, validations.ValidateInstallSection(u.Name, util.IsTrue(u.Enabled), util.NilOrEmpty(u.Contents), opts))
@@ -57,7 +55,7 @@ func validateName(name string) error {
}
func (d Dropin) Validate(c cpath.ContextPath) (r report.Report) {
- _, err := validateUnitContent(d.Contents)
+ _, err := parse.ParseUnitContents(d.Contents)
r.AddOnError(c.Append("contents"), err)
switch path.Ext(d.Name) {
@@ -68,15 +66,3 @@ func (d Dropin) Validate(c cpath.ContextPath) (r report.Report) {
return
}
-
-func validateUnitContent(content *string) ([]*unit.UnitOption, error) {
- if content == nil {
- return []*unit.UnitOption{}, nil
- }
- c := strings.NewReader(*content)
- opts, err := unit.Deserialize(c)
- if err != nil {
- return nil, fmt.Errorf("invalid unit content: %s", err)
- }
- return opts, nil
-}
diff --git a/vendor/github.com/coreos/ignition/v2/config/v3_2/types/config.go b/vendor/github.com/coreos/ignition/v2/config/v3_2/types/config.go
index 4b18d5378246..0e2fc3703aa7 100644
--- a/vendor/github.com/coreos/ignition/v2/config/v3_2/types/config.go
+++ b/vendor/github.com/coreos/ignition/v2/config/v3_2/types/config.go
@@ -15,7 +15,12 @@
package types
import (
+ "github.com/coreos/ignition/v2/config/shared/errors"
+ "github.com/coreos/ignition/v2/config/util"
+
"github.com/coreos/go-semver/semver"
+ "github.com/coreos/vcontext/path"
+ "github.com/coreos/vcontext/report"
)
var (
@@ -24,3 +29,36 @@ var (
Minor: 2,
}
)
+
+func (cfg Config) Validate(c path.ContextPath) (r report.Report) {
+ systemdPath := "/etc/systemd/system/"
+ unitPaths := map[string]struct{}{}
+ for _, unit := range cfg.Systemd.Units {
+ if !util.NilOrEmpty(unit.Contents) {
+ pathString := systemdPath + unit.Name
+ unitPaths[pathString] = struct{}{}
+ }
+ for _, dropin := range unit.Dropins {
+ if !util.NilOrEmpty(dropin.Contents) {
+ pathString := systemdPath + unit.Name + ".d/" + dropin.Name
+ unitPaths[pathString] = struct{}{}
+ }
+ }
+ }
+ for i, f := range cfg.Storage.Files {
+ if _, exists := unitPaths[f.Path]; exists {
+ r.AddOnError(c.Append("storage", "files", i, "path"), errors.ErrPathConflictsSystemd)
+ }
+ }
+ for i, d := range cfg.Storage.Directories {
+ if _, exists := unitPaths[d.Path]; exists {
+ r.AddOnError(c.Append("storage", "directories", i, "path"), errors.ErrPathConflictsSystemd)
+ }
+ }
+ for i, l := range cfg.Storage.Links {
+ if _, exists := unitPaths[l.Path]; exists {
+ r.AddOnError(c.Append("storage", "links", i, "path"), errors.ErrPathConflictsSystemd)
+ }
+ }
+ return
+}
diff --git a/vendor/github.com/coreos/ignition/v2/config/v3_2/types/storage.go b/vendor/github.com/coreos/ignition/v2/config/v3_2/types/storage.go
index fd1b8cecf62c..5cec008dec34 100644
--- a/vendor/github.com/coreos/ignition/v2/config/v3_2/types/storage.go
+++ b/vendor/github.com/coreos/ignition/v2/config/v3_2/types/storage.go
@@ -34,6 +34,14 @@ func (s Storage) MergedKeys() map[string]string {
}
func (s Storage) Validate(c vpath.ContextPath) (r report.Report) {
+ s.validateDirectories(c, &r)
+ s.validateFiles(c, &r)
+ s.validateLinks(c, &r)
+ s.validateFilesystems(c, &r)
+ return
+}
+
+func (s Storage) validateDirectories(c vpath.ContextPath, r *report.Report) {
for i, d := range s.Directories {
for _, l := range s.Links {
if strings.HasPrefix(d.Path, l.Path+"/") {
@@ -41,6 +49,9 @@ func (s Storage) Validate(c vpath.ContextPath) (r report.Report) {
}
}
}
+}
+
+func (s Storage) validateFiles(c vpath.ContextPath, r *report.Report) {
for i, f := range s.Files {
for _, l := range s.Links {
if strings.HasPrefix(f.Path, l.Path+"/") {
@@ -48,6 +59,9 @@ func (s Storage) Validate(c vpath.ContextPath) (r report.Report) {
}
}
}
+}
+
+func (s Storage) validateLinks(c vpath.ContextPath, r *report.Report) {
for i, l1 := range s.Links {
for _, l2 := range s.Links {
if strings.HasPrefix(l1.Path, l2.Path+"/") {
@@ -66,6 +80,32 @@ func (s Storage) Validate(c vpath.ContextPath) (r report.Report) {
r.AddOnError(c.Append("links", i), errors.ErrHardLinkToDirectory)
}
}
+ ownerCheck := func(ok bool, path vpath.ContextPath) {
+ if !ok {
+ r.AddOnWarn(path, errors.ErrHardLinkSpecifiesOwner)
+ }
+ }
+ ownerCheck(l1.User.ID == nil, c.Append("links", i, "user", "id"))
+ ownerCheck(l1.User.Name == nil, c.Append("links", i, "user", "name"))
+ ownerCheck(l1.Group.ID == nil, c.Append("links", i, "group", "id"))
+ ownerCheck(l1.Group.Name == nil, c.Append("links", i, "group", "name"))
+ }
+}
+
+func (s Storage) validateFilesystems(c vpath.ContextPath, r *report.Report) {
+ disks := make(map[string]Disk)
+ for _, d := range s.Disks {
+ disks[d.Device] = d
+ }
+
+ for i, f := range s.Filesystems {
+ disk, exist := disks[f.Device]
+ if exist {
+ if len(disk.Partitions) > 0 {
+ r.AddOnWarn(c.Append("filesystems", i, "device"), errors.ErrPartitionsOverwritten)
+ } else if !util.IsTrue(f.WipeFilesystem) && util.IsTrue(disk.WipeTable) {
+ r.AddOnWarn(c.Append("filesystems", i, "device"), errors.ErrFilesystemImplicitWipe)
+ }
+ }
}
- return
}
diff --git a/vendor/github.com/coreos/ignition/v2/config/v3_2/types/systemd.go b/vendor/github.com/coreos/ignition/v2/config/v3_2/types/systemd.go
new file mode 100644
index 000000000000..ac521ba73f73
--- /dev/null
+++ b/vendor/github.com/coreos/ignition/v2/config/v3_2/types/systemd.go
@@ -0,0 +1,61 @@
+// Copyright 2022 Red Hat, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 types
+
+import (
+ "regexp"
+
+ "github.com/coreos/ignition/v2/config/shared/errors"
+ "github.com/coreos/ignition/v2/config/shared/parse"
+ "github.com/coreos/ignition/v2/config/util"
+
+ vpath "github.com/coreos/vcontext/path"
+ "github.com/coreos/vcontext/report"
+)
+
+func (s Systemd) Validate(c vpath.ContextPath) (r report.Report) {
+ units := make(map[string]Unit)
+ checkInstanceUnit := regexp.MustCompile(`^(.+?)@(.+?)\.service$`)
+ for _, d := range s.Units {
+ units[d.Name] = d
+ }
+ for index, unit := range s.Units {
+ if checkInstanceUnit.MatchString(unit.Name) && util.IsTrue(unit.Enabled) {
+ instUnitSlice := checkInstanceUnit.FindSubmatch([]byte(unit.Name))
+ instantiableUnit := string(instUnitSlice[1]) + "@.service"
+ if _, ok := units[instantiableUnit]; ok && util.NotEmpty(units[instantiableUnit].Contents) {
+ foundInstallSection := false
+ // we're doing a separate validation pass on each unit to identify
+ // if an instantiable unit has the install section. So logging an
+ // `AddOnError` will produce duplicate errors on bad unit contents
+ // because we're already doing that while validating a unit separately.
+ opts, err := parse.ParseUnitContents(units[instantiableUnit].Contents)
+ if err != nil {
+ continue
+ }
+ for _, section := range opts {
+ if section.Section == "Install" {
+ foundInstallSection = true
+ break
+ }
+ }
+ if !foundInstallSection {
+ r.AddOnWarn(c.Append("units", index, "contents"), errors.NewNoInstallSectionForInstantiableUnitError(instantiableUnit, unit.Name))
+ }
+ }
+ }
+ }
+ return
+}
diff --git a/vendor/github.com/coreos/ignition/v2/config/v3_2/types/unit.go b/vendor/github.com/coreos/ignition/v2/config/v3_2/types/unit.go
index bc2d3299c4b4..c5ee1e8e3d81 100644
--- a/vendor/github.com/coreos/ignition/v2/config/v3_2/types/unit.go
+++ b/vendor/github.com/coreos/ignition/v2/config/v3_2/types/unit.go
@@ -15,15 +15,13 @@
package types
import (
- "fmt"
"path"
- "strings"
"github.com/coreos/ignition/v2/config/shared/errors"
+ "github.com/coreos/ignition/v2/config/shared/parse"
"github.com/coreos/ignition/v2/config/shared/validations"
"github.com/coreos/ignition/v2/config/util"
- "github.com/coreos/go-systemd/v22/unit"
cpath "github.com/coreos/vcontext/path"
"github.com/coreos/vcontext/report"
)
@@ -39,7 +37,7 @@ func (d Dropin) Key() string {
func (u Unit) Validate(c cpath.ContextPath) (r report.Report) {
r.AddOnError(c.Append("name"), validateName(u.Name))
c = c.Append("contents")
- opts, err := validateUnitContent(u.Contents)
+ opts, err := parse.ParseUnitContents(u.Contents)
r.AddOnError(c, err)
r.AddOnWarn(c, validations.ValidateInstallSection(u.Name, util.IsTrue(u.Enabled), util.NilOrEmpty(u.Contents), opts))
@@ -57,7 +55,7 @@ func validateName(name string) error {
}
func (d Dropin) Validate(c cpath.ContextPath) (r report.Report) {
- _, err := validateUnitContent(d.Contents)
+ _, err := parse.ParseUnitContents(d.Contents)
r.AddOnError(c.Append("contents"), err)
switch path.Ext(d.Name) {
@@ -68,15 +66,3 @@ func (d Dropin) Validate(c cpath.ContextPath) (r report.Report) {
return
}
-
-func validateUnitContent(content *string) ([]*unit.UnitOption, error) {
- if content == nil {
- return []*unit.UnitOption{}, nil
- }
- c := strings.NewReader(*content)
- opts, err := unit.Deserialize(c)
- if err != nil {
- return nil, fmt.Errorf("invalid unit content: %s", err)
- }
- return opts, nil
-}
diff --git a/vendor/github.com/coreos/ignition/v2/config/validate/validate.go b/vendor/github.com/coreos/ignition/v2/config/validate/validate.go
index 613c21e44636..56ffcd0a76d6 100644
--- a/vendor/github.com/coreos/ignition/v2/config/validate/validate.go
+++ b/vendor/github.com/coreos/ignition/v2/config/validate/validate.go
@@ -83,7 +83,7 @@ func ValidateUnusedKeys(v reflect.Value, c path.ContextPath, root tree.Node) (r
mapNode, ok := node.(tree.MapNode)
if !ok {
// Something is wrong, we won't be able to report unused keys here, so just warn about it and stop trying
- r.AddOnWarn(c, fmt.Errorf("context tree does not match content tree at %s. Line and column reporting may be inconsistent. Unused keys may not be reported.", c.String()))
+ r.AddOnWarn(c, fmt.Errorf("context tree does not match content tree at %s. Line and column reporting may be inconsistent. Unused keys may not be reported", c.String()))
return
}
@@ -94,7 +94,7 @@ func ValidateUnusedKeys(v reflect.Value, c path.ContextPath, root tree.Node) (r
}
for key := range mapNode.Keys {
if _, ok := fieldMap[key]; !ok {
- r.AddOnWarn(c.Append(tree.Key(key)), fmt.Errorf("Unused key %s", key))
+ r.AddOnWarn(c.Append(tree.Key(key)), fmt.Errorf("unused key %s", key))
}
}
return
diff --git a/vendor/github.com/diskfs/go-diskfs/.golangci.yml b/vendor/github.com/diskfs/go-diskfs/.golangci.yml
index 2ec29ec289d3..5434216b2680 100644
--- a/vendor/github.com/diskfs/go-diskfs/.golangci.yml
+++ b/vendor/github.com/diskfs/go-diskfs/.golangci.yml
@@ -21,7 +21,6 @@ linters:
disable-all: true
enable:
- bodyclose
- - depguard
- dogsled
- dupl
- errcheck
@@ -49,9 +48,6 @@ linters:
- unconvert
- unparam
- whitespace
- # - wsl # лишние пустые строки и т.д., чистый стиль
- # - goconst # проверка на наличие переменных, которых следовало бы вынести в const
- # - gomnd # поиск всяких "магических" чисел, переменных
run:
issues-exit-code: 1
diff --git a/vendor/github.com/diskfs/go-diskfs/Makefile b/vendor/github.com/diskfs/go-diskfs/Makefile
index 7aacf67c928d..24bbc2f446a1 100644
--- a/vendor/github.com/diskfs/go-diskfs/Makefile
+++ b/vendor/github.com/diskfs/go-diskfs/Makefile
@@ -6,7 +6,7 @@ GOENV ?= GO111MODULE=on CGO_ENABLED=0
GO_FILES ?= $(shell $(GOENV) go list ./...)
GOBIN ?= $(shell go env GOPATH)/bin
LINTER ?= $(GOBIN)/golangci-lint
-LINTER_VERSION ?= v1.51.2
+LINTER_VERSION ?= v1.55.2
# BUILDARCH is the host architecture
# ARCH is the target architecture
diff --git a/vendor/github.com/diskfs/go-diskfs/README.md b/vendor/github.com/diskfs/go-diskfs/README.md
index aa290f7b7a48..e230077b8235 100644
--- a/vendor/github.com/diskfs/go-diskfs/README.md
+++ b/vendor/github.com/diskfs/go-diskfs/README.md
@@ -85,49 +85,7 @@ Some filesystem types are intended to be created once, after which they are read
### Example
-There are examples in the [examples/](./examples/) directory. Here is one to get you started.
-
-The following example will create a fully bootable EFI disk image. It assumes you have a bootable EFI file (any modern Linux kernel compiled with `CONFIG_EFI_STUB=y` will work) available.
-
-```go
-import diskfs "github.com/diskfs/go-diskfs"
-
-espSize int := 100*1024*1024 // 100 MB
-diskSize int := espSize + 4*1024*1024 // 104 MB
-
-
-// create a disk image
-diskImg := "/tmp/disk.img"
-disk := diskfs.Create(diskImg, diskSize, diskfs.Raw, diskfs.SectorSizeDefault)
-// create a partition table
-blkSize int := 512
-partitionSectors int := espSize / blkSize
-partitionStart int := 2048
-partitionEnd int := partitionSectors - partitionStart + 1
-table := PartitionTable{
- type: partition.GPT,
- partitions:[
- Partition{Start: partitionStart, End: partitionEnd, Type: partition.EFISystemPartition, Name: "EFI System"}
- ]
-}
-// apply the partition table
-err = disk.Partition(table)
-
-
-/*
- * create an ESP partition with some contents
- */
-kernel, err := os.ReadFile("/some/kernel/file")
-
-fs, err := disk.CreateFilesystem(0, diskfs.TypeFat32)
-
-// make our directories
-err = fs.Mkdir("/EFI/BOOT")
-rw, err := fs.OpenFile("/EFI/BOOT/BOOTX64.EFI", os.O_CREATE|os.O_RDRWR)
-
-err = rw.Write(kernel)
-
-```
+There are examples in the [examples/](./examples/) directory. See for example how to [create a fully bootable EFI disk image](./examples/efi_create.go).
## Tests
There are two ways to run tests: unit and integration (somewhat loosely defined).
@@ -151,7 +109,6 @@ cat $PWD/foo.img | docker run -i --rm $INT_IMAGE mdir -i /file.img /abc
Future plans are to add the following:
* embed boot code in `mbr` e.g. `altmbr.bin` (no need for `gpt` since an ESP with `/EFI/BOOT/BOOT.EFI` will boot)
-* `ext4` filesystem
* `Joliet` extensions to `iso9660`
* `Rock Ridge` sparse file support - supports the flag, but not yet reading or writing
* `squashfs` sparse file support - currently treats sparse files as regular files
diff --git a/vendor/github.com/diskfs/go-diskfs/disk/disk.go b/vendor/github.com/diskfs/go-diskfs/disk/disk.go
index 08c7dfe11fa3..796565b864b9 100644
--- a/vendor/github.com/diskfs/go-diskfs/disk/disk.go
+++ b/vendor/github.com/diskfs/go-diskfs/disk/disk.go
@@ -13,6 +13,7 @@ import (
log "github.com/sirupsen/logrus"
"github.com/diskfs/go-diskfs/filesystem"
+ "github.com/diskfs/go-diskfs/filesystem/ext4"
"github.com/diskfs/go-diskfs/filesystem/fat32"
"github.com/diskfs/go-diskfs/filesystem/iso9660"
"github.com/diskfs/go-diskfs/filesystem/squashfs"
@@ -185,6 +186,8 @@ func (d *Disk) CreateFilesystem(spec FilesystemSpec) (filesystem.FileSystem, err
return fat32.Create(d.File, size, start, d.LogicalBlocksize, spec.VolumeLabel)
case filesystem.TypeISO9660:
return iso9660.Create(d.File, size, start, d.LogicalBlocksize, spec.WorkDir)
+ case filesystem.TypeExt4:
+ return ext4.Create(d.File, size, start, d.LogicalBlocksize, nil)
case filesystem.TypeSquashfs:
return nil, errors.New("squashfs is a read-only filesystem")
default:
@@ -244,5 +247,20 @@ func (d *Disk) GetFilesystem(part int) (filesystem.FileSystem, error) {
if err == nil {
return squashFS, nil
}
+ log.Debug("trying ext4")
+ ext4FS, err := ext4.Read(d.File, size, start, d.LogicalBlocksize)
+ if err == nil {
+ return ext4FS, nil
+ }
+ log.Debugf("ext4 failed: %v", err)
return nil, fmt.Errorf("unknown filesystem on partition %d", part)
}
+
+// Close the disk. Once successfully closed, it can no longer be used.
+func (d *Disk) Close() error {
+ if err := d.File.Close(); err != nil {
+ return err
+ }
+ *d = Disk{}
+ return nil
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/disk/disk_wasip1.go b/vendor/github.com/diskfs/go-diskfs/disk/disk_wasip1.go
new file mode 100644
index 000000000000..6a290d1999a5
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/disk/disk_wasip1.go
@@ -0,0 +1,10 @@
+//go:build wasip1
+// +build wasip1
+
+package disk
+
+import "errors"
+
+func (d *Disk) ReReadPartitionTable() error {
+ return errors.New("not implemented")
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/diskfs.go b/vendor/github.com/diskfs/go-diskfs/diskfs.go
index f2e39cf2c9e0..f0952a096500 100644
--- a/vendor/github.com/diskfs/go-diskfs/diskfs.go
+++ b/vendor/github.com/diskfs/go-diskfs/diskfs.go
@@ -335,7 +335,7 @@ func Open(device string, opts ...OpenOpt) (*disk.Disk, error) {
// Create a Disk from a path to a device
// Should pass a path to a block device e.g. /dev/sda or a path to a file /tmp/foo.img
// The provided device must not exist at the time you call Create()
-func Create(device string, size int64, format Format, sectorSize SectorSize) (*disk.Disk, error) {
+func Create(device string, size int64, _ Format, sectorSize SectorSize) (*disk.Disk, error) {
if device == "" {
return nil, errors.New("must pass device name")
}
@@ -344,11 +344,11 @@ func Create(device string, size int64, format Format, sectorSize SectorSize) (*d
}
f, err := os.OpenFile(device, os.O_RDWR|os.O_EXCL|os.O_CREATE, 0o666)
if err != nil {
- return nil, fmt.Errorf("could not create device %s: %v", device, errors.Unwrap(err))
+ return nil, fmt.Errorf("could not create device %s: %w", device, err)
}
err = os.Truncate(device, size)
if err != nil {
- return nil, fmt.Errorf("could not expand device %s to size %d: %v", device, size, errors.Unwrap(err))
+ return nil, fmt.Errorf("could not expand device %s to size %d: %w", device, size, err)
}
// return our disk
return initDisk(f, ReadWriteExclusive, sectorSize)
diff --git a/vendor/github.com/diskfs/go-diskfs/diskfs_other.go b/vendor/github.com/diskfs/go-diskfs/diskfs_other.go
index 95f1f487f9f1..16208aea9cc5 100644
--- a/vendor/github.com/diskfs/go-diskfs/diskfs_other.go
+++ b/vendor/github.com/diskfs/go-diskfs/diskfs_other.go
@@ -8,11 +8,11 @@ import (
)
// getBlockDeviceSize get the size of an opened block device in Bytes.
-func getBlockDeviceSize(f *os.File) (int64, error) {
+func getBlockDeviceSize(_ *os.File) (int64, error) {
return 0, errors.New("block devices not supported on this platform")
}
// getSectorSizes get the logical and physical sector sizes for a block device
-func getSectorSizes(f *os.File) (logicalSectorSize, physicalSectorSize int64, err error) {
+func getSectorSizes(_ *os.File) (logicalSectorSize, physicalSectorSize int64, err error) {
return 0, 0, errors.New("block devices not supported on this platform")
}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/blockgroup.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/blockgroup.go
new file mode 100644
index 000000000000..bf3b426d9af5
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/blockgroup.go
@@ -0,0 +1,55 @@
+package ext4
+
+import (
+ "fmt"
+
+ "github.com/diskfs/go-diskfs/util"
+)
+
+// blockGroup is a structure holding the data about a single block group
+//
+//nolint:unused // will be used in the future, not yet
+type blockGroup struct {
+ inodeBitmap *util.Bitmap
+ blockBitmap *util.Bitmap
+ blockSize int
+ number int
+ inodeTableSize int
+ firstDataBlock int
+}
+
+// blockGroupFromBytes create a blockGroup struct from bytes
+// it does not load the inode table or data blocks into memory, rather holding pointers to where they are
+//
+//nolint:unused // will be used in the future, not yet
+func blockGroupFromBytes(b []byte, blockSize, groupNumber int) (*blockGroup, error) {
+ expectedSize := 2 * blockSize
+ actualSize := len(b)
+ if actualSize != expectedSize {
+ return nil, fmt.Errorf("expected to be passed %d bytes for 2 blocks of size %d, instead received %d", expectedSize, blockSize, actualSize)
+ }
+ inodeBitmap := util.BitmapFromBytes(b[0:blockSize])
+ blockBitmap := util.BitmapFromBytes(b[blockSize : 2*blockSize])
+
+ bg := blockGroup{
+ inodeBitmap: inodeBitmap,
+ blockBitmap: blockBitmap,
+ number: groupNumber,
+ blockSize: blockSize,
+ }
+ return &bg, nil
+}
+
+// toBytes returns bitmaps ready to be written to disk
+//
+//nolint:unused // will be used in the future, not yet
+func (bg *blockGroup) toBytes() ([]byte, error) {
+ b := make([]byte, 2*bg.blockSize)
+ inodeBitmapBytes := bg.inodeBitmap.ToBytes()
+ blockBitmapBytes := bg.blockBitmap.ToBytes()
+
+ b = append(b, inodeBitmapBytes...)
+ b = append(b, blockBitmapBytes...)
+
+ return b, nil
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/checksum.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/checksum.go
new file mode 100644
index 000000000000..d7ffea437495
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/checksum.go
@@ -0,0 +1,50 @@
+package ext4
+
+import (
+ "encoding/binary"
+
+ "github.com/diskfs/go-diskfs/filesystem/ext4/crc"
+)
+
+// checksumAppender is a function that takes a byte slice and returns a byte slice with a checksum appended
+type checksumAppender func([]byte) []byte
+type checksummer func([]byte) uint32
+
+// directoryChecksummer returns a function that implements checksumAppender for a directory entries block
+// original calculations can be seen for e2fsprogs https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/tree/lib/ext2fs/csum.c#n301
+// and in the linux tree https://github.com/torvalds/linux/blob/master/fs/ext4/namei.c#L376-L384
+func directoryChecksummer(seed, inodeNumber, inodeGeneration uint32) checksummer {
+ numBytes := make([]byte, 4)
+ binary.LittleEndian.PutUint32(numBytes, inodeNumber)
+ crcResult := crc.CRC32c(seed, numBytes)
+ genBytes := make([]byte, 4)
+ binary.LittleEndian.PutUint32(genBytes, inodeGeneration)
+ crcResult = crc.CRC32c(crcResult, genBytes)
+ return func(b []byte) uint32 {
+ checksum := crc.CRC32c(crcResult, b)
+ return checksum
+ }
+}
+
+// directoryChecksumAppender returns a function that implements checksumAppender for a directory entries block
+// original calculations can be seen for e2fsprogs https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/tree/lib/ext2fs/csum.c#n301
+// and in the linux tree https://github.com/torvalds/linux/blob/master/fs/ext4/namei.c#L376-L384
+//
+//nolint:unparam // inodeGeneration is always 0
+func directoryChecksumAppender(seed, inodeNumber, inodeGeneration uint32) checksumAppender {
+ fn := directoryChecksummer(seed, inodeNumber, inodeGeneration)
+ return func(b []byte) []byte {
+ checksum := fn(b)
+ checksumBytes := make([]byte, 12)
+ checksumBytes[4] = 12
+ checksumBytes[7] = 0xde
+ binary.LittleEndian.PutUint32(checksumBytes[8:12], checksum)
+ b = append(b, checksumBytes...)
+ return b
+ }
+}
+
+// nullDirectoryChecksummer does not change anything
+func nullDirectoryChecksummer(b []byte) []byte {
+ return b
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/consts.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/consts.go
new file mode 100644
index 000000000000..2295aa08264d
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/consts.go
@@ -0,0 +1,5 @@
+package ext4
+
+const (
+ maxUint16 uint64 = 1<<16 - 1
+)
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/crc/crc16.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/crc/crc16.go
new file mode 100644
index 000000000000..b8c37882fa98
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/crc/crc16.go
@@ -0,0 +1,44 @@
+package crc
+
+var crc16tab = [256]uint16{
+ 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
+ 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
+ 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
+ 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de,
+ 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485,
+ 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,
+ 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4,
+ 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc,
+ 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823,
+ 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b,
+ 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12,
+ 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a,
+ 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41,
+ 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49,
+ 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70,
+ 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78,
+ 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f,
+ 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067,
+ 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e,
+ 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256,
+ 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d,
+ 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
+ 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c,
+ 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634,
+ 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab,
+ 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3,
+ 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a,
+ 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92,
+ 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9,
+ 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,
+ 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8,
+ 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0}
+
+func CRC16(crc uint16, bs []byte) uint16 {
+ l := len(bs)
+ for i := 0; i < l; i++ {
+ crc = ((crc << 8) & 0xff00) ^ crc16tab[((crc>>8)&0xff)^uint16(bs[i])]
+ }
+
+ return crc
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/crc/crc32.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/crc/crc32.go
new file mode 100644
index 000000000000..70b44b0e33e2
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/crc/crc32.go
@@ -0,0 +1,74 @@
+package crc
+
+import (
+ "encoding/binary"
+ "hash/crc32"
+)
+
+// Define the CRC32C table using the Castagnoli polynomial
+var (
+ crc32cTable = crc32.MakeTable(crc32.Castagnoli)
+ crc32cTables = generateTables(crc32cTable)
+)
+
+func generateTables(poly *crc32.Table) [8][256]uint32 {
+ var tab [8][256]uint32
+ tab[0] = *poly
+
+ for i := 0; i < 256; i++ {
+ crc := tab[0][i]
+ for j := 1; j < 8; j++ {
+ crc = (crc >> 8) ^ tab[0][crc&0xff]
+ tab[j][i] = crc
+ }
+ }
+
+ return tab
+}
+
+func CRC32c(base uint32, b []byte) uint32 {
+ // Compute the CRC32C checksum
+ // for reasons unknown, the checksum from go package hash/crc32, using crc32.Update(), is different from the one calculated by the kernel
+ // so we use this
+ return crc32Body(base, b, &crc32cTables)
+}
+
+// doCRC processes a single byte
+func doCRC(crc uint32, x byte, tab *[256]uint32) uint32 {
+ return tab[(crc^uint32(x))&0xff] ^ (crc >> 8)
+}
+
+// doCRC4 processes 4 bytes
+func doCRC4(q uint32, tab *[8][256]uint32) uint32 {
+ return tab[3][q&0xff] ^ tab[2][(q>>8)&0xff] ^ tab[1][(q>>16)&0xff] ^ tab[0][(q>>24)&0xff]
+}
+
+// doCRC8 processes 8 bytes
+func doCRC8(q uint32, tab *[8][256]uint32) uint32 {
+ return tab[7][q&0xff] ^ tab[6][(q>>8)&0xff] ^ tab[5][(q>>16)&0xff] ^ tab[4][(q>>24)&0xff]
+}
+
+func crc32Body(crc uint32, buf []byte, tab *[8][256]uint32) uint32 {
+ // Align it
+ for len(buf) > 0 && (uintptr(len(buf))&3) != 0 {
+ crc = doCRC(crc, buf[0], &tab[0])
+ buf = buf[1:]
+ }
+
+ // Process in chunks of 8 bytes
+ remLen := len(buf) % 8
+ for len(buf) >= 8 {
+ q := crc ^ binary.LittleEndian.Uint32(buf[:4])
+ crc = doCRC8(q, tab)
+ q = binary.LittleEndian.Uint32(buf[4:8])
+ crc ^= doCRC4(q, tab)
+ buf = buf[8:]
+ }
+
+ // Process remaining bytes
+ for _, b := range buf[:remLen] {
+ crc = doCRC(crc, b, &tab[0])
+ }
+
+ return crc
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/directory.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/directory.go
new file mode 100644
index 000000000000..24535f0297db
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/directory.go
@@ -0,0 +1,211 @@
+package ext4
+
+import (
+ "bytes"
+ "encoding/binary"
+ "fmt"
+)
+
+const (
+ directoryHashTreeRootMinSize = 0x28
+ directoryHashTreeNodeMinSize = 0x12
+)
+
+// Directory represents a single directory in an ext4 filesystem
+type Directory struct {
+ directoryEntry
+ root bool
+ entries []*directoryEntry
+}
+
+// toBytes convert our entries to raw bytes. Provides checksum as well. Final returned byte slice will be a multiple of bytesPerBlock.
+func (d *Directory) toBytes(bytesPerBlock uint32, checksumFunc checksumAppender) []byte {
+ b := make([]byte, 0)
+ var (
+ previousLength int
+ previousEntry *directoryEntry
+ lastEntryCount int
+ block []byte
+ )
+ if len(d.entries) == 0 {
+ return b
+ }
+ lastEntryCount = len(d.entries) - 1
+ for i, de := range d.entries {
+ b2 := de.toBytes(0)
+ switch {
+ case len(block)+len(b2) > int(bytesPerBlock)-minDirEntryLength:
+ // if adding this one will go past the end of the block, pad out the previous
+ block = block[:len(block)-previousLength]
+ previousB := previousEntry.toBytes(uint16(int(bytesPerBlock) - len(block) - minDirEntryLength))
+ block = append(block, previousB...)
+ // add the checksum
+ block = checksumFunc(block)
+ b = append(b, block...)
+ // start a new block
+ block = make([]byte, 0)
+ case i == lastEntryCount:
+ // if this is the last one, pad it out
+ b2 = de.toBytes(uint16(int(bytesPerBlock) - len(block) - minDirEntryLength))
+ block = append(block, b2...)
+ // add the checksum
+ block = checksumFunc(block)
+ b = append(b, block...)
+ // start a new block
+ block = make([]byte, 0)
+ default:
+ block = append(block, b2...)
+ }
+ previousLength = len(b2)
+ previousEntry = de
+ }
+ remainder := len(b) % int(bytesPerBlock)
+ if remainder > 0 {
+ extra := int(bytesPerBlock) - remainder
+ zeroes := make([]byte, extra)
+ b = append(b, zeroes...)
+ }
+ return b
+}
+
+type directoryHashEntry struct {
+ hash uint32
+ block uint32
+}
+
+type dxNode interface {
+ entries() []directoryHashEntry
+}
+
+type directoryHashNode struct {
+ childEntries []directoryHashEntry
+}
+
+func (d *directoryHashNode) entries() []directoryHashEntry {
+ return d.childEntries
+}
+
+type directoryHashRoot struct {
+ inodeDir uint32
+ inodeParent uint32
+ hashVersion hashVersion
+ depth uint8
+ hashAlgorithm hashAlgorithm
+ childEntries []directoryHashEntry
+ dotEntry *directoryEntry
+ dotDotEntry *directoryEntry
+}
+
+func (d *directoryHashRoot) entries() []directoryHashEntry {
+ return d.childEntries
+}
+
+// parseDirectoryTreeRoot parses the directory hash tree root from the given byte slice. Reads only the root node.
+func parseDirectoryTreeRoot(b []byte, largeDir bool) (node *directoryHashRoot, err error) {
+ // min size
+ if len(b) < directoryHashTreeRootMinSize {
+ return nil, fmt.Errorf("directory hash tree root is too small")
+ }
+
+ // dot parameters
+ dotInode := binary.LittleEndian.Uint32(b[0x0:0x4])
+ dotSize := binary.LittleEndian.Uint16(b[0x4:0x6])
+ if dotSize != 12 {
+ return nil, fmt.Errorf("directory hash tree root dot size is %d and not 12", dotSize)
+ }
+ dotNameSize := b[0x6]
+ if dotNameSize != 1 {
+ return nil, fmt.Errorf("directory hash tree root dot name length is %d and not 1", dotNameSize)
+ }
+ dotFileType := directoryFileType(b[0x7])
+ if dotFileType != dirFileTypeDirectory {
+ return nil, fmt.Errorf("directory hash tree root dot file type is %d and not %v", dotFileType, dirFileTypeDirectory)
+ }
+ dotName := b[0x8:0xc]
+ if !bytes.Equal(dotName, []byte{'.', 0, 0, 0}) {
+ return nil, fmt.Errorf("directory hash tree root dot name is %s and not '.'", dotName)
+ }
+
+ // dotdot parameters
+ dotdotInode := binary.LittleEndian.Uint32(b[0xc:0x10])
+ dotdotNameSize := b[0x12]
+ if dotdotNameSize != 2 {
+ return nil, fmt.Errorf("directory hash tree root dotdot name length is %d and not 2", dotdotNameSize)
+ }
+ dotdotFileType := directoryFileType(b[0x13])
+ if dotdotFileType != dirFileTypeDirectory {
+ return nil, fmt.Errorf("directory hash tree root dotdot file type is %d and not %v", dotdotFileType, dirFileTypeDirectory)
+ }
+ dotdotName := b[0x14:0x18]
+ if !bytes.Equal(dotdotName, []byte{'.', '.', 0, 0}) {
+ return nil, fmt.Errorf("directory hash tree root dotdot name is %s and not '..'", dotdotName)
+ }
+
+ treeInformation := b[0x1d]
+ if treeInformation != 8 {
+ return nil, fmt.Errorf("directory hash tree root tree information is %d and not 8", treeInformation)
+ }
+ treeDepth := b[0x1e]
+ // there are maximums for this
+ maxTreeDepth := uint8(2)
+ if largeDir {
+ maxTreeDepth = 3
+ }
+ if treeDepth > maxTreeDepth {
+ return nil, fmt.Errorf("directory hash tree root tree depth is %d and not between 0 and %d", treeDepth, maxTreeDepth)
+ }
+
+ dxEntriesCount := binary.LittleEndian.Uint16(b[0x22:0x24])
+
+ node = &directoryHashRoot{
+ inodeDir: binary.LittleEndian.Uint32(b[0x0:0x4]),
+ inodeParent: binary.LittleEndian.Uint32(b[0xC:0x10]),
+ hashAlgorithm: hashAlgorithm(b[0x1c]), // what hashing algorithm is used?
+ depth: treeDepth,
+ childEntries: make([]directoryHashEntry, 0, int(dxEntriesCount)),
+ dotEntry: &directoryEntry{
+ inode: dotInode,
+ fileType: dotFileType,
+ filename: ".",
+ },
+ dotDotEntry: &directoryEntry{
+ inode: dotdotInode,
+ fileType: dotdotFileType,
+ filename: "..",
+ },
+ }
+
+ // remove 1, because the count includes the one in the dx_root itself
+ node.childEntries = append(node.childEntries, directoryHashEntry{hash: 0, block: binary.LittleEndian.Uint32(b[0x24:0x28])})
+ for i := 0; i < int(dxEntriesCount)-1; i++ {
+ entryOffset := 0x28 + (i * 8)
+ hash := binary.LittleEndian.Uint32(b[entryOffset : entryOffset+4])
+ block := binary.LittleEndian.Uint32(b[entryOffset+4 : entryOffset+8])
+ node.childEntries = append(node.childEntries, directoryHashEntry{hash: hash, block: block})
+ }
+
+ return node, nil
+}
+
+// parseDirectoryTreeNode parses an internal directory hash tree node from the given byte slice. Reads only the node.
+func parseDirectoryTreeNode(b []byte) (node *directoryHashNode, err error) {
+ // min size
+ if len(b) < directoryHashTreeNodeMinSize {
+ return nil, fmt.Errorf("directory hash tree root is too small")
+ }
+
+ dxEntriesCount := binary.LittleEndian.Uint16(b[0xa:0xc])
+
+ node = &directoryHashNode{
+ childEntries: make([]directoryHashEntry, 0, int(dxEntriesCount)),
+ }
+ node.childEntries = append(node.childEntries, directoryHashEntry{hash: 0, block: binary.LittleEndian.Uint32(b[0xc:0x10])})
+ for i := 0; i < int(dxEntriesCount)-1; i++ {
+ entryOffset := 0x10 + (i * 8)
+ hash := binary.LittleEndian.Uint32(b[entryOffset : entryOffset+4])
+ block := binary.LittleEndian.Uint32(b[entryOffset+4 : entryOffset+8])
+ node.childEntries = append(node.childEntries, directoryHashEntry{hash: hash, block: block})
+ }
+
+ return node, nil
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/directoryentry.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/directoryentry.go
new file mode 100644
index 000000000000..295469348e2f
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/directoryentry.go
@@ -0,0 +1,176 @@
+package ext4
+
+import (
+ "encoding/binary"
+ "fmt"
+)
+
+// directoryFileType uses different constants than the file type property in the inode
+type directoryFileType uint8
+
+const (
+ minDirEntryLength int = 12 // actually 9 for 1-byte file length, but must be multiple of 4 bytes
+ maxDirEntryLength int = 263
+
+ // directory file types
+ dirFileTypeUnknown directoryFileType = 0x0
+ dirFileTypeRegular directoryFileType = 0x1
+ dirFileTypeDirectory directoryFileType = 0x2
+ dirFileTypeCharacter directoryFileType = 0x3
+ dirFileTypeBlock directoryFileType = 0x4
+ dirFileTypeFifo directoryFileType = 0x5
+ dirFileTypeSocket directoryFileType = 0x6
+ dirFileTypeSymlink directoryFileType = 0x7
+)
+
+// directoryEntry is a single directory entry
+type directoryEntry struct {
+ inode uint32
+ filename string
+ fileType directoryFileType
+}
+
+func (de *directoryEntry) equal(other *directoryEntry) bool {
+ return de.inode == other.inode && de.filename == other.filename && de.fileType == other.fileType
+}
+
+func directoryEntryFromBytes(b []byte) (*directoryEntry, error) {
+ if len(b) < minDirEntryLength {
+ return nil, fmt.Errorf("directory entry of length %d is less than minimum %d", len(b), minDirEntryLength)
+ }
+ if len(b) > maxDirEntryLength {
+ b = b[:maxDirEntryLength]
+ }
+
+ //nolint:gocritic // keep this here for future reference
+ // length := binary.LittleEndian.Uint16(b[0x4:0x6])
+ nameLength := b[0x6]
+ name := b[0x8 : 0x8+nameLength]
+ de := directoryEntry{
+ inode: binary.LittleEndian.Uint32(b[0x0:0x4]),
+ fileType: directoryFileType(b[0x7]),
+ filename: string(name),
+ }
+ return &de, nil
+}
+
+func directoryEntriesChecksumFromBytes(b []byte) (checksum uint32, err error) {
+ if len(b) != minDirEntryLength {
+ return checksum, fmt.Errorf("directory entry checksum of length %d is not required %d", len(b), minDirEntryLength)
+ }
+ inode := binary.LittleEndian.Uint32(b[0x0:0x4])
+ if inode != 0 {
+ return checksum, fmt.Errorf("directory entry checksum inode is not 0")
+ }
+ length := binary.LittleEndian.Uint16(b[0x4:0x6])
+ if int(length) != minDirEntryLength {
+ return checksum, fmt.Errorf("directory entry checksum length is not %d", minDirEntryLength)
+ }
+ nameLength := b[0x6]
+ if nameLength != 0 {
+ return checksum, fmt.Errorf("directory entry checksum name length is not 0")
+ }
+ fileType := b[0x7]
+ if fileType != 0xde {
+ return checksum, fmt.Errorf("directory entry checksum file type is not set to reserved 0xde")
+ }
+ return binary.LittleEndian.Uint32(b[0x8:0xc]), nil
+}
+
+// toBytes convert a directoryEntry to bytes. If isLast, then the size recorded is the number of bytes
+// from beginning of directory entry to end of block, minus the amount left for the checksum.
+func (de *directoryEntry) toBytes(withSize uint16) []byte {
+ // it must be the header length + filename length rounded up to nearest multiple of 4
+ nameLength := uint8(len(de.filename))
+ entryLength := uint16(nameLength) + 8
+ if leftover := entryLength % 4; leftover > 0 {
+ entryLength += (4 - leftover)
+ }
+
+ if withSize > 0 {
+ entryLength = withSize
+ }
+ b := make([]byte, entryLength)
+ binary.LittleEndian.PutUint32(b[0x0:0x4], de.inode)
+ binary.LittleEndian.PutUint16(b[0x4:0x6], entryLength)
+ b[0x6] = nameLength
+ b[0x7] = byte(de.fileType)
+ copy(b[0x8:], de.filename)
+
+ return b
+}
+
+func parseDirEntriesLinear(b []byte, withChecksums bool, blocksize, inodeNumber, inodeGeneration, checksumSeed uint32) ([]*directoryEntry, error) {
+ // checksum if needed
+ if withChecksums {
+ var (
+ newb []byte
+ checksumEntryOffset = int(blocksize) - minDirEntryLength
+ checksumOffset = int(blocksize) - 4
+ )
+ checksummer := directoryChecksummer(checksumSeed, inodeNumber, inodeGeneration)
+ for i := 0; i < len(b); i += int(blocksize) {
+ block := b[i : i+int(blocksize)]
+ inBlockChecksum := block[checksumOffset:]
+ block = block[:checksumEntryOffset]
+ // save everything except the checksum
+ newb = append(newb, block...)
+ // checksum the entire block
+ checksumValue := binary.LittleEndian.Uint32(inBlockChecksum)
+ // checksum the block
+ actualChecksum := checksummer(block)
+ if actualChecksum != checksumValue {
+ return nil, fmt.Errorf("directory block checksum mismatch: expected %x, got %x", checksumValue, actualChecksum)
+ }
+ }
+ b = newb
+ }
+
+ // convert into directory entries
+ entries := make([]*directoryEntry, 0, 4)
+ count := 0
+ for i := 0; i < len(b); count++ {
+ // read the length of the entry
+ length := binary.LittleEndian.Uint16(b[i+0x4 : i+0x6])
+ de, err := directoryEntryFromBytes(b[i : i+int(length)])
+ if err != nil {
+ return nil, fmt.Errorf("failed to parse directory entry %d: %v", count, err)
+ }
+ entries = append(entries, de)
+ i += int(length)
+ }
+ return entries, nil
+}
+
+// parseDirEntriesHashed parse hashed data blocks to get directory entries.
+// If hashedName is 0, returns all directory entries; otherwise, returns a slice with a single entry with the given name.
+func parseDirEntriesHashed(b []byte, depth uint8, node dxNode, blocksize uint32, withChecksums bool, inodeNumber, inodeGeneration, checksumSeed uint32) (dirEntries []*directoryEntry, err error) {
+ for _, entry := range node.entries() {
+ var (
+ addDirEntries []*directoryEntry
+ start = entry.block * blocksize
+ end = start + blocksize
+ )
+
+ nextBlock := b[start:end]
+ if depth == 0 {
+ addDirEntries, err = parseDirEntriesLinear(nextBlock, withChecksums, blocksize, inodeNumber, inodeGeneration, checksumSeed)
+ if err != nil {
+ return nil, fmt.Errorf("error parsing linear directory entries: %w", err)
+ }
+ } else {
+ // recursively parse the next level of the tree
+ // read the next level down
+ node, err := parseDirectoryTreeNode(nextBlock)
+ if err != nil {
+ return nil, fmt.Errorf("error parsing directory tree node: %w", err)
+ }
+ addDirEntries, err = parseDirEntriesHashed(b, depth-1, node, blocksize, withChecksums, inodeNumber, inodeGeneration, checksumSeed)
+ if err != nil {
+ return nil, fmt.Errorf("error parsing hashed directory entries: %w", err)
+ }
+ }
+ dirEntries = append(dirEntries, addDirEntries...)
+ }
+ return dirEntries, nil
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/dirhash.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/dirhash.go
new file mode 100644
index 000000000000..8717c34136ef
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/dirhash.go
@@ -0,0 +1,157 @@
+package ext4
+
+import (
+ "github.com/diskfs/go-diskfs/filesystem/ext4/md4"
+)
+
+const (
+ teaDelta uint32 = 0x9E3779B9
+ k1 uint32 = 0
+ k2 uint32 = 0o13240474631
+ k3 uint32 = 0o15666365641
+ ext4HtreeEOF32 uint32 = ((1 << (32 - 1)) - 1)
+ ext4HtreeEOF64 uint64 = ((1 << (64 - 1)) - 1)
+)
+
+type hashVersion uint8
+
+const (
+ HashVersionLegacy = 0
+ HashVersionHalfMD4 = 1
+ HashVersionTEA = 2
+ HashVersionLegacyUnsigned = 3
+ HashVersionHalfMD4Unsigned = 4
+ HashVersionTEAUnsigned = 5
+ HashVersionSIP = 6
+)
+
+func TEATransform(buf [4]uint32, in []uint32) [4]uint32 {
+ var sum uint32
+ var b0, b1 = buf[0], buf[1]
+ var a, b, c, d = in[0], in[1], in[2], in[3]
+ var n = 16
+
+ for ; n > 0; n-- {
+ sum += teaDelta
+ b0 += ((b1 << 4) + a) ^ (b1 + sum) ^ ((b1 >> 5) + b)
+ b1 += ((b0 << 4) + c) ^ (b0 + sum) ^ ((b0 >> 5) + d)
+ }
+
+ buf[0] += b0
+ buf[1] += b1
+ return buf
+}
+
+// the old legacy hash
+//
+//nolint:unparam,revive // we do not used signed, but we probably should, so leaving until we are sure
+func dxHackHash(name string, signed bool) uint32 {
+ var hash uint32
+ var hash0, hash1 uint32 = 0x12a3fe2d, 0x37abe8f9
+ b := []byte(name)
+
+ for i := len(b); i > 0; i-- {
+ // get the specific character
+ c := int(b[i-1])
+ // the value of the individual character depends on if it is signed or not
+ hash = hash1 + (hash0 ^ uint32(c*7152373))
+
+ if hash&0x80000000 != 0 {
+ hash -= 0x7fffffff
+ }
+ hash1 = hash0
+ hash0 = hash
+ }
+ return hash0 << 1
+}
+
+//nolint:unparam,revive // we do not used signed, but we probably should, so leaving until we are sure
+func str2hashbuf(msg string, num int, signed bool) []uint32 {
+ var buf [8]uint32
+ var pad, val uint32
+ b := []byte(msg)
+ size := len(b)
+
+ pad = uint32(size) | (uint32(size) << 8)
+ pad |= pad << 16
+
+ val = pad
+ if size > num*4 {
+ size = num * 4
+ }
+ var j int
+ for i := 0; i < size; i++ {
+ c := int(b[i])
+ val = uint32(c) + (val << 8)
+ if (i % 4) == 3 {
+ buf[j] = val
+ val = pad
+ num--
+ j++
+ }
+ }
+ num--
+ if num >= 0 {
+ buf[j] = val
+ j++
+ }
+ for num--; num >= 0; num-- {
+ buf[j] = pad
+ j++
+ }
+ return buf[:]
+}
+
+func ext4fsDirhash(name string, version hashVersion, seed []uint32) (hash, minorHash uint32) {
+ /* Initialize the default seed for the hash checksum functions */
+ var buf = [4]uint32{0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476}
+
+ // Check to see if the seed is all zero, and if so, use the default
+ for i, val := range seed {
+ if val != 0 {
+ buf[i] = val
+ }
+ }
+
+ switch version {
+ case HashVersionLegacyUnsigned:
+ hash = dxHackHash(name, false)
+ case HashVersionLegacy:
+ hash = dxHackHash(name, true)
+ case HashVersionHalfMD4Unsigned:
+ for i := 0; i < len(name); i += 32 {
+ in := str2hashbuf(name[i:], 8, false)
+ buf[1] = md4.HalfMD4Transform(buf, in)
+ }
+ minorHash = buf[2]
+ hash = buf[1]
+ case HashVersionHalfMD4:
+ for i := 0; i < len(name); i += 32 {
+ in := str2hashbuf(name[i:], 8, true)
+ buf[1] = md4.HalfMD4Transform(buf, in)
+ }
+ minorHash = buf[2]
+ hash = buf[1]
+ case HashVersionTEAUnsigned:
+ for i := 0; i < len(name); i += 16 {
+ in := str2hashbuf(name[i:], 4, false)
+ buf = TEATransform(buf, in)
+ }
+ hash = buf[0]
+ minorHash = buf[1]
+ case HashVersionTEA:
+ for i := 0; i < len(name); i += 16 {
+ in := str2hashbuf(name[i:], 4, true)
+ buf = TEATransform(buf, in)
+ }
+ hash = buf[0]
+ minorHash = buf[1]
+ default:
+ return 0, 0
+ }
+ hash &= ^uint32(1)
+ if hash == (ext4HtreeEOF32 << 1) {
+ hash = (ext4HtreeEOF32 - 1) << 1
+ }
+ return hash, minorHash
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/ext4.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/ext4.go
new file mode 100644
index 000000000000..b322dd7356d9
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/ext4.go
@@ -0,0 +1,1748 @@
+package ext4
+
+import (
+ "encoding/binary"
+ "errors"
+ "fmt"
+ "io"
+ iofs "io/fs"
+ "math"
+ "os"
+ "path"
+ "sort"
+ "strings"
+ "time"
+
+ "github.com/diskfs/go-diskfs/filesystem"
+ "github.com/diskfs/go-diskfs/filesystem/ext4/crc"
+ "github.com/diskfs/go-diskfs/util"
+ "github.com/google/uuid"
+)
+
+// SectorSize indicates what the sector size in bytes is
+type SectorSize uint16
+
+// BlockSize indicates how many sectors are in a block
+type BlockSize uint8
+
+// BlockGroupSize indicates how many blocks are in a group, standardly 8*block_size_in_bytes
+
+const (
+ // SectorSize512 is a sector size of 512 bytes, used as the logical size for all ext4 filesystems
+ SectorSize512 SectorSize = 512
+ minBlocksPerGroup uint32 = 256
+ BootSectorSize SectorSize = 2 * SectorSize512
+ SuperblockSize SectorSize = 2 * SectorSize512
+ BlockGroupFactor int = 8
+ DefaultInodeRatio int64 = 8192
+ DefaultInodeSize int64 = 256
+ DefaultReservedBlocksPercent uint8 = 5
+ DefaultVolumeName = "diskfs_ext4"
+ minClusterSize int = 128
+ maxClusterSize int = 65529
+ bytesPerSlot int = 32
+ maxCharsLongFilename int = 13
+ maxBlocksPerExtent uint16 = 32768
+ million int = 1000000
+ billion int = 1000 * million
+ firstNonReservedInode uint32 = 11 // traditional
+
+ minBlockLogSize int = 10 /* 1024 */
+ maxBlockLogSize int = 16 /* 65536 */
+ minBlockSize int = (1 << minBlockLogSize)
+ maxBlockSize int = (1 << maxBlockLogSize)
+
+ max32Num uint64 = math.MaxUint32
+ max64Num uint64 = math.MaxUint64
+
+ maxFilesystemSize32Bit uint64 = 16*2 ^ 40
+ maxFilesystemSize64Bit uint64 = 1*2 ^ 60
+
+ checksumType uint8 = 1
+
+ // default for log groups per flex group
+ defaultLogGroupsPerFlex int = 3
+
+ // fixed inodes
+ rootInode uint32 = 2
+ userQuotaInode uint32 = 3
+ groupQuotaInode uint32 = 4
+ journalInode uint32 = 8
+ lostFoundInode = 11 // traditional
+)
+
+type Params struct {
+ UUID *uuid.UUID
+ SectorsPerBlock uint8
+ BlocksPerGroup uint32
+ InodeRatio int64
+ InodeCount uint32
+ SparseSuperVersion uint8
+ Checksum bool
+ ClusterSize int64
+ ReservedBlocksPercent uint8
+ VolumeName string
+ // JournalDevice external journal device, only checked if WithFeatureSeparateJournalDevice(true) is set
+ JournalDevice string
+ LogFlexBlockGroups int
+ Features []FeatureOpt
+ DefaultMountOpts []MountOpt
+}
+
+// FileSystem implememnts the FileSystem interface
+type FileSystem struct {
+ bootSector []byte
+ superblock *superblock
+ groupDescriptors *groupDescriptors
+ blockGroups int64
+ size int64
+ start int64
+ file util.File
+}
+
+// Equal compare if two filesystems are equal
+func (fs *FileSystem) Equal(a *FileSystem) bool {
+ localMatch := fs.file == a.file
+ sbMatch := fs.superblock.equal(a.superblock)
+ gdMatch := fs.groupDescriptors.equal(a.groupDescriptors)
+ return localMatch && sbMatch && gdMatch
+}
+
+// Create creates an ext4 filesystem in a given file or device
+//
+// requires the util.File where to create the filesystem, size is the size of the filesystem in bytes,
+// start is how far in bytes from the beginning of the util.File to create the filesystem,
+// and blocksize is is the logical blocksize to use for creating the filesystem
+//
+// note that you are *not* required to create the filesystem on the entire disk. You could have a disk of size
+// 20GB, and create a small filesystem of size 50MB that begins 2GB into the disk.
+// This is extremely useful for creating filesystems on disk partitions.
+//
+// Note, however, that it is much easier to do this using the higher-level APIs at github.com/diskfs/go-diskfs
+// which allow you to work directly with partitions, rather than having to calculate (and hopefully not make any errors)
+// where a partition starts and ends.
+//
+// If the provided blocksize is 0, it will use the default of 512 bytes. If it is any number other than 0
+// or 512, it will return an error.
+//
+//nolint:gocyclo // yes, this has high cyclomatic complexity, but we can accept it
+func Create(f util.File, size, start, sectorsize int64, p *Params) (*FileSystem, error) {
+ // be safe about the params pointer
+ if p == nil {
+ p = &Params{}
+ }
+
+ // sectorsize must be <=0 or exactly SectorSize512 or error
+ // because of this, we know we can scale it down to a uint32, since it only can be 512 bytes
+ if sectorsize != int64(SectorSize512) && sectorsize > 0 {
+ return nil, fmt.Errorf("sectorsize for ext4 must be either 512 bytes or 0, not %d", sectorsize)
+ }
+ var sectorsize32 = uint32(sectorsize)
+ // there almost are no limits on an ext4 fs - theoretically up to 1 YB
+ // but we do have to check the max and min size per the requested parameters
+ // if size < minSizeGivenParameters {
+ // return nil, fmt.Errorf("requested size is smaller than minimum allowed ext4 size %d for given parameters", minSizeGivenParameters*4)
+ // }
+ // if size > maxSizeGivenParameters {
+ // return nil, fmt.Errorf("requested size is bigger than maximum ext4 size %d for given parameters", maxSizeGivenParameters*4)
+ // }
+
+ // uuid
+ fsuuid := p.UUID
+ if fsuuid == nil {
+ fsuuid2, _ := uuid.NewRandom()
+ fsuuid = &fsuuid2
+ }
+
+ // blocksize
+ sectorsPerBlock := p.SectorsPerBlock
+ userProvidedBlocksize := false
+ switch {
+ case sectorsPerBlock > 128 || sectorsPerBlock < 2:
+ return nil, fmt.Errorf("invalid sectors per block %d, must be between %d and %d sectors", sectorsPerBlock, 2, 128)
+ case sectorsPerBlock < 1:
+ sectorsPerBlock = 2
+ default:
+ userProvidedBlocksize = true
+ }
+ blocksize := uint32(sectorsPerBlock) * sectorsize32
+
+ // how many whole blocks is that?
+ numblocks := size / int64(blocksize)
+
+ // recalculate if it was not user provided
+ if !userProvidedBlocksize {
+ sectorsPerBlockR, blocksizeR, numblocksR := recalculateBlocksize(numblocks, size)
+ _, blocksize, numblocks = uint8(sectorsPerBlockR), blocksizeR, numblocksR
+ }
+
+ // how many blocks in each block group (and therefore how many block groups)
+ // if not provided, by default it is 8*blocksize (in bytes)
+ blocksPerGroup := p.BlocksPerGroup
+ switch {
+ case blocksPerGroup <= 0:
+ blocksPerGroup = blocksize * 8
+ case blocksPerGroup < minBlocksPerGroup:
+ return nil, fmt.Errorf("invalid number of blocks per group %d, must be at least %d", blocksPerGroup, minBlocksPerGroup)
+ case blocksPerGroup > 8*blocksize:
+ return nil, fmt.Errorf("invalid number of blocks per group %d, must be no larger than 8*blocksize of %d", blocksPerGroup, blocksize)
+ case blocksPerGroup%8 != 0:
+ return nil, fmt.Errorf("invalid number of blocks per group %d, must be divisible by 8", blocksPerGroup)
+ }
+
+ // how many block groups do we have?
+ blockGroups := numblocks / int64(blocksPerGroup)
+
+ // track how many free blocks we have
+ freeBlocks := numblocks
+
+ clusterSize := p.ClusterSize
+
+ // use our inode ratio to determine how many inodes we should have
+ inodeRatio := p.InodeRatio
+ if inodeRatio <= 0 {
+ inodeRatio = DefaultInodeRatio
+ }
+ if inodeRatio < int64(blocksize) {
+ inodeRatio = int64(blocksize)
+ }
+ if inodeRatio < clusterSize {
+ inodeRatio = clusterSize
+ }
+
+ inodeCount := p.InodeCount
+ switch {
+ case inodeCount <= 0:
+ // calculate how many inodes are needed
+ inodeCount64 := (numblocks * int64(blocksize)) / inodeRatio
+ if uint64(inodeCount64) > max32Num {
+ return nil, fmt.Errorf("requested %d inodes, greater than max %d", inodeCount64, max32Num)
+ }
+ inodeCount = uint32(inodeCount64)
+ case uint64(inodeCount) > max32Num:
+ return nil, fmt.Errorf("requested %d inodes, greater than max %d", inodeCount, max32Num)
+ }
+
+ inodesPerGroup := int64(inodeCount) / blockGroups
+
+ // track how many free inodes we have
+ freeInodes := inodeCount
+
+ // which blocks have superblock and GDT?
+ var (
+ backupSuperblocks []int64
+ backupSuperblockGroupsSparse [2]uint32
+ )
+ // 0 - primary
+ // ?? - backups
+ switch p.SparseSuperVersion {
+ case 2:
+ // backups in first and last block group
+ backupSuperblockGroupsSparse = [2]uint32{0, uint32(blockGroups) - 1}
+ backupSuperblocks = []int64{0, 1, blockGroups - 1}
+ default:
+ backupSuperblockGroups := calculateBackupSuperblockGroups(blockGroups)
+ backupSuperblocks = []int64{0}
+ for _, bg := range backupSuperblockGroups {
+ backupSuperblocks = append(backupSuperblocks, bg*int64(blocksPerGroup))
+ }
+ }
+
+ freeBlocks -= int64(len(backupSuperblocks))
+
+ var firstDataBlock uint32
+ if blocksize == 1024 {
+ firstDataBlock = 1
+ }
+
+ /*
+ size calculations
+ we have the total size of the disk from `size uint64`
+ we have the sectorsize fixed at SectorSize512
+
+ what do we need to determine or calculate?
+ - block size
+ - number of blocks
+ - number of block groups
+ - block groups for superblock and gdt backups
+ - in each block group:
+ - number of blocks in gdt
+ - number of reserved blocks in gdt
+ - number of blocks in inode table
+ - number of data blocks
+
+ config info:
+
+ [defaults]
+ base_features = sparse_super,large_file,filetype,resize_inode,dir_index,ext_attr
+ default_mntopts = acl,user_xattr
+ enable_periodic_fsck = 0
+ blocksize = 4096
+ inode_size = 256
+ inode_ratio = 16384
+
+ [fs_types]
+ ext3 = {
+ features = has_journal
+ }
+ ext4 = {
+ features = has_journal,extent,huge_file,flex_bg,uninit_bg,64bit,dir_nlink,extra_isize
+ inode_size = 256
+ }
+ ext4dev = {
+ features = has_journal,extent,huge_file,flex_bg,uninit_bg,inline_data,64bit,dir_nlink,extra_isize
+ inode_size = 256
+ options = test_fs=1
+ }
+ small = {
+ blocksize = 1024
+ inode_size = 128
+ inode_ratio = 4096
+ }
+ floppy = {
+ blocksize = 1024
+ inode_size = 128
+ inode_ratio = 8192
+ }
+ big = {
+ inode_ratio = 32768
+ }
+ huge = {
+ inode_ratio = 65536
+ }
+ news = {
+ inode_ratio = 4096
+ }
+ largefile = {
+ inode_ratio = 1048576
+ blocksize = -1
+ }
+ largefile4 = {
+ inode_ratio = 4194304
+ blocksize = -1
+ }
+ hurd = {
+ blocksize = 4096
+ inode_size = 128
+ }
+ */
+
+ // allocate root directory, single inode
+ freeInodes--
+
+ // how many reserved blocks?
+ reservedBlocksPercent := p.ReservedBlocksPercent
+ if reservedBlocksPercent <= 0 {
+ reservedBlocksPercent = DefaultReservedBlocksPercent
+ }
+
+ // are checksums enabled?
+ gdtChecksumType := gdtChecksumNone
+ if p.Checksum {
+ gdtChecksumType = gdtChecksumMetadata
+ }
+
+ // we do not yet support bigalloc
+ var clustersPerGroup = blocksPerGroup
+
+ // inodesPerGroup: once we know how many inodes per group, and how many groups
+ // we will have the total inode count
+
+ volumeName := p.VolumeName
+ if volumeName == "" {
+ volumeName = DefaultVolumeName
+ }
+
+ fflags := defaultFeatureFlags
+ for _, flagopt := range p.Features {
+ flagopt(&fflags)
+ }
+
+ mflags := defaultMiscFlags
+
+ // generate hash seed
+ hashSeed, _ := uuid.NewRandom()
+ hashSeedBytes := hashSeed[:]
+ htreeSeed := make([]uint32, 0, 4)
+ htreeSeed = append(htreeSeed,
+ binary.LittleEndian.Uint32(hashSeedBytes[:4]),
+ binary.LittleEndian.Uint32(hashSeedBytes[4:8]),
+ binary.LittleEndian.Uint32(hashSeedBytes[8:12]),
+ binary.LittleEndian.Uint32(hashSeedBytes[12:16]),
+ )
+
+ // create a UUID for the journal
+ journalSuperblockUUID, _ := uuid.NewRandom()
+
+ // group descriptor size could be 32 or 64, depending on option
+ var gdSize uint16
+ if fflags.fs64Bit {
+ gdSize = groupDescriptorSize64Bit
+ }
+
+ var firstMetaBG uint32
+ if fflags.metaBlockGroups {
+ return nil, fmt.Errorf("meta block groups not yet supported")
+ }
+
+ // calculate the maximum number of block groups
+ // maxBlockGroups = (maxFSSize) / (blocksPerGroup * blocksize)
+ var (
+ maxBlockGroups uint64
+ )
+ if fflags.fs64Bit {
+ maxBlockGroups = maxFilesystemSize64Bit / (uint64(blocksPerGroup) * uint64(blocksize))
+ } else {
+ maxBlockGroups = maxFilesystemSize32Bit / (uint64(blocksPerGroup) * uint64(blocksize))
+ }
+ reservedGDTBlocks := maxBlockGroups * 32 / maxBlockGroups
+ if reservedGDTBlocks > math.MaxUint16 {
+ return nil, fmt.Errorf("too many reserved blocks calculated for group descriptor table")
+ }
+
+ var (
+ journalDeviceNumber uint32
+ err error
+ )
+ if fflags.separateJournalDevice && p.JournalDevice != "" {
+ journalDeviceNumber, err = journalDevice(p.JournalDevice)
+ if err != nil {
+ return nil, fmt.Errorf("unable to get journal device: %w", err)
+ }
+ }
+
+ // get default mount options
+ mountOptions := defaultMountOptionsFromOpts(p.DefaultMountOpts)
+
+ // initial KB written. This must be adjusted over time to include:
+ // - superblock itself (1KB bytes)
+ // - GDT
+ // - block bitmap (1KB per block group)
+ // - inode bitmap (1KB per block group)
+ // - inode tables (inodes per block group * bytes per inode)
+ // - root directory
+
+ // for now, we just make it 1024 = 1 KB
+ initialKB := 1024
+
+ // only set a project quota inode if the feature was enabled
+ var projectQuotaInode uint32
+ if fflags.projectQuotas {
+ projectQuotaInode = lostFoundInode + 1
+ freeInodes--
+ }
+
+ // how many log groups per flex group? Depends on if we have flex groups
+ logGroupsPerFlex := 0
+ if fflags.flexBlockGroups {
+ logGroupsPerFlex = defaultLogGroupsPerFlex
+ if p.LogFlexBlockGroups > 0 {
+ logGroupsPerFlex = p.LogFlexBlockGroups
+ }
+ }
+
+ // create the superblock - MUST ADD IN OPTIONS
+ now, epoch := time.Now(), time.Unix(0, 0)
+ sb := superblock{
+ inodeCount: inodeCount,
+ blockCount: uint64(numblocks),
+ reservedBlocks: uint64(reservedBlocksPercent) / 100 * uint64(numblocks),
+ freeBlocks: uint64(freeBlocks),
+ freeInodes: freeInodes,
+ firstDataBlock: firstDataBlock,
+ blockSize: blocksize,
+ clusterSize: uint64(clusterSize),
+ blocksPerGroup: blocksPerGroup,
+ clustersPerGroup: clustersPerGroup,
+ inodesPerGroup: uint32(inodesPerGroup),
+ mountTime: now,
+ writeTime: now,
+ mountCount: 0,
+ mountsToFsck: 0,
+ filesystemState: fsStateCleanlyUnmounted,
+ errorBehaviour: errorsContinue,
+ minorRevision: 0,
+ lastCheck: now,
+ checkInterval: 0,
+ creatorOS: osLinux,
+ revisionLevel: 1,
+ reservedBlocksDefaultUID: 0,
+ reservedBlocksDefaultGID: 0,
+ firstNonReservedInode: firstNonReservedInode,
+ inodeSize: uint16(DefaultInodeSize),
+ blockGroup: 0,
+ features: fflags,
+ uuid: fsuuid,
+ volumeLabel: volumeName,
+ lastMountedDirectory: "/",
+ algorithmUsageBitmap: 0, // not used in Linux e2fsprogs
+ preallocationBlocks: 0, // not used in Linux e2fsprogs
+ preallocationDirectoryBlocks: 0, // not used in Linux e2fsprogs
+ reservedGDTBlocks: uint16(reservedGDTBlocks),
+ journalSuperblockUUID: &journalSuperblockUUID,
+ journalInode: journalInode,
+ journalDeviceNumber: journalDeviceNumber,
+ orphanedInodesStart: 0,
+ hashTreeSeed: htreeSeed,
+ hashVersion: hashHalfMD4,
+ groupDescriptorSize: gdSize,
+ defaultMountOptions: *mountOptions,
+ firstMetablockGroup: firstMetaBG,
+ mkfsTime: now,
+ journalBackup: nil,
+ // 64-bit mode features
+ inodeMinBytes: minInodeExtraSize,
+ inodeReserveBytes: wantInodeExtraSize,
+ miscFlags: mflags,
+ raidStride: 0,
+ multiMountPreventionInterval: 0,
+ multiMountProtectionBlock: 0,
+ raidStripeWidth: 0,
+ checksumType: checksumType,
+ totalKBWritten: uint64(initialKB),
+ errorCount: 0,
+ errorFirstTime: epoch,
+ errorFirstInode: 0,
+ errorFirstBlock: 0,
+ errorFirstFunction: "",
+ errorFirstLine: 0,
+ errorLastTime: epoch,
+ errorLastInode: 0,
+ errorLastLine: 0,
+ errorLastBlock: 0,
+ errorLastFunction: "",
+ mountOptions: "", // no mount options until it is mounted
+ backupSuperblockBlockGroups: backupSuperblockGroupsSparse,
+ lostFoundInode: lostFoundInode,
+ overheadBlocks: 0,
+ checksumSeed: crc.CRC32c(0, fsuuid[:]), // according to docs, this should be crc32c(~0, $orig_fs_uuid)
+ snapshotInodeNumber: 0,
+ snapshotID: 0,
+ snapshotReservedBlocks: 0,
+ snapshotStartInode: 0,
+ userQuotaInode: userQuotaInode,
+ groupQuotaInode: groupQuotaInode,
+ projectQuotaInode: projectQuotaInode,
+ logGroupsPerFlex: uint64(logGroupsPerFlex),
+ }
+ gdt := groupDescriptors{}
+
+ b, err := sb.toBytes()
+ if err != nil {
+ return nil, fmt.Errorf("error converting Superblock to bytes: %v", err)
+ }
+
+ g := gdt.toBytes(gdtChecksumType, sb.checksumSeed)
+ // how big should the GDT be?
+ gdSize = groupDescriptorSize
+ if sb.features.fs64Bit {
+ gdSize = groupDescriptorSize64Bit
+ }
+ gdtSize := int64(gdSize) * numblocks
+ // write the superblock and GDT to the various locations on disk
+ for _, bg := range backupSuperblocks {
+ block := bg * int64(blocksPerGroup)
+ blockStart := block * int64(blocksize)
+ // allow that the first one requires an offset
+ incr := int64(0)
+ if block == 0 {
+ incr = int64(SectorSize512) * 2
+ }
+
+ // write the superblock
+ count, err := f.WriteAt(b, incr+blockStart+start)
+ if err != nil {
+ return nil, fmt.Errorf("error writing Superblock for block %d to disk: %v", block, err)
+ }
+ if count != int(SuperblockSize) {
+ return nil, fmt.Errorf("wrote %d bytes of Superblock for block %d to disk instead of expected %d", count, block, SuperblockSize)
+ }
+
+ // write the GDT
+ count, err = f.WriteAt(g, incr+blockStart+int64(SuperblockSize)+start)
+ if err != nil {
+ return nil, fmt.Errorf("error writing GDT for block %d to disk: %v", block, err)
+ }
+ if count != int(gdtSize) {
+ return nil, fmt.Errorf("wrote %d bytes of GDT for block %d to disk instead of expected %d", count, block, gdtSize)
+ }
+ }
+
+ // create root directory
+ // there is nothing in there
+ return &FileSystem{
+ bootSector: []byte{},
+ superblock: &sb,
+ groupDescriptors: &gdt,
+ blockGroups: blockGroups,
+ size: size,
+ start: start,
+ file: f,
+ }, nil
+}
+
+// Read reads a filesystem from a given disk.
+//
+// requires the util.File where to read the filesystem, size is the size of the filesystem in bytes,
+// start is how far in bytes from the beginning of the util.File the filesystem is expected to begin,
+// and blocksize is is the logical blocksize to use for creating the filesystem
+//
+// note that you are *not* required to read a filesystem on the entire disk. You could have a disk of size
+// 20GB, and a small filesystem of size 50MB that begins 2GB into the disk.
+// This is extremely useful for working with filesystems on disk partitions.
+//
+// Note, however, that it is much easier to do this using the higher-level APIs at github.com/diskfs/go-diskfs
+// which allow you to work directly with partitions, rather than having to calculate (and hopefully not make any errors)
+// where a partition starts and ends.
+//
+// If the provided blocksize is 0, it will use the default of 512 bytes. If it is any number other than 0
+// or 512, it will return an error.
+func Read(file util.File, size, start, sectorsize int64) (*FileSystem, error) {
+ // blocksize must be <=0 or exactly SectorSize512 or error
+ if sectorsize != int64(SectorSize512) && sectorsize > 0 {
+ return nil, fmt.Errorf("sectorsize for ext4 must be either 512 bytes or 0, not %d", sectorsize)
+ }
+ // we do not check for ext4 max size because it is theoreticallt 1YB, which is bigger than an int64! Even 1ZB is!
+ if size < Ext4MinSize {
+ return nil, fmt.Errorf("requested size is smaller than minimum allowed ext4 size %d", Ext4MinSize)
+ }
+
+ // load the information from the disk
+ // read boot sector code
+ bs := make([]byte, BootSectorSize)
+ n, err := file.ReadAt(bs, start)
+ if err != nil {
+ return nil, fmt.Errorf("could not read boot sector bytes from file: %v", err)
+ }
+ if uint16(n) < uint16(BootSectorSize) {
+ return nil, fmt.Errorf("only could read %d boot sector bytes from file", n)
+ }
+
+ // read the superblock
+ // the superblock is one minimal block, i.e. 2 sectors
+ superblockBytes := make([]byte, SuperblockSize)
+ n, err = file.ReadAt(superblockBytes, start+int64(BootSectorSize))
+ if err != nil {
+ return nil, fmt.Errorf("could not read superblock bytes from file: %v", err)
+ }
+ if uint16(n) < uint16(SuperblockSize) {
+ return nil, fmt.Errorf("only could read %d superblock bytes from file", n)
+ }
+
+ // convert the bytes into a superblock structure
+ sb, err := superblockFromBytes(superblockBytes)
+ if err != nil {
+ return nil, fmt.Errorf("could not interpret superblock data: %v", err)
+ }
+
+ // now read the GDT
+ // how big should the GDT be?
+ gdtSize := uint64(sb.groupDescriptorSize) * sb.blockGroupCount()
+
+ gdtBytes := make([]byte, gdtSize)
+ // where do we find the GDT?
+ // - if blocksize is 1024, then 1024 padding for BootSector is block 0, 1024 for superblock is block 1
+ // and then the GDT starts at block 2
+ // - if blocksize is larger than 1024, then 1024 padding for BootSector followed by 1024 for superblock
+ // is block 0, and then the GDT starts at block 1
+ gdtBlock := 1
+ if sb.blockSize == 1024 {
+ gdtBlock = 2
+ }
+ n, err = file.ReadAt(gdtBytes, start+int64(gdtBlock)*int64(sb.blockSize))
+ if err != nil {
+ return nil, fmt.Errorf("could not read Group Descriptor Table bytes from file: %v", err)
+ }
+ if uint64(n) < gdtSize {
+ return nil, fmt.Errorf("only could read %d Group Descriptor Table bytes from file instead of %d", n, gdtSize)
+ }
+ gdt, err := groupDescriptorsFromBytes(gdtBytes, sb.groupDescriptorSize, sb.checksumSeed, sb.gdtChecksumType())
+ if err != nil {
+ return nil, fmt.Errorf("could not interpret Group Descriptor Table data: %v", err)
+ }
+
+ return &FileSystem{
+ bootSector: bs,
+ superblock: sb,
+ groupDescriptors: gdt,
+ blockGroups: int64(sb.blockGroupCount()),
+ size: size,
+ start: start,
+ file: file,
+ }, nil
+}
+
+// Type returns the type code for the filesystem. Always returns filesystem.TypeExt4
+func (fs *FileSystem) Type() filesystem.Type {
+ return filesystem.TypeExt4
+}
+
+// Mkdir make a directory at the given path. It is equivalent to `mkdir -p`, i.e. idempotent, in that:
+//
+// * It will make the entire tree path if it does not exist
+// * It will not return an error if the path already exists
+func (fs *FileSystem) Mkdir(p string) error {
+ _, err := fs.readDirWithMkdir(p, true)
+ // we are not interesting in returning the entries
+ return err
+}
+
+// ReadDir return the contents of a given directory in a given filesystem.
+//
+// Returns a slice of os.FileInfo with all of the entries in the directory.
+//
+// Will return an error if the directory does not exist or is a regular file and not a directory
+func (fs *FileSystem) ReadDir(p string) ([]os.FileInfo, error) {
+ dir, err := fs.readDirWithMkdir(p, false)
+ if err != nil {
+ return nil, fmt.Errorf("error reading directory %s: %v", p, err)
+ }
+ // once we have made it here, looping is done. We have found the final entry
+ // we need to return all of the file info
+ count := len(dir.entries)
+ ret := make([]os.FileInfo, count)
+ for i, e := range dir.entries {
+ in, err := fs.readInode(e.inode)
+ if err != nil {
+ return nil, fmt.Errorf("could not read inode %d at position %d in directory: %v", e.inode, i, err)
+ }
+ ret[i] = &FileInfo{
+ modTime: in.modifyTime,
+ name: e.filename,
+ size: int64(in.size),
+ isDir: e.fileType == dirFileTypeDirectory,
+ }
+ }
+
+ return ret, nil
+}
+
+// OpenFile returns an io.ReadWriter from which you can read the contents of a file
+// or write contents to the file
+//
+// accepts normal os.OpenFile flags
+//
+// returns an error if the file does not exist
+func (fs *FileSystem) OpenFile(p string, flag int) (filesystem.File, error) {
+ filename := path.Base(p)
+ dir := path.Dir(p)
+ parentDir, entry, err := fs.getEntryAndParent(p)
+ if err != nil {
+ return nil, err
+ }
+ if entry != nil && entry.fileType == dirFileTypeDirectory {
+ return nil, fmt.Errorf("cannot open directory %s as file", p)
+ }
+
+ // see if the file exists
+ // if the file does not exist, and is not opened for os.O_CREATE, return an error
+ if entry == nil {
+ if flag&os.O_CREATE == 0 {
+ return nil, fmt.Errorf("target file %s does not exist and was not asked to create", p)
+ }
+ // else create it
+ entry, err = fs.mkFile(parentDir, filename)
+ if err != nil {
+ return nil, fmt.Errorf("failed to create file %s: %v", p, err)
+ }
+ }
+ // get the inode
+ inodeNumber := entry.inode
+ inode, err := fs.readInode(inodeNumber)
+ if err != nil {
+ return nil, fmt.Errorf("could not read inode number %d: %v", inodeNumber, err)
+ }
+
+ // if a symlink, read the target, rather than the inode itself, which does not point to anything
+ if inode.fileType == fileTypeSymbolicLink {
+ // is the symlink relative or absolute?
+ linkTarget := inode.linkTarget
+ if !path.IsAbs(linkTarget) {
+ // convert it into an absolute path
+ // and start the process again
+ linkTarget = path.Join(dir, linkTarget)
+ // we probably could make this more efficient by checking if the final linkTarget
+ // is in the same directory as we already are parsing, rather than walking the whole thing again
+ // leave that for the future.
+ linkTarget = path.Clean(linkTarget)
+ }
+ return fs.OpenFile(linkTarget, flag)
+ }
+ offset := int64(0)
+ if flag&os.O_APPEND == os.O_APPEND {
+ offset = int64(inode.size)
+ }
+ // when we open a file, we load the inode but also all of the extents
+ extents, err := inode.extents.blocks(fs)
+ if err != nil {
+ return nil, fmt.Errorf("could not read extent tree for inode %d: %v", inodeNumber, err)
+ }
+ return &File{
+ directoryEntry: entry,
+ inode: inode,
+ isReadWrite: flag&os.O_RDWR != 0,
+ isAppend: flag&os.O_APPEND != 0,
+ offset: offset,
+ filesystem: fs,
+ extents: extents,
+ }, nil
+}
+
+// Label read the volume label
+func (fs *FileSystem) Label() string {
+ if fs.superblock == nil {
+ return ""
+ }
+ return fs.superblock.volumeLabel
+}
+
+// Rm remove file or directory at path.
+// If path is directory, it only will remove if it is empty.
+// If path is a file, it will remove the file.
+// Will not remove any parents.
+// Error if the file does not exist or is not an empty directory
+func (fs *FileSystem) Rm(p string) error {
+ parentDir, entry, err := fs.getEntryAndParent(p)
+ if err != nil {
+ return err
+ }
+ if parentDir.root && entry == &parentDir.directoryEntry {
+ return fmt.Errorf("cannot remove root directory")
+ }
+ if entry == nil {
+ return fmt.Errorf("file does not exist: %s", p)
+ }
+ // if it is a directory, it must be empty
+ if entry.fileType == dirFileTypeDirectory {
+ // read the directory
+ entries, err := fs.readDirectory(entry.inode)
+ if err != nil {
+ return fmt.Errorf("could not read directory %s: %v", p, err)
+ }
+ if len(entries) > 2 {
+ return fmt.Errorf("directory not empty: %s", p)
+ }
+ }
+ // at this point, it is either a file or an empty directory, so remove it
+
+ // free up the blocks
+ // read the inode to find the blocks
+ removedInode, err := fs.readInode(entry.inode)
+ if err != nil {
+ return fmt.Errorf("could not read inode %d for %s: %v", entry.inode, p, err)
+ }
+ extents, err := removedInode.extents.blocks(fs)
+ if err != nil {
+ return fmt.Errorf("could not read extents for inode %d for %s: %v", entry.inode, p, err)
+ }
+ // clear the inode from the inode bitmap
+ inodeBG := blockGroupForInode(int(entry.inode), fs.superblock.inodesPerGroup)
+ inodeBitmap, err := fs.readInodeBitmap(inodeBG)
+ if err != nil {
+ return fmt.Errorf("could not read inode bitmap: %v", err)
+ }
+ // clear up the blocks from the block bitmap. We are not clearing the block content, just the bitmap.
+ // keep a cache of bitmaps, so we do not have to read them again and again
+ blockBitmaps := make(map[int]*util.Bitmap)
+ for _, e := range extents {
+ for i := e.startingBlock; i < e.startingBlock+uint64(e.count); i++ {
+ // determine what block group this block is in, and read the bitmap for that blockgroup
+ bg := blockGroupForBlock(int(i), fs.superblock.blocksPerGroup)
+ dataBlockBitmap, ok := blockBitmaps[bg]
+ if !ok {
+ dataBlockBitmap, err = fs.readBlockBitmap(bg)
+ if err != nil {
+ return fmt.Errorf("could not read block bitmap: %v", err)
+ }
+ blockBitmaps[bg] = dataBlockBitmap
+ }
+ // the extent lists the absolute block number, but the bitmap is relative to the block group
+ blockInBG := int(i) - int(fs.superblock.blocksPerGroup)*bg
+ if err := dataBlockBitmap.Clear(blockInBG); err != nil {
+ return fmt.Errorf("could not clear block bitmap for block %d: %v", i, err)
+ }
+ }
+ }
+ for bg, dataBlockBitmap := range blockBitmaps {
+ if err := fs.writeBlockBitmap(dataBlockBitmap, bg); err != nil {
+ return fmt.Errorf("could not write block bitmap back to disk: %v", err)
+ }
+ }
+
+ // remove the directory entry from the parent
+ newEntries := make([]*directoryEntry, 0, len(parentDir.entries)-1)
+ for _, e := range parentDir.entries {
+ if e.inode == entry.inode {
+ continue
+ }
+ newEntries = append(newEntries, e)
+ }
+ parentDir.entries = newEntries
+ // write the parent directory back
+ dirBytes := parentDir.toBytes(fs.superblock.blockSize, directoryChecksumAppender(fs.superblock.checksumSeed, parentDir.inode, 0))
+ parentInode, err := fs.readInode(parentDir.inode)
+ if err != nil {
+ return fmt.Errorf("could not read inode %d for %s: %v", entry.inode, path.Base(p), err)
+ }
+ extents, err = parentInode.extents.blocks(fs)
+ if err != nil {
+ return fmt.Errorf("could not read extents for inode %d for %s: %v", entry.inode, path.Base(p), err)
+ }
+ for _, e := range extents {
+ for i := 0; i < int(e.count); i++ {
+ b := dirBytes[i:fs.superblock.blockSize]
+ if _, err := fs.file.WriteAt(b, (int64(i)+int64(e.startingBlock))*int64(fs.superblock.blockSize)); err != nil {
+ return fmt.Errorf("could not write inode bitmap back to disk: %v", err)
+ }
+ }
+ }
+
+ // remove the inode from the bitmap and write the inode bitmap back
+ // inode is absolute, but bitmap is relative to block group
+ inodeInBG := int(entry.inode) - int(fs.superblock.inodesPerGroup)*inodeBG
+ if err := inodeBitmap.Clear(inodeInBG); err != nil {
+ return fmt.Errorf("could not clear inode bitmap for inode %d: %v", entry.inode, err)
+ }
+
+ // write the inode bitmap back
+ if err := fs.writeInodeBitmap(inodeBitmap, inodeBG); err != nil {
+ return fmt.Errorf("could not write inode bitmap back to disk: %v", err)
+ }
+ // update the group descriptor
+ gd := fs.groupDescriptors.descriptors[inodeBG]
+
+ // update the group descriptor inodes and blocks
+ gd.freeInodes++
+ gd.freeBlocks += uint32(removedInode.blocks)
+ // write the group descriptor back
+ gdBytes := gd.toBytes(fs.superblock.gdtChecksumType(), fs.superblock.uuid.ID())
+ gdtBlock := 1
+ if fs.superblock.blockSize == 1024 {
+ gdtBlock = 2
+ }
+ if _, err := fs.file.WriteAt(gdBytes, fs.start+int64(gdtBlock)*int64(fs.superblock.blockSize)+int64(gd.number)*int64(fs.superblock.groupDescriptorSize)); err != nil {
+ return fmt.Errorf("could not write Group Descriptor bytes to file: %v", err)
+ }
+
+ // we could remove the inode from the inode table in the group descriptor,
+ // but we do not need to do so. Since we are not reusing the inode, we can just leave it there,
+ // the bitmap always is checked before reusing an inode location.
+ fs.superblock.freeInodes++
+ fs.superblock.freeBlocks += removedInode.blocks
+ return fs.writeSuperblock()
+}
+
+func (fs *FileSystem) Truncate(p string, size int64) error {
+ _, entry, err := fs.getEntryAndParent(p)
+ if err != nil {
+ return err
+ }
+ if entry == nil {
+ return fmt.Errorf("file does not exist: %s", p)
+ }
+ if entry.fileType == dirFileTypeDirectory {
+ return fmt.Errorf("cannot truncate directory %s", p)
+ }
+ // it is not a directory, and it exists, so truncate it
+ inode, err := fs.readInode(entry.inode)
+ if err != nil {
+ return fmt.Errorf("could not read inode %d in directory: %v", entry.inode, err)
+ }
+ // change the file size
+ inode.size = uint64(size)
+
+ // free used blocks if shrank, or reserve new blocks if grew
+ // both of which mean updating the superblock, and the extents tree in the inode
+
+ // write the inode back
+ return fs.writeInode(inode)
+}
+
+// getEntryAndParent given a path, get the Directory for the parent and the directory entry for the file.
+// If the directory does not exist, returns an error.
+// If the file does not exist, does not return an error, but rather returns a nil entry.
+func (fs *FileSystem) getEntryAndParent(p string) (parent *Directory, entry *directoryEntry, err error) {
+ dir := path.Dir(p)
+ filename := path.Base(p)
+ // get the directory entries
+ parentDir, err := fs.readDirWithMkdir(dir, false)
+ if err != nil {
+ return nil, nil, fmt.Errorf("could not read directory entries for %s", dir)
+ }
+ // we now know that the directory exists, see if the file exists
+ var targetEntry *directoryEntry
+ if parentDir.root && filename == "/" {
+ // root directory
+ return parentDir, &parentDir.directoryEntry, nil
+ }
+
+ for _, e := range parentDir.entries {
+ if e.filename != filename {
+ continue
+ }
+ // if we got this far, we have found the file
+ targetEntry = e
+ break
+ }
+ return parentDir, targetEntry, nil
+}
+
+// Stat return fs.FileInfo about a specific file path.
+func (fs *FileSystem) Stat(p string) (iofs.FileInfo, error) {
+ _, entry, err := fs.getEntryAndParent(p)
+ if err != nil {
+ return nil, err
+ }
+ if entry == nil {
+ return nil, fmt.Errorf("file does not exist: %s", p)
+ }
+ in, err := fs.readInode(entry.inode)
+ if err != nil {
+ return nil, fmt.Errorf("could not read inode %d in directory: %v", entry.inode, err)
+ }
+ return &FileInfo{
+ modTime: in.modifyTime,
+ name: entry.filename,
+ size: int64(in.size),
+ isDir: entry.fileType == dirFileTypeDirectory,
+ }, nil
+}
+
+// SetLabel changes the label on the writable filesystem. Different file system may hav different
+// length constraints.
+func (fs *FileSystem) SetLabel(label string) error {
+ fs.superblock.volumeLabel = label
+ return fs.writeSuperblock()
+}
+
+// readInode read a single inode from disk
+func (fs *FileSystem) readInode(inodeNumber uint32) (*inode, error) {
+ if inodeNumber == 0 {
+ return nil, fmt.Errorf("cannot read inode 0")
+ }
+ sb := fs.superblock
+ inodeSize := sb.inodeSize
+ inodesPerGroup := sb.inodesPerGroup
+ // figure out which block group the inode is on
+ bg := (inodeNumber - 1) / inodesPerGroup
+ // read the group descriptor to find out the location of the inode table
+ gd := fs.groupDescriptors.descriptors[bg]
+ inodeTableBlock := gd.inodeTableLocation
+ inodeBytes := make([]byte, inodeSize)
+ // bytesStart is beginning byte for the inodeTableBlock
+ byteStart := inodeTableBlock * uint64(sb.blockSize)
+ // offsetInode is how many inodes in our inode is
+ offsetInode := (inodeNumber - 1) % inodesPerGroup
+ // offset is how many bytes in our inode is
+ offset := offsetInode * uint32(inodeSize)
+ read, err := fs.file.ReadAt(inodeBytes, int64(byteStart)+int64(offset))
+ if err != nil {
+ return nil, fmt.Errorf("failed to read inode %d from offset %d of block %d from block group %d: %v", inodeNumber, offset, inodeTableBlock, bg, err)
+ }
+ if read != int(inodeSize) {
+ return nil, fmt.Errorf("read %d bytes for inode %d instead of inode size of %d", read, inodeNumber, inodeSize)
+ }
+ inode, err := inodeFromBytes(inodeBytes, sb, inodeNumber)
+ if err != nil {
+ return nil, fmt.Errorf("could not interpret inode data: %v", err)
+ }
+ // fill in symlink target if needed
+ if inode.fileType == fileTypeSymbolicLink && inode.linkTarget == "" {
+ // read the symlink target
+ extents, err := inode.extents.blocks(fs)
+ if err != nil {
+ return nil, fmt.Errorf("could not read extent tree for symlink inode %d: %v", inodeNumber, err)
+ }
+ b, err := fs.readFileBytes(extents, inode.size)
+ if err != nil {
+ return nil, fmt.Errorf("could not read symlink target for inode %d: %v", inodeNumber, err)
+ }
+ inode.linkTarget = string(b)
+ }
+ return inode, nil
+}
+
+// writeInode write a single inode to disk
+func (fs *FileSystem) writeInode(i *inode) error {
+ sb := fs.superblock
+ inodeSize := sb.inodeSize
+ inodesPerGroup := sb.inodesPerGroup
+ // figure out which block group the inode is on
+ bg := (i.number - 1) / inodesPerGroup
+ // read the group descriptor to find out the location of the inode table
+ gd := fs.groupDescriptors.descriptors[bg]
+ inodeTableBlock := gd.inodeTableLocation
+ // bytesStart is beginning byte for the inodeTableBlock
+ // byteStart := inodeTableBlock * sb.blockSize
+ // offsetInode is how many inodes in our inode is
+ offsetInode := (i.number - 1) % inodesPerGroup
+ byteStart := inodeTableBlock * uint64(sb.blockSize)
+ // offsetInode is how many inodes in our inode is
+ // offset is how many bytes in our inode is
+ // offset is how many bytes in our inode is
+ offset := int64(offsetInode) * int64(inodeSize)
+ inodeBytes := i.toBytes(sb)
+ wrote, err := fs.file.WriteAt(inodeBytes, int64(byteStart)+offset)
+ if err != nil {
+ return fmt.Errorf("failed to write inode %d at offset %d of block %d from block group %d: %v", i.number, offset, inodeTableBlock, bg, err)
+ }
+ if wrote != int(inodeSize) {
+ return fmt.Errorf("wrote %d bytes for inode %d instead of inode size of %d", wrote, i.number, inodeSize)
+ }
+ return nil
+}
+
+// read directory entries for a given directory
+func (fs *FileSystem) readDirectory(inodeNumber uint32) ([]*directoryEntry, error) {
+ // read the inode for the directory
+ in, err := fs.readInode(inodeNumber)
+ if err != nil {
+ return nil, fmt.Errorf("could not read inode %d for directory: %v", inodeNumber, err)
+ }
+ // convert the extent tree into a sorted list of extents
+ extents, err := in.extents.blocks(fs)
+ if err != nil {
+ return nil, fmt.Errorf("unable to get blocks for inode %d: %w", in.number, err)
+ }
+ // read the contents of the file across all blocks
+ b, err := fs.readFileBytes(extents, in.size)
+ if err != nil {
+ return nil, fmt.Errorf("error reading file bytes for inode %d: %v", inodeNumber, err)
+ }
+
+ var dirEntries []*directoryEntry
+ // TODO: none of this works for hashed dir entries, indicated by in.flags.hashedDirectoryIndexes == true
+ if in.flags.hashedDirectoryIndexes {
+ treeRoot, err := parseDirectoryTreeRoot(b[:fs.superblock.blockSize], fs.superblock.features.largeDirectory)
+ if err != nil {
+ return nil, fmt.Errorf("failed to parse directory tree root: %v", err)
+ }
+ subDirEntries, err := parseDirEntriesHashed(b, treeRoot.depth, treeRoot, fs.superblock.blockSize, fs.superblock.features.metadataChecksums, in.number, in.nfsFileVersion, fs.superblock.checksumSeed)
+ if err != nil {
+ return nil, fmt.Errorf("failed to parse hashed directory entries: %v", err)
+ }
+ // include the dot and dotdot entries from treeRoot; they do not show up in the hashed entries
+ dirEntries = []*directoryEntry{treeRoot.dotEntry, treeRoot.dotDotEntry}
+ dirEntries = append(dirEntries, subDirEntries...)
+ } else {
+ // convert into directory entries
+ dirEntries, err = parseDirEntriesLinear(b, fs.superblock.features.metadataChecksums, fs.superblock.blockSize, in.number, in.nfsFileVersion, fs.superblock.checksumSeed)
+ }
+
+ return dirEntries, err
+}
+
+// readFileBytes read all of the bytes for an individual file pointed at by a given inode
+// normally not very useful, but helpful when reading an entire directory.
+func (fs *FileSystem) readFileBytes(extents extents, filesize uint64) ([]byte, error) {
+ // walk through each one, gobbling up the bytes
+ b := make([]byte, 0, fs.superblock.blockSize)
+ for i, e := range extents {
+ start := e.startingBlock * uint64(fs.superblock.blockSize)
+ count := uint64(e.count) * uint64(fs.superblock.blockSize)
+ if uint64(len(b))+count > filesize {
+ count = filesize - uint64(len(b))
+ }
+ b2 := make([]byte, count)
+ read, err := fs.file.ReadAt(b2, int64(start))
+ if err != nil {
+ return nil, fmt.Errorf("failed to read bytes for extent %d: %v", i, err)
+ }
+ if read != int(count) {
+ return nil, fmt.Errorf("read %d bytes instead of %d for extent %d", read, count, i)
+ }
+ b = append(b, b2...)
+ if uint64(len(b)) >= filesize {
+ break
+ }
+ }
+ return b, nil
+}
+
+// mkFile make a file with a given name in the given directory.
+func (fs *FileSystem) mkFile(parent *Directory, name string) (*directoryEntry, error) {
+ return fs.mkDirEntry(parent, name, false)
+}
+
+// readDirWithMkdir - walks down a directory tree to the last entry in p.
+// For example, if p is /a/b/c, it will walk down to c.
+// Expects c to be a directory.
+// If each step in the tree does not exist, it will either make it if doMake is true, or return an error.
+func (fs *FileSystem) readDirWithMkdir(p string, doMake bool) (*Directory, error) {
+ paths := splitPath(p)
+
+ // walk down the directory tree until all paths have been walked or we cannot find something
+ // start with the root directory
+ var entries []*directoryEntry
+ currentDir := &Directory{
+ directoryEntry: directoryEntry{
+ inode: rootInode,
+ filename: "",
+ fileType: dirFileTypeDirectory,
+ },
+ root: true,
+ }
+ entries, err := fs.readDirectory(rootInode)
+ if err != nil {
+ return nil, fmt.Errorf("failed to read directory %s", "/")
+ }
+ currentDir.entries = entries
+ for i, subp := range paths {
+ // do we have an entry whose name is the same as this name?
+ found := false
+ for _, e := range entries {
+ if e.filename != subp {
+ continue
+ }
+ if e.fileType != dirFileTypeDirectory {
+ return nil, fmt.Errorf("cannot create directory at %s since it is a file", "/"+strings.Join(paths[0:i+1], "/"))
+ }
+ // the filename matches, and it is a subdirectory, so we can break after saving the directory entry, which contains the inode
+ found = true
+ currentDir = &Directory{
+ directoryEntry: *e,
+ }
+ break
+ }
+
+ // if not, either make it, retrieve its cluster and entries, and loop;
+ // or error out
+ if !found {
+ if doMake {
+ var subdirEntry *directoryEntry
+ subdirEntry, err = fs.mkSubdir(currentDir, subp)
+ if err != nil {
+ return nil, fmt.Errorf("failed to create subdirectory %s", "/"+strings.Join(paths[0:i+1], "/"))
+ }
+ // save where we are to search next
+ currentDir = &Directory{
+ directoryEntry: *subdirEntry,
+ }
+ } else {
+ return nil, fmt.Errorf("path %s not found", "/"+strings.Join(paths[0:i+1], "/"))
+ }
+ }
+ // get all of the entries in this directory
+ entries, err = fs.readDirectory(currentDir.inode)
+ if err != nil {
+ return nil, fmt.Errorf("failed to read directory %s", "/"+strings.Join(paths[0:i+1], "/"))
+ }
+ currentDir.entries = entries
+ }
+ // once we have made it here, looping is done; we have found the final entry
+ currentDir.entries = entries
+ return currentDir, nil
+}
+
+// readBlock read a single block from disk
+func (fs *FileSystem) readBlock(blockNumber uint64) ([]byte, error) {
+ sb := fs.superblock
+ // bytesStart is beginning byte for the inodeTableBlock
+ byteStart := blockNumber * uint64(sb.blockSize)
+ blockBytes := make([]byte, sb.blockSize)
+ read, err := fs.file.ReadAt(blockBytes, int64(byteStart))
+ if err != nil {
+ return nil, fmt.Errorf("failed to read block %d: %v", blockNumber, err)
+ }
+ if read != int(sb.blockSize) {
+ return nil, fmt.Errorf("read %d bytes for block %d instead of size of %d", read, blockNumber, sb.blockSize)
+ }
+ return blockBytes, nil
+}
+
+// recalculate blocksize based on the existing number of blocks
+// - 0 <= blocks < 3MM : floppy - blocksize = 1024
+// - 3MM <= blocks < 512MM : small - blocksize = 1024
+// - 512MM <= blocks < 4*1024*1024MM : default - blocksize =
+// - 4*1024*1024MM <= blocks < 16*1024*1024MM : big - blocksize =
+// - 16*1024*1024MM <= blocks : huge - blocksize =
+//
+// the original code from e2fsprogs https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/tree/misc/mke2fs.c
+func recalculateBlocksize(numblocks, size int64) (sectorsPerBlock int, blocksize uint32, numBlocksAdjusted int64) {
+ var (
+ million64 = int64(million)
+ sectorSize512 = uint32(SectorSize512)
+ )
+ switch {
+ case 0 <= numblocks && numblocks < 3*million64:
+ sectorsPerBlock = 2
+ blocksize = 2 * sectorSize512
+ case 3*million64 <= numblocks && numblocks < 512*million64:
+ sectorsPerBlock = 2
+ blocksize = 2 * sectorSize512
+ case 512*million64 <= numblocks && numblocks < 4*1024*1024*million64:
+ sectorsPerBlock = 2
+ blocksize = 2 * sectorSize512
+ case 4*1024*1024*million64 <= numblocks && numblocks < 16*1024*1024*million64:
+ sectorsPerBlock = 2
+ blocksize = 2 * sectorSize512
+ case numblocks > 16*1024*1024*million64:
+ sectorsPerBlock = 2
+ blocksize = 2 * sectorSize512
+ }
+ return sectorsPerBlock, blocksize, size / int64(blocksize)
+}
+
+// mkSubdir make a subdirectory of a given name inside the parent
+// 1- allocate a single data block for the directory
+// 2- create an inode in the inode table pointing to that data block
+// 3- mark the inode in the inode bitmap
+// 4- mark the data block in the data block bitmap
+// 5- create a directory entry in the parent directory data blocks
+func (fs *FileSystem) mkSubdir(parent *Directory, name string) (*directoryEntry, error) {
+ return fs.mkDirEntry(parent, name, true)
+}
+
+func (fs *FileSystem) mkDirEntry(parent *Directory, name string, isDir bool) (*directoryEntry, error) {
+ // still to do:
+ // - write directory entry in parent
+ // - write inode to disk
+
+ // create an inode
+ inodeNumber, err := fs.allocateInode(parent.inode)
+ if err != nil {
+ return nil, fmt.Errorf("could not allocate inode for file %s: %w", name, err)
+ }
+ // get extents for the file - prefer in the same block group as the inode, if possible
+ newExtents, err := fs.allocateExtents(1, nil)
+ if err != nil {
+ return nil, fmt.Errorf("could not allocate disk space for file %s: %w", name, err)
+ }
+ extentTreeParsed, err := extendExtentTree(nil, newExtents, fs, nil)
+ if err != nil {
+ return nil, fmt.Errorf("could not convert extents into tree: %w", err)
+ }
+ // normally, after getting a tree from extents, you would need to then allocate all of the blocks
+ // in the extent tree - leafs and intermediate. However, because we are allocating a new directory
+ // with a single extent, we *know* it can fit in the inode itself (which has a max of 4), so no need
+
+ // create a directory entry for the file
+ deFileType := dirFileTypeRegular
+ fileType := fileTypeRegularFile
+ var contentSize uint64
+ if isDir {
+ deFileType = dirFileTypeDirectory
+ fileType = fileTypeDirectory
+ contentSize = uint64(fs.superblock.blockSize)
+ }
+ de := directoryEntry{
+ inode: inodeNumber,
+ filename: name,
+ fileType: deFileType,
+ }
+ parent.entries = append(parent.entries, &de)
+ // write the parent out to disk
+ bytesPerBlock := fs.superblock.blockSize
+ parentDirBytes := parent.toBytes(bytesPerBlock, directoryChecksumAppender(fs.superblock.checksumSeed, parent.inode, 0))
+ // check if parent has increased in size beyond allocated blocks
+ parentInode, err := fs.readInode(parent.inode)
+ if err != nil {
+ return nil, fmt.Errorf("could not read inode %d of parent directory: %w", parent.inode, err)
+ }
+
+ // write the directory entry in the parent
+ // figure out which block it goes into, and possibly rebalance the directory entries hash tree
+ parentExtents, err := parentInode.extents.blocks(fs)
+ if err != nil {
+ return nil, fmt.Errorf("could not read parent extents for directory: %w", err)
+ }
+ dirFile := &File{
+ inode: parentInode,
+ directoryEntry: &directoryEntry{
+ inode: parent.inode,
+ filename: name,
+ fileType: dirFileTypeDirectory,
+ },
+ filesystem: fs,
+ isReadWrite: true,
+ isAppend: true,
+ offset: 0,
+ extents: parentExtents,
+ }
+ wrote, err := dirFile.Write(parentDirBytes)
+ if err != nil && err != io.EOF {
+ return nil, fmt.Errorf("unable to write new directory: %w", err)
+ }
+ if wrote != len(parentDirBytes) {
+ return nil, fmt.Errorf("wrote only %d bytes instead of expected %d for new directory", wrote, len(parentDirBytes))
+ }
+
+ // write the inode for the new entry out
+ now := time.Now()
+ in := inode{
+ number: inodeNumber,
+ permissionsGroup: parentInode.permissionsGroup,
+ permissionsOwner: parentInode.permissionsOwner,
+ permissionsOther: parentInode.permissionsOther,
+ fileType: fileType,
+ owner: parentInode.owner,
+ group: parentInode.group,
+ size: contentSize,
+ hardLinks: 2,
+ blocks: newExtents.blockCount(),
+ flags: &inodeFlags{},
+ nfsFileVersion: 0,
+ version: 0,
+ inodeSize: parentInode.inodeSize,
+ deletionTime: 0,
+ accessTime: now,
+ changeTime: now,
+ createTime: now,
+ modifyTime: now,
+ extendedAttributeBlock: 0,
+ project: 0,
+ extents: extentTreeParsed,
+ }
+ // write the inode to disk
+ if err := fs.writeInode(&in); err != nil {
+ return nil, fmt.Errorf("could not write inode for new directory: %w", err)
+ }
+ // if a directory, put entries for . and .. in the first block for the new directory
+ if isDir {
+ initialEntries := []*directoryEntry{
+ {
+ inode: inodeNumber,
+ filename: ".",
+ fileType: dirFileTypeDirectory,
+ },
+ {
+ inode: parent.inode,
+ filename: "..",
+ fileType: dirFileTypeDirectory,
+ },
+ }
+ newDir := Directory{
+ directoryEntry: de,
+ root: false,
+ entries: initialEntries,
+ }
+ dirBytes := newDir.toBytes(fs.superblock.blockSize, directoryChecksumAppender(fs.superblock.checksumSeed, inodeNumber, 0))
+ // write the bytes out to disk
+ dirFile = &File{
+ inode: &in,
+ directoryEntry: &directoryEntry{
+ inode: inodeNumber,
+ filename: name,
+ fileType: dirFileTypeDirectory,
+ },
+ filesystem: fs,
+ isReadWrite: true,
+ isAppend: true,
+ offset: 0,
+ extents: *newExtents,
+ }
+ wrote, err := dirFile.Write(dirBytes)
+ if err != nil && err != io.EOF {
+ return nil, fmt.Errorf("unable to write new directory: %w", err)
+ }
+ if wrote != len(dirBytes) {
+ return nil, fmt.Errorf("wrote only %d bytes instead of expected %d for new entry", wrote, len(dirBytes))
+ }
+ }
+
+ // return
+ return &de, nil
+}
+
+// allocateInode allocate a single inode
+// passed the parent, so it can know where to allocate it
+// logic:
+// - parent is 0 : root inode, will allocate at 2
+// - parent is 2 : child of root, will try to spread out
+// - else : try to collocate with parent, if possible
+func (fs *FileSystem) allocateInode(parent uint32) (uint32, error) {
+ var (
+ inodeNumber = -1
+ )
+ if parent == 0 {
+ inodeNumber = 2
+ }
+ // load the inode bitmap
+ var (
+ bg int
+ gd groupDescriptor
+ )
+
+ for _, gd = range fs.groupDescriptors.descriptors {
+ if inodeNumber != -1 {
+ break
+ }
+ bg := int(gd.number)
+ bm, err := fs.readInodeBitmap(bg)
+ if err != nil {
+ return 0, fmt.Errorf("could not read inode bitmap: %w", err)
+ }
+ // get first free inode
+ inodeNumber = bm.FirstFree(0)
+ // if we found a
+ if inodeNumber == -1 {
+ continue
+ }
+ // set it as marked
+ if err := bm.Set(inodeNumber); err != nil {
+ return 0, fmt.Errorf("could not set inode bitmap: %w", err)
+ }
+ // write the inode bitmap bytes
+ if err := fs.writeInodeBitmap(bm, bg); err != nil {
+ return 0, fmt.Errorf("could not write inode bitmap: %w", err)
+ }
+ }
+ if inodeNumber == -1 {
+ return 0, errors.New("no free inodes available")
+ }
+
+ // reduce number of free inodes in that descriptor in the group descriptor table
+ gd.freeInodes--
+
+ // get the group descriptor as bytes
+ gdBytes := gd.toBytes(fs.superblock.gdtChecksumType(), fs.superblock.uuid.ID())
+
+ // write the group descriptor bytes
+ // gdt starts in block 1 of any redundant copies, specifically in BG 0
+ gdtBlock := 1
+ blockByteLocation := gdtBlock * int(fs.superblock.blockSize)
+ gdOffset := fs.start + int64(blockByteLocation) + int64(bg)*int64(fs.superblock.groupDescriptorSize)
+ wrote, err := fs.file.WriteAt(gdBytes, gdOffset)
+ if err != nil {
+ return 0, fmt.Errorf("unable to write group descriptor bytes for blockgroup %d: %v", bg, err)
+ }
+ if wrote != len(gdBytes) {
+ return 0, fmt.Errorf("wrote only %d bytes instead of expected %d for group descriptor of block group %d", wrote, len(gdBytes), bg)
+ }
+
+ return uint32(inodeNumber), nil
+}
+
+// allocateExtents allocate the data blocks in extents that are
+// to be used for a file of a given size
+// arguments are file size in bytes and existing extents
+// if previous is nil, then we are not (re)sizing an existing file but creating a new one
+// returns the extents to be used in order
+func (fs *FileSystem) allocateExtents(size uint64, previous *extents) (*extents, error) {
+ // 1- calculate how many blocks are needed
+ required := size / uint64(fs.superblock.blockSize)
+ remainder := size % uint64(fs.superblock.blockSize)
+ if remainder > 0 {
+ required++
+ }
+ // 2- see how many blocks already are allocated
+ var allocated uint64
+ if previous != nil {
+ allocated = previous.blockCount()
+ }
+ // 3- if needed, allocate new blocks in extents
+ extraBlockCount := required - allocated
+ // if we have enough, do not add anything
+ if extraBlockCount <= 0 {
+ return previous, nil
+ }
+
+ // if there are not enough blocks left on the filesystem, return an error
+ if fs.superblock.freeBlocks < extraBlockCount {
+ return nil, fmt.Errorf("only %d blocks free, requires additional %d", fs.superblock.freeBlocks, extraBlockCount)
+ }
+
+ // now we need to look for as many contiguous blocks as possible
+ // first calculate the minimum number of extents needed
+
+ // if all of the extents, except possibly the last, are maximum size, then we need minExtents extents
+ // we loop through, trying to allocate an extent as large as our remaining blocks or maxBlocksPerExtent,
+ // whichever is smaller
+ blockGroupCount := fs.blockGroups
+ // TODO: instead of starting with BG 0, should start with BG where the inode for this file/dir is located
+ var (
+ newExtents []extent
+ datablockBitmaps = map[int]*util.Bitmap{}
+ blocksPerGroup = fs.superblock.blocksPerGroup
+ )
+
+ var i int64
+ for i = 0; i < blockGroupCount && allocated < extraBlockCount; i++ {
+ // keep track if we allocated anything in this blockgroup
+ // 1- read the GDT for this blockgroup to find the location of the block bitmap
+ // and total free blocks
+ // 2- read the block bitmap from disk
+ // 3- find the maximum contiguous space available
+ bs, err := fs.readBlockBitmap(int(i))
+ if err != nil {
+ return nil, fmt.Errorf("could not read block bitmap for block group %d: %v", i, err)
+ }
+ // now find our unused blocks and how many there are in a row as potential extents
+ if extraBlockCount > maxUint16 {
+ return nil, fmt.Errorf("cannot allocate more than %d blocks in a single extent", maxUint16)
+ }
+ // get the list of free blocks
+ blockList := bs.FreeList()
+
+ // create possible extents by size
+ // Step 3: Group contiguous blocks into extents
+ var extents []extent
+ for _, freeBlock := range blockList {
+ start, length := freeBlock.Position, freeBlock.Count
+ for length > 0 {
+ extentLength := min(length, int(maxBlocksPerExtent))
+ extents = append(extents, extent{startingBlock: uint64(start) + uint64(i)*uint64(blocksPerGroup), count: uint16(extentLength)})
+ start += extentLength
+ length -= extentLength
+ }
+ }
+
+ // sort in descending order
+ sort.Slice(extents, func(i, j int) bool {
+ return extents[i].count > extents[j].count
+ })
+
+ var allocatedBlocks uint64
+ for _, ext := range extents {
+ if extraBlockCount <= 0 {
+ break
+ }
+ extentToAdd := ext
+ if uint64(ext.count) >= extraBlockCount {
+ extentToAdd = extent{startingBlock: ext.startingBlock, count: uint16(extraBlockCount)}
+ }
+ newExtents = append(newExtents, extentToAdd)
+ allocatedBlocks += uint64(extentToAdd.count)
+ extraBlockCount -= uint64(extentToAdd.count)
+ // set the marked blocks in the bitmap, and save the bitmap
+ for block := extentToAdd.startingBlock; block < extentToAdd.startingBlock+uint64(extentToAdd.count); block++ {
+ // determine what block group this block is in, and read the bitmap for that blockgroup
+ // the extent lists the absolute block number, but the bitmap is relative to the block group
+ blockInGroup := block - uint64(i)*uint64(blocksPerGroup)
+ if err := bs.Set(int(blockInGroup)); err != nil {
+ return nil, fmt.Errorf("could not clear block bitmap for block %d: %v", i, err)
+ }
+ }
+
+ // do *not* write the bitmap back yet, as we do not yet know if we will be able to fulfill the entire request.
+ // instead save it for later
+ datablockBitmaps[int(i)] = bs
+ }
+ }
+ if extraBlockCount > 0 {
+ return nil, fmt.Errorf("could not allocate %d blocks", extraBlockCount)
+ }
+
+ // write the block bitmaps back to disk
+ for bg, bs := range datablockBitmaps {
+ if err := fs.writeBlockBitmap(bs, bg); err != nil {
+ return nil, fmt.Errorf("could not write block bitmap for block group %d: %v", bg, err)
+ }
+ }
+
+ // need to update the total blocks used/free in superblock
+ fs.superblock.freeBlocks -= allocated
+ // update the blockBitmapChecksum for any updated block groups in GDT
+ // write updated superblock and GDT to disk
+ if err := fs.writeSuperblock(); err != nil {
+ return nil, fmt.Errorf("could not write superblock: %w", err)
+ }
+ // write backup copies
+ var exten extents = newExtents
+ return &exten, nil
+}
+
+// readInodeBitmap read the inode bitmap off the disk.
+// This would be more efficient if we just read one group descriptor's bitmap
+// but for now we are about functionality, not efficiency, so it will read the whole thing.
+func (fs *FileSystem) readInodeBitmap(group int) (*util.Bitmap, error) {
+ if group >= len(fs.groupDescriptors.descriptors) {
+ return nil, fmt.Errorf("block group %d does not exist", group)
+ }
+ gd := fs.groupDescriptors.descriptors[group]
+ bitmapLocation := gd.inodeBitmapLocation
+ bitmapByteCount := fs.superblock.inodesPerGroup / 8
+ b := make([]byte, bitmapByteCount)
+ offset := int64(bitmapLocation*uint64(fs.superblock.blockSize) + uint64(fs.start))
+ read, err := fs.file.ReadAt(b, offset)
+ if err != nil {
+ return nil, fmt.Errorf("unable to read inode bitmap for blockgroup %d: %w", gd.number, err)
+ }
+ if read != int(bitmapByteCount) {
+ return nil, fmt.Errorf("Read %d bytes instead of expected %d for inode bitmap of block group %d", read, bitmapByteCount, gd.number)
+ }
+ // only take bytes corresponding to the number of inodes per group
+
+ // create a bitmap
+ bs := util.NewBitmap(int(fs.superblock.blockSize) * len(fs.groupDescriptors.descriptors))
+ bs.FromBytes(b)
+ return bs, nil
+}
+
+// writeInodeBitmap write the inode bitmap to the disk.
+func (fs *FileSystem) writeInodeBitmap(bm *util.Bitmap, group int) error {
+ if group >= len(fs.groupDescriptors.descriptors) {
+ return fmt.Errorf("block group %d does not exist", group)
+ }
+ b := bm.ToBytes()
+ gd := fs.groupDescriptors.descriptors[group]
+ bitmapByteCount := fs.superblock.inodesPerGroup / 8
+ bitmapLocation := gd.inodeBitmapLocation
+ offset := int64(bitmapLocation*uint64(fs.superblock.blockSize) + uint64(fs.start))
+ wrote, err := fs.file.WriteAt(b, offset)
+ if err != nil {
+ return fmt.Errorf("unable to write inode bitmap for blockgroup %d: %w", gd.number, err)
+ }
+ if wrote != int(bitmapByteCount) {
+ return fmt.Errorf("wrote %d bytes instead of expected %d for inode bitmap of block group %d", wrote, bitmapByteCount, gd.number)
+ }
+
+ return nil
+}
+
+func (fs *FileSystem) readBlockBitmap(group int) (*util.Bitmap, error) {
+ if group >= len(fs.groupDescriptors.descriptors) {
+ return nil, fmt.Errorf("block group %d does not exist", group)
+ }
+ gd := fs.groupDescriptors.descriptors[group]
+ bitmapLocation := gd.blockBitmapLocation
+ b := make([]byte, fs.superblock.blockSize)
+ offset := int64(bitmapLocation*uint64(fs.superblock.blockSize) + uint64(fs.start))
+ read, err := fs.file.ReadAt(b, offset)
+ if err != nil {
+ return nil, fmt.Errorf("unable to read block bitmap for blockgroup %d: %w", gd.number, err)
+ }
+ if read != int(fs.superblock.blockSize) {
+ return nil, fmt.Errorf("Read %d bytes instead of expected %d for block bitmap of block group %d", read, fs.superblock.blockSize, gd.number)
+ }
+ // create a bitmap
+ bs := util.NewBitmap(int(fs.superblock.blockSize) * len(fs.groupDescriptors.descriptors))
+ bs.FromBytes(b)
+ return bs, nil
+}
+
+// writeBlockBitmap write the inode bitmap to the disk.
+func (fs *FileSystem) writeBlockBitmap(bm *util.Bitmap, group int) error {
+ if group >= len(fs.groupDescriptors.descriptors) {
+ return fmt.Errorf("block group %d does not exist", group)
+ }
+ b := bm.ToBytes()
+ gd := fs.groupDescriptors.descriptors[group]
+ bitmapLocation := gd.blockBitmapLocation
+ offset := int64(bitmapLocation*uint64(fs.superblock.blockSize) + uint64(fs.start))
+ wrote, err := fs.file.WriteAt(b, offset)
+ if err != nil {
+ return fmt.Errorf("unable to write block bitmap for blockgroup %d: %w", gd.number, err)
+ }
+ if wrote != int(fs.superblock.blockSize) {
+ return fmt.Errorf("wrote %d bytes instead of expected %d for block bitmap of block group %d", wrote, fs.superblock.blockSize, gd.number)
+ }
+
+ return nil
+}
+
+func (fs *FileSystem) writeSuperblock() error {
+ superblockBytes, err := fs.superblock.toBytes()
+ if err != nil {
+ return fmt.Errorf("could not convert superblock to bytes: %v", err)
+ }
+ _, err = fs.file.WriteAt(superblockBytes, fs.start+int64(BootSectorSize))
+ return err
+}
+
+func blockGroupForInode(inodeNumber int, inodesPerGroup uint32) int {
+ return (inodeNumber - 1) / int(inodesPerGroup)
+}
+func blockGroupForBlock(blockNumber int, blocksPerGroup uint32) int {
+ return (blockNumber - 1) / int(blocksPerGroup)
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/ext4.md b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/ext4.md
new file mode 100644
index 000000000000..0cfa7191f736
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/ext4.md
@@ -0,0 +1,335 @@
+# ext4
+This file describes the layout on disk of ext4. It is a living document and probably will be deleted rather than committed to git.
+
+The primary reference document is [here](https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout).
+
+Also useful are:
+
+* https://blogs.oracle.com/linux/post/understanding-ext4-disk-layout-part-2
+* https://www.sans.org/blog/understanding-ext4-part-6-directories/ - blog series
+* https://digital-forensics.sans.org/blog/2017/06/07/understanding-ext4-part-6-directories
+* https://metebalci.com/blog/a-minimum-complete-tutorial-of-linux-ext4-file-system/
+
+## Concepts
+
+* Sector: a section of 512 bytes
+* Block: a contiguous group of sectors. Block size usually is either 4K (4096 bytes) or 1K (1024 bytes), i.e. 8 sectors or 2 sectors. Block size minimum is 1KB (2 sectors), max is 64KB (128 sectors). Each block is associated with exactly one file. A file may contain more than one block - e.g. if a file is larger than the size of a single block - but each block belongs to exactly one file.
+* inode: metadata about a file or directory. Each inode contains metadata about exactly one file. The number of inodes in a system is identical to the number of blocks for 32-bit, or far fewer for 64-bit.
+* Block group: a contiguous group of blocks. Each block group is (`8*block_size_in_bytes`) blocks. So if block size is 4K, or 4096 bytes, then a block group is `8*4096` = 32,768 blocks, each of size 4096 bytes, for a block group of 128MB. If block size is 1K, a block group is 8192 blocks, or 8MB.
+* 64-bit feature: ext4 filesystems normally uses 32-bit, which means the maximum blocks per filesystem is 2^32. If the 64-bit feature is enabled, then the maximum blocks per filesystem is 2^64.
+* Superblock: A block that contains information about the entire filesystem. Exists in block group 0 and sometimes is backed up to other block groups. The superblock contains information about the filesystem as a whole: inode size, block size, last mount time, etc.
+* Block Group Descriptor: Block Group Descriptors contain information about each block group: start block, end block, inodes, etc. One Descriptor per Group. But it is stored next to the Superblock (and backups), not with each Group.
+* Extent: an extent is a contiguous group of blocks. Extents are used to store files. Extents are mapped beginning with the inode, and provide the way of getting from an inode to the blocks that contain the file's data.
+
+
+### Block Group
+
+Each block group is built in the following order. There is a distinction between Group 0 - the first one
+in the filesystem - and all others.
+
+Block groups come in one of several types. It isn't necessary to list all of them here. The key elements are as follows.
+
+Block 0:
+
+1. Padding: 1024 bytes, used for boot sector
+
+Block 0 (above 1024 bytes, if blocksize >1024) or Block 1; all backup blocks:
+
+2. Superblock: One block
+3. Group Descriptors: Many blocks
+4. Reserved GDT Blocks: Many blocks, reserved in case we need to expand to more Group Descriptors in the future
+
+All blocks:
+
+5. Data block bitmap: 1 block. One bit per block in the block group. Set to 1 if a data block is in use, 0 if not.
+6. inode bitmap: 1 block. One bit per inode in the block group. Set to 1 if an inode is in use, 0 if not.
+7. inode table: many blocks. Calculated by `(inodes_per_group)*(size_of_inode)`. Remember that `inodes_per_group` = `blocks_per_group` = `8*block_size_in_bytes`. The original `size_of_inode` in ext2 was 128 bytes. In ext4 it uses 156 bytes, but is stored in 256 bytes of space, so `inode_size_in_bytes` = 256 bytes.
+8. Data blocks: all of the rest of the blocks in the block group
+
+The variant on the above is with Flexible Block Groups. If flexbg is enabled, then block groups are grouped together, normally
+groups of 16 (but the actual number is in the superblock). The data block bitmap, inode bitmap and inode table are
+in the first block group for each flexible block group.
+
+This means you can have all sorts of combinations:
+
+* block that is both first in a block group (contains block bitmap, inode bitmap, inode table) and superblock/backup (contains superblock, GDT, reserved GDT blocks)
+* block that is first in a block group (block bitmap, inode bitmap, inode table) but not first in a block group or Flex BG
+* block that is superblock/backup (superblock, GDT, reserved GDT blocks) but not first in a block group or Flex BG
+* neither of the above (contains just data blocks)
+
+Summary: block bitmap, inode bitmap and inode table are in the first block in a blockgroup or Flex BG, which is a consistent
+number. Superblock backups are in specific blocks, calculated by being a block number that is a power of 3, 5 or 7.
+
+## How to
+
+Different actions. These all will be replaced by actual code. Things we need to be able to do:
+
+* walk the tree to a particular directory or file
+* inode to data blocks
+* read directory entries
+* create a new directory entry
+* read contents of a file
+* write contents to a file
+
+### Walk the Tree
+
+In order to get to any particular file or directory in the ext4 filesystem, you need to "walk the tree".
+For example, say you want to read the contents of directory `/usr/local/bin/`.
+
+1. Find the inode of the root directory in the inode table. This **always** is inode 2.
+1. Read inode of the root directory to get the data blocks that contain the contents of the root directory. See [inode to data blocks](#inode-to-data-blocks).
+1. Read the directory entries in the data blocks to get the names of the files and directories in root. This can be linear or hash.
+ * linear: read sequentially until you find the one whose name matches the desired subdirectory, for example `usr`
+ * hash: hash the name and use that to get the correct location
+1. Using the matched directory entry, get the inode number for that subdirectory.
+1. Use the superblock to read how many inodes are in each block group, e.g. 8144
+1. Calculate which block group contains the inode you are looking for. Using the above example, 0-8143 are in group 0, 8144-16287 are in group 1, etc.
+1. Read the inode of that subdirectory in the inode table of the given block group to get the data blocks that contain the contents of that directory.
+1. Repeat until you have read the data blocks for the desired entry.
+
+### Inode to Data Blocks
+
+Start with the inode
+
+1. Read the inode
+1. Read the `i_block` value, 60 bytes at location 0x28 (= 40)
+1. The first 12 bytes are an extent header:
+ * magic number 0xf30a (little endian) - 2 bytes
+ * number of entries following the header - 2 bytes - in the inode, always 1, 2, 3, or 4
+ * maximum number of entries that could follow the header - 2 bytes - in the inode, always 4
+ * depth of this node in the extent tree, where 0 = leaf, parent to that is 1, etc. - 2 bytes
+ * generation (unused) - 4 bytes
+1. Read the entries that follow.
+
+If the data inside the inode is a leaf node (header depth = 0), then the entries will be leaf entries of 12 bytes:
+
+* first block in the file that this extent covers - 4 bytes
+* number of blocks in this extent - 2 bytes - If the value of this field is <= 32768, the extent is initialized. If the value of the field is > 32768, the extent is uninitialized and the actual extent length is ee_len - 32768. Therefore, the maximum length of a initialized extent is 32768 blocks, and the maximum length of an uninitialized extent is 32767.
+* upper 16 bits of the block location - 2 bytes
+* lower 32 bits of the block location - 4 bytes
+
+For example, if a file has 1,000 blocks, and a particular extent entry points to blocks 100-299 of the file, and it starts
+at filesystem block 10000, then the entry will be:
+
+* 100 (4 bytes)
+* 200 (2 bytes) - is this correct? This would indicate uninitialized
+* 0 (2 bytes)
+* 10000 (4 bytes)
+
+If the data inside the inode is an internal node (header depth > 0), then the entries will be internal entries of 12 bytes:
+
+* first file block that this extent and all its children cover - 4 bytes
+* lower 32 bits of the block number os the extent node on the next lower level - 4 bytes
+* upper 16 bits of the block number of the extent node on the next lower level - 2 bytes
+* unused - 2 bytes
+
+For example, if a file has 10,000 blocks, covered in 15 extents, then there will be 15 level 0 extents, and 1 level 1 extent,
+and the 15 extents are stored in filesystem block 20000.
+
+The lower level 0 extent will look like our leaf node example above.
+The upper level 1 extent will look like:
+
+* 0 (4 bytes) - because this starts from file block 0
+* 20000 (4 bytes) - the block number of the extent node on the next lower level
+* 0 (2 bytes) - because lower 4 bytes were enough to cover
+
+You can find all of the blocks simply by looking at the root of the extent tree in the inode.
+
+* If the extents for the file are 4 or fewer, then the extent tree is stored in the inode itself.
+* If the extents for the file are more than 4, but enough to fit the extents in 1-4 blocks, then:
+ * level 0 extents are stored in a single separate block
+ * level 1 extents are stored in the inode, with up to 4 entries pointing to the level 0 extents blocks
+* If the extents for the file are more than fit in 4 blocks, then:
+ * level 0 extents are stored in as many blocks as needed
+ * level 1 extents are stored in other blocks pointing to level 0 extent blocks
+ * level 2 extents - up to 4 - are stored in the inode
+
+Each of these is repeated upwards. The maximum at the top of the tree is 4, the maximum in each block is `(blocksize-12)/12`.
+Because:
+
+- each block of extent nodes needs a header of 12 bytes
+- each extent node is 12 bytes
+
+### Read Directory Entries
+To read directory entries
+
+1. Walk the tree until you find the inode for the directory you want.
+2. Read the data blocks pointed to by that inode, see [inode to data blocks](#inode-to-data-blocks).
+3. Interpret the data blocks.
+
+The directory itself is just a single "file". It has an inode that indicates the file "length", which is the number of bytes that the listing takes up.
+
+There are two types of directories: Classic and Hash Tree. Classic are just linear, unsorted, unordered lists of files. They work fine for shorter lists, but large directories can be slow to traverse if they grow too large. Once the contents of the directory "file" will be larger than a single block, ext4 switches it to a Hash Tree Directory Entry.
+
+Which directory type it is - classical linear or hash tree - does not affect the inode, for which it is just a file, but the contents of the directory entry "file". You can tell if it is linear or hash tree by checking the inode flag `EXT4_INDEX_FL`. If it is set (i.e. `& 0x1000`), then it is a hash tree.
+
+#### Classic Directory Entry
+Each directory entry is at most 263 bytes long. They are arranged in sequential order in the file. The contents are:
+
+* first four bytes are a `uint32` giving the inode number
+* next 2 bytes give the length of the directory entry (max 263)
+* next 1 byte gives the length of the file name (which could be calculated from the directory entry length...)
+* next 1 byte gives type: unknown, file, directory, char device, block device, FIFO, socket, symlink
+* next (up to 255) bytes contain chars with the file or directory name
+
+The above is for the second version of ext4 directory entry (`ext4_dir_entry_2`). The slightly older version (`ext4_dir_entry`) is similar, except it does not give the file type, which in any case is in the inode. Instead it uses 2 bytes for the file name length.
+
+#### Hash Tree Directory Entry
+Entries in the block are structured as follows:
+
+* `.` and `..` are the first two entries, and are classic `ext4_dir_entry_2`
+* Look in byte `0x1c` to find the hash algorithm
+* take the desired file/subdirectory name (just the `basename`) and hash it, see [Calculating the hash value][Calculating the hash value]
+* look in the root directory entry in the hashmap to find the relative block number. Note that the block number is relative to the block in the directory, not the filesystem or block group.
+* Next step depends on the hash tree depth:
+ * Depth = 0: read directory entry from the given block.
+ * Depth > 0: use the block as another lookup table, repeating the steps above, until we come to the depth.
+* Once we have the final leaf block given by the hash table, we just read the block sequentially; it will be full of classical directory entries linearly.
+
+When reading the hashmap, it may not match precisely. Instead, it will fit within a range. The hashmap is sorted by `>=` to `<`. So if the table has entries as follows:
+
+| Hash | Block |
+| -------|-------|
+| 0 | 1 |
+| 100 | 25 |
+| 300 | 16 |
+
+Then:
+
+* all hash values from `0`-`99` will be in block `1`
+* all hash values from `100-299` will be in block `25`
+* all hash values from `300` to infinite will be in block `16`
+
+##### Calculating the hash value
+
+The hashing uses one of several algorithms. Most commonly, it is Half MD4.
+
+MD4 gives a digest length of 128 bits = 16 bytes.
+
+The "half md4" algorithm is given by the transformation code
+[here](https://elixir.bootlin.com/linux/v4.6/source/lib/halfmd4.c#L26). The result
+of it is 4 bytes. Those 4 bytes are the input to the hash.
+
+### Create a Directory Entry
+
+To create a directory, you need to go through the following steps:
+
+1. "Walk the tree" to find the parent directory. E.g. if you are creating `/usr/local/foo`, then you need to walk the tree to get to the directory "file" for `/usr/local`. If the parent directory is just the root `/`, e.g. you are creating `/foo`, then you use the root directory, whose inode always is `2`.
+2. Determine if the parent directory is classical linear or hash tree, by checking the flag `EXT4_INDEX_FL` in the parent directory's inode.
+ * if hash:
+ 1. find a block in the "directory" file with space to add a linear entry
+ 1. create and add the entry
+ 1. calculate the hash of the filename
+ 1. add the `hash:block_number` entry into the tree
+ 1. rebalance if needed
+ * if linear, create the entry:
+ * if adding one will not exceed the size for linear, write it and done
+ * if adding one will exceed the size for linear, convert to hash, then write it
+
+#### Hash Tree
+
+1. Calculate the hash of the new directory entry name
+2. Determine which block in the parent directory "file" the new entry should live, based on the hash table.
+3. Find the block.
+4. Add a classical linear entry at the end of it.
+5. Update the inode for the parent directory with the new file size.
+
+If there is no room at the end of the block, you need to rebalance the hash tree. See below.
+
+#### Classical Linear
+
+1. Find the last block in the parent directory "file"
+ * if there is no room for another entry, extend the file size by another block, and update the inode for the file with the block map
+2. Add a classical linear directory entry at the end of it.
+3. Update the inode for the parent directory with the new file size, if any. E.g. if the entry fit within padding, there is no change in size.
+
+If this entry will cause the directory "file" to extend beyond a single block, convert to a hash tree. See below.
+
+### Rebalance Hash Tree
+
+Rebalancing the hash tree is rebalancing a btree, where the keys are the hash values.
+You only ever need to rebalance when you add or remove an entry.
+
+#### Adding an entry
+
+When adding an entry, you only ever need to rebalance the node to which you add it, and parents up to the root.
+
+1. Calculate the hash of the entry
+1. Determine the leaf node into which it should go
+1. If the leaf node has less than the maximum number of elements, add it and done
+1. If the lead node has the maximum number of elements:
+ 1. Add the new node in the right place
+ 1. Find the median
+ 1. Move the median up to the parent node
+ 1. If necessary, rebalance the parent node
+
+#### Removing an entry
+
+When removing an entry, you only ever need to rebalance the node from which you remove it, and parents up to the root.
+
+1. Calculate the hash of the entry
+1. Determine the leaf node in which it exists
+1. If the leaf node has less than the maximum number of elements, add it and done
+1. If the lead node has the maximum number of elements:
+ 1. Add the new node in the right place
+ 1. Find the median
+ 1. Move the median up to the parent node
+ 1. If necessary, rebalance the parent node
+
+### Convert Classical Linear Directory Entries to Hash Tree
+
+The conversion usually happens when a single entry will exceed the capacity of a single block.
+
+1. Switch the flag in the inode to hash-tree
+1. Calculate the hash of each entry
+1. Create 2 new blocks:
+ * 1 for the bottom half of the entries
+ * 1 for the top half of the entries
+1. Move the bottom half of the entries into the bottom block
+1. Move the top half of the entries into the top block
+1. Zero out the current single file block, which previously had the classic linear directory entries
+1. Write the header into the tree block, with the 0-hash-value pointing to the bottom block
+1. Write one entry after the header, for the lowest hash value of the upper block, pointing to the upper block
+
+### Read File Contents
+
+1. Walk the tree until you find the inode for the file you want.
+1. Find the data blocks for that inode, see [inode to data blocks](#inode-to-data-blocks).
+1. Interpret the data blocks.
+
+### Create File
+
+1. Walk the tree until you find the inode for the parent directory.
+1. Find a free inode using the inode bitmap.
+1. Find a free block using the block bitmap.
+1. Create the inode for the new file in the inode table. Be sure to update all the dependencies:
+ * inode bitmap
+ * inode table
+ * inode count in the block group table
+ * inode count in the superblock
+1. Reserve a data block for the new file in the block group table. Be sure to update all the dependencies:
+ * block bitmap
+ * block count in the block group table
+ * block count in the superblock
+1. Create the file entry in the parent directory. Depends on if this is classic linear directory or hash tree directory. Note that if it is classic linear, calculate the new size before writing the entry. If it is bigger than a single block, convert to hash tree. TODO: is this the right boundary, single block?
+ * Classic linear directory:
+ 1. Find the last block in the parent directory "file"
+ 1. Add a classical linear directory entry at the end of it
+ 1. Update the inode for the parent directory with the new file size
+ * Hash tree directory:
+ 1. Calculate the hash of the new directory entry name
+ 1. Determine which block in the parent directory "file" the new entry should live, based on the hash table
+ 1. Find the block
+ 1. Add a classical linear entry at the end of it
+ 1. Update the inode for the parent directory with the new file size
+
+
+### Write File Contents
+
+1. Walk the tree until you find the inode for the file you want.
+1. Find the data blocks for that inode, see [inode to data blocks](#inode-to-data-blocks).
+1. Write the data to the data blocks.
+1. If the data written exceeds the end of the last block, reserve a new block, update the inode extent tree, and write the data to the new block.
+1. Update the inode with the filesize
+1. Update the block group table with the used blocks
+1. Update the superblock with the used blocks
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/extent.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/extent.go
new file mode 100644
index 000000000000..e5d456e00681
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/extent.go
@@ -0,0 +1,733 @@
+package ext4
+
+import (
+ "encoding/binary"
+ "fmt"
+ "sort"
+)
+
+const (
+ extentTreeHeaderLength int = 12
+ extentTreeEntryLength int = 12
+ extentHeaderSignature uint16 = 0xf30a
+ extentTreeMaxDepth int = 5
+)
+
+// extens a structure holding multiple extents
+type extents []extent
+
+// extent a structure with information about a single contiguous run of blocks containing file data
+type extent struct {
+ // fileBlock block number relative to the file. E.g. if the file is composed of 5 blocks, this could be 0-4
+ fileBlock uint32
+ // startingBlock the first block on disk that contains the data in this extent. E.g. if the file is made up of data from blocks 100-104 on the disk, this would be 100
+ startingBlock uint64
+ // count how many contiguous blocks are covered by this extent
+ count uint16
+}
+
+// equal if 2 extents are equal
+//
+//nolint:unused // useful function for future
+func (e *extent) equal(a *extent) bool {
+ if (e == nil && a != nil) || (a == nil && e != nil) {
+ return false
+ }
+ if e == nil && a == nil {
+ return true
+ }
+ return *e == *a
+}
+
+// blockCount how many blocks are covered in the extents
+//
+//nolint:unused // useful function for future
+func (e extents) blockCount() uint64 {
+ var count uint64
+ for _, ext := range e {
+ count += uint64(ext.count)
+ }
+ return count
+}
+
+// extentBlockFinder provides a way of finding the blocks on disk that represent the block range of a given file.
+// Arguments are the starting and ending blocks in the file. Returns a slice of blocks to read on disk.
+// These blocks are in order. For example, if you ask to read file blocks starting at 20 for a count of 25, then you might
+// get a single fileToBlocks{block: 100, count: 25} if the file is contiguous on disk. Or you might get
+// fileToBlocks{block: 100, count: 10}, fileToBlocks{block: 200, count: 15} if the file is fragmented on disk.
+// The slice should be read in order.
+type extentBlockFinder interface {
+ // findBlocks find the actual blocks for a range in the file, given the start block in the file and how many blocks
+ findBlocks(start, count uint64, fs *FileSystem) ([]uint64, error)
+ // blocks get all of the blocks for a file, in sequential order, essentially unravels the tree into a slice of extents
+ blocks(fs *FileSystem) (extents, error)
+ // toBytes convert this extentBlockFinder to bytes to be stored in a block or inode
+ toBytes() []byte
+ getDepth() uint16
+ getMax() uint16
+ getBlockSize() uint32
+ getFileBlock() uint32
+ getCount() uint32
+}
+
+var (
+ _ extentBlockFinder = &extentInternalNode{}
+ _ extentBlockFinder = &extentLeafNode{}
+)
+
+// extentNodeHeader represents the header of an extent node
+type extentNodeHeader struct {
+ depth uint16 // the depth of tree below here; for leaf nodes, will be 0
+ entries uint16 // number of entries
+ max uint16 // maximum number of entries allowed at this level
+ blockSize uint32 // block size for this tree
+}
+
+func (e extentNodeHeader) toBytes() []byte {
+ b := make([]byte, 12)
+ binary.LittleEndian.PutUint16(b[0:2], extentHeaderSignature)
+ binary.LittleEndian.PutUint16(b[2:4], e.entries)
+ binary.LittleEndian.PutUint16(b[4:6], e.max)
+ binary.LittleEndian.PutUint16(b[6:8], e.depth)
+ return b
+}
+
+// extentChildPtr represents a child pointer in an internal node of extents
+// the child could be a leaf node or another internal node. We only would know
+// after parsing diskBlock to see its header.
+type extentChildPtr struct {
+ fileBlock uint32 // extents or children of this cover from file block fileBlock onwards
+ count uint32 // how many blocks are covered by this extent
+ diskBlock uint64 // block number where the children live
+}
+
+// extentLeafNode represents a leaf node of extents
+// it includes the information in the header and the extents (leaf nodes).
+// By definition, this is a leaf node, so depth=0
+type extentLeafNode struct {
+ extentNodeHeader
+ extents extents // the actual extents
+}
+
+// findBlocks find the actual blocks for a range in the file. leaf nodes already have all of the data inside,
+// so the FileSystem reference is unused.
+func (e extentLeafNode) findBlocks(start, count uint64, _ *FileSystem) ([]uint64, error) {
+ var ret []uint64
+
+ // before anything, figure out which file block is the start and end of the desired range
+ end := start + count - 1
+
+ // we are at the bottom of the tree, so we can just return the extents
+ for _, ext := range e.extents {
+ extentStart := uint64(ext.fileBlock)
+ extentEnd := uint64(ext.fileBlock + uint32(ext.count) - 1)
+
+ // Check if the extent does not overlap with the given block range
+ if extentEnd < start || extentStart > end {
+ continue
+ }
+
+ // Calculate the overlapping range
+ overlapStart := max(start, extentStart)
+ overlapEnd := min(end, extentEnd)
+
+ // Calculate the starting disk block for the overlap
+ diskBlockStart := ext.startingBlock + (overlapStart - extentStart)
+
+ // Append the corresponding disk blocks to the result
+ for i := uint64(0); i <= overlapEnd-overlapStart; i++ {
+ ret = append(ret, diskBlockStart+i)
+ }
+ }
+ return ret, nil
+}
+
+// blocks find the actual blocks for a range in the file. leaf nodes already have all of the data inside,
+// so the FileSystem reference is unused.
+func (e extentLeafNode) blocks(_ *FileSystem) (extents, error) {
+ return e.extents, nil
+}
+
+// toBytes convert the node to raw bytes to be stored, either in a block or in an inode
+func (e extentLeafNode) toBytes() []byte {
+ // 12 byte header, 12 bytes per child
+ b := make([]byte, 12+12*e.max)
+ copy(b[0:12], e.extentNodeHeader.toBytes())
+
+ for i, ext := range e.extents {
+ base := (i + 1) * 12
+ binary.LittleEndian.PutUint32(b[base:base+4], ext.fileBlock)
+ binary.LittleEndian.PutUint16(b[base+4:base+6], ext.count)
+ diskBlock := make([]byte, 8)
+ binary.LittleEndian.PutUint64(diskBlock, ext.startingBlock)
+ copy(b[base+6:base+8], diskBlock[4:6])
+ copy(b[base+8:base+12], diskBlock[0:4])
+ }
+ return b
+}
+
+func (e *extentLeafNode) getDepth() uint16 {
+ return e.depth
+}
+
+func (e *extentLeafNode) getMax() uint16 {
+ return e.max
+}
+
+func (e *extentLeafNode) getBlockSize() uint32 {
+ return e.blockSize
+}
+
+func (e *extentLeafNode) getFileBlock() uint32 {
+ return e.extents[0].fileBlock
+}
+
+func (e *extentLeafNode) getCount() uint32 {
+ return uint32(len(e.extents))
+}
+
+// extentInternalNode represents an internal node in a tree of extents
+// it includes the information in the header and the internal nodes
+// By definition, this is an internal node, so depth>0
+type extentInternalNode struct {
+ extentNodeHeader
+ children []*extentChildPtr // the children
+}
+
+// findBlocks find the actual blocks for a range in the file. internal nodes need to read the filesystem to
+// get the child nodes, so the FileSystem reference is used.
+func (e extentInternalNode) findBlocks(start, count uint64, fs *FileSystem) ([]uint64, error) {
+ var ret []uint64
+
+ // before anything, figure out which file block is the start and end of the desired range
+ end := start + count - 1
+
+ // we are not depth 0, so we have children extent tree nodes. Figure out which ranges we are in.
+ // the hard part here is that each child has start but not end or count. You only know it from reading the next one.
+ // So if the one we are looking at is in the range, we get it from the children, and keep going
+ for _, child := range e.children {
+ extentStart := uint64(child.fileBlock)
+ extentEnd := uint64(child.fileBlock + child.count - 1)
+
+ // Check if the extent does not overlap with the given block range
+ if extentEnd < start || extentStart > end {
+ continue
+ }
+
+ // read the extent block from the disk
+ b, err := fs.readBlock(child.diskBlock)
+ if err != nil {
+ return nil, err
+ }
+ ebf, err := parseExtents(b, e.blockSize, uint32(extentStart), uint32(extentEnd))
+ if err != nil {
+ return nil, err
+ }
+ blocks, err := ebf.findBlocks(extentStart, uint64(child.count), fs)
+ if err != nil {
+ return nil, err
+ }
+ if len(blocks) > 0 {
+ ret = append(ret, blocks...)
+ }
+ }
+ return ret, nil
+}
+
+// blocks find the actual blocks for a range in the file. leaf nodes already have all of the data inside,
+// so the FileSystem reference is unused.
+func (e extentInternalNode) blocks(fs *FileSystem) (extents, error) {
+ var ret extents
+
+ // we are not depth 0, so we have children extent tree nodes. Walk the tree below us and find all of the blocks
+ for _, child := range e.children {
+ // read the extent block from the disk
+ b, err := fs.readBlock(child.diskBlock)
+ if err != nil {
+ return nil, err
+ }
+ ebf, err := parseExtents(b, e.blockSize, child.fileBlock, child.fileBlock+child.count-1)
+ if err != nil {
+ return nil, err
+ }
+ blocks, err := ebf.blocks(fs)
+ if err != nil {
+ return nil, err
+ }
+ if len(blocks) > 0 {
+ ret = append(ret, blocks...)
+ }
+ }
+ return ret, nil
+}
+
+// toBytes convert the node to raw bytes to be stored, either in a block or in an inode
+func (e extentInternalNode) toBytes() []byte {
+ // 12 byte header, 12 bytes per child
+ b := make([]byte, 12+12*e.max)
+ copy(b[0:12], e.extentNodeHeader.toBytes())
+
+ for i, child := range e.children {
+ base := (i + 1) * 12
+ binary.LittleEndian.PutUint32(b[base:base+4], child.fileBlock)
+ diskBlock := make([]byte, 8)
+ binary.LittleEndian.PutUint64(diskBlock, child.diskBlock)
+ copy(b[base+4:base+8], diskBlock[0:4])
+ copy(b[base+8:base+10], diskBlock[4:6])
+ }
+ return b
+}
+func (e *extentInternalNode) getDepth() uint16 {
+ return e.depth
+}
+
+func (e *extentInternalNode) getMax() uint16 {
+ return e.max
+}
+
+func (e *extentInternalNode) getBlockSize() uint32 {
+ return e.blockSize
+}
+
+func (e *extentInternalNode) getFileBlock() uint32 {
+ return e.children[0].fileBlock
+}
+
+func (e *extentInternalNode) getCount() uint32 {
+ return uint32(len(e.children))
+}
+
+// parseExtents takes bytes, parses them to find the actual extents or the next blocks down.
+// It does not recurse down the tree, as we do not want to do that until we actually are ready
+// to read those blocks. This is similar to how ext4 driver in the Linux kernel does it.
+// totalBlocks is the total number of blocks covered in this given section of the extent tree.
+func parseExtents(b []byte, blocksize, start, count uint32) (extentBlockFinder, error) {
+ var ret extentBlockFinder
+ // must have at least header and one entry
+ minLength := extentTreeHeaderLength + extentTreeEntryLength
+ if len(b) < minLength {
+ return nil, fmt.Errorf("cannot parse extent tree from %d bytes, minimum required %d", len(b), minLength)
+ }
+ // check magic signature
+ if binary.LittleEndian.Uint16(b[0:2]) != extentHeaderSignature {
+ return nil, fmt.Errorf("invalid extent tree signature: %x", b[0x0:0x2])
+ }
+ e := extentNodeHeader{
+ entries: binary.LittleEndian.Uint16(b[0x2:0x4]),
+ max: binary.LittleEndian.Uint16(b[0x4:0x6]),
+ depth: binary.LittleEndian.Uint16(b[0x6:0x8]),
+ blockSize: blocksize,
+ }
+ // b[0x8:0xc] is used for the generation by Lustre but not standard ext4, so we ignore
+
+ // we have parsed the header, now read either the leaf entries or the intermediate nodes
+ switch e.depth {
+ case 0:
+ leafNode := extentLeafNode{
+ extentNodeHeader: e,
+ }
+ // read the leaves
+ for i := 0; i < int(e.entries); i++ {
+ start := i*extentTreeEntryLength + extentTreeHeaderLength
+ diskBlock := make([]byte, 8)
+ copy(diskBlock[0:4], b[start+8:start+12])
+ copy(diskBlock[4:6], b[start+6:start+8])
+ leafNode.extents = append(leafNode.extents, extent{
+ fileBlock: binary.LittleEndian.Uint32(b[start : start+4]),
+ count: binary.LittleEndian.Uint16(b[start+4 : start+6]),
+ startingBlock: binary.LittleEndian.Uint64(diskBlock),
+ })
+ }
+ ret = &leafNode
+ default:
+ internalNode := extentInternalNode{
+ extentNodeHeader: e,
+ }
+ for i := 0; i < int(e.entries); i++ {
+ start := i*extentTreeEntryLength + extentTreeHeaderLength
+ diskBlock := make([]byte, 8)
+ copy(diskBlock[0:4], b[start+4:start+8])
+ copy(diskBlock[4:6], b[start+8:start+10])
+ ptr := &extentChildPtr{
+ diskBlock: binary.LittleEndian.Uint64(diskBlock),
+ fileBlock: binary.LittleEndian.Uint32(b[start : start+4]),
+ }
+ internalNode.children = append(internalNode.children, ptr)
+ if i > 0 {
+ internalNode.children[i-1].count = ptr.fileBlock - internalNode.children[i-1].fileBlock
+ }
+ }
+ if len(internalNode.children) > 0 {
+ internalNode.children[len(internalNode.children)-1].count = start + count - internalNode.children[len(internalNode.children)-1].fileBlock
+ }
+ ret = &internalNode
+ }
+
+ return ret, nil
+}
+
+// extendExtentTree extends extent tree with a slice of new extents
+// if the existing tree is nil, create a new one.
+// For example, if the input is an extent tree - like the kind found in an inode - and you want to add more extents to it,
+// you add the provided extents, and it expands the tree, including creating new internal nodes and writing them to disk, as needed.
+
+func extendExtentTree(existing extentBlockFinder, added *extents, fs *FileSystem, parent *extentInternalNode) (extentBlockFinder, error) {
+ // Check if existing is a leaf or internal node
+ switch node := existing.(type) {
+ case *extentLeafNode:
+ return extendLeafNode(node, added, fs, parent)
+ case *extentInternalNode:
+ return extendInternalNode(node, added, fs, parent)
+ case nil:
+ // brand new extent tree. The root is in the inode, which has a max of 4 extents.
+ return createRootExtentTree(added, fs)
+ default:
+ return nil, fmt.Errorf("unsupported extentBlockFinder type")
+ }
+}
+
+func createRootExtentTree(added *extents, fs *FileSystem) (extentBlockFinder, error) {
+ // the root always is in the inode, which has a maximum of 4 extents. If it fits within that, we can just create a leaf node.
+ if len(*added) <= 4 {
+ return &extentLeafNode{
+ extentNodeHeader: extentNodeHeader{
+ depth: 0,
+ entries: uint16(len(*added)),
+ max: 4,
+ blockSize: fs.superblock.blockSize,
+ },
+ extents: *added,
+ }, nil
+ }
+ // in theory, we never should be creating a root internal node. We always should be starting with an extent or two,
+ // and later expanding the file.
+ // It might be theoretically possible, though, so we will handle it in the future.
+ return nil, fmt.Errorf("cannot create root internal node")
+}
+
+func extendLeafNode(node *extentLeafNode, added *extents, fs *FileSystem, parent *extentInternalNode) (extentBlockFinder, error) {
+ // Check if the leaf node has enough space for the added extents
+ if len(node.extents)+len(*added) <= int(node.max) {
+ // Simply append the extents if there's enough space
+ node.extents = append(node.extents, *added...)
+ node.entries = uint16(len(node.extents))
+
+ // Write the updated node back to the disk
+ err := writeNodeToDisk(node, fs, parent)
+ if err != nil {
+ return nil, err
+ }
+
+ return node, nil
+ }
+
+ // If not enough space, split the node
+ newNodes, err := splitLeafNode(node, added, fs, parent)
+ if err != nil {
+ return nil, err
+ }
+
+ // Check if the original node was the root
+ if parent == nil {
+ // Create a new internal node to reference the split leaf nodes
+ var newNodesAsBlockFinder []extentBlockFinder
+ for _, n := range newNodes {
+ newNodesAsBlockFinder = append(newNodesAsBlockFinder, n)
+ }
+ newRoot := createInternalNode(newNodesAsBlockFinder, nil, fs)
+ return newRoot, nil
+ }
+
+ // If the original node was not the root, handle the parent internal node
+ parentNode, err := getParentNode(node, fs)
+ if err != nil {
+ return nil, err
+ }
+
+ return extendInternalNode(parentNode, added, fs, parent)
+}
+
+func splitLeafNode(node *extentLeafNode, added *extents, fs *FileSystem, parent *extentInternalNode) ([]*extentLeafNode, error) {
+ // Combine existing and new extents
+ allExtents := node.extents
+ allExtents = append(allExtents, *added...)
+ // Sort extents by fileBlock to maintain order
+ sort.Slice(allExtents, func(i, j int) bool {
+ return allExtents[i].fileBlock < allExtents[j].fileBlock
+ })
+
+ // Calculate the midpoint to split the extents
+ mid := len(allExtents) / 2
+
+ // Create the first new leaf node
+ firstLeaf := &extentLeafNode{
+ extentNodeHeader: extentNodeHeader{
+ depth: 0,
+ entries: uint16(mid),
+ max: node.max,
+ blockSize: node.blockSize,
+ },
+ extents: allExtents[:mid],
+ }
+
+ // Create the second new leaf node
+ secondLeaf := &extentLeafNode{
+ extentNodeHeader: extentNodeHeader{
+ depth: 0,
+ entries: uint16(len(allExtents) - mid),
+ max: node.max,
+ blockSize: node.blockSize,
+ },
+ extents: allExtents[mid:],
+ }
+
+ // Write new leaf nodes to the disk
+ err := writeNodeToDisk(firstLeaf, fs, parent)
+ if err != nil {
+ return nil, err
+ }
+ err = writeNodeToDisk(secondLeaf, fs, parent)
+ if err != nil {
+ return nil, err
+ }
+
+ return []*extentLeafNode{firstLeaf, secondLeaf}, nil
+}
+
+func createInternalNode(nodes []extentBlockFinder, parent *extentInternalNode, fs *FileSystem) *extentInternalNode {
+ internalNode := &extentInternalNode{
+ extentNodeHeader: extentNodeHeader{
+ depth: nodes[0].getDepth() + 1, // Depth is 1 more than the children
+ entries: uint16(len(nodes)),
+ max: nodes[0].getMax(), // Assuming uniform max for all nodes
+ blockSize: nodes[0].getBlockSize(),
+ },
+ children: make([]*extentChildPtr, len(nodes)),
+ }
+
+ for i, node := range nodes {
+ internalNode.children[i] = &extentChildPtr{
+ fileBlock: node.getFileBlock(),
+ count: node.getCount(),
+ diskBlock: getBlockNumberFromNode(node, parent),
+ }
+ }
+
+ // Write the new internal node to the disk
+ err := writeNodeToDisk(internalNode, fs, parent)
+ if err != nil {
+ return nil
+ }
+
+ return internalNode
+}
+
+func getBlockNumberFromNode(node extentBlockFinder, parent *extentInternalNode) uint64 {
+ for _, childPtr := range parent.children {
+ if childPtrMatchesNode(childPtr, node) {
+ return childPtr.diskBlock
+ }
+ }
+ return 0 // Return 0 or an appropriate error value if the block number is not found
+}
+
+// Helper function to match a child pointer to a node
+func childPtrMatchesNode(childPtr *extentChildPtr, node extentBlockFinder) bool {
+ switch n := node.(type) {
+ case *extentLeafNode:
+ return childPtr.fileBlock == n.extents[0].fileBlock
+ case *extentInternalNode:
+ // Logic to determine if the childPtr matches the internal node
+ // Placeholder: Implement based on your specific matching criteria
+ return true
+ default:
+ return false
+ }
+}
+
+func extendInternalNode(node *extentInternalNode, added *extents, fs *FileSystem, parent *extentInternalNode) (extentBlockFinder, error) {
+ // Find the appropriate child node to extend
+ childIndex := findChildNode(node, added)
+ childPtr := node.children[childIndex]
+
+ // Load the actual child node from the disk
+ childNode, err := loadChildNode(childPtr, fs)
+ if err != nil {
+ return nil, err
+ }
+
+ // Recursively extend the child node
+ updatedChild, err := extendExtentTree(childNode, added, fs, node)
+ if err != nil {
+ return nil, err
+ }
+
+ // Update the current internal node to reference the updated child
+ switch updatedChild := updatedChild.(type) {
+ case *extentLeafNode:
+ node.children[childIndex] = &extentChildPtr{
+ fileBlock: updatedChild.extents[0].fileBlock,
+ count: uint32(len(updatedChild.extents)),
+ diskBlock: getBlockNumberFromNode(updatedChild, node),
+ }
+ case *extentInternalNode:
+ node.children[childIndex] = &extentChildPtr{
+ fileBlock: updatedChild.children[0].fileBlock,
+ count: uint32(len(updatedChild.children)),
+ diskBlock: getBlockNumberFromNode(updatedChild, node),
+ }
+ default:
+ return nil, fmt.Errorf("unsupported updatedChild type")
+ }
+
+ // Check if the internal node is at capacity
+ if len(node.children) > int(node.max) {
+ // Split the internal node if it's at capacity
+ newInternalNodes, err := splitInternalNode(node, node.children[childIndex], fs, parent)
+ if err != nil {
+ return nil, err
+ }
+
+ // Check if the original node was the root
+ if parent == nil {
+ // Create a new internal node as the new root
+ var newNodesAsBlockFinder []extentBlockFinder
+ for _, n := range newInternalNodes {
+ newNodesAsBlockFinder = append(newNodesAsBlockFinder, n)
+ }
+ newRoot := createInternalNode(newNodesAsBlockFinder, nil, fs)
+ return newRoot, nil
+ }
+
+ // If the original node was not the root, handle the parent internal node
+ return extendInternalNode(parent, added, fs, parent)
+ }
+
+ // Write the updated node back to the disk
+ err = writeNodeToDisk(node, fs, parent)
+ if err != nil {
+ return nil, err
+ }
+
+ return node, nil
+}
+
+// Helper function to get the parent node of a given internal node
+//
+//nolint:revive // this parameter will be used eventually
+func getParentNode(node extentBlockFinder, fs *FileSystem) (*extentInternalNode, error) {
+ // Logic to find and return the parent node of the given node
+ // This is a placeholder and needs to be implemented based on your specific tree structure
+ return nil, fmt.Errorf("getParentNode not implemented")
+}
+
+func splitInternalNode(node *extentInternalNode, newChild *extentChildPtr, fs *FileSystem, parent *extentInternalNode) ([]*extentInternalNode, error) {
+ // Combine existing children with the new child
+ allChildren := node.children
+ allChildren = append(allChildren, newChild)
+ // Sort children by fileBlock to maintain order
+ sort.Slice(allChildren, func(i, j int) bool {
+ return allChildren[i].fileBlock < allChildren[j].fileBlock
+ })
+
+ // Calculate the midpoint to split the children
+ mid := len(allChildren) / 2
+
+ // Create the first new internal node
+ firstInternal := &extentInternalNode{
+ extentNodeHeader: extentNodeHeader{
+ depth: node.depth,
+ entries: uint16(mid),
+ max: node.max,
+ blockSize: node.blockSize,
+ },
+ children: allChildren[:mid],
+ }
+
+ // Create the second new internal node
+ secondInternal := &extentInternalNode{
+ extentNodeHeader: extentNodeHeader{
+ depth: node.depth,
+ entries: uint16(len(allChildren) - mid),
+ max: node.max,
+ blockSize: node.blockSize,
+ },
+ children: allChildren[mid:],
+ }
+
+ // Write new internal nodes to the disk
+ err := writeNodeToDisk(firstInternal, fs, parent)
+ if err != nil {
+ return nil, err
+ }
+ err = writeNodeToDisk(secondInternal, fs, parent)
+ if err != nil {
+ return nil, err
+ }
+
+ return []*extentInternalNode{firstInternal, secondInternal}, nil
+}
+
+func writeNodeToDisk(node extentBlockFinder, fs *FileSystem, parent *extentInternalNode) error {
+ var blockNumber uint64
+ if parent != nil {
+ blockNumber = getBlockNumberFromNode(node, parent)
+ } else {
+ blockNumber = getNewBlockNumber(fs)
+ }
+
+ if blockNumber == 0 {
+ return fmt.Errorf("block number not found for node")
+ }
+
+ data := node.toBytes()
+ _, err := fs.file.WriteAt(data, int64(blockNumber)*int64(fs.superblock.blockSize))
+ return err
+}
+
+// Helper function to get a new block number when there is no parent
+//
+//nolint:revive // this parameter will be used eventually
+func getNewBlockNumber(fs *FileSystem) uint64 {
+ // Logic to allocate a new block
+ // This is a placeholder and needs to be implemented based on your specific filesystem structure
+ return 0 // Placeholder: Replace with actual implementation
+}
+
+// Helper function to find the block number of a child node from its parent
+func findChildBlockNumber(parent *extentInternalNode, child extentBlockFinder) uint64 {
+ for _, childPtr := range parent.children {
+ if childPtrMatchesNode(childPtr, child) {
+ return childPtr.diskBlock
+ }
+ }
+ return 0
+}
+
+func findChildNode(node *extentInternalNode, added *extents) int {
+ // Assuming added extents are sorted, find the correct child node to extend
+ addedSlice := *added
+ for i, child := range node.children {
+ if addedSlice[0].fileBlock < child.fileBlock {
+ return i - 1
+ }
+ }
+ return len(node.children) - 1
+}
+
+// loadChildNode load up a child node from the disk
+//
+//nolint:unparam // this parameter will be used eventually
+func loadChildNode(childPtr *extentChildPtr, fs *FileSystem) (extentBlockFinder, error) {
+ data := make([]byte, fs.superblock.blockSize)
+ _, err := fs.file.ReadAt(data, int64(childPtr.diskBlock)*int64(fs.superblock.blockSize))
+ if err != nil {
+ return nil, err
+ }
+
+ // Logic to decode data into an extentBlockFinder (extentLeafNode or extentInternalNode)
+ // This is a placeholder and needs to be implemented based on your specific encoding scheme
+ var node extentBlockFinder
+ // Implement the logic to decode the node from the data
+ return node, nil
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/features.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/features.go
new file mode 100644
index 000000000000..9a8baa9ebbe7
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/features.go
@@ -0,0 +1,451 @@
+package ext4
+
+// features are defined
+// beginning at https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/tree/lib/ext2fs/ext2_fs.h#n820
+
+// featureFlags is a structure holding which flags are set - compatible, incompatible and read-only compatible
+type featureFlags struct {
+ // compatible, incompatible, and compatibleReadOnly feature flags
+ directoryPreAllocate bool
+ imagicInodes bool
+ hasJournal bool
+ extendedAttributes bool
+ reservedGDTBlocksForExpansion bool
+ directoryIndices bool
+ lazyBlockGroup bool
+ excludeInode bool
+ excludeBitmap bool
+ sparseSuperBlockV2 bool
+ fastCommit bool
+ stableInodes bool
+ orphanFile bool
+ compression bool
+ directoryEntriesRecordFileType bool
+ recoveryNeeded bool
+ separateJournalDevice bool
+ metaBlockGroups bool
+ extents bool
+ fs64Bit bool
+ multipleMountProtection bool
+ flexBlockGroups bool
+ extendedAttributeInodes bool
+ dataInDirectoryEntries bool
+ metadataChecksumSeedInSuperblock bool
+ largeDirectory bool
+ dataInInode bool
+ encryptInodes bool
+ sparseSuperblock bool
+ largeFile bool
+ btreeDirectory bool
+ hugeFile bool
+ gdtChecksum bool
+ largeSubdirectoryCount bool
+ largeInodes bool
+ snapshot bool
+ quota bool
+ bigalloc bool
+ metadataChecksums bool
+ replicas bool
+ readOnly bool
+ projectQuotas bool
+}
+
+func parseFeatureFlags(compatFlags, incompatFlags, roCompatFlags uint32) featureFlags {
+ f := featureFlags{
+ directoryPreAllocate: compatFeatureDirectoryPreAllocate.included(compatFlags),
+ imagicInodes: compatFeatureImagicInodes.included(compatFlags),
+ hasJournal: compatFeatureHasJournal.included(compatFlags),
+ extendedAttributes: compatFeatureExtendedAttributes.included(compatFlags),
+ reservedGDTBlocksForExpansion: compatFeatureReservedGDTBlocksForExpansion.included(compatFlags),
+ directoryIndices: compatFeatureDirectoryIndices.included(compatFlags),
+ lazyBlockGroup: compatFeatureLazyBlockGroup.included(compatFlags),
+ excludeInode: compatFeatureExcludeInode.included(compatFlags),
+ excludeBitmap: compatFeatureExcludeBitmap.included(compatFlags),
+ sparseSuperBlockV2: compatFeatureSparseSuperBlockV2.included(compatFlags),
+ fastCommit: compatFeatureFastCommit.included(compatFlags),
+ stableInodes: compatFeatureStableInodes.included(compatFlags),
+ orphanFile: compatFeatureOrphanFile.included(compatFlags),
+ compression: incompatFeatureCompression.included(incompatFlags),
+ directoryEntriesRecordFileType: incompatFeatureDirectoryEntriesRecordFileType.included(incompatFlags),
+ recoveryNeeded: incompatFeatureRecoveryNeeded.included(incompatFlags),
+ separateJournalDevice: incompatFeatureSeparateJournalDevice.included(incompatFlags),
+ metaBlockGroups: incompatFeatureMetaBlockGroups.included(incompatFlags),
+ extents: incompatFeatureExtents.included(incompatFlags),
+ fs64Bit: incompatFeature64Bit.included(incompatFlags),
+ multipleMountProtection: incompatFeatureMultipleMountProtection.included(incompatFlags),
+ flexBlockGroups: incompatFeatureFlexBlockGroups.included(incompatFlags),
+ extendedAttributeInodes: incompatFeatureExtendedAttributeInodes.included(incompatFlags),
+ dataInDirectoryEntries: incompatFeatureDataInDirectoryEntries.included(incompatFlags),
+ metadataChecksumSeedInSuperblock: incompatFeatureMetadataChecksumSeedInSuperblock.included(incompatFlags),
+ largeDirectory: incompatFeatureLargeDirectory.included(incompatFlags),
+ dataInInode: incompatFeatureDataInInode.included(incompatFlags),
+ encryptInodes: incompatFeatureEncryptInodes.included(incompatFlags),
+ sparseSuperblock: roCompatFeatureSparseSuperblock.included(roCompatFlags),
+ largeFile: roCompatFeatureLargeFile.included(roCompatFlags),
+ btreeDirectory: roCompatFeatureBtreeDirectory.included(roCompatFlags),
+ hugeFile: roCompatFeatureHugeFile.included(roCompatFlags),
+ gdtChecksum: roCompatFeatureGDTChecksum.included(roCompatFlags),
+ largeSubdirectoryCount: roCompatFeatureLargeSubdirectoryCount.included(roCompatFlags),
+ largeInodes: roCompatFeatureLargeInodes.included(roCompatFlags),
+ snapshot: roCompatFeatureSnapshot.included(roCompatFlags),
+ quota: roCompatFeatureQuota.included(roCompatFlags),
+ bigalloc: roCompatFeatureBigalloc.included(roCompatFlags),
+ metadataChecksums: roCompatFeatureMetadataChecksums.included(roCompatFlags),
+ replicas: roCompatFeatureReplicas.included(roCompatFlags),
+ readOnly: roCompatFeatureReadOnly.included(roCompatFlags),
+ projectQuotas: roCompatFeatureProjectQuotas.included(roCompatFlags),
+ }
+
+ return f
+}
+
+//nolint:gocyclo // we know this has cyclomatic complexity, but not worth breaking apart
+func (f *featureFlags) toInts() (compatFlags, incompatFlags, roCompatFlags uint32) {
+ // compatible flags
+ if f.directoryPreAllocate {
+ compatFlags |= uint32(compatFeatureDirectoryPreAllocate)
+ }
+ if f.imagicInodes {
+ compatFlags |= uint32(compatFeatureImagicInodes)
+ }
+ if f.hasJournal {
+ compatFlags |= uint32(compatFeatureHasJournal)
+ }
+ if f.extendedAttributes {
+ compatFlags |= uint32(compatFeatureExtendedAttributes)
+ }
+ if f.reservedGDTBlocksForExpansion {
+ compatFlags |= uint32(compatFeatureReservedGDTBlocksForExpansion)
+ }
+ if f.directoryIndices {
+ compatFlags |= uint32(compatFeatureDirectoryIndices)
+ }
+ if f.lazyBlockGroup {
+ compatFlags |= uint32(compatFeatureLazyBlockGroup)
+ }
+ if f.excludeInode {
+ compatFlags |= uint32(compatFeatureExcludeInode)
+ }
+ if f.excludeBitmap {
+ compatFlags |= uint32(compatFeatureExcludeBitmap)
+ }
+ if f.sparseSuperBlockV2 {
+ compatFlags |= uint32(compatFeatureSparseSuperBlockV2)
+ }
+ if f.fastCommit {
+ compatFlags |= uint32(compatFeatureFastCommit)
+ }
+ if f.stableInodes {
+ compatFlags |= uint32(compatFeatureStableInodes)
+ }
+ if f.orphanFile {
+ compatFlags |= uint32(compatFeatureOrphanFile)
+ }
+
+ // incompatible flags
+ if f.compression {
+ incompatFlags |= uint32(incompatFeatureCompression)
+ }
+ if f.directoryEntriesRecordFileType {
+ incompatFlags |= uint32(incompatFeatureDirectoryEntriesRecordFileType)
+ }
+ if f.recoveryNeeded {
+ incompatFlags |= uint32(incompatFeatureRecoveryNeeded)
+ }
+ if f.separateJournalDevice {
+ incompatFlags |= uint32(incompatFeatureSeparateJournalDevice)
+ }
+ if f.metaBlockGroups {
+ incompatFlags |= uint32(incompatFeatureMetaBlockGroups)
+ }
+ if f.extents {
+ incompatFlags |= uint32(incompatFeatureExtents)
+ }
+ if f.fs64Bit {
+ incompatFlags |= uint32(incompatFeature64Bit)
+ }
+ if f.multipleMountProtection {
+ incompatFlags |= uint32(incompatFeatureMultipleMountProtection)
+ }
+ if f.flexBlockGroups {
+ incompatFlags |= uint32(incompatFeatureFlexBlockGroups)
+ }
+ if f.extendedAttributeInodes {
+ incompatFlags |= uint32(incompatFeatureExtendedAttributeInodes)
+ }
+ if f.dataInDirectoryEntries {
+ incompatFlags |= uint32(incompatFeatureDataInDirectoryEntries)
+ }
+ if f.metadataChecksumSeedInSuperblock {
+ incompatFlags |= uint32(incompatFeatureMetadataChecksumSeedInSuperblock)
+ }
+ if f.largeDirectory {
+ incompatFlags |= uint32(incompatFeatureLargeDirectory)
+ }
+ if f.dataInInode {
+ incompatFlags |= uint32(incompatFeatureDataInInode)
+ }
+ if f.encryptInodes {
+ incompatFlags |= uint32(incompatFeatureEncryptInodes)
+ }
+
+ // read only compatible flags
+ if f.sparseSuperblock {
+ roCompatFlags |= uint32(roCompatFeatureSparseSuperblock)
+ }
+ if f.largeFile {
+ roCompatFlags |= uint32(roCompatFeatureLargeFile)
+ }
+ if f.btreeDirectory {
+ roCompatFlags |= uint32(roCompatFeatureBtreeDirectory)
+ }
+ if f.hugeFile {
+ roCompatFlags |= uint32(roCompatFeatureHugeFile)
+ }
+ if f.gdtChecksum {
+ roCompatFlags |= uint32(roCompatFeatureGDTChecksum)
+ }
+ if f.largeSubdirectoryCount {
+ roCompatFlags |= uint32(roCompatFeatureLargeSubdirectoryCount)
+ }
+ if f.largeInodes {
+ roCompatFlags |= uint32(roCompatFeatureLargeInodes)
+ }
+ if f.snapshot {
+ roCompatFlags |= uint32(roCompatFeatureSnapshot)
+ }
+ if f.quota {
+ roCompatFlags |= uint32(roCompatFeatureQuota)
+ }
+ if f.bigalloc {
+ roCompatFlags |= uint32(roCompatFeatureBigalloc)
+ }
+ if f.metadataChecksums {
+ roCompatFlags |= uint32(roCompatFeatureMetadataChecksums)
+ }
+ if f.replicas {
+ roCompatFlags |= uint32(roCompatFeatureReplicas)
+ }
+ if f.readOnly {
+ roCompatFlags |= uint32(roCompatFeatureReadOnly)
+ }
+ if f.projectQuotas {
+ roCompatFlags |= uint32(roCompatFeatureProjectQuotas)
+ }
+
+ return compatFlags, incompatFlags, roCompatFlags
+}
+
+// default features
+/*
+ base_features = sparse_super,large_file,filetype,resize_inode,dir_index,ext_attr
+ features = has_journal,extent,huge_file,flex_bg,uninit_bg,64bit,dir_nlink,extra_isize
+*/
+var defaultFeatureFlags = featureFlags{
+ largeFile: true,
+ hugeFile: true,
+ sparseSuperblock: true,
+ flexBlockGroups: true,
+ hasJournal: true,
+ extents: true,
+ fs64Bit: true,
+ extendedAttributes: true,
+}
+
+type FeatureOpt func(*featureFlags)
+
+func WithFeatureDirectoryPreAllocate(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.directoryPreAllocate = enable
+ }
+}
+func WithFeatureImagicInodes(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.imagicInodes = enable
+ }
+}
+func WithFeatureHasJournal(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.hasJournal = enable
+ }
+}
+func WithFeatureExtendedAttributes(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.extendedAttributes = enable
+ }
+}
+func WithFeatureReservedGDTBlocksForExpansion(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.reservedGDTBlocksForExpansion = enable
+ }
+}
+func WithFeatureDirectoryIndices(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.directoryIndices = enable
+ }
+}
+func WithFeatureLazyBlockGroup(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.lazyBlockGroup = enable
+ }
+}
+func WithFeatureExcludeInode(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.excludeInode = enable
+ }
+}
+func WithFeatureExcludeBitmap(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.excludeBitmap = enable
+ }
+}
+func WithFeatureSparseSuperBlockV2(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.sparseSuperBlockV2 = enable
+ }
+}
+func WithFeatureCompression(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.compression = enable
+ }
+}
+func WithFeatureDirectoryEntriesRecordFileType(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.directoryEntriesRecordFileType = enable
+ }
+}
+func WithFeatureRecoveryNeeded(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.recoveryNeeded = enable
+ }
+}
+func WithFeatureSeparateJournalDevice(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.separateJournalDevice = enable
+ }
+}
+func WithFeatureMetaBlockGroups(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.metaBlockGroups = enable
+ }
+}
+func WithFeatureExtents(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.extents = enable
+ }
+}
+func WithFeatureFS64Bit(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.fs64Bit = enable
+ }
+}
+func WithFeatureMultipleMountProtection(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.multipleMountProtection = enable
+ }
+}
+func WithFeatureFlexBlockGroups(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.flexBlockGroups = enable
+ }
+}
+func WithFeatureExtendedAttributeInodes(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.extendedAttributeInodes = enable
+ }
+}
+func WithFeatureDataInDirectoryEntries(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.dataInDirectoryEntries = enable
+ }
+}
+func WithFeatureMetadataChecksumSeedInSuperblock(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.metadataChecksumSeedInSuperblock = enable
+ }
+}
+func WithFeatureLargeDirectory(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.largeDirectory = enable
+ }
+}
+func WithFeatureDataInInode(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.dataInInode = enable
+ }
+}
+func WithFeatureEncryptInodes(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.encryptInodes = enable
+ }
+}
+func WithFeatureSparseSuperblock(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.sparseSuperblock = enable
+ }
+}
+func WithFeatureLargeFile(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.largeFile = enable
+ }
+}
+func WithFeatureBTreeDirectory(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.btreeDirectory = enable
+ }
+}
+func WithFeatureHugeFile(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.hugeFile = enable
+ }
+}
+func WithFeatureGDTChecksum(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.gdtChecksum = enable
+ }
+}
+func WithFeatureLargeSubdirectoryCount(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.largeSubdirectoryCount = enable
+ }
+}
+func WithFeatureLargeInodes(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.largeInodes = enable
+ }
+}
+func WithFeatureSnapshot(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.snapshot = enable
+ }
+}
+func WithFeatureQuota(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.quota = enable
+ }
+}
+func WithFeatureBigalloc(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.bigalloc = enable
+ }
+}
+func WithFeatureMetadataChecksums(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.metadataChecksums = enable
+ }
+}
+func WithFeatureReplicas(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.replicas = enable
+ }
+}
+func WithFeatureReadOnly(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.readOnly = enable
+ }
+}
+func WithFeatureProjectQuotas(enable bool) FeatureOpt {
+ return func(o *featureFlags) {
+ o.projectQuotas = enable
+ }
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/file.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/file.go
new file mode 100644
index 000000000000..4dc653956c66
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/file.go
@@ -0,0 +1,208 @@
+package ext4
+
+import (
+ "fmt"
+ "io"
+)
+
+// File represents a single file in an ext4 filesystem
+type File struct {
+ *directoryEntry
+ *inode
+ isReadWrite bool
+ isAppend bool
+ offset int64
+ filesystem *FileSystem
+ extents extents
+}
+
+// Read reads up to len(b) bytes from the File.
+// It returns the number of bytes read and any error encountered.
+// At end of file, Read returns 0, io.EOF
+// reads from the last known offset in the file from last read or write
+// use Seek() to set at a particular point
+func (fl *File) Read(b []byte) (int, error) {
+ var (
+ fileSize = int64(fl.size)
+ blocksize = uint64(fl.filesystem.superblock.blockSize)
+ )
+ if fl.offset >= fileSize {
+ return 0, io.EOF
+ }
+
+ // Calculate the number of bytes to read
+ bytesToRead := int64(len(b))
+ if fl.offset+bytesToRead > fileSize {
+ bytesToRead = fileSize - fl.offset
+ }
+
+ // Create a buffer to hold the bytes to be read
+ readBytes := int64(0)
+ b = b[:bytesToRead]
+
+ // the offset given for reading is relative to the file, so we need to calculate
+ // where these are in the extents relative to the file
+ readStartBlock := uint64(fl.offset) / blocksize
+ for _, e := range fl.extents {
+ // if the last block of the extent is before the first block we want to read, skip it
+ if uint64(e.fileBlock)+uint64(e.count) < readStartBlock {
+ continue
+ }
+ // extentSize is the number of bytes on the disk for the extent
+ extentSize := int64(e.count) * int64(blocksize)
+ // where do we start and end in the extent?
+ startPositionInExtent := fl.offset - int64(e.fileBlock)*int64(blocksize)
+ leftInExtent := extentSize - startPositionInExtent
+ // how many bytes are left to read
+ toReadInOffset := bytesToRead - readBytes
+ if toReadInOffset > leftInExtent {
+ toReadInOffset = leftInExtent
+ }
+ // read those bytes
+ startPosOnDisk := e.startingBlock*blocksize + uint64(startPositionInExtent)
+ b2 := make([]byte, toReadInOffset)
+ read, err := fl.filesystem.file.ReadAt(b2, int64(startPosOnDisk))
+ if err != nil {
+ return int(readBytes), fmt.Errorf("failed to read bytes: %v", err)
+ }
+ copy(b[readBytes:], b2[:read])
+ readBytes += int64(read)
+ fl.offset += int64(read)
+
+ if readBytes >= bytesToRead {
+ break
+ }
+ }
+ var err error
+ if fl.offset >= fileSize {
+ err = io.EOF
+ }
+
+ return int(readBytes), err
+}
+
+// Write writes len(b) bytes to the File.
+// It returns the number of bytes written and an error, if any.
+// returns a non-nil error when n != len(b)
+// writes to the last known offset in the file from last read or write
+// use Seek() to set at a particular point
+func (fl *File) Write(b []byte) (int, error) {
+ var (
+ fileSize = int64(fl.size)
+ originalFileSize = int64(fl.size)
+ blockCount = fl.blocks
+ originalBlockCount = fl.blocks
+ blocksize = uint64(fl.filesystem.superblock.blockSize)
+ )
+ if !fl.isReadWrite {
+ return 0, fmt.Errorf("file is not open for writing")
+ }
+
+ // if adding these bytes goes past the filesize, update the inode filesize to the new size and write the inode
+ // if adding these bytes goes past the total number of blocks, add more blocks, update the inode block count and write the inode
+ // if the offset is greater than the filesize, update the inode filesize to the offset
+ if fl.offset >= fileSize {
+ fl.size = uint64(fl.offset)
+ }
+
+ // Calculate the number of bytes to write
+ bytesToWrite := int64(len(b))
+
+ offsetAfterWrite := fl.offset + bytesToWrite
+ if offsetAfterWrite > int64(fl.size) {
+ fl.size = uint64(fl.offset + bytesToWrite)
+ }
+
+ // calculate the number of blocks in the file post-write
+ newBlockCount := fl.size / blocksize
+ if fl.size%blocksize > 0 {
+ newBlockCount++
+ }
+ blocksNeeded := newBlockCount - blockCount
+ bytesNeeded := blocksNeeded * blocksize
+ if newBlockCount > blockCount {
+ newExtents, err := fl.filesystem.allocateExtents(bytesNeeded, &fl.extents)
+ if err != nil {
+ return 0, fmt.Errorf("could not allocate disk space for file %w", err)
+ }
+ extentTreeParsed, err := extendExtentTree(fl.inode.extents, newExtents, fl.filesystem, nil)
+ if err != nil {
+ return 0, fmt.Errorf("could not convert extents into tree: %w", err)
+ }
+ fl.inode.extents = extentTreeParsed
+ fl.blocks = newBlockCount
+ }
+
+ if originalFileSize != int64(fl.size) || originalBlockCount != fl.blocks {
+ err := fl.filesystem.writeInode(fl.inode)
+ if err != nil {
+ return 0, fmt.Errorf("could not write inode: %w", err)
+ }
+ }
+
+ writtenBytes := int64(0)
+
+ // the offset given for reading is relative to the file, so we need to calculate
+ // where these are in the extents relative to the file
+ writeStartBlock := uint64(fl.offset) / blocksize
+ for _, e := range fl.extents {
+ // if the last block of the extent is before the first block we want to write, skip it
+ if uint64(e.fileBlock)+uint64(e.count) < writeStartBlock {
+ continue
+ }
+ // extentSize is the number of bytes on the disk for the extent
+ extentSize := int64(e.count) * int64(blocksize)
+ // where do we start and end in the extent?
+ startPositionInExtent := fl.offset - int64(e.fileBlock)*int64(blocksize)
+ leftInExtent := extentSize - startPositionInExtent
+ // how many bytes are left in the extent?
+ toWriteInOffset := bytesToWrite - writtenBytes
+ if toWriteInOffset > leftInExtent {
+ toWriteInOffset = leftInExtent
+ }
+ // read those bytes
+ startPosOnDisk := e.startingBlock*blocksize + uint64(startPositionInExtent)
+ b2 := make([]byte, toWriteInOffset)
+ copy(b2, b[writtenBytes:])
+ written, err := fl.filesystem.file.WriteAt(b2, int64(startPosOnDisk))
+ if err != nil {
+ return int(writtenBytes), fmt.Errorf("failed to read bytes: %v", err)
+ }
+ writtenBytes += int64(written)
+ fl.offset += int64(written)
+
+ if written >= len(b) {
+ break
+ }
+ }
+ var err error
+ if fl.offset >= fileSize {
+ err = io.EOF
+ }
+
+ return int(writtenBytes), err
+}
+
+// Seek set the offset to a particular point in the file
+func (fl *File) Seek(offset int64, whence int) (int64, error) {
+ newOffset := int64(0)
+ switch whence {
+ case io.SeekStart:
+ newOffset = offset
+ case io.SeekEnd:
+ newOffset = int64(fl.size) + offset
+ case io.SeekCurrent:
+ newOffset = fl.offset + offset
+ }
+ if newOffset < 0 {
+ return fl.offset, fmt.Errorf("cannot set offset %d before start of file", offset)
+ }
+ fl.offset = newOffset
+ return fl.offset, nil
+}
+
+// Close close a file that is being read
+func (fl *File) Close() error {
+ *fl = File{}
+ return nil
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/fileinfo.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/fileinfo.go
new file mode 100644
index 000000000000..4a6e5c3aacb3
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/fileinfo.go
@@ -0,0 +1,48 @@
+package ext4
+
+import (
+ "os"
+ "time"
+)
+
+// FileInfo represents the information for an individual file
+// it fulfills os.FileInfo interface
+type FileInfo struct {
+ modTime time.Time
+ mode os.FileMode
+ name string
+ size int64
+ isDir bool
+}
+
+// IsDir abbreviation for Mode().IsDir()
+func (fi *FileInfo) IsDir() bool {
+ return fi.isDir
+}
+
+// ModTime modification time
+func (fi *FileInfo) ModTime() time.Time {
+ return fi.modTime
+}
+
+// Mode returns file mode
+func (fi *FileInfo) Mode() os.FileMode {
+ return fi.mode
+}
+
+// Name base name of the file
+//
+// will return the long name of the file. If none exists, returns the shortname and extension
+func (fi *FileInfo) Name() string {
+ return fi.name
+}
+
+// Size length in bytes for regular files
+func (fi *FileInfo) Size() int64 {
+ return fi.size
+}
+
+// Sys underlying data source - not supported yet and so will return nil
+func (fi *FileInfo) Sys() interface{} {
+ return nil
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/groupdescriptors.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/groupdescriptors.go
new file mode 100644
index 000000000000..995cda05e869
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/groupdescriptors.go
@@ -0,0 +1,327 @@
+package ext4
+
+import (
+ "cmp"
+ "encoding/binary"
+ "fmt"
+ "slices"
+
+ "github.com/diskfs/go-diskfs/filesystem/ext4/crc"
+)
+
+type blockGroupFlag uint16
+type gdtChecksumType uint8
+
+func (b blockGroupFlag) included(a uint16) bool {
+ return a&uint16(b) == uint16(b)
+}
+
+//nolint:unused // will be used in the future, not yet
+func (g gdtChecksumType) included(a uint8) bool {
+ return a&uint8(g) == uint8(g)
+}
+
+const (
+ groupDescriptorSize uint16 = 32
+ groupDescriptorSize64Bit uint16 = 64
+ blockGroupFlagInodesUninitialized blockGroupFlag = 0x1
+ blockGroupFlagBlockBitmapUninitialized blockGroupFlag = 0x2
+ blockGroupFlagInodeTableZeroed blockGroupFlag = 0x4
+ gdtChecksumNone gdtChecksumType = 0
+ gdtChecksumGdt gdtChecksumType = 1
+ gdtChecksumMetadata gdtChecksumType = 2
+)
+
+type blockGroupFlags struct {
+ inodesUninitialized bool
+ blockBitmapUninitialized bool
+ inodeTableZeroed bool
+}
+
+// groupdescriptors is a structure holding all of the group descriptors for all of the block groups
+type groupDescriptors struct {
+ descriptors []groupDescriptor
+}
+
+// groupDescriptor is a structure holding the data about a single block group
+type groupDescriptor struct {
+ blockBitmapLocation uint64
+ inodeBitmapLocation uint64
+ inodeTableLocation uint64
+ freeBlocks uint32
+ freeInodes uint32
+ usedDirectories uint32
+ flags blockGroupFlags
+ snapshotExclusionBitmapLocation uint64
+ blockBitmapChecksum uint32
+ inodeBitmapChecksum uint32
+ unusedInodes uint32
+ size uint16
+ number uint16
+}
+
+func (gd *groupDescriptor) equal(other *groupDescriptor) bool {
+ if other == nil {
+ return gd == nil
+ }
+ return *gd == *other
+}
+
+func (gds *groupDescriptors) equal(a *groupDescriptors) bool {
+ if gds == nil && a == nil {
+ return true
+ }
+ if (gds == nil && a != nil) || (a == nil && gds != nil) || len(gds.descriptors) != len(a.descriptors) {
+ return false
+ }
+
+ // both not nil, same size, so compare them
+ for i, g := range gds.descriptors {
+ if g != a.descriptors[i] {
+ return false
+ }
+ }
+ // if we made it this far, all the same
+ return true
+}
+
+// groupDescriptorsFromBytes create a groupDescriptors struct from bytes
+func groupDescriptorsFromBytes(b []byte, gdSize uint16, hashSeed uint32, checksumType gdtChecksumType) (*groupDescriptors, error) {
+ gds := groupDescriptors{}
+ gdSlice := make([]groupDescriptor, 0, 10)
+
+ count := len(b) / int(gdSize)
+
+ // go through them gdSize bytes at a time
+ for i := 0; i < count; i++ {
+ start := i * int(gdSize)
+ end := start + int(gdSize)
+ gd, err := groupDescriptorFromBytes(b[start:end], gdSize, i, checksumType, hashSeed)
+ if err != nil || gd == nil {
+ return nil, fmt.Errorf("error creating group descriptor from bytes: %w", err)
+ }
+ gdSlice = append(gdSlice, *gd)
+ }
+ gds.descriptors = gdSlice
+
+ return &gds, nil
+}
+
+// toBytes returns groupDescriptors ready to be written to disk
+func (gds *groupDescriptors) toBytes(checksumType gdtChecksumType, hashSeed uint32) []byte {
+ b := make([]byte, 0, 10*groupDescriptorSize)
+ for _, gd := range gds.descriptors {
+ b2 := gd.toBytes(checksumType, hashSeed)
+ b = append(b, b2...)
+ }
+
+ return b
+}
+
+// byFreeBlocks provides a sorted list of groupDescriptors by free blocks, descending.
+// If you want them ascending, sort if.
+func (gds *groupDescriptors) byFreeBlocks() []groupDescriptor {
+ // make a copy of the slice
+ gdSlice := make([]groupDescriptor, len(gds.descriptors))
+ copy(gdSlice, gds.descriptors)
+
+ // sort the slice
+ slices.SortFunc(gdSlice, func(a, b groupDescriptor) int {
+ return cmp.Compare(a.freeBlocks, b.freeBlocks)
+ })
+
+ return gdSlice
+}
+
+// groupDescriptorFromBytes create a groupDescriptor struct from bytes
+func groupDescriptorFromBytes(b []byte, gdSize uint16, number int, checksumType gdtChecksumType, hashSeed uint32) (*groupDescriptor, error) {
+ // block count, reserved block count and free blocks depends on whether the fs is 64-bit or not
+ blockBitmapLocation := make([]byte, 8)
+ inodeBitmapLocation := make([]byte, 8)
+ inodeTableLocation := make([]byte, 8)
+ freeBlocks := make([]byte, 4)
+ freeInodes := make([]byte, 4)
+ usedirectories := make([]byte, 4)
+ snapshotExclusionBitmapLocation := make([]byte, 8)
+ blockBitmapChecksum := make([]byte, 4)
+ inodeBitmapChecksum := make([]byte, 4)
+ unusedInodes := make([]byte, 4)
+
+ copy(blockBitmapLocation[0:4], b[0x0:0x4])
+ copy(inodeBitmapLocation[0:4], b[0x4:0x8])
+ copy(inodeTableLocation[0:4], b[0x8:0xc])
+ copy(freeBlocks[0:2], b[0xc:0xe])
+ copy(freeInodes[0:2], b[0xe:0x10])
+ copy(usedirectories[0:2], b[0x10:0x12])
+ copy(snapshotExclusionBitmapLocation[0:4], b[0x14:0x18])
+ copy(blockBitmapChecksum[0:2], b[0x18:0x1a])
+ copy(inodeBitmapChecksum[0:2], b[0x1a:0x1c])
+ copy(unusedInodes[0:2], b[0x1c:0x1e])
+
+ if gdSize == 64 {
+ copy(blockBitmapLocation[4:8], b[0x20:0x24])
+ copy(inodeBitmapLocation[4:8], b[0x24:0x28])
+ copy(inodeTableLocation[4:8], b[0x28:0x2c])
+ copy(freeBlocks[2:4], b[0x2c:0x2e])
+ copy(freeInodes[2:4], b[0x2e:0x30])
+ copy(usedirectories[2:4], b[0x30:0x32])
+ copy(unusedInodes[2:4], b[0x32:0x34])
+ copy(snapshotExclusionBitmapLocation[4:8], b[0x34:0x38])
+ copy(blockBitmapChecksum[2:4], b[0x38:0x3a])
+ copy(inodeBitmapChecksum[2:4], b[0x3a:0x3c])
+ }
+
+ gdNumber := uint16(number)
+ // only bother with checking the checksum if it was not type none (pre-checksums)
+ if checksumType != gdtChecksumNone {
+ checksum := binary.LittleEndian.Uint16(b[0x1e:0x20])
+ actualChecksum := groupDescriptorChecksum(b[0x0:0x40], hashSeed, gdNumber, checksumType)
+ if checksum != actualChecksum {
+ return nil, fmt.Errorf("checksum mismatch, passed %x, actual %x", checksum, actualChecksum)
+ }
+ }
+
+ gd := groupDescriptor{
+ size: gdSize,
+ number: gdNumber,
+ blockBitmapLocation: binary.LittleEndian.Uint64(blockBitmapLocation),
+ inodeBitmapLocation: binary.LittleEndian.Uint64(inodeBitmapLocation),
+ inodeTableLocation: binary.LittleEndian.Uint64(inodeTableLocation),
+ freeBlocks: binary.LittleEndian.Uint32(freeBlocks),
+ freeInodes: binary.LittleEndian.Uint32(freeInodes),
+ usedDirectories: binary.LittleEndian.Uint32(usedirectories),
+ snapshotExclusionBitmapLocation: binary.LittleEndian.Uint64(snapshotExclusionBitmapLocation),
+ blockBitmapChecksum: binary.LittleEndian.Uint32(blockBitmapChecksum),
+ inodeBitmapChecksum: binary.LittleEndian.Uint32(inodeBitmapChecksum),
+ unusedInodes: binary.LittleEndian.Uint32(unusedInodes),
+ flags: parseBlockGroupFlags(binary.LittleEndian.Uint16(b[0x12:0x14])),
+ }
+
+ return &gd, nil
+}
+
+// toBytes returns a groupDescriptor ready to be written to disk
+func (gd *groupDescriptor) toBytes(checksumType gdtChecksumType, hashSeed uint32) []byte {
+ gdSize := gd.size
+
+ b := make([]byte, gdSize)
+
+ blockBitmapLocation := make([]byte, 8)
+ inodeBitmapLocation := make([]byte, 8)
+ inodeTableLocation := make([]byte, 8)
+ freeBlocks := make([]byte, 4)
+ freeInodes := make([]byte, 4)
+ usedirectories := make([]byte, 4)
+ snapshotExclusionBitmapLocation := make([]byte, 8)
+ blockBitmapChecksum := make([]byte, 4)
+ inodeBitmapChecksum := make([]byte, 4)
+ unusedInodes := make([]byte, 4)
+
+ binary.LittleEndian.PutUint64(blockBitmapLocation, gd.blockBitmapLocation)
+ binary.LittleEndian.PutUint64(inodeTableLocation, gd.inodeTableLocation)
+ binary.LittleEndian.PutUint64(inodeBitmapLocation, gd.inodeBitmapLocation)
+ binary.LittleEndian.PutUint32(freeBlocks, gd.freeBlocks)
+ binary.LittleEndian.PutUint32(freeInodes, gd.freeInodes)
+ binary.LittleEndian.PutUint32(usedirectories, gd.usedDirectories)
+ binary.LittleEndian.PutUint64(snapshotExclusionBitmapLocation, gd.snapshotExclusionBitmapLocation)
+ binary.LittleEndian.PutUint32(blockBitmapChecksum, gd.blockBitmapChecksum)
+ binary.LittleEndian.PutUint32(inodeBitmapChecksum, gd.inodeBitmapChecksum)
+ binary.LittleEndian.PutUint32(unusedInodes, gd.unusedInodes)
+
+ // copy the lower 32 bytes in
+ copy(b[0x0:0x4], blockBitmapLocation[0:4])
+ copy(b[0x4:0x8], inodeBitmapLocation[0:4])
+ copy(b[0x8:0xc], inodeTableLocation[0:4])
+ copy(b[0xc:0xe], freeBlocks[0:2])
+ copy(b[0xe:0x10], freeInodes[0:2])
+ copy(b[0x10:0x12], usedirectories[0:2])
+ binary.LittleEndian.PutUint16(b[0x12:0x14], gd.flags.toInt())
+ copy(b[0x14:0x18], snapshotExclusionBitmapLocation[0:4])
+ copy(b[0x18:0x1a], blockBitmapChecksum[0:2])
+ copy(b[0x1a:0x1c], inodeBitmapChecksum[0:2])
+ copy(b[0x1c:0x1e], unusedInodes[0:2])
+
+ // now for the upper 32 bytes
+ if gd.size == 64 {
+ copy(b[0x20:0x24], blockBitmapLocation[4:8])
+ copy(b[0x24:0x28], inodeBitmapLocation[4:8])
+ copy(b[0x28:0x2c], inodeTableLocation[4:8])
+ copy(b[0x2c:0x2e], freeBlocks[2:4])
+ copy(b[0x2e:0x30], freeInodes[2:4])
+ copy(b[0x30:0x32], usedirectories[2:4])
+ copy(b[0x32:0x34], unusedInodes[2:4])
+ copy(b[0x34:0x38], snapshotExclusionBitmapLocation[4:8])
+ copy(b[0x38:0x3a], blockBitmapChecksum[2:4])
+ copy(b[0x3a:0x3c], inodeBitmapChecksum[2:4])
+ }
+
+ checksum := groupDescriptorChecksum(b[0x0:0x40], hashSeed, gd.number, checksumType)
+ binary.LittleEndian.PutUint16(b[0x1e:0x20], checksum)
+
+ return b
+}
+
+func parseBlockGroupFlags(flags uint16) blockGroupFlags {
+ f := blockGroupFlags{
+ inodeTableZeroed: blockGroupFlagInodeTableZeroed.included(flags),
+ inodesUninitialized: blockGroupFlagInodesUninitialized.included(flags),
+ blockBitmapUninitialized: blockGroupFlagBlockBitmapUninitialized.included(flags),
+ }
+
+ return f
+}
+
+func (f *blockGroupFlags) toInt() uint16 {
+ var (
+ flags uint16
+ )
+
+ // compatible flags
+ if f.inodeTableZeroed {
+ flags |= uint16(blockGroupFlagInodeTableZeroed)
+ }
+ if f.inodesUninitialized {
+ flags |= uint16(blockGroupFlagInodesUninitialized)
+ }
+ if f.blockBitmapUninitialized {
+ flags |= uint16(blockGroupFlagBlockBitmapUninitialized)
+ }
+ return flags
+}
+
+// groupDescriptorChecksum calculate the checksum for a block group descriptor
+// NOTE: we are assuming that the block group number is uint64, but we do not know that to be true
+//
+// it might be uint32 or uint64, and it might be in BigEndian as opposed to LittleEndian
+// just have to start with this and see
+// we do know that the maximum number of block groups in 32-bit mode is 2^19, which must be uint32
+// and in 64-bit mode it is 2^51 which must be uint64
+// So we start with uint32 = [4]byte{} for regular mode and [8]byte{} for mod32
+func groupDescriptorChecksum(b []byte, hashSeed uint32, groupNumber uint16, checksumType gdtChecksumType) uint16 {
+ var checksum uint16
+
+ numBytes := make([]byte, 4)
+ binary.LittleEndian.PutUint16(numBytes, groupNumber)
+ switch checksumType {
+ case gdtChecksumNone:
+ checksum = 0
+ case gdtChecksumMetadata:
+ // metadata checksum applies groupNumber to seed, then zeroes out checksum bytes from entire descriptor, then applies descriptor bytes
+ crcResult := crc.CRC32c(hashSeed, numBytes)
+ b2 := make([]byte, len(b))
+ copy(b2, b)
+ b2[0x1e] = 0
+ b2[0x1f] = 0
+ crcResult = crc.CRC32c(crcResult, b2)
+ checksum = uint16(crcResult & 0xffff)
+ case gdtChecksumGdt:
+ hashSeed16 := uint16(hashSeed & 0xffff)
+ crcResult := crc.CRC16(hashSeed16, numBytes)
+ b2 := make([]byte, len(b))
+ copy(b2, b)
+ b2[0x1e] = 0
+ b2[0x1f] = 0
+ checksum = crc.CRC16(crcResult, b)
+ }
+ return checksum
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/inode.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/inode.go
new file mode 100644
index 000000000000..b760c0cf6728
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/inode.go
@@ -0,0 +1,588 @@
+package ext4
+
+import (
+ "encoding/binary"
+ "fmt"
+ "time"
+
+ "github.com/diskfs/go-diskfs/filesystem/ext4/crc"
+)
+
+type inodeFlag uint32
+type fileType uint16
+
+func (i inodeFlag) included(a uint32) bool {
+ return a&uint32(i) == uint32(i)
+}
+
+const (
+ ext2InodeSize uint16 = 128
+ // minInodeSize is ext2 + the extra min 32 bytes in ext4
+ minInodeExtraSize uint16 = 32
+ wantInodeExtraSize uint16 = 128
+ minInodeSize uint16 = ext2InodeSize + minInodeExtraSize
+ extentInodeMaxEntries int = 4
+ inodeFlagSecureDeletion inodeFlag = 0x1
+ inodeFlagPreserveForUndeletion inodeFlag = 0x2
+ inodeFlagCompressed inodeFlag = 0x4
+ inodeFlagSynchronous inodeFlag = 0x8
+ inodeFlagImmutable inodeFlag = 0x10
+ inodeFlagAppendOnly inodeFlag = 0x20
+ inodeFlagNoDump inodeFlag = 0x40
+ inodeFlagNoAccessTimeUpdate inodeFlag = 0x80
+ inodeFlagDirtyCompressed inodeFlag = 0x100
+ inodeFlagCompressedClusters inodeFlag = 0x200
+ inodeFlagNoCompress inodeFlag = 0x400
+ inodeFlagEncryptedInode inodeFlag = 0x800
+ inodeFlagHashedDirectoryIndexes inodeFlag = 0x1000
+ inodeFlagAFSMagicDirectory inodeFlag = 0x2000
+ inodeFlagAlwaysJournal inodeFlag = 0x4000
+ inodeFlagNoMergeTail inodeFlag = 0x8000
+ inodeFlagSyncDirectoryData inodeFlag = 0x10000
+ inodeFlagTopDirectory inodeFlag = 0x20000
+ inodeFlagHugeFile inodeFlag = 0x40000
+ inodeFlagUsesExtents inodeFlag = 0x80000
+ inodeFlagExtendedAttributes inodeFlag = 0x200000
+ inodeFlagBlocksPastEOF inodeFlag = 0x400000
+ inodeFlagSnapshot inodeFlag = 0x1000000
+ inodeFlagDeletingSnapshot inodeFlag = 0x4000000
+ inodeFlagCompletedSnapshotShrink inodeFlag = 0x8000000
+ inodeFlagInlineData inodeFlag = 0x10000000
+ inodeFlagInheritProject inodeFlag = 0x20000000
+
+ fileTypeFifo fileType = 0x1000
+ fileTypeCharacterDevice fileType = 0x2000
+ fileTypeDirectory fileType = 0x4000
+ fileTypeBlockDevice fileType = 0x6000
+ fileTypeRegularFile fileType = 0x8000
+ fileTypeSymbolicLink fileType = 0xA000
+ fileTypeSocket fileType = 0xC000
+
+ filePermissionsOwnerExecute uint16 = 0x40
+ filePermissionsOwnerWrite uint16 = 0x80
+ filePermissionsOwnerRead uint16 = 0x100
+ filePermissionsGroupExecute uint16 = 0x8
+ filePermissionsGroupWrite uint16 = 0x10
+ filePermissionsGroupRead uint16 = 0x20
+ filePermissionsOtherExecute uint16 = 0x1
+ filePermissionsOtherWrite uint16 = 0x2
+ filePermissionsOtherRead uint16 = 0x4
+)
+
+// mountOptions is a structure holding flags for an inode
+type inodeFlags struct {
+ secureDeletion bool
+ preserveForUndeletion bool
+ compressed bool
+ synchronous bool
+ immutable bool
+ appendOnly bool
+ noDump bool
+ noAccessTimeUpdate bool
+ dirtyCompressed bool
+ compressedClusters bool
+ noCompress bool
+ encryptedInode bool
+ hashedDirectoryIndexes bool
+ AFSMagicDirectory bool
+ alwaysJournal bool
+ noMergeTail bool
+ syncDirectoryData bool
+ topDirectory bool
+ hugeFile bool
+ usesExtents bool
+ extendedAttributes bool
+ blocksPastEOF bool
+ snapshot bool
+ deletingSnapshot bool
+ completedSnapshotShrink bool
+ inlineData bool
+ inheritProject bool
+}
+
+type filePermissions struct {
+ read bool
+ write bool
+ execute bool
+}
+
+// inode is a structure holding the data about an inode
+type inode struct {
+ number uint32
+ permissionsOther filePermissions
+ permissionsGroup filePermissions
+ permissionsOwner filePermissions
+ fileType fileType
+ owner uint32
+ group uint32
+ size uint64
+ accessTime time.Time
+ changeTime time.Time
+ modifyTime time.Time
+ createTime time.Time
+ deletionTime uint32
+ hardLinks uint16
+ blocks uint64
+ filesystemBlocks bool
+ flags *inodeFlags
+ version uint64
+ nfsFileVersion uint32
+ extendedAttributeBlock uint64
+ inodeSize uint16
+ project uint32
+ extents extentBlockFinder
+ linkTarget string
+}
+
+//nolint:unused // will be used in the future, not yet
+func (i *inode) equal(a *inode) bool {
+ if (i == nil && a != nil) || (a == nil && i != nil) {
+ return false
+ }
+ if i == nil && a == nil {
+ return true
+ }
+ return *i == *a
+}
+
+// inodeFromBytes create an inode struct from bytes
+func inodeFromBytes(b []byte, sb *superblock, number uint32) (*inode, error) {
+ // safely make sure it is the min size
+ if len(b) < int(minInodeSize) {
+ return nil, fmt.Errorf("inode data too short: %d bytes, must be min %d bytes", len(b), minInodeSize)
+ }
+
+ // checksum before using the data
+ checksumBytes := make([]byte, 4)
+
+ // checksum before using the data
+ copy(checksumBytes[0:2], b[0x7c:0x7e])
+ copy(checksumBytes[2:4], b[0x82:0x84])
+ // zero out checksum fields before calculating the checksum
+ b[0x7c] = 0
+ b[0x7d] = 0
+ b[0x82] = 0
+ b[0x83] = 0
+
+ // block count, reserved block count and free blocks depends on whether the fs is 64-bit or not
+ owner := make([]byte, 4)
+ fileSize := make([]byte, 8)
+ group := make([]byte, 4)
+ accessTime := make([]byte, 8)
+ changeTime := make([]byte, 8)
+ modifyTime := make([]byte, 8)
+ createTime := make([]byte, 8)
+ version := make([]byte, 8)
+ extendedAttributeBlock := make([]byte, 8)
+
+ mode := binary.LittleEndian.Uint16(b[0x0:0x2])
+
+ copy(owner[0:2], b[0x2:0x4])
+ copy(owner[2:4], b[0x78:0x7a])
+ copy(group[0:2], b[0x18:0x20])
+ copy(group[2:4], b[0x7a:0x7c])
+ copy(fileSize[0:4], b[0x4:0x8])
+ copy(fileSize[4:8], b[0x6c:0x70])
+ copy(version[0:4], b[0x24:0x28])
+ copy(version[4:8], b[0x98:0x9c])
+ copy(extendedAttributeBlock[0:4], b[0x88:0x8c])
+ copy(extendedAttributeBlock[4:6], b[0x76:0x78])
+
+ // get the the times
+ // the structure is as follows:
+ // original 32 bits (0:4) are seconds. Add (to the left) 2 more bits from the 32
+ // the remaining 30 bites are nanoseconds
+ copy(accessTime[0:4], b[0x8:0xc])
+ // take the two bits relevant and add to fifth byte
+ accessTime[4] = b[0x8c] & 0x3
+ copy(changeTime[0:4], b[0xc:0x10])
+ changeTime[4] = b[0x84] & 0x3
+ copy(modifyTime[0:4], b[0x10:0x14])
+ modifyTime[4] = b[0x88] & 0x3
+ copy(createTime[0:4], b[0x90:0x94])
+ createTime[4] = b[0x94] & 0x3
+
+ accessTimeSeconds := binary.LittleEndian.Uint64(accessTime)
+ changeTimeSeconds := binary.LittleEndian.Uint64(changeTime)
+ modifyTimeSeconds := binary.LittleEndian.Uint64(modifyTime)
+ createTimeSeconds := binary.LittleEndian.Uint64(createTime)
+
+ // now get the nanoseconds by using the upper 30 bites
+ accessTimeNanoseconds := binary.LittleEndian.Uint32(b[0x8c:0x90]) >> 2
+ changeTimeNanoseconds := binary.LittleEndian.Uint32(b[0x84:0x88]) >> 2
+ modifyTimeNanoseconds := binary.LittleEndian.Uint32(b[0x88:0x8c]) >> 2
+ createTimeNanoseconds := binary.LittleEndian.Uint32(b[0x94:0x98]) >> 2
+
+ flagsNum := binary.LittleEndian.Uint32(b[0x20:0x24])
+
+ flags := parseInodeFlags(flagsNum)
+
+ blocksLow := binary.LittleEndian.Uint32(b[0x1c:0x20])
+ blocksHigh := binary.LittleEndian.Uint16(b[0x74:0x76])
+ var (
+ blocks uint64
+ filesystemBlocks bool
+ )
+
+ hugeFile := sb.features.hugeFile
+ switch {
+ case !hugeFile:
+ // just 512-byte blocks
+ blocks = uint64(blocksLow)
+ filesystemBlocks = false
+ case hugeFile && !flags.hugeFile:
+ // larger number of 512-byte blocks
+ blocks = uint64(blocksHigh)<<32 + uint64(blocksLow)
+ filesystemBlocks = false
+ default:
+ // larger number of filesystem blocks
+ blocks = uint64(blocksHigh)<<32 + uint64(blocksLow)
+ filesystemBlocks = true
+ }
+ fileType := parseFileType(mode)
+ fileSizeNum := binary.LittleEndian.Uint64(fileSize)
+
+ extentInfo := make([]byte, 60)
+ copy(extentInfo, b[0x28:0x64])
+ // symlinks might store link target in extentInfo, or might store them elsewhere
+ var (
+ linkTarget string
+ allExtents extentBlockFinder
+ err error
+ )
+ if fileType == fileTypeSymbolicLink && fileSizeNum < 60 {
+ linkTarget = string(extentInfo[:fileSizeNum])
+ } else {
+ // parse the extent information in the inode to get the root of the extents tree
+ // we do not walk the entire tree, to get a slice of blocks for the file.
+ // If we want to do that, we call the extentBlockFinder.blocks() method
+ allExtents, err = parseExtents(extentInfo, sb.blockSize, 0, uint32(blocks))
+ if err != nil {
+ return nil, fmt.Errorf("error parsing extent tree: %v", err)
+ }
+ }
+
+ i := inode{
+ number: number,
+ permissionsGroup: parseGroupPermissions(mode),
+ permissionsOwner: parseOwnerPermissions(mode),
+ permissionsOther: parseOtherPermissions(mode),
+ fileType: fileType,
+ owner: binary.LittleEndian.Uint32(owner),
+ group: binary.LittleEndian.Uint32(group),
+ size: fileSizeNum,
+ hardLinks: binary.LittleEndian.Uint16(b[0x1a:0x1c]),
+ blocks: blocks,
+ filesystemBlocks: filesystemBlocks,
+ flags: &flags,
+ nfsFileVersion: binary.LittleEndian.Uint32(b[0x64:0x68]),
+ version: binary.LittleEndian.Uint64(version),
+ inodeSize: binary.LittleEndian.Uint16(b[0x80:0x82]) + minInodeSize,
+ deletionTime: binary.LittleEndian.Uint32(b[0x14:0x18]),
+ accessTime: time.Unix(int64(accessTimeSeconds), int64(accessTimeNanoseconds)),
+ changeTime: time.Unix(int64(changeTimeSeconds), int64(changeTimeNanoseconds)),
+ modifyTime: time.Unix(int64(modifyTimeSeconds), int64(modifyTimeNanoseconds)),
+ createTime: time.Unix(int64(createTimeSeconds), int64(createTimeNanoseconds)),
+ extendedAttributeBlock: binary.LittleEndian.Uint64(extendedAttributeBlock),
+ project: binary.LittleEndian.Uint32(b[0x9c:0x100]),
+ extents: allExtents,
+ linkTarget: linkTarget,
+ }
+ checksum := binary.LittleEndian.Uint32(checksumBytes)
+ actualChecksum := inodeChecksum(b, sb.checksumSeed, number, i.nfsFileVersion)
+
+ if actualChecksum != checksum {
+ return nil, fmt.Errorf("checksum mismatch, on-disk %x vs calculated %x", checksum, actualChecksum)
+ }
+
+ return &i, nil
+}
+
+// toBytes returns an inode ready to be written to disk
+//
+//nolint:unused // will be used in the future, not yet
+func (i *inode) toBytes(sb *superblock) []byte {
+ iSize := sb.inodeSize
+
+ b := make([]byte, iSize)
+
+ mode := make([]byte, 2)
+ owner := make([]byte, 4)
+ fileSize := make([]byte, 8)
+ group := make([]byte, 4)
+ accessTime := make([]byte, 8)
+ changeTime := make([]byte, 8)
+ modifyTime := make([]byte, 8)
+ createTime := make([]byte, 8)
+ version := make([]byte, 8)
+ extendedAttributeBlock := make([]byte, 8)
+
+ binary.LittleEndian.PutUint16(mode, i.permissionsGroup.toGroupInt()|i.permissionsOther.toOtherInt()|i.permissionsOwner.toOwnerInt()|uint16(i.fileType))
+ binary.LittleEndian.PutUint32(owner, i.owner)
+ binary.LittleEndian.PutUint32(group, i.group)
+ binary.LittleEndian.PutUint64(fileSize, i.size)
+ binary.LittleEndian.PutUint64(version, i.version)
+ binary.LittleEndian.PutUint64(extendedAttributeBlock, i.extendedAttributeBlock)
+
+ // there is some odd stuff that ext4 does with nanoseconds. We might need this in the future.
+ // See https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Inode_Timestamps
+ // binary.LittleEndian.PutUint32(accessTime[4:8], (i.accessTimeNanoseconds<<2)&accessTime[4])
+ binary.LittleEndian.PutUint64(accessTime, uint64(i.accessTime.Unix()))
+ binary.LittleEndian.PutUint32(accessTime[4:8], uint32(i.accessTime.Nanosecond()))
+ binary.LittleEndian.PutUint64(createTime, uint64(i.createTime.Unix()))
+ binary.LittleEndian.PutUint32(createTime[4:8], uint32(i.createTime.Nanosecond()))
+ binary.LittleEndian.PutUint64(changeTime, uint64(i.changeTime.Unix()))
+ binary.LittleEndian.PutUint32(changeTime[4:8], uint32(i.changeTime.Nanosecond()))
+ binary.LittleEndian.PutUint64(modifyTime, uint64(i.modifyTime.Unix()))
+ binary.LittleEndian.PutUint32(modifyTime[4:8], uint32(i.modifyTime.Nanosecond()))
+
+ blocks := make([]byte, 8)
+ binary.LittleEndian.PutUint64(blocks, i.blocks)
+
+ copy(b[0x0:0x2], mode)
+ copy(b[0x2:0x4], owner[0:2])
+ copy(b[0x4:0x8], fileSize[0:4])
+ copy(b[0x8:0xc], accessTime[0:4])
+ copy(b[0xc:0x10], changeTime[0:4])
+ copy(b[0x10:0x14], modifyTime[0:4])
+
+ binary.LittleEndian.PutUint32(b[0x14:0x18], i.deletionTime)
+ copy(b[0x18:0x1a], group[0:2])
+ binary.LittleEndian.PutUint16(b[0x1a:0x1c], i.hardLinks)
+ copy(b[0x1c:0x20], blocks[0:4])
+ binary.LittleEndian.PutUint32(b[0x20:0x24], i.flags.toInt())
+ copy(b[0x24:0x28], version[0:4])
+ copy(b[0x28:0x64], i.extents.toBytes())
+ binary.LittleEndian.PutUint32(b[0x64:0x68], i.nfsFileVersion)
+ copy(b[0x68:0x6c], extendedAttributeBlock[0:4])
+ copy(b[0x6c:0x70], fileSize[4:8])
+ // b[0x70:0x74] is obsolete
+ copy(b[0x74:0x76], blocks[4:8])
+ copy(b[0x76:0x78], extendedAttributeBlock[4:6])
+ copy(b[0x78:0x7a], owner[2:4])
+ copy(b[0x7a:0x7c], group[2:4])
+ // b[0x7c:0x7e] is for checkeum
+ // b[0x7e:0x80] is unused
+ binary.LittleEndian.PutUint16(b[0x80:0x82], i.inodeSize-minInodeSize)
+ // b[0x82:0x84] is for checkeum
+ copy(b[0x84:0x88], changeTime[4:8])
+ copy(b[0x88:0x8c], modifyTime[4:8])
+ copy(b[0x8c:0x90], accessTime[4:8])
+ copy(b[0x90:0x94], createTime[0:4])
+ copy(b[0x94:0x98], createTime[4:8])
+
+ actualChecksum := inodeChecksum(b, sb.checksumSeed, i.number, i.nfsFileVersion)
+ checksum := make([]byte, 4)
+ binary.LittleEndian.PutUint32(checksum, actualChecksum)
+ copy(b[0x7c:0x7e], checksum[0:2])
+ copy(b[0x82:0x84], checksum[2:4])
+
+ return b
+}
+
+func parseOwnerPermissions(mode uint16) filePermissions {
+ return filePermissions{
+ execute: mode&filePermissionsOwnerExecute == filePermissionsOwnerExecute,
+ write: mode&filePermissionsOwnerWrite == filePermissionsOwnerWrite,
+ read: mode&filePermissionsOwnerRead == filePermissionsOwnerRead,
+ }
+}
+func parseGroupPermissions(mode uint16) filePermissions {
+ return filePermissions{
+ execute: mode&filePermissionsGroupExecute == filePermissionsGroupExecute,
+ write: mode&filePermissionsGroupWrite == filePermissionsGroupWrite,
+ read: mode&filePermissionsGroupRead == filePermissionsGroupRead,
+ }
+}
+func parseOtherPermissions(mode uint16) filePermissions {
+ return filePermissions{
+ execute: mode&filePermissionsOtherExecute == filePermissionsOtherExecute,
+ write: mode&filePermissionsOtherWrite == filePermissionsOtherWrite,
+ read: mode&filePermissionsOtherRead == filePermissionsOtherRead,
+ }
+}
+
+//nolint:unused // will be used in the future, not yet
+func (fp *filePermissions) toOwnerInt() uint16 {
+ var mode uint16
+ if fp.execute {
+ mode |= filePermissionsOwnerExecute
+ }
+ if fp.write {
+ mode |= filePermissionsOwnerWrite
+ }
+ if fp.read {
+ mode |= filePermissionsOwnerRead
+ }
+ return mode
+}
+
+//nolint:unused // will be used in the future, not yet
+func (fp *filePermissions) toOtherInt() uint16 {
+ var mode uint16
+ if fp.execute {
+ mode |= filePermissionsOtherExecute
+ }
+ if fp.write {
+ mode |= filePermissionsOtherWrite
+ }
+ if fp.read {
+ mode |= filePermissionsOtherRead
+ }
+ return mode
+}
+
+//nolint:unused // will be used in the future, not yet
+func (fp *filePermissions) toGroupInt() uint16 {
+ var mode uint16
+ if fp.execute {
+ mode |= filePermissionsGroupExecute
+ }
+ if fp.write {
+ mode |= filePermissionsGroupWrite
+ }
+ if fp.read {
+ mode |= filePermissionsGroupRead
+ }
+ return mode
+}
+
+// parseFileType from the uint16 mode. The mode is built of bottom 12 bits
+// being "any of" several permissions, and thus resolved via AND,
+// while the top 4 bits are "only one of" several types, and thus resolved via just equal.
+func parseFileType(mode uint16) fileType {
+ return fileType(mode & 0xF000)
+}
+
+func parseInodeFlags(flags uint32) inodeFlags {
+ return inodeFlags{
+ secureDeletion: inodeFlagSecureDeletion.included(flags),
+ preserveForUndeletion: inodeFlagPreserveForUndeletion.included(flags),
+ compressed: inodeFlagCompressed.included(flags),
+ synchronous: inodeFlagSynchronous.included(flags),
+ immutable: inodeFlagImmutable.included(flags),
+ appendOnly: inodeFlagAppendOnly.included(flags),
+ noDump: inodeFlagNoDump.included(flags),
+ noAccessTimeUpdate: inodeFlagNoAccessTimeUpdate.included(flags),
+ dirtyCompressed: inodeFlagDirtyCompressed.included(flags),
+ compressedClusters: inodeFlagCompressedClusters.included(flags),
+ noCompress: inodeFlagNoCompress.included(flags),
+ encryptedInode: inodeFlagEncryptedInode.included(flags),
+ hashedDirectoryIndexes: inodeFlagHashedDirectoryIndexes.included(flags),
+ AFSMagicDirectory: inodeFlagAFSMagicDirectory.included(flags),
+ alwaysJournal: inodeFlagAlwaysJournal.included(flags),
+ noMergeTail: inodeFlagNoMergeTail.included(flags),
+ syncDirectoryData: inodeFlagSyncDirectoryData.included(flags),
+ topDirectory: inodeFlagTopDirectory.included(flags),
+ hugeFile: inodeFlagHugeFile.included(flags),
+ usesExtents: inodeFlagUsesExtents.included(flags),
+ extendedAttributes: inodeFlagExtendedAttributes.included(flags),
+ blocksPastEOF: inodeFlagBlocksPastEOF.included(flags),
+ snapshot: inodeFlagSnapshot.included(flags),
+ deletingSnapshot: inodeFlagDeletingSnapshot.included(flags),
+ completedSnapshotShrink: inodeFlagCompletedSnapshotShrink.included(flags),
+ inlineData: inodeFlagInlineData.included(flags),
+ inheritProject: inodeFlagInheritProject.included(flags),
+ }
+}
+
+//nolint:unused // will be used in the future, not yet
+func (i *inodeFlags) toInt() uint32 {
+ var flags uint32
+
+ if i.secureDeletion {
+ flags |= uint32(inodeFlagSecureDeletion)
+ }
+ if i.preserveForUndeletion {
+ flags |= uint32(inodeFlagPreserveForUndeletion)
+ }
+ if i.compressed {
+ flags |= uint32(inodeFlagCompressed)
+ }
+ if i.synchronous {
+ flags |= uint32(inodeFlagSynchronous)
+ }
+ if i.immutable {
+ flags |= uint32(inodeFlagImmutable)
+ }
+ if i.appendOnly {
+ flags |= uint32(inodeFlagAppendOnly)
+ }
+ if i.noDump {
+ flags |= uint32(inodeFlagNoDump)
+ }
+ if i.noAccessTimeUpdate {
+ flags |= uint32(inodeFlagNoAccessTimeUpdate)
+ }
+ if i.dirtyCompressed {
+ flags |= uint32(inodeFlagDirtyCompressed)
+ }
+ if i.compressedClusters {
+ flags |= uint32(inodeFlagCompressedClusters)
+ }
+ if i.noCompress {
+ flags |= uint32(inodeFlagNoCompress)
+ }
+ if i.encryptedInode {
+ flags |= uint32(inodeFlagEncryptedInode)
+ }
+ if i.hashedDirectoryIndexes {
+ flags |= uint32(inodeFlagHashedDirectoryIndexes)
+ }
+ if i.AFSMagicDirectory {
+ flags |= uint32(inodeFlagAFSMagicDirectory)
+ }
+ if i.alwaysJournal {
+ flags |= uint32(inodeFlagAlwaysJournal)
+ }
+ if i.noMergeTail {
+ flags |= uint32(inodeFlagNoMergeTail)
+ }
+ if i.syncDirectoryData {
+ flags |= uint32(inodeFlagSyncDirectoryData)
+ }
+ if i.topDirectory {
+ flags |= uint32(inodeFlagTopDirectory)
+ }
+ if i.hugeFile {
+ flags |= uint32(inodeFlagHugeFile)
+ }
+ if i.usesExtents {
+ flags |= uint32(inodeFlagUsesExtents)
+ }
+ if i.extendedAttributes {
+ flags |= uint32(inodeFlagExtendedAttributes)
+ }
+ if i.blocksPastEOF {
+ flags |= uint32(inodeFlagBlocksPastEOF)
+ }
+ if i.snapshot {
+ flags |= uint32(inodeFlagSnapshot)
+ }
+ if i.deletingSnapshot {
+ flags |= uint32(inodeFlagDeletingSnapshot)
+ }
+ if i.completedSnapshotShrink {
+ flags |= uint32(inodeFlagCompletedSnapshotShrink)
+ }
+ if i.inlineData {
+ flags |= uint32(inodeFlagInlineData)
+ }
+ if i.inheritProject {
+ flags |= uint32(inodeFlagInheritProject)
+ }
+
+ return flags
+}
+
+// inodeChecksum calculate the checksum for an inode
+func inodeChecksum(b []byte, checksumSeed, inodeNumber, inodeGeneration uint32) uint32 {
+ numberBytes := make([]byte, 4)
+ binary.LittleEndian.PutUint32(numberBytes, inodeNumber)
+ crcResult := crc.CRC32c(checksumSeed, numberBytes)
+ genBytes := make([]byte, 4)
+ binary.LittleEndian.PutUint32(genBytes, inodeGeneration)
+ crcResult = crc.CRC32c(crcResult, genBytes)
+ checksum := crc.CRC32c(crcResult, b)
+ return checksum
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/journaldevice_other.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/journaldevice_other.go
new file mode 100644
index 000000000000..09a61488e6d0
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/journaldevice_other.go
@@ -0,0 +1,12 @@
+//go:build !linux && !unix && !darwin && !windows
+
+package ext4
+
+import (
+ "fmt"
+ "runtime"
+)
+
+func journalDevice(devicePath string) (deviceNumber uint32, err error) {
+ return 0, fmt.Errorf("external journal device unsupported on filesystem %s", runtime.GOOS)
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/journaldevice_shared.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/journaldevice_shared.go
new file mode 100644
index 000000000000..00a91da9b850
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/journaldevice_shared.go
@@ -0,0 +1,40 @@
+//go:build linux || unix || freebsd || netbsd || openbsd || darwin
+
+package ext4
+
+import (
+ "fmt"
+ "math"
+
+ "golang.org/x/sys/unix"
+)
+
+func journalDevice(devicePath string) (deviceNumber uint32, err error) {
+ // Use unix.Stat to get file status
+ var stat unix.Stat_t
+ err = unix.Stat(devicePath, &stat)
+ if err != nil {
+ return deviceNumber, err
+ }
+
+ // Extract major and minor device numbers
+ //nolint:unconvert,nolintlint // lint stumbles on this, thinks it is an unnecessary conversion, which is true
+ // on Linux, but not on others. So we will be explicit about this, and add a nolint flag
+ major := unix.Major(uint64(stat.Rdev))
+ //nolint:unconvert,nolintlint // lint stumbles on this, thinks it is an unnecessary conversion, which is true
+ // on Linux, but not on others. So we will be explicit about this, and add a nolint flag
+ minor := unix.Minor(uint64(stat.Rdev))
+
+ // Combine major and minor numbers using unix.Mkdev
+ // interestingly, this does not 100% align with what I read about linux mkdev works, which would be:
+ // const minorbits = 20
+ // func mkdev(major, minor uint32) uint32 {
+ // return (((major) << minorbits) | (minor))
+ // }
+ // we leave this here for a future potential fix
+ journalDeviceNumber64 := unix.Mkdev(major, minor)
+ if journalDeviceNumber64 > math.MaxUint32 {
+ return deviceNumber, fmt.Errorf("journal device number %d is too large", journalDeviceNumber64)
+ }
+ return uint32(journalDeviceNumber64), nil
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/journaldevice_windows.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/journaldevice_windows.go
new file mode 100644
index 000000000000..bf36fb2e38ac
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/journaldevice_windows.go
@@ -0,0 +1,11 @@
+//go:build windows
+
+package ext4
+
+import (
+ "errors"
+)
+
+func journalDevice(devicePath string) (deviceNumber uint32, err error) {
+ return 0, errors.New("external journal device unsupported on Windows")
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/md4/md4.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/md4/md4.go
new file mode 100644
index 000000000000..77df42700b78
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/md4/md4.go
@@ -0,0 +1,73 @@
+package md4
+
+// rotateLeft rotates a 32-bit integer to the left
+func rotateLeft(x uint32, s uint) uint32 {
+ return (x << s) | (x >> (32 - s))
+}
+
+// basic MD4 functions
+func f(x, y, z uint32) uint32 {
+ return z ^ (x & (y ^ z))
+}
+
+func g(x, y, z uint32) uint32 {
+ return (x & y) + ((x ^ y) & z)
+}
+
+func h(x, y, z uint32) uint32 {
+ return x ^ y ^ z
+}
+
+// MD4 constants
+const (
+ k1 uint32 = 0
+ k2 uint32 = 0x5A827999
+ k3 uint32 = 0x6ED9EBA1
+)
+
+// round applies the round function as a macro
+func round(f func(uint32, uint32, uint32) uint32, a, b, c, d, x uint32, s uint) uint32 {
+ return rotateLeft(a+f(b, c, d)+x, s)
+}
+
+// halfMD4Transform basic cut-down MD4 transform. Returns only 32 bits of result.
+func HalfMD4Transform(buf [4]uint32, in []uint32) uint32 {
+ var a, b, c, d = buf[0], buf[1], buf[2], buf[3]
+
+ /* Round 1 */
+ a = round(f, a, b, c, d, in[0]+k1, 3)
+ d = round(f, d, a, b, c, in[1]+k1, 7)
+ c = round(f, c, d, a, b, in[2]+k1, 11)
+ b = round(f, b, c, d, a, in[3]+k1, 19)
+ a = round(f, a, b, c, d, in[4]+k1, 3)
+ d = round(f, d, a, b, c, in[5]+k1, 7)
+ c = round(f, c, d, a, b, in[6]+k1, 11)
+ b = round(f, b, c, d, a, in[7]+k1, 19)
+
+ /* Round 2 */
+ a = round(g, a, b, c, d, in[1]+k2, 3)
+ d = round(g, d, a, b, c, in[3]+k2, 5)
+ c = round(g, c, d, a, b, in[5]+k2, 9)
+ b = round(g, b, c, d, a, in[7]+k2, 13)
+ a = round(g, a, b, c, d, in[0]+k2, 3)
+ d = round(g, d, a, b, c, in[2]+k2, 5)
+ c = round(g, c, d, a, b, in[4]+k2, 9)
+ b = round(g, b, c, d, a, in[6]+k2, 13)
+
+ /* Round 3 */
+ a = round(h, a, b, c, d, in[3]+k3, 3)
+ d = round(h, d, a, b, c, in[7]+k3, 9)
+ c = round(h, c, d, a, b, in[2]+k3, 11)
+ b = round(h, b, c, d, a, in[6]+k3, 15)
+ a = round(h, a, b, c, d, in[1]+k3, 3)
+ d = round(h, d, a, b, c, in[5]+k3, 9)
+ c = round(h, c, d, a, b, in[0]+k3, 11)
+ b = round(h, b, c, d, a, in[4]+k3, 15)
+
+ buf[0] += a
+ buf[1] += b
+ buf[2] += c
+ buf[3] += d
+
+ return buf[1]
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/miscflags.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/miscflags.go
new file mode 100644
index 000000000000..d2a22368e388
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/miscflags.go
@@ -0,0 +1,34 @@
+package ext4
+
+// miscFlags is a structure holding various miscellaneous flags
+type miscFlags struct {
+ signedDirectoryHash bool
+ unsignedDirectoryHash bool
+ developmentTest bool
+}
+
+func parseMiscFlags(flags uint32) miscFlags {
+ m := miscFlags{
+ signedDirectoryHash: flagSignedDirectoryHash.included(flags),
+ unsignedDirectoryHash: flagUnsignedDirectoryHash.included(flags),
+ developmentTest: flagTestDevCode.included(flags),
+ }
+ return m
+}
+
+func (m *miscFlags) toInt() uint32 {
+ var flags uint32
+
+ if m.signedDirectoryHash {
+ flags |= uint32(flagSignedDirectoryHash)
+ }
+ if m.unsignedDirectoryHash {
+ flags |= uint32(flagUnsignedDirectoryHash)
+ }
+ if m.developmentTest {
+ flags |= uint32(flagTestDevCode)
+ }
+ return flags
+}
+
+var defaultMiscFlags = miscFlags{}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/mountoptions.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/mountoptions.go
new file mode 100644
index 000000000000..a93a21a11d19
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/mountoptions.go
@@ -0,0 +1,182 @@
+package ext4
+
+const (
+ // default mount options
+ mountPrintDebugInfo mountOption = 0x1
+ mountNewFilesGIDContainingDirectory mountOption = 0x2
+ mountUserspaceExtendedAttributes mountOption = 0x4
+ mountPosixACLs mountOption = 0x8
+ mount16BitUIDs mountOption = 0x10
+ mountJournalDataAndMetadata mountOption = 0x20
+ mountFlushBeforeJournal mountOption = 0x40
+ mountUnorderingDataMetadata mountOption = 0x60
+ mountDisableWriteFlushes mountOption = 0x100
+ mountTrackMetadataBlocks mountOption = 0x200
+ mountDiscardDeviceSupport mountOption = 0x400
+ mountDisableDelayedAllocation mountOption = 0x800
+)
+
+// mountOptions is a structure holding which default mount options are set
+type mountOptions struct {
+ printDebugInfo bool
+ newFilesGIDContainingDirectory bool
+ userspaceExtendedAttributes bool
+ posixACLs bool
+ use16BitUIDs bool
+ journalDataAndMetadata bool
+ flushBeforeJournal bool
+ unorderingDataMetadata bool
+ disableWriteFlushes bool
+ trackMetadataBlocks bool
+ discardDeviceSupport bool
+ disableDelayedAllocation bool
+}
+
+type mountOption uint32
+
+func (m mountOption) included(a uint32) bool {
+ return a&uint32(m) == uint32(m)
+}
+
+type MountOpt func(*mountOptions)
+
+func WithDefaultMountOptionPrintDebuggingInfo(enable bool) MountOpt {
+ return func(o *mountOptions) {
+ o.printDebugInfo = enable
+ }
+}
+
+func WithDefaultMountOptionGIDFromDirectory(enable bool) MountOpt {
+ return func(o *mountOptions) {
+ o.newFilesGIDContainingDirectory = enable
+ }
+}
+
+func WithDefaultMountOptionUserspaceXattrs(enable bool) MountOpt {
+ return func(o *mountOptions) {
+ o.userspaceExtendedAttributes = enable
+ }
+}
+
+func WithDefaultMountOptionPOSIXACLs(enable bool) MountOpt {
+ return func(o *mountOptions) {
+ o.posixACLs = enable
+ }
+}
+
+func WithDefaultMountOptionUID16Bit(enable bool) MountOpt {
+ return func(o *mountOptions) {
+ o.use16BitUIDs = enable
+ }
+}
+
+func WithDefaultMountOptionJournalModeData(enable bool) MountOpt {
+ return func(o *mountOptions) {
+ o.journalDataAndMetadata = enable
+ }
+}
+
+func WithDefaultMountOptionJournalModeOrdered(enable bool) MountOpt {
+ return func(o *mountOptions) {
+ o.flushBeforeJournal = enable
+ }
+}
+
+func WithDefaultMountOptionJournalModeWriteback(enable bool) MountOpt {
+ return func(o *mountOptions) {
+ o.unorderingDataMetadata = enable
+ }
+}
+
+func WithDefaultMountOptionDisableWriteFlushes(enable bool) MountOpt {
+ return func(o *mountOptions) {
+ o.disableWriteFlushes = enable
+ }
+}
+
+func WithDefaultMountOptionBlockValidity(enable bool) MountOpt {
+ return func(o *mountOptions) {
+ o.trackMetadataBlocks = enable
+ }
+}
+
+func WithDefaultMountOptionDiscardSupport(enable bool) MountOpt {
+ return func(o *mountOptions) {
+ o.discardDeviceSupport = enable
+ }
+}
+
+func WithDefaultMountOptionDisableDelayedAllocation(enable bool) MountOpt {
+ return func(o *mountOptions) {
+ o.disableDelayedAllocation = enable
+ }
+}
+
+func defaultMountOptionsFromOpts(opts []MountOpt) *mountOptions {
+ o := &mountOptions{}
+ for _, opt := range opts {
+ opt(o)
+ }
+ return o
+}
+
+func parseMountOptions(flags uint32) mountOptions {
+ m := mountOptions{
+ printDebugInfo: mountPrintDebugInfo.included(flags),
+ newFilesGIDContainingDirectory: mountNewFilesGIDContainingDirectory.included(flags),
+ userspaceExtendedAttributes: mountUserspaceExtendedAttributes.included(flags),
+ posixACLs: mountPosixACLs.included(flags),
+ use16BitUIDs: mount16BitUIDs.included(flags),
+ journalDataAndMetadata: mountJournalDataAndMetadata.included(flags),
+ flushBeforeJournal: mountFlushBeforeJournal.included(flags),
+ unorderingDataMetadata: mountUnorderingDataMetadata.included(flags),
+ disableWriteFlushes: mountDisableWriteFlushes.included(flags),
+ trackMetadataBlocks: mountTrackMetadataBlocks.included(flags),
+ discardDeviceSupport: mountDiscardDeviceSupport.included(flags),
+ disableDelayedAllocation: mountDisableDelayedAllocation.included(flags),
+ }
+ return m
+}
+
+func (m *mountOptions) toInt() uint32 {
+ var flags uint32
+
+ if m.printDebugInfo {
+ flags |= uint32(mountPrintDebugInfo)
+ }
+ if m.newFilesGIDContainingDirectory {
+ flags |= uint32(mountNewFilesGIDContainingDirectory)
+ }
+ if m.userspaceExtendedAttributes {
+ flags |= uint32(mountUserspaceExtendedAttributes)
+ }
+ if m.posixACLs {
+ flags |= uint32(mountPosixACLs)
+ }
+ if m.use16BitUIDs {
+ flags |= uint32(mount16BitUIDs)
+ }
+ if m.journalDataAndMetadata {
+ flags |= uint32(mountJournalDataAndMetadata)
+ }
+ if m.flushBeforeJournal {
+ flags |= uint32(mountFlushBeforeJournal)
+ }
+ if m.unorderingDataMetadata {
+ flags |= uint32(mountUnorderingDataMetadata)
+ }
+ if m.disableWriteFlushes {
+ flags |= uint32(mountDisableWriteFlushes)
+ }
+ if m.trackMetadataBlocks {
+ flags |= uint32(mountTrackMetadataBlocks)
+ }
+ if m.discardDeviceSupport {
+ flags |= uint32(mountDiscardDeviceSupport)
+ }
+ if m.disableDelayedAllocation {
+ flags |= uint32(mountDisableDelayedAllocation)
+ }
+
+ return flags
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/superblock.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/superblock.go
new file mode 100644
index 000000000000..fcafda9390b0
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/superblock.go
@@ -0,0 +1,768 @@
+package ext4
+
+import (
+ "encoding/binary"
+ "fmt"
+ "math"
+ "reflect"
+ "sort"
+ "time"
+
+ "github.com/diskfs/go-diskfs/filesystem/ext4/crc"
+ "github.com/diskfs/go-diskfs/util"
+ "github.com/google/uuid"
+)
+
+type filesystemState uint16
+type errorBehaviour uint16
+type osFlag uint32
+type feature uint32
+type hashAlgorithm byte
+type flag uint32
+type encryptionAlgorithm byte
+
+func (f feature) included(a uint32) bool {
+ return a&uint32(f) == uint32(f)
+}
+
+//nolint:unused // we know this is unused, but it will be needed in future
+func (f flag) equal(a flag) bool {
+ return f == a
+}
+func (f flag) included(a uint32) bool {
+ return a&uint32(f) == uint32(f)
+}
+
+const (
+ // superblockSignature is the signature for every superblock
+ superblockSignature uint16 = 0xef53
+ // optional states for the filesystem
+ fsStateCleanlyUnmounted filesystemState = 0x0001
+ fsStateErrors filesystemState = 0x0002
+ fsStateOrphansRecovered filesystemState = 0x0004
+ // how to handle erorrs
+ errorsContinue errorBehaviour = 1
+ errorsRemountReadOnly errorBehaviour = 2
+ errorsPanic errorBehaviour = 3
+ // checksum type
+ checkSumTypeCRC32c byte = 1
+ // oses
+ osLinux osFlag = 0
+ osHurd osFlag = 1
+ osMasix osFlag = 2
+ osFreeBSD osFlag = 3
+ osLites osFlag = 4
+ // compatible, incompatible, and compatibleReadOnly feature flags
+ compatFeatureDirectoryPreAllocate feature = 0x1
+ compatFeatureImagicInodes feature = 0x2
+ compatFeatureHasJournal feature = 0x4
+ compatFeatureExtendedAttributes feature = 0x8
+ compatFeatureReservedGDTBlocksForExpansion feature = 0x10
+ compatFeatureDirectoryIndices feature = 0x20
+ compatFeatureLazyBlockGroup feature = 0x40
+ compatFeatureExcludeInode feature = 0x80
+ compatFeatureExcludeBitmap feature = 0x100
+ compatFeatureSparseSuperBlockV2 feature = 0x200
+ compatFeatureFastCommit feature = 0x400
+ compatFeatureStableInodes feature = 0x800
+ compatFeatureOrphanFile feature = 0x1000
+ incompatFeatureCompression feature = 0x1
+ incompatFeatureDirectoryEntriesRecordFileType feature = 0x2
+ incompatFeatureRecoveryNeeded feature = 0x4
+ incompatFeatureSeparateJournalDevice feature = 0x8
+ incompatFeatureMetaBlockGroups feature = 0x10
+ incompatFeatureExtents feature = 0x40
+ incompatFeature64Bit feature = 0x80
+ incompatFeatureMultipleMountProtection feature = 0x100
+ incompatFeatureFlexBlockGroups feature = 0x200
+ incompatFeatureExtendedAttributeInodes feature = 0x400
+ incompatFeatureDataInDirectoryEntries feature = 0x1000
+ incompatFeatureMetadataChecksumSeedInSuperblock feature = 0x2000
+ incompatFeatureLargeDirectory feature = 0x4000
+ incompatFeatureDataInInode feature = 0x8000
+ incompatFeatureEncryptInodes feature = 0x10000
+ roCompatFeatureSparseSuperblock feature = 0x1
+ roCompatFeatureLargeFile feature = 0x2
+ roCompatFeatureBtreeDirectory feature = 0x4
+ roCompatFeatureHugeFile feature = 0x8
+ roCompatFeatureGDTChecksum feature = 0x10
+ roCompatFeatureLargeSubdirectoryCount feature = 0x20
+ roCompatFeatureLargeInodes feature = 0x40
+ roCompatFeatureSnapshot feature = 0x80
+ roCompatFeatureQuota feature = 0x100
+ roCompatFeatureBigalloc feature = 0x200
+ roCompatFeatureMetadataChecksums feature = 0x400
+ roCompatFeatureReplicas feature = 0x800
+ roCompatFeatureReadOnly feature = 0x1000
+ roCompatFeatureProjectQuotas feature = 0x2000
+ // hash algorithms for htree directory entries
+ hashLegacy hashAlgorithm = 0x0
+ hashHalfMD4 hashAlgorithm = 0x1
+ hashTea hashAlgorithm = 0x2
+ hashLegacyUnsigned hashAlgorithm = 0x3
+ hashHalfMD4Unsigned hashAlgorithm = 0x4
+ hashTeaUnsigned hashAlgorithm = 0x5
+ // miscellaneous flags
+ flagSignedDirectoryHash flag = 0x0001
+ flagUnsignedDirectoryHash flag = 0x0002
+ flagTestDevCode flag = 0x0004
+ // encryption algorithms
+ //nolint:unused // we know these are unused, but they will be needed in the future
+ encryptionAlgorithmInvalid encryptionAlgorithm = 0
+ encryptionAlgorithm256AESXTS encryptionAlgorithm = 1
+ encryptionAlgorithm256AESGCM encryptionAlgorithm = 2
+ encryptionAlgorithm256AESCBC encryptionAlgorithm = 3
+)
+
+// journalBackup is a backup in the superblock of the journal's inode i_block[] array and size
+type journalBackup struct {
+ iBlocks [15]uint32
+ iSize uint64
+}
+
+// Superblock is a structure holding the ext4 superblock
+type superblock struct {
+ inodeCount uint32
+ blockCount uint64
+ reservedBlocks uint64
+ freeBlocks uint64
+ freeInodes uint32
+ firstDataBlock uint32
+ blockSize uint32
+ clusterSize uint64
+ blocksPerGroup uint32
+ clustersPerGroup uint32
+ inodesPerGroup uint32
+ mountTime time.Time
+ writeTime time.Time
+ mountCount uint16
+ mountsToFsck uint16
+ filesystemState filesystemState
+ errorBehaviour errorBehaviour
+ minorRevision uint16
+ lastCheck time.Time
+ checkInterval uint32
+ creatorOS osFlag
+ revisionLevel uint32
+ reservedBlocksDefaultUID uint16
+ reservedBlocksDefaultGID uint16
+ firstNonReservedInode uint32
+ inodeSize uint16
+ blockGroup uint16
+ features featureFlags
+ uuid *uuid.UUID
+ volumeLabel string
+ lastMountedDirectory string
+ algorithmUsageBitmap uint32
+ preallocationBlocks byte
+ preallocationDirectoryBlocks byte
+ reservedGDTBlocks uint16
+ journalSuperblockUUID *uuid.UUID
+ journalInode uint32
+ journalDeviceNumber uint32
+ orphanedInodesStart uint32
+ hashTreeSeed []uint32
+ hashVersion hashAlgorithm
+ groupDescriptorSize uint16
+ defaultMountOptions mountOptions
+ firstMetablockGroup uint32
+ mkfsTime time.Time
+ journalBackup *journalBackup
+ // 64-bit mode features
+ inodeMinBytes uint16
+ inodeReserveBytes uint16
+ miscFlags miscFlags
+ raidStride uint16
+ multiMountPreventionInterval uint16
+ multiMountProtectionBlock uint64
+ raidStripeWidth uint32
+ logGroupsPerFlex uint64
+ checksumType byte
+ totalKBWritten uint64
+ snapshotInodeNumber uint32
+ snapshotID uint32
+ snapshotReservedBlocks uint64
+ snapshotStartInode uint32
+ errorCount uint32
+ errorFirstTime time.Time
+ errorFirstInode uint32
+ errorFirstBlock uint64
+ errorFirstFunction string
+ errorFirstLine uint32
+ errorLastTime time.Time
+ errorLastInode uint32
+ errorLastLine uint32
+ errorLastBlock uint64
+ errorLastFunction string
+ errorFirstCode byte
+ errorLastCode byte
+ mountOptions string
+ userQuotaInode uint32
+ groupQuotaInode uint32
+ overheadBlocks uint32
+ backupSuperblockBlockGroups [2]uint32
+ encryptionAlgorithms [4]encryptionAlgorithm
+ encryptionSalt [16]byte
+ lostFoundInode uint32
+ projectQuotaInode uint32
+ checksumSeed uint32
+ // encoding
+ filenameCharsetEncoding uint16
+ filenameCharsetEncodingFlags uint16
+ // inode for tracking orphaned inodes
+ orphanedInodeInodeNumber uint32
+}
+
+func (sb *superblock) equal(o *superblock) bool {
+ if (sb == nil && o != nil) || (o == nil && sb != nil) {
+ return false
+ }
+ if sb == nil && o == nil {
+ return true
+ }
+ return reflect.DeepEqual(sb, o)
+}
+
+// FSInformationSectorFromBytes create an FSInformationSector struct from bytes
+func superblockFromBytes(b []byte) (*superblock, error) {
+ bLen := len(b)
+ if bLen != int(SuperblockSize) {
+ return nil, fmt.Errorf("cannot read superblock from %d bytes instead of expected %d", bLen, SuperblockSize)
+ }
+
+ // check the magic signature
+ actualSignature := binary.LittleEndian.Uint16(b[0x38:0x3a])
+ if actualSignature != superblockSignature {
+ return nil, fmt.Errorf("erroneous signature at location 0x38 was %x instead of expected %x", actualSignature, superblockSignature)
+ }
+
+ sb := superblock{}
+
+ // first read feature flags of various types
+ compatFlags := binary.LittleEndian.Uint32(b[0x5c:0x60])
+ incompatFlags := binary.LittleEndian.Uint32(b[0x60:0x64])
+ roCompatFlags := binary.LittleEndian.Uint32(b[0x64:0x68])
+ // track which ones are set
+ sb.features = parseFeatureFlags(compatFlags, incompatFlags, roCompatFlags)
+
+ sb.inodeCount = binary.LittleEndian.Uint32(b[0:4])
+
+ // block count, reserved block count and free blocks depends on whether the fs is 64-bit or not
+ blockCount := make([]byte, 8)
+ reservedBlocks := make([]byte, 8)
+ freeBlocks := make([]byte, 8)
+
+ copy(blockCount[0:4], b[0x4:0x8])
+ copy(reservedBlocks[0:4], b[0x8:0xc])
+ copy(freeBlocks[0:4], b[0xc:0x10])
+
+ if sb.features.fs64Bit {
+ copy(blockCount[4:8], b[0x150:0x154])
+ copy(reservedBlocks[4:8], b[0x154:0x158])
+ copy(freeBlocks[4:8], b[0x158:0x15c])
+ }
+ sb.blockCount = binary.LittleEndian.Uint64(blockCount)
+ sb.reservedBlocks = binary.LittleEndian.Uint64(reservedBlocks)
+ sb.freeBlocks = binary.LittleEndian.Uint64(freeBlocks)
+
+ sb.freeInodes = binary.LittleEndian.Uint32(b[0x10:0x14])
+ sb.firstDataBlock = binary.LittleEndian.Uint32(b[0x14:0x18])
+ sb.blockSize = uint32(math.Exp2(float64(10 + binary.LittleEndian.Uint32(b[0x18:0x1c]))))
+ sb.clusterSize = uint64(math.Exp2(float64(binary.LittleEndian.Uint32(b[0x1c:0x20]))))
+ sb.blocksPerGroup = binary.LittleEndian.Uint32(b[0x20:0x24])
+ if sb.features.bigalloc {
+ sb.clustersPerGroup = binary.LittleEndian.Uint32(b[0x24:0x28])
+ }
+ sb.inodesPerGroup = binary.LittleEndian.Uint32(b[0x28:0x2c])
+ // these higher bits are listed as reserved in https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout
+ // but looking at the source to mke2fs, we see that some are used, see
+ // https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/tree/lib/ext2fs/ext2_fs.h#n653
+ //
+ // mount time has low 32 bits at 0x2c and high 8 bits at 0x274
+ // write time has low 32 bits at 0x30 and high 8 bits at 0x275
+ // mkfs time has low 32 bits at 0x108 and high 8 bits at 0x276
+ // lastcheck time has low 32 bits at 0x40 and high 8 bits at 0x277
+ // firsterror time has low 32 bits at 0x198 and high 8 bits at 0x278
+ // lasterror time has low 32 bits at 0x1cc and high 8 bits at 0x279
+ // firsterror code is 8 bits at 0x27a
+ // lasterror code is 8 bits at 0x27b
+ sb.mountTime = bytesToTime(b[0x2c:0x30], b[0x274:0x275])
+ sb.writeTime = bytesToTime(b[0x30:0x34], b[0x275:0x276])
+ sb.mkfsTime = bytesToTime(b[0x108:0x10c], b[0x276:0x277])
+ sb.lastCheck = bytesToTime(b[0x40:0x44], b[0x277:0x278])
+ sb.errorFirstTime = bytesToTime(b[0x198:0x19c], b[0x278:0x279])
+ sb.errorLastTime = bytesToTime(b[0x1cc:0x1d0], b[0x279:0x280])
+
+ sb.errorFirstCode = b[0x27a]
+ sb.errorLastCode = b[0x27b]
+
+ sb.mountCount = binary.LittleEndian.Uint16(b[0x34:0x36])
+ sb.mountsToFsck = binary.LittleEndian.Uint16(b[0x36:0x38])
+
+ sb.filesystemState = filesystemState(binary.LittleEndian.Uint16(b[0x3a:0x3c]))
+ sb.errorBehaviour = errorBehaviour(binary.LittleEndian.Uint16(b[0x3c:0x3e]))
+
+ sb.minorRevision = binary.LittleEndian.Uint16(b[0x3e:0x40])
+ sb.checkInterval = binary.LittleEndian.Uint32(b[0x44:0x48])
+
+ sb.creatorOS = osFlag(binary.LittleEndian.Uint32(b[0x48:0x4c]))
+ sb.revisionLevel = binary.LittleEndian.Uint32(b[0x4c:0x50])
+ sb.reservedBlocksDefaultUID = binary.LittleEndian.Uint16(b[0x50:0x52])
+ sb.reservedBlocksDefaultGID = binary.LittleEndian.Uint16(b[0x52:0x54])
+
+ sb.firstNonReservedInode = binary.LittleEndian.Uint32(b[0x54:0x58])
+ sb.inodeSize = binary.LittleEndian.Uint16(b[0x58:0x5a])
+ sb.blockGroup = binary.LittleEndian.Uint16(b[0x5a:0x5c])
+
+ voluuid, err := uuid.FromBytes(b[0x68:0x78])
+ if err != nil {
+ return nil, fmt.Errorf("unable to read volume UUID: %v", err)
+ }
+ sb.uuid = &voluuid
+ sb.volumeLabel = minString(b[0x78:0x88])
+ sb.lastMountedDirectory = minString(b[0x88:0xc8])
+ sb.algorithmUsageBitmap = binary.LittleEndian.Uint32(b[0xc8:0xcc])
+
+ sb.preallocationBlocks = b[0xcc]
+ sb.preallocationDirectoryBlocks = b[0xcd]
+ sb.reservedGDTBlocks = binary.LittleEndian.Uint16(b[0xce:0xd0])
+
+ journaluuid, err := uuid.FromBytes(b[0xd0:0xe0])
+ if err != nil {
+ return nil, fmt.Errorf("unable to read journal UUID: %v", err)
+ }
+ sb.journalSuperblockUUID = &journaluuid
+ sb.journalInode = binary.LittleEndian.Uint32(b[0xe0:0xe4])
+ sb.journalDeviceNumber = binary.LittleEndian.Uint32(b[0xe4:0xe8])
+ sb.orphanedInodesStart = binary.LittleEndian.Uint32(b[0xe8:0xec])
+
+ htreeSeed := make([]uint32, 0, 4)
+ htreeSeed = append(htreeSeed,
+ binary.LittleEndian.Uint32(b[0xec:0xf0]),
+ binary.LittleEndian.Uint32(b[0xf0:0xf4]),
+ binary.LittleEndian.Uint32(b[0xf4:0xf8]),
+ binary.LittleEndian.Uint32(b[0xf8:0xfc]),
+ )
+ sb.hashTreeSeed = htreeSeed
+
+ sb.hashVersion = hashAlgorithm(b[0xfc])
+
+ sb.groupDescriptorSize = binary.LittleEndian.Uint16(b[0xfe:0x100])
+
+ sb.defaultMountOptions = parseMountOptions(binary.LittleEndian.Uint32(b[0x100:0x104]))
+ sb.firstMetablockGroup = binary.LittleEndian.Uint32(b[0x104:0x108])
+
+ journalBackupType := b[0xfd]
+ if journalBackupType == 0 || journalBackupType == 1 {
+ journalBackupArray := [15]uint32{}
+ startJournalBackup := 0x10c
+ for i := 0; i < 15; i++ {
+ start := startJournalBackup + 4*i
+ end := startJournalBackup + 4*i + 4
+ journalBackupArray[i] = binary.LittleEndian.Uint32(b[start:end])
+ }
+ iSizeBytes := make([]byte, 8)
+
+ copy(iSizeBytes[0:4], b[startJournalBackup+4*16:startJournalBackup+4*17])
+ copy(iSizeBytes[4:8], b[startJournalBackup+4*15:startJournalBackup+4*16])
+
+ sb.journalBackup = &journalBackup{
+ iSize: binary.LittleEndian.Uint64(iSizeBytes),
+ iBlocks: journalBackupArray,
+ }
+ }
+
+ sb.inodeMinBytes = binary.LittleEndian.Uint16(b[0x15c:0x15e])
+ sb.inodeReserveBytes = binary.LittleEndian.Uint16(b[0x15e:0x160])
+ sb.miscFlags = parseMiscFlags(binary.LittleEndian.Uint32(b[0x160:0x164]))
+
+ sb.raidStride = binary.LittleEndian.Uint16(b[0x164:0x166])
+ sb.raidStripeWidth = binary.LittleEndian.Uint32(b[0x170:0x174])
+
+ sb.multiMountPreventionInterval = binary.LittleEndian.Uint16(b[0x166:0x168])
+ sb.multiMountProtectionBlock = binary.LittleEndian.Uint64(b[0x168:0x170])
+
+ sb.logGroupsPerFlex = uint64(math.Exp2(float64(b[0x174])))
+
+ sb.checksumType = b[0x175] // only valid one is 1
+ if sb.checksumType != checkSumTypeCRC32c {
+ return nil, fmt.Errorf("cannot read superblock: invalid checksum type %d, only valid is %d", sb.checksumType, checkSumTypeCRC32c)
+ }
+
+ // b[0x176:0x178] are reserved padding
+
+ sb.totalKBWritten = binary.LittleEndian.Uint64(b[0x178:0x180])
+
+ sb.snapshotInodeNumber = binary.LittleEndian.Uint32(b[0x180:0x184])
+ sb.snapshotID = binary.LittleEndian.Uint32(b[0x184:0x188])
+ sb.snapshotReservedBlocks = binary.LittleEndian.Uint64(b[0x188:0x190])
+ sb.snapshotStartInode = binary.LittleEndian.Uint32(b[0x190:0x194])
+
+ // errors
+ sb.errorCount = binary.LittleEndian.Uint32(b[0x194:0x198])
+ sb.errorFirstInode = binary.LittleEndian.Uint32(b[0x19c:0x1a0])
+ sb.errorFirstBlock = binary.LittleEndian.Uint64(b[0x1a0:0x1a8])
+ sb.errorFirstFunction = minString(b[0x1a8:0x1c8])
+ sb.errorFirstLine = binary.LittleEndian.Uint32(b[0x1c8:0x1cc])
+ sb.errorLastInode = binary.LittleEndian.Uint32(b[0x1d0:0x1d4])
+ sb.errorLastLine = binary.LittleEndian.Uint32(b[0x1d4:0x1d8])
+ sb.errorLastBlock = binary.LittleEndian.Uint64(b[0x1d8:0x1e0])
+ sb.errorLastFunction = minString(b[0x1e0:0x200])
+
+ sb.mountOptions = minString(b[0x200:0x240])
+ sb.userQuotaInode = binary.LittleEndian.Uint32(b[0x240:0x244])
+ sb.groupQuotaInode = binary.LittleEndian.Uint32(b[0x244:0x248])
+ // overheadBlocks *always* is 0
+ sb.overheadBlocks = binary.LittleEndian.Uint32(b[0x248:0x24c])
+ sb.backupSuperblockBlockGroups = [2]uint32{
+ binary.LittleEndian.Uint32(b[0x24c:0x250]),
+ binary.LittleEndian.Uint32(b[0x250:0x254]),
+ }
+ for i := 0; i < 4; i++ {
+ sb.encryptionAlgorithms[i] = encryptionAlgorithm(b[0x254+i])
+ }
+ for i := 0; i < 16; i++ {
+ sb.encryptionSalt[i] = b[0x258+i]
+ }
+ sb.lostFoundInode = binary.LittleEndian.Uint32(b[0x268:0x26c])
+ sb.projectQuotaInode = binary.LittleEndian.Uint32(b[0x26c:0x270])
+
+ sb.checksumSeed = binary.LittleEndian.Uint32(b[0x270:0x274])
+ // what if the seed is missing? It can be.
+ if sb.features.metadataChecksums && sb.checksumSeed == 0 {
+ sb.checksumSeed = crc.CRC32c(0xffffffff, sb.uuid[:])
+ }
+
+ sb.filenameCharsetEncoding = binary.LittleEndian.Uint16(b[0x27c:0x27e])
+ sb.filenameCharsetEncodingFlags = binary.LittleEndian.Uint16(b[0x27e:0x280])
+ sb.orphanedInodeInodeNumber = binary.LittleEndian.Uint32(b[0x280:0x284])
+
+ // b[0x288:0x3fc] are reserved for zero padding
+
+ // checksum
+ checksum := binary.LittleEndian.Uint32(b[0x3fc:0x400])
+
+ // calculate the checksum and validate - we use crc32c
+ if sb.features.metadataChecksums {
+ actualChecksum := crc.CRC32c(0xffffffff, b[0:0x3fc])
+ if actualChecksum != checksum {
+ return nil, fmt.Errorf("invalid superblock checksum, actual was %x, on disk was %x, inverted on disk was %x", actualChecksum, checksum, 0xffffffff-checksum)
+ }
+ }
+
+ return &sb, nil
+}
+
+// toBytes returns a superblock ready to be written to disk
+func (sb *superblock) toBytes() ([]byte, error) {
+ b := make([]byte, SuperblockSize)
+
+ binary.LittleEndian.PutUint16(b[0x38:0x3a], superblockSignature)
+ compatFlags, incompatFlags, roCompatFlags := sb.features.toInts()
+ binary.LittleEndian.PutUint32(b[0x5c:0x60], compatFlags)
+ binary.LittleEndian.PutUint32(b[0x60:0x64], incompatFlags)
+ binary.LittleEndian.PutUint32(b[0x64:0x68], roCompatFlags)
+
+ binary.LittleEndian.PutUint32(b[0:4], sb.inodeCount)
+
+ // block count, reserved block count and free blocks depends on whether the fs is 64-bit or not
+ blockCount := make([]byte, 8)
+ reservedBlocks := make([]byte, 8)
+ freeBlocks := make([]byte, 8)
+
+ binary.LittleEndian.PutUint64(blockCount, sb.blockCount)
+ binary.LittleEndian.PutUint64(reservedBlocks, sb.reservedBlocks)
+ binary.LittleEndian.PutUint64(freeBlocks, sb.freeBlocks)
+
+ copy(b[0x4:0x8], blockCount[0:4])
+ copy(b[0x8:0xc], reservedBlocks[0:4])
+ copy(b[0xc:0x10], freeBlocks[0:4])
+
+ if sb.features.fs64Bit {
+ copy(b[0x150:0x154], blockCount[4:8])
+ copy(b[0x154:0x158], reservedBlocks[4:8])
+ copy(b[0x158:0x15c], freeBlocks[4:8])
+ }
+
+ binary.LittleEndian.PutUint32(b[0x10:0x14], sb.freeInodes)
+ binary.LittleEndian.PutUint32(b[0x14:0x18], sb.firstDataBlock)
+ binary.LittleEndian.PutUint32(b[0x18:0x1c], uint32(math.Log2(float64(sb.blockSize))-10))
+ binary.LittleEndian.PutUint32(b[0x1c:0x20], uint32(math.Log2(float64(sb.clusterSize))))
+
+ binary.LittleEndian.PutUint32(b[0x20:0x24], sb.blocksPerGroup)
+ if sb.features.bigalloc {
+ binary.LittleEndian.PutUint32(b[0x24:0x28], sb.clustersPerGroup)
+ } else {
+ binary.LittleEndian.PutUint32(b[0x24:0x28], sb.blocksPerGroup)
+ }
+ binary.LittleEndian.PutUint32(b[0x28:0x2c], sb.inodesPerGroup)
+ mountTime := timeToBytes(sb.mountTime)
+ writeTime := timeToBytes(sb.writeTime)
+ mkfsTime := timeToBytes(sb.mkfsTime)
+ lastCheck := timeToBytes(sb.lastCheck)
+ errorFirstTime := timeToBytes(sb.errorFirstTime)
+ errorLastTime := timeToBytes(sb.errorLastTime)
+
+ // mount time low bits, high bit
+ copy(b[0x2c:0x30], mountTime[0:4])
+ b[0x274] = mountTime[4]
+ // write time low bits, high bit
+ copy(b[0x30:0x34], writeTime[0:4])
+ b[0x275] = writeTime[4]
+ // mkfs time low bits, high bit
+ copy(b[0x108:0x10c], mkfsTime[0:4])
+ b[0x276] = mkfsTime[4]
+ // last check time low bits, high bit
+ copy(b[0x40:0x44], lastCheck[0:4])
+ b[0x277] = lastCheck[4]
+ // first error time low bits, high bit
+ copy(b[0x198:0x19c], errorFirstTime[0:4])
+ b[0x278] = errorFirstTime[4]
+ // last error time low bits, high bit
+ copy(b[0x1cc:0x1d0], errorLastTime[0:4])
+ b[0x279] = errorLastTime[4]
+
+ // error codes
+ b[0x27a] = sb.errorFirstCode
+ b[0x27b] = sb.errorLastCode
+
+ binary.LittleEndian.PutUint16(b[0x34:0x36], sb.mountCount)
+ binary.LittleEndian.PutUint16(b[0x36:0x38], sb.mountsToFsck)
+
+ binary.LittleEndian.PutUint16(b[0x3a:0x3c], uint16(sb.filesystemState))
+ binary.LittleEndian.PutUint16(b[0x3c:0x3e], uint16(sb.errorBehaviour))
+
+ binary.LittleEndian.PutUint16(b[0x3e:0x40], sb.minorRevision)
+ binary.LittleEndian.PutUint32(b[0x40:0x44], uint32(sb.lastCheck.Unix()))
+ binary.LittleEndian.PutUint32(b[0x44:0x48], sb.checkInterval)
+
+ binary.LittleEndian.PutUint32(b[0x48:0x4c], uint32(sb.creatorOS))
+ binary.LittleEndian.PutUint32(b[0x4c:0x50], sb.revisionLevel)
+ binary.LittleEndian.PutUint16(b[0x50:0x52], sb.reservedBlocksDefaultUID)
+ binary.LittleEndian.PutUint16(b[0x52:0x54], sb.reservedBlocksDefaultGID)
+
+ binary.LittleEndian.PutUint32(b[0x54:0x58], sb.firstNonReservedInode)
+ binary.LittleEndian.PutUint16(b[0x58:0x5a], sb.inodeSize)
+ binary.LittleEndian.PutUint16(b[0x5a:0x5c], sb.blockGroup)
+
+ if sb.uuid != nil {
+ copy(b[0x68:0x78], sb.uuid[:])
+ }
+
+ ab, err := stringToASCIIBytes(sb.volumeLabel, 16)
+ if err != nil {
+ return nil, fmt.Errorf("error converting volume label to bytes: %v", err)
+ }
+ copy(b[0x78:0x88], ab[0:16])
+ ab, err = stringToASCIIBytes(sb.lastMountedDirectory, 64)
+ if err != nil {
+ return nil, fmt.Errorf("error last mounted directory to bytes: %v", err)
+ }
+ copy(b[0x88:0xc8], ab[0:64])
+
+ binary.LittleEndian.PutUint32(b[0xc8:0xcc], sb.algorithmUsageBitmap)
+
+ b[0xcc] = sb.preallocationBlocks
+ b[0xcd] = sb.preallocationDirectoryBlocks
+ binary.LittleEndian.PutUint16(b[0xce:0xd0], sb.reservedGDTBlocks)
+
+ if sb.journalSuperblockUUID != nil {
+ copy(b[0xd0:0xe0], sb.journalSuperblockUUID[:])
+ }
+
+ binary.LittleEndian.PutUint32(b[0xe0:0xe4], sb.journalInode)
+ binary.LittleEndian.PutUint32(b[0xe4:0xe8], sb.journalDeviceNumber)
+ binary.LittleEndian.PutUint32(b[0xe8:0xec], sb.orphanedInodesStart)
+
+ // to be safe
+ if len(sb.hashTreeSeed) < 4 {
+ sb.hashTreeSeed = append(sb.hashTreeSeed, 0, 0, 0, 0)
+ }
+ binary.LittleEndian.PutUint32(b[0xec:0xf0], sb.hashTreeSeed[0])
+ binary.LittleEndian.PutUint32(b[0xf0:0xf4], sb.hashTreeSeed[1])
+ binary.LittleEndian.PutUint32(b[0xf4:0xf8], sb.hashTreeSeed[2])
+ binary.LittleEndian.PutUint32(b[0xf8:0xfc], sb.hashTreeSeed[3])
+
+ b[0xfc] = byte(sb.hashVersion)
+
+ binary.LittleEndian.PutUint16(b[0xfe:0x100], sb.groupDescriptorSize)
+
+ binary.LittleEndian.PutUint32(b[0x100:0x104], sb.defaultMountOptions.toInt())
+ binary.LittleEndian.PutUint32(b[0x104:0x108], sb.firstMetablockGroup)
+
+ if sb.journalBackup != nil {
+ b[0xfd] = 1
+ startJournalBackup := 0x10c
+ for i := 0; i < 15; i++ {
+ start := startJournalBackup + 4*i
+ end := startJournalBackup + 4*i + 4
+ binary.LittleEndian.PutUint32(b[start:end], sb.journalBackup.iBlocks[i])
+ }
+
+ iSizeBytes := make([]byte, 8)
+ binary.LittleEndian.PutUint64(iSizeBytes, sb.journalBackup.iSize)
+ copy(b[startJournalBackup+4*16:startJournalBackup+4*17], iSizeBytes[0:4])
+ copy(b[startJournalBackup+4*15:startJournalBackup+4*16], iSizeBytes[4:8])
+ }
+
+ binary.LittleEndian.PutUint16(b[0x15c:0x15e], sb.inodeMinBytes)
+ binary.LittleEndian.PutUint16(b[0x15e:0x160], sb.inodeReserveBytes)
+ binary.LittleEndian.PutUint32(b[0x160:0x164], sb.miscFlags.toInt())
+
+ binary.LittleEndian.PutUint16(b[0x164:0x166], sb.raidStride)
+ binary.LittleEndian.PutUint32(b[0x170:0x174], sb.raidStripeWidth)
+
+ binary.LittleEndian.PutUint16(b[0x166:0x168], sb.multiMountPreventionInterval)
+ binary.LittleEndian.PutUint64(b[0x168:0x170], sb.multiMountProtectionBlock)
+
+ b[0x174] = uint8(math.Log2(float64(sb.logGroupsPerFlex)))
+
+ b[0x175] = sb.checksumType // only valid one is 1
+
+ // b[0x176:0x178] are reserved padding
+
+ binary.LittleEndian.PutUint64(b[0x178:0x180], sb.totalKBWritten)
+
+ binary.LittleEndian.PutUint32(b[0x180:0x184], sb.snapshotInodeNumber)
+ binary.LittleEndian.PutUint32(b[0x184:0x188], sb.snapshotID)
+ binary.LittleEndian.PutUint64(b[0x188:0x190], sb.snapshotReservedBlocks)
+ binary.LittleEndian.PutUint32(b[0x190:0x194], sb.snapshotStartInode)
+
+ // errors
+ binary.LittleEndian.PutUint32(b[0x194:0x198], sb.errorCount)
+ binary.LittleEndian.PutUint32(b[0x19c:0x1a0], sb.errorFirstInode)
+ binary.LittleEndian.PutUint64(b[0x1a0:0x1a8], sb.errorFirstBlock)
+ errorFirstFunctionBytes, err := stringToASCIIBytes(sb.errorFirstFunction, 32)
+ if err != nil {
+ return nil, fmt.Errorf("error converting errorFirstFunction to bytes: %v", err)
+ }
+ copy(b[0x1a8:0x1c8], errorFirstFunctionBytes)
+ binary.LittleEndian.PutUint32(b[0x1c8:0x1cc], sb.errorFirstLine)
+ binary.LittleEndian.PutUint32(b[0x1d0:0x1d4], sb.errorLastInode)
+ binary.LittleEndian.PutUint32(b[0x1d4:0x1d8], sb.errorLastLine)
+ binary.LittleEndian.PutUint64(b[0x1d8:0x1e0], sb.errorLastBlock)
+ errorLastFunctionBytes, err := stringToASCIIBytes(sb.errorLastFunction, 32)
+ if err != nil {
+ return nil, fmt.Errorf("error converting errorLastFunction to bytes: %v", err)
+ }
+ copy(b[0x1e0:0x200], errorLastFunctionBytes)
+
+ mountOptionsBytes, err := stringToASCIIBytes(sb.mountOptions, 64)
+ if err != nil {
+ return nil, fmt.Errorf("error converting mountOptions to bytes: %v", err)
+ }
+ copy(b[0x200:0x240], mountOptionsBytes)
+ binary.LittleEndian.PutUint32(b[0x240:0x244], sb.userQuotaInode)
+ binary.LittleEndian.PutUint32(b[0x244:0x248], sb.groupQuotaInode)
+ // overheadBlocks *always* is 0
+ binary.LittleEndian.PutUint32(b[0x248:0x24c], sb.overheadBlocks)
+ binary.LittleEndian.PutUint32(b[0x24c:0x250], sb.backupSuperblockBlockGroups[0])
+ binary.LittleEndian.PutUint32(b[0x250:0x254], sb.backupSuperblockBlockGroups[1])
+ // safety check of encryption algorithms
+
+ for i := 0; i < 4; i++ {
+ b[0x254+i] = byte(sb.encryptionAlgorithms[i])
+ }
+ for i := 0; i < 16; i++ {
+ b[0x258+i] = sb.encryptionSalt[i]
+ }
+ binary.LittleEndian.PutUint32(b[0x268:0x26c], sb.lostFoundInode)
+ binary.LittleEndian.PutUint32(b[0x26c:0x270], sb.projectQuotaInode)
+
+ binary.LittleEndian.PutUint32(b[0x270:0x274], sb.checksumSeed)
+
+ binary.LittleEndian.PutUint16(b[0x27c:0x27e], sb.filenameCharsetEncoding)
+ binary.LittleEndian.PutUint16(b[0x27e:0x280], sb.filenameCharsetEncodingFlags)
+ binary.LittleEndian.PutUint32(b[0x280:0x284], sb.orphanedInodeInodeNumber)
+
+ // b[0x288:0x3fc] are reserved for zero padding
+
+ // calculate the checksum and validate - we use crc32c
+ if sb.features.metadataChecksums {
+ actualChecksum := crc.CRC32c(0xffffffff, b[0:0x3fc])
+ binary.LittleEndian.PutUint32(b[0x3fc:0x400], actualChecksum)
+ }
+
+ return b, nil
+}
+
+func (sb *superblock) gdtChecksumType() gdtChecksumType {
+ var gdtChecksumTypeInFS gdtChecksumType
+ switch {
+ case sb.features.metadataChecksums:
+ gdtChecksumTypeInFS = gdtChecksumMetadata
+ case sb.features.gdtChecksum:
+ gdtChecksumTypeInFS = gdtChecksumGdt
+ default:
+ gdtChecksumTypeInFS = gdtChecksumNone
+ }
+ return gdtChecksumTypeInFS
+}
+
+func (sb *superblock) blockGroupCount() uint64 {
+ whole := sb.blockCount / uint64(sb.blocksPerGroup)
+ part := sb.blockCount % uint64(sb.blocksPerGroup)
+ if part > 0 {
+ whole++
+ }
+ return whole
+}
+
+// calculateBackupSuperblocks calculate which block groups should have backup superblocks.
+func calculateBackupSuperblockGroups(bgs int64) []int64 {
+ // calculate which block groups should have backup superblocks
+ // these are if the block group number is a power of 3, 5, or 7
+ var backupGroups []int64
+ for i := float64(0); ; i++ {
+ bg := int64(math.Pow(3, i))
+ if bg >= bgs {
+ break
+ }
+ backupGroups = append(backupGroups, bg)
+ }
+ for i := float64(0); ; i++ {
+ bg := int64(math.Pow(5, i))
+ if bg >= bgs {
+ break
+ }
+ backupGroups = append(backupGroups, bg)
+ }
+ for i := float64(0); ; i++ {
+ bg := int64(math.Pow(7, i))
+ if bg >= bgs {
+ break
+ }
+ backupGroups = append(backupGroups, bg)
+ }
+ // sort the backup groups
+ uniqBackupGroups := util.Uniqify[int64](backupGroups)
+ sort.Slice(uniqBackupGroups, func(i, j int) bool {
+ return uniqBackupGroups[i] < uniqBackupGroups[j]
+ })
+ return uniqBackupGroups
+}
+
+func bytesToTime(b ...[]byte) time.Time {
+ // ensure it is at least 8 bytes
+ var (
+ in [8]byte
+ count int
+ )
+ for _, v := range b {
+ toCopy := len(v)
+ if toCopy+count > len(in) {
+ toCopy = len(in) - count
+ }
+ copied := copy(in[count:], v[:toCopy])
+ count += copied
+ }
+ return time.Unix(int64(binary.LittleEndian.Uint64(in[:])), 0).UTC()
+}
+
+// timeToBytes convert a time.Time to an 8 byte slice. Guarantees 8 bytes
+func timeToBytes(t time.Time) []byte {
+ timestamp := t.Unix()
+ var b = make([]byte, 8)
+ binary.LittleEndian.PutUint64(b, uint64(timestamp))
+ return b
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/util.go b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/util.go
new file mode 100644
index 000000000000..ae2294302642
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/ext4/util.go
@@ -0,0 +1,106 @@
+package ext4
+
+import (
+ "fmt"
+ "strings"
+)
+
+const (
+ // KB represents one KB
+ KB int64 = 1024
+ // MB represents one MB
+ MB int64 = 1024 * KB
+ // GB represents one GB
+ GB int64 = 1024 * MB
+ // TB represents one TB
+ TB int64 = 1024 * GB
+ // PB represents one TB
+ PB int64 = 1024 * TB
+ // XB represents one Exabyte
+ XB int64 = 1024 * PB
+ // these because they are larger than int64 or uint64 can handle
+ // ZB represents one Zettabyte
+ // ZB int64 = 1024 * XB
+ // YB represents one Yottabyte
+ // YB int64 = 1024 * ZB
+ // Ext4MaxSize is maximum size of an ext4 filesystem in bytes
+ // it varies based on the block size and if we are 64-bit or 32-bit mode, but the absolute complete max
+ // is 64KB per block (128 sectors) in 64-bit mode
+ // for a max filesystem size of 1YB (yottabyte)
+ // Ext4MaxSize int64 = YB
+ // if we ever actually care, we will use math/big to do it
+ // var xb, ZB, kb, YB big.Int
+ // kb.SetUint64(1024)
+ // xb.SetUint64(uint64(XB))
+ // ZB.Mul(&xb, &kb)
+ // YB.Mul(&ZB, &kb)
+
+ // Ext4MinSize is minimum size for an ext4 filesystem
+ // it assumes a single block group with:
+ // blocksize = 2 sectors = 1KB
+ // 1 block for boot code
+ // 1 block for superblock
+ // 1 block for block group descriptors
+ // 1 block for bock and inode bitmaps and inode table
+ // 1 block for data
+ // total = 5 blocks
+ Ext4MinSize int64 = 5 * int64(SectorSize512)
+
+ // volume
+)
+
+func splitPath(p string) []string {
+ // we need to split such that each one ends in "/", except possibly the last one
+ parts := strings.Split(p, "/")
+ // eliminate empty parts
+ ret := make([]string, 0)
+ for _, sub := range parts {
+ if sub != "" {
+ ret = append(ret, sub)
+ }
+ }
+ return ret
+}
+
+// convert a string to a byte array, if all characters are valid ascii
+// always pads to the full length provided in padding. If size is less than the length of the string, it will be truncated
+func stringToASCIIBytes(s string, size int) ([]byte, error) {
+ length := len(s)
+ b := make([]byte, length)
+ // convert the name into 11 bytes
+ r := []rune(s)
+ // take the first 8 characters
+ for i := 0; i < length; i++ {
+ val := int(r[i])
+ // we only can handle values less than max byte = 255
+ if val > 255 {
+ return nil, fmt.Errorf("Non-ASCII character in name: %s", s)
+ }
+ b[i] = byte(val)
+ }
+ if len(b) < size {
+ // pad with nulls
+ for i := len(b); i < size; i++ {
+ b = append(b, 0)
+ }
+ }
+ if len(b) > size {
+ b = b[:size]
+ }
+ return b, nil
+}
+
+// minString convert []byte to string, but drop extraneous 0x0
+func minString(b []byte) string {
+ // find the last byte that is not 0x0
+ if len(b) == 0 {
+ return ""
+ }
+ index := len(b) - 1
+ for ; index >= 0; index-- {
+ if b[index] != 0 {
+ break
+ }
+ }
+ return string(b[:index+1])
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/fat32/fat32.go b/vendor/github.com/diskfs/go-diskfs/filesystem/fat32/fat32.go
index 84961587205c..ae6531734f8e 100644
--- a/vendor/github.com/diskfs/go-diskfs/filesystem/fat32/fat32.go
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/fat32/fat32.go
@@ -375,7 +375,7 @@ func Read(file util.File, size, start, blocksize int64) (*FileSystem, error) {
_, _ = file.ReadAt(b, int64(fatSecondaryStart)+start)
fat2 := tableFromBytes(b)
if !fat.equal(fat2) {
- return nil, errors.New("fat tables did not much")
+ return nil, errors.New("fat tables did not match")
}
dataStart := uint32(fatSecondaryStart) + fat.size
@@ -493,9 +493,12 @@ func (fs *FileSystem) ReadDir(p string) ([]os.FileInfo, error) {
}
// once we have made it here, looping is done. We have found the final entry
// we need to return all of the file info
- count := len(entries)
- ret := make([]os.FileInfo, count)
- for i, e := range entries {
+ //nolint:prealloc // because the following loop may omit some entry
+ var ret []os.FileInfo
+ for _, e := range entries {
+ if e.isVolumeLabel {
+ continue
+ }
shortName := e.filenameShort
if e.lowercaseShortname {
shortName = strings.ToLower(shortName)
@@ -507,13 +510,13 @@ func (fs *FileSystem) ReadDir(p string) ([]os.FileInfo, error) {
if fileExtension != "" {
shortName = fmt.Sprintf("%s.%s", shortName, fileExtension)
}
- ret[i] = FileInfo{
+ ret = append(ret, FileInfo{
modTime: e.modifyTime,
name: e.filenameLong,
shortName: shortName,
size: int64(e.fileSize),
isDir: e.isSubdirectory,
- }
+ })
}
return ret, nil
}
@@ -850,6 +853,7 @@ func (fs *FileSystem) readDirWithMkdir(p string, doMake bool) (*Directory, []*di
if err != nil {
return nil, nil, fmt.Errorf("failed to create subdirectory %s", "/"+strings.Join(paths[0:i+1], "/"))
}
+ currentDir.modifyTime = subdirEntry.createTime
// make a basic entry for the new subdir
parentDirectoryCluster := currentDir.clusterLocation
if parentDirectoryCluster == 2 {
@@ -859,8 +863,22 @@ func (fs *FileSystem) readDirWithMkdir(p string, doMake bool) (*Directory, []*di
dir := &Directory{
directoryEntry: directoryEntry{clusterLocation: subdirEntry.clusterLocation},
entries: []*directoryEntry{
- {filenameShort: ".", isSubdirectory: true, clusterLocation: subdirEntry.clusterLocation},
- {filenameShort: "..", isSubdirectory: true, clusterLocation: parentDirectoryCluster},
+ {
+ filenameShort: ".",
+ isSubdirectory: true,
+ clusterLocation: subdirEntry.clusterLocation,
+ createTime: subdirEntry.createTime,
+ modifyTime: subdirEntry.modifyTime,
+ accessTime: subdirEntry.accessTime,
+ },
+ {
+ filenameShort: "..",
+ isSubdirectory: true,
+ clusterLocation: parentDirectoryCluster,
+ createTime: currentDir.createTime,
+ modifyTime: currentDir.modifyTime,
+ accessTime: currentDir.accessTime,
+ },
},
}
// write the new directory entries to disk
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/filesystem.go b/vendor/github.com/diskfs/go-diskfs/filesystem/filesystem.go
index fdd35313d015..2c1acfa6c362 100644
--- a/vendor/github.com/diskfs/go-diskfs/filesystem/filesystem.go
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/filesystem.go
@@ -34,4 +34,6 @@ const (
TypeISO9660
// TypeSquashfs is a squashfs filesystem
TypeSquashfs
+ // TypeExt4 is an ext4 compatible filesystem
+ TypeExt4
)
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/directoryentry.go b/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/directoryentry.go
index 1f6947811b19..d9877673041d 100644
--- a/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/directoryentry.go
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/directoryentry.go
@@ -119,7 +119,7 @@ func (de *directoryEntry) toBytes(skipExt bool, ceBlocks []uint32) ([][]byte, er
filenameBytes = []byte{0x01}
default:
// first validate the filename
- err = validateFilename(de.filename, de.isSubdirectory)
+ err = validateFilename(de.filename, de.isSubdirectory, de.filesystem.suspEnabled)
if err != nil {
nametype := "filename"
if de.isSubdirectory {
@@ -189,9 +189,8 @@ func dirEntryExtensionsToBytes(extensions []directoryEntrySystemUseExtension, ma
}
b = append(b, ce.Bytes()...)
break
- } else {
- b = append(b, b2...)
}
+ b = append(b, b2...)
}
ret = append(ret, b)
if len(continuedBytes) > 0 {
@@ -482,9 +481,24 @@ func (de *directoryEntry) Size() int64 {
// Mode() FileMode // file mode bits
func (de *directoryEntry) Mode() os.FileMode {
+ for _, ext := range de.extensions {
+ if s, ok := ext.(rockRidgeSymlink); ok && !s.continued {
+ return 0o755 | os.ModeSymlink
+ }
+ }
return 0o755
}
+// Readlink tries to return the target link, only valid for symlinks
+func (de *directoryEntry) ReadLink() (string, bool) {
+ for _, ext := range de.extensions {
+ if s, ok := ext.(rockRidgeSymlink); ok && !s.continued {
+ return s.name, true
+ }
+ }
+ return "", false
+}
+
// ModTime() time.Time // modification time
func (de *directoryEntry) ModTime() time.Time {
return de.creation
@@ -534,16 +548,27 @@ func timeToBytes(t time.Time) []byte {
}
// convert a string to ascii bytes, but only accept valid d-characters
-func validateFilename(s string, isDir bool) error {
+func validateFilename(s string, isDir, suspExtension bool) error {
+ var err error
+ if suspExtension {
+ err = validateSUSPFilename(s, isDir)
+ } else {
+ err = validateISOFilename(s, isDir)
+ }
+ return err
+}
+
+// validateISOFilename validates a filename that is plain ISO9660-compliant (levels 2 & 3)
+func validateISOFilename(s string, isDir bool) error {
var err error
+ // all allowed up to 30 characters, of A-Z,0-9,_
if isDir {
- // directory only allowed up to 8 characters of A-Z,0-9,_
re := regexp.MustCompile("^[A-Z0-9_]{1,30}$")
if !re.MatchString(s) {
err = fmt.Errorf("directory name must be of up to 30 characters from A-Z0-9_")
}
} else {
- // filename only allowed up to 8 characters of A-Z,0-9,_, plus an optional '.' plus up to 3 characters of A-Z,0-9,_, plus must have ";1"
+ // filename also allowed an optional '.' plus up to 3 characters of A-Z,0-9,_, plus must have ";1"
re := regexp.MustCompile("^[A-Z0-9_]+(.[A-Z0-9_]*)?;1$")
switch {
case !re.MatchString(s):
@@ -555,6 +580,20 @@ func validateFilename(s string, isDir bool) error {
return err
}
+// validateSUSPFilename validates a filename that is Rock Ridge compliant
+func validateSUSPFilename(s string, _ bool) error {
+ var err error
+ // all allowed up to 255 characters of any kind, except null (0x0) and '/'
+ re := regexp.MustCompile(`^[^\x00/]*$`)
+ switch {
+ case len(s) > 255:
+ err = fmt.Errorf("filename must be at most 255 characters")
+ case !re.MatchString(s):
+ err = fmt.Errorf("filename must not include / or null characters")
+ }
+ return err
+}
+
// convert a string to a byte array, if all characters are valid ascii
func stringToASCIIBytes(s string) ([]byte, error) {
length := len(s)
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/directoryentrysystemuseextension.go b/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/directoryentrysystemuseextension.go
index 1d10ec54eef0..8bef9f6c27d3 100644
--- a/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/directoryentrysystemuseextension.go
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/directoryentrysystemuseextension.go
@@ -37,7 +37,7 @@ type suspExtension interface {
Descriptor() string
Source() string
Version() uint8
- GetFileExtensions(string, bool, bool) ([]directoryEntrySystemUseExtension, error)
+ GetFileExtensions(*finalizeFileInfo, bool, bool) ([]directoryEntrySystemUseExtension, error)
GetFinalizeExtensions(*finalizeFileInfo) ([]directoryEntrySystemUseExtension, error)
Relocatable() bool
Relocate(map[string]*finalizeFileInfo) ([]*finalizeFileInfo, map[string]*finalizeFileInfo, error)
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/eltorito.go b/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/eltorito.go
index a2cb818be66a..a598ef6695f8 100644
--- a/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/eltorito.go
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/eltorito.go
@@ -33,7 +33,7 @@ const (
elToritoDefaultCatalogRR = "boot.catalog"
)
-// Emulation what emulation should be used for booting, normally none
+// Emulation that should be used for booting, normally none
type Emulation uint8
const (
@@ -55,7 +55,7 @@ type ElTorito struct {
BootCatalog string
// HideBootCatalog if the boot catalog should be hidden in the file system. Defaults to false
HideBootCatalog bool
- // Entries list of ElToritoEntry boot entires
+ // Entries list of ElToritoEntry boot entries
Entries []*ElToritoEntry
// Platform supported platform
Platform Platform
@@ -72,11 +72,11 @@ type ElToritoEntry struct {
// option `-boot-info-table`. Unlike genisoimage, does not modify the file in the
// filesystem, but inserts it on the fly.
BootTable bool
- // SystemType type of system the partition is, accordinng to the MBR standard
+ // SystemType type of system the partition is, according to the MBR standard
SystemType mbr.Type
// LoadSize how many blocks of BootFile to load, equivalent to genisoimage option `-boot-load-size`
LoadSize uint16
- size uint16
+ size uint32
location uint32
}
@@ -127,7 +127,7 @@ func (e *ElToritoEntry) headerBytes(last bool, entries uint16) []byte {
func (e *ElToritoEntry) entryBytes() []byte {
blocks := e.LoadSize
if blocks == 0 {
- blocks = e.size / 512
+ blocks = uint16(e.size / 512)
if e.size%512 > 1 {
blocks++
}
@@ -153,7 +153,7 @@ func (e *ElToritoEntry) generateBootTable(pvdSector uint32, p string) ([]byte, e
b := make([]byte, 56)
binary.LittleEndian.PutUint32(b[0:4], pvdSector)
binary.LittleEndian.PutUint32(b[4:8], e.location)
- binary.LittleEndian.PutUint32(b[8:12], uint32(e.size))
+ binary.LittleEndian.PutUint32(b[8:12], e.size)
// Checksum - simply add up all 32-bit words beginning at byte position 64
f, err := os.Open(p)
if err != nil {
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/file.go b/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/file.go
index 7d6bb519357d..83dff8b79666 100644
--- a/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/file.go
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/file.go
@@ -64,7 +64,7 @@ func (fl *File) Read(b []byte) (int, error) {
// Write writes len(b) bytes to the File.
//
// you cannot write to an iso, so this returns an error
-func (fl *File) Write(p []byte) (int, error) {
+func (fl *File) Write(_ []byte) (int, error) {
return 0, fmt.Errorf("cannot write to a read-only iso filesystem")
}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/finalize.go b/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/finalize.go
index c055cf4d350e..aaa32629b9f0 100644
--- a/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/finalize.go
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/finalize.go
@@ -3,6 +3,7 @@ package iso9660
import (
"fmt"
"io"
+ "io/fs"
"os"
"path"
"path/filepath"
@@ -12,11 +13,13 @@ import (
"time"
"github.com/diskfs/go-diskfs/util"
+ "github.com/djherbis/times"
)
const (
dataStartSector = 16
defaultVolumeIdentifier = "ISOIMAGE"
+ elToritoBootTableOffset = 8
)
// FinalizeOptions options to pass to finalize
@@ -41,6 +44,14 @@ type FinalizeOptions struct {
// IsDir() bool // abbreviation for Mode().IsDir()
// Sys() interface{} // underlying data source (can return nil)
//
+// Also supports:
+//
+// AccessTime() time.Time
+// ChangeTime() time.Time
+// Nlink() uint32 // number of hardlinks, if supported
+// Uid() uint32 // uid, if supported
+// Gid() uint32 // gid, if supported
+//
//nolint:structcheck // keep unused members so that we can know their references
type finalizeFileInfo struct {
path string
@@ -56,6 +67,8 @@ type finalizeFileInfo struct {
size int64
mode os.FileMode
modTime time.Time
+ accessTime time.Time
+ changeTime time.Time
isDir bool
isRoot bool
bytes [][]byte
@@ -64,7 +77,55 @@ type finalizeFileInfo struct {
trueParent *finalizeFileInfo
trueChild *finalizeFileInfo
elToritoEntry *ElToritoEntry
- content []byte
+ linkTarget string
+ uid uint32
+ gid uint32
+ nlink uint32
+ // content in memory content of file. If this is anything other than nil, including a zero-length slice,
+ // then this content is used, rather than anything on disk.
+ content []byte
+ serial uint64
+}
+
+func finalizeFileInfoFromFile(p, fullPath string, fi fs.FileInfo) (*finalizeFileInfo, error) {
+ isRoot := p == "."
+ name := fi.Name()
+ shortname, _ := calculateShortnameExtension(name)
+
+ if isRoot {
+ name = string([]byte{0x00})
+ shortname = name
+ }
+ t, err := times.Lstat(fullPath)
+ if err != nil {
+ return nil, fmt.Errorf("could not get times information for %s: %w", fullPath, err)
+ }
+ mode := fi.Mode()
+ var target string
+ if fi.Mode()&os.ModeSymlink == os.ModeSymlink {
+ target, err = os.Readlink(fullPath)
+ if err != nil {
+ return nil, fmt.Errorf("unable to read link for %s: %w", fullPath, err)
+ }
+ }
+ nlink, uid, gid := statt(fi)
+
+ return &finalizeFileInfo{
+ path: p,
+ name: name,
+ isDir: fi.IsDir(),
+ isRoot: isRoot,
+ modTime: fi.ModTime(),
+ accessTime: t.AccessTime(),
+ changeTime: t.ChangeTime(),
+ mode: mode,
+ size: fi.Size(),
+ shortname: shortname,
+ linkTarget: target,
+ uid: uid,
+ gid: gid,
+ nlink: nlink,
+ }, nil
}
func (fi *finalizeFileInfo) Name() string {
@@ -100,8 +161,26 @@ func (fi *finalizeFileInfo) updateDepth(depth int) {
}
}
}
+func (fi *finalizeFileInfo) AccessTime() time.Time {
+ return fi.accessTime
+}
+func (fi *finalizeFileInfo) ChangeTime() time.Time {
+ return fi.changeTime
+}
+func (fi *finalizeFileInfo) LinkTarget() string {
+ return fi.linkTarget
+}
+func (fi *finalizeFileInfo) Nlink() uint32 {
+ return fi.nlink
+}
+func (fi *finalizeFileInfo) UID() uint32 {
+ return fi.uid
+}
+func (fi *finalizeFileInfo) GID() uint32 {
+ return fi.gid
+}
-func (fi *finalizeFileInfo) toDirectoryEntry(fs *FileSystem, isSelf, isParent bool) (*directoryEntry, error) {
+func (fi *finalizeFileInfo) toDirectoryEntry(fsm *FileSystem, isSelf, isParent bool) (*directoryEntry, error) {
de := &directoryEntry{
extAttrSize: 0,
location: fi.location,
@@ -116,18 +195,22 @@ func (fi *finalizeFileInfo) toDirectoryEntry(fs *FileSystem, isSelf, isParent bo
isSelf: isSelf,
isParent: isParent,
volumeSequence: 1,
- filesystem: fs,
+ filesystem: fsm,
// we keep the full filename until after processing
filename: fi.Name(),
}
// if it is root, and we have susp enabled, add the necessary entries
- if fs.suspEnabled {
+ if fsm.suspEnabled {
if fi.isRoot && isSelf {
de.extensions = append(de.extensions, directoryEntrySystemUseExtensionSharingProtocolIndicator{skipBytes: 0})
}
// add appropriate PX, TF, SL, NM extensions
- for _, e := range fs.suspExtensions {
- ext, err := e.GetFileExtensions(path.Join(fs.workspace, fi.path), isSelf, isParent)
+ for _, e := range fsm.suspExtensions {
+ var (
+ ext []directoryEntrySystemUseExtension
+ err error
+ )
+ ext, err = e.GetFileExtensions(fi, isSelf, isParent)
if err != nil {
return nil, fmt.Errorf("error getting extensions for %s at path %s: %v", e.ID(), fi.path, err)
}
@@ -140,14 +223,14 @@ func (fi *finalizeFileInfo) toDirectoryEntry(fs *FileSystem, isSelf, isParent bo
}
if fi.isRoot && isSelf {
- for _, e := range fs.suspExtensions {
+ for _, e := range fsm.suspExtensions {
de.extensions = append(de.extensions, directoryEntrySystemUseExtensionReference{id: e.ID(), descriptor: e.Descriptor(), source: e.Source(), extensionVersion: e.Version()})
}
}
}
return de, nil
}
-func (fi *finalizeFileInfo) toDirectory(fs *FileSystem) (*Directory, error) {
+func (fi *finalizeFileInfo) toDirectory(fsm *FileSystem) (*Directory, error) {
// also need to add self and parent to it
var (
self, parent, dirEntry *directoryEntry
@@ -156,7 +239,7 @@ func (fi *finalizeFileInfo) toDirectory(fs *FileSystem) (*Directory, error) {
if !fi.IsDir() {
return nil, fmt.Errorf("cannot convert a file entry to a directtory")
}
- self, err = fi.toDirectoryEntry(fs, true, false)
+ self, err = fi.toDirectoryEntry(fsm, true, false)
if err != nil {
return nil, fmt.Errorf("could not convert self entry %s to dirEntry: %v", fi.path, err)
}
@@ -167,14 +250,14 @@ func (fi *finalizeFileInfo) toDirectory(fs *FileSystem) (*Directory, error) {
if fi.isRoot {
parentEntry = fi
}
- parent, err = parentEntry.toDirectoryEntry(fs, false, true)
+ parent, err = parentEntry.toDirectoryEntry(fsm, false, true)
if err != nil {
return nil, fmt.Errorf("could not convert parent entry %s to dirEntry: %v", fi.parent.path, err)
}
entries := []*directoryEntry{self, parent}
for _, child := range fi.children {
- dirEntry, err = child.toDirectoryEntry(fs, false, false)
+ dirEntry, err = child.toDirectoryEntry(fsm, false, false)
if err != nil {
return nil, fmt.Errorf("could not convert child entry %s to dirEntry: %v", child.path, err)
}
@@ -188,10 +271,10 @@ func (fi *finalizeFileInfo) toDirectory(fs *FileSystem) (*Directory, error) {
}
// calculate the size of a directory entry single record
-func (fi *finalizeFileInfo) calculateRecordSize(fs *FileSystem, isSelf, isParent bool) (dirEntrySize, continuationBlocksSize int, err error) {
+func (fi *finalizeFileInfo) calculateRecordSize(fsm *FileSystem, isSelf, isParent bool) (dirEntrySize, continuationBlocksSize int, err error) {
// we do not actually need the the continuation blocks to calculate size, just length, so use an empty slice
extTmpBlocks := make([]uint32, 100)
- dirEntry, err := fi.toDirectoryEntry(fs, isSelf, isParent)
+ dirEntry, err := fi.toDirectoryEntry(fsm, isSelf, isParent)
if err != nil {
return 0, 0, fmt.Errorf("could not convert to dirEntry: %v", err)
}
@@ -205,21 +288,21 @@ func (fi *finalizeFileInfo) calculateRecordSize(fs *FileSystem, isSelf, isParent
}
// calculate the size of a directory, similar to a file size
-func (fi *finalizeFileInfo) calculateDirectorySize(fs *FileSystem) (dirEntrySize, continuationBlocksSize int, err error) {
+func (fi *finalizeFileInfo) calculateDirectorySize(fsm *FileSystem) (dirEntrySize, continuationBlocksSize int, err error) {
var (
recSize, recCE int
)
if !fi.IsDir() {
- return 0, 0, fmt.Errorf("cannot convert a file entry to a directtory")
+ return 0, 0, fmt.Errorf("cannot convert a file entry to a directory")
}
- recSize, recCE, err = fi.calculateRecordSize(fs, true, false)
+ recSize, recCE, err = fi.calculateRecordSize(fsm, true, false)
if err != nil {
return 0, 0, fmt.Errorf("could not calculate self entry size %s: %v", fi.path, err)
}
dirEntrySize += recSize
continuationBlocksSize += recCE
- recSize, recCE, err = fi.calculateRecordSize(fs, false, true)
+ recSize, recCE, err = fi.calculateRecordSize(fsm, false, true)
if err != nil {
return 0, 0, fmt.Errorf("could not calculate parent entry size %s: %v", fi.path, err)
}
@@ -228,13 +311,13 @@ func (fi *finalizeFileInfo) calculateDirectorySize(fs *FileSystem) (dirEntrySize
for _, e := range fi.children {
// get size of data and CE blocks
- recSize, recCE, err = e.calculateRecordSize(fs, false, false)
+ recSize, recCE, err = e.calculateRecordSize(fsm, false, false)
if err != nil {
return 0, 0, fmt.Errorf("could not calculate child %s entry size %s: %v", e.path, fi.path, err)
}
// do not go over a block boundary; pad if necessary
newSize := dirEntrySize + recSize
- blocksize := int(fs.blocksize)
+ blocksize := int(fsm.blocksize)
left := blocksize - dirEntrySize%blocksize
if left != 0 && newSize/blocksize > dirEntrySize/blocksize {
dirEntrySize += left
@@ -341,21 +424,21 @@ func (fi *finalizeFileInfo) addChild(entry *finalizeFileInfo) {
// Finalize finalize a read-only filesystem by writing it out to a read-only format
//
//nolint:gocyclo // this finalize function is complex and needs to be. We might be better off refactoring it to multiple functions, but it does not buy all that much.
-func (fs *FileSystem) Finalize(options FinalizeOptions) error {
- if fs.workspace == "" {
+func (fsm *FileSystem) Finalize(options FinalizeOptions) error {
+ if fsm.workspace == "" {
return fmt.Errorf("cannot finalize an already finalized filesystem")
}
// did we ask for susp?
if options.RockRidge {
- fs.suspEnabled = true
- fs.suspExtensions = append(fs.suspExtensions, getRockRidgeExtension(rockRidge112))
+ fsm.suspEnabled = true
+ fsm.suspExtensions = append(fsm.suspExtensions, getRockRidgeExtension(rockRidge112))
}
/*
There is nothing in the iso9660 spec about the order of directories and files,
other than that they must be accessible in the location specified in directory entry and/or path table
- However, most implementations seem to it as follows:
+ However, most implementations seem to do it as follows:
- each directory follows its parent
- data (i.e. file) sectors in each directory are immediately after its directory and immediately before the next sibling directory to its parent
@@ -380,11 +463,11 @@ func (fs *FileSystem) Finalize(options FinalizeOptions) error {
10- write volume descriptor set terminator
*/
- f := fs.file
- blocksize := int(fs.blocksize)
+ f := fsm.file
+ blocksize := int(fsm.blocksize)
// 1- blank out sectors 0-15
- b := make([]byte, dataStartSector*fs.blocksize)
+ b := make([]byte, dataStartSector*fsm.blocksize)
n, err := f.WriteAt(b, 0)
if err != nil {
return fmt.Errorf("could not write blank system area: %v", err)
@@ -394,7 +477,7 @@ func (fs *FileSystem) Finalize(options FinalizeOptions) error {
}
// 3- build out file tree
- fileList, dirList, err := walkTree(fs.Workspace())
+ fileList, dirList, err := walkTree(fsm.Workspace())
if err != nil {
return fmt.Errorf("error walking tree: %v", err)
}
@@ -406,9 +489,9 @@ func (fs *FileSystem) Finalize(options FinalizeOptions) error {
// if we need to relocate directories, must do them here, before finalizing order and sizes
// do not bother if enabled DeepDirectories, i.e. non-ISO9660 compliant
if !options.DeepDirectories {
- if fs.suspEnabled {
+ if fsm.suspEnabled {
var handler suspExtension
- for _, e := range fs.suspExtensions {
+ for _, e := range fsm.suspExtensions {
if e.Relocatable() {
handler = e
break
@@ -431,7 +514,7 @@ func (fs *FileSystem) Finalize(options FinalizeOptions) error {
// convert sizes to required blocks for files
for _, e := range fileList {
- e.blocks = calculateBlocks(e.size, fs.blocksize)
+ e.blocks = calculateBlocks(e.size, fsm.blocksize)
}
// we now have list of all of the files and directories and their properties, as well as children of every directory
@@ -467,14 +550,18 @@ func (fs *FileSystem) Finalize(options FinalizeOptions) error {
shortname, extension := calculateShortnameExtension(path.Base(catname))
// break down the catalog basename from the parent dir
catSize := int64(len(bootcat))
+ now := time.Now()
catEntry = &finalizeFileInfo{
- content: bootcat,
- size: catSize,
- path: catname,
- name: path.Base(catname),
- shortname: shortname,
- extension: extension,
- blocks: calculateBlocks(catSize, fs.blocksize),
+ content: bootcat,
+ size: catSize,
+ path: catname,
+ name: path.Base(catname),
+ shortname: shortname,
+ extension: extension,
+ blocks: calculateBlocks(catSize, fsm.blocksize),
+ modTime: now,
+ accessTime: now,
+ changeTime: now,
}
// make it the first file
files = append([]*finalizeFileInfo{catEntry}, files...)
@@ -503,8 +590,11 @@ func (fs *FileSystem) Finalize(options FinalizeOptions) error {
return fmt.Errorf("unable to find image child %s: %v", e.BootFile, err)
}
}
+ if child == nil {
+ return fmt.Errorf("unable to find image child %s: %v", e.BootFile, err)
+ }
// save the child so we can add location late
- e.size = uint16(child.size)
+ e.size = uint32(child.size)
child.elToritoEntry = e
}
}
@@ -512,7 +602,7 @@ func (fs *FileSystem) Finalize(options FinalizeOptions) error {
var size, ceBlocks int
for _, dir := range dirs {
dir.location = location
- size, ceBlocks, err = dir.calculateDirectorySize(fs)
+ size, ceBlocks, err = dir.calculateDirectorySize(fsm)
if err != nil {
return fmt.Errorf("unable to calculate size of directory for %s: %v", dir.path, err)
}
@@ -566,7 +656,7 @@ func (fs *FileSystem) Finalize(options FinalizeOptions) error {
for _, e := range dirs {
writeAt := int64(e.location) * int64(blocksize)
var d *Directory
- d, err = e.toDirectory(fs)
+ d, err = e.toDirectory(fsm)
if err != nil {
return fmt.Errorf("unable to convert entry to directory: %v", err)
}
@@ -601,13 +691,14 @@ func (fs *FileSystem) Finalize(options FinalizeOptions) error {
}()
for _, e := range files {
var (
- from *os.File
- copied int
+ from *os.File
+ copied int
+ bootTableMinSize int
)
writeAt := int64(e.location) * int64(blocksize)
if e.content == nil {
// for file, just copy the data across
- from, err = os.Open(path.Join(fs.workspace, e.path))
+ from, err = os.Open(path.Join(fsm.workspace, e.path))
if err != nil {
return fmt.Errorf("failed to open file for reading %s: %v", e.path, err)
}
@@ -617,21 +708,23 @@ func (fs *FileSystem) Finalize(options FinalizeOptions) error {
var count int
// first 8 bytes
- count, err = copyFileData(from, f, 0, writeAt, 8)
+ count, err = copyFileData(from, f, 0, writeAt, elToritoBootTableOffset)
if err != nil {
return fmt.Errorf("failed to copy first bytes 0-8 of boot file to disk %s: %v", e.path, err)
}
copied += count
// insert El Torito Boot Information Table
- bootTable, err := e.elToritoEntry.generateBootTable(dataStartSector, path.Join(fs.workspace, e.path))
+ bootTable, err := e.elToritoEntry.generateBootTable(dataStartSector, path.Join(fsm.workspace, e.path))
if err != nil {
return fmt.Errorf("failed to generate boot table for %s: %v", e.path, err)
}
- count, err = f.WriteAt(bootTable, writeAt+8)
+ count, err = f.WriteAt(bootTable, writeAt+elToritoBootTableOffset)
if err != nil {
return fmt.Errorf("failed to write 56 byte boot table to disk %s: %v", e.path, err)
}
copied += count
+ // file with boot table file must be a minimum of boot table size and the offset
+ bootTableMinSize = count
// remainder of file
count, err = copyFileData(from, f, 64, writeAt+64, 0)
if err != nil {
@@ -644,8 +737,12 @@ func (fs *FileSystem) Finalize(options FinalizeOptions) error {
return fmt.Errorf("failed to copy file to disk %s: %v", e.path, err)
}
}
- if copied != int(e.Size()) {
- return fmt.Errorf("error copying file %s to disk, copied %d bytes, expected %d", e.path, copied, e.Size())
+ targetSize := e.Size()
+ if targetSize < int64(bootTableMinSize) {
+ targetSize = int64(bootTableMinSize)
+ }
+ if copied != int(targetSize) {
+ return fmt.Errorf("error copying file %s to disk, copied %d bytes, expected %d", e.path, copied, targetSize)
}
} else {
copied = len(e.content)
@@ -665,7 +762,7 @@ func (fs *FileSystem) Finalize(options FinalizeOptions) error {
location = dataStartSector
// create and write the primary volume descriptor, supplementary and boot, and volume descriptor set terminator
now := time.Now()
- rootDE, err := root.toDirectoryEntry(fs, true, false)
+ rootDE, err := root.toDirectoryEntry(fsm, true, false)
if err != nil {
return fmt.Errorf("could not convert root entry for primary volume descriptor to dirEntry: %v", err)
}
@@ -676,7 +773,7 @@ func (fs *FileSystem) Finalize(options FinalizeOptions) error {
volumeSize: totalSize,
setSize: 1,
sequenceNumber: 1,
- blocksize: uint16(fs.blocksize),
+ blocksize: uint16(fsm.blocksize),
pathTableSize: uint32(pathTableSize),
pathTableLLocation: pathTableLLocation,
pathTableLOptionalLocation: 0,
@@ -710,10 +807,10 @@ func (fs *FileSystem) Finalize(options FinalizeOptions) error {
b = terminator.toBytes()
_, _ = f.WriteAt(b, int64(location)*int64(blocksize))
- _ = os.RemoveAll(fs.workspace)
+ _ = os.RemoveAll(fsm.workspace)
// finish by setting as finalized
- fs.workspace = ""
+ fsm.workspace = ""
return nil
}
@@ -772,16 +869,16 @@ func sortFinalizeFileInfoPathTable(left, right *finalizeFileInfo) bool {
// create a path table from a slice of *finalizeFileInfo that are directories
func createPathTable(fi []*finalizeFileInfo) *pathTable {
// copy so we do not modify the original
- fs := make([]*finalizeFileInfo, len(fi))
- copy(fs, fi)
+ fis := make([]*finalizeFileInfo, len(fi))
+ copy(fis, fi)
// sort via the rules
- sort.Slice(fs, func(i, j int) bool {
- return sortFinalizeFileInfoPathTable(fs[i], fs[j])
+ sort.Slice(fis, func(i, j int) bool {
+ return sortFinalizeFileInfoPathTable(fis[i], fis[j])
})
indexMap := make(map[*finalizeFileInfo]int)
// now that it is sorted, create the ordered path table entries
entries := make([]*pathTableEntry, 0)
- for i, e := range fs {
+ for i, e := range fis {
name := e.Name()
nameSize := len(name)
size := 8 + uint16(nameSize)
@@ -811,28 +908,34 @@ func createPathTable(fi []*finalizeFileInfo) *pathTable {
}
func walkTree(workspace string) ([]*finalizeFileInfo, map[string]*finalizeFileInfo, error) {
- cwd, err := os.Getwd()
- if err != nil {
- return nil, nil, fmt.Errorf("could not get pwd: %v", err)
- }
- // make everything relative to the workspace
- _ = os.Chdir(workspace)
- dirList := make(map[string]*finalizeFileInfo)
- fileList := make([]*finalizeFileInfo, 0)
- var entry *finalizeFileInfo
- err = filepath.Walk(".", func(fp string, fi os.FileInfo, err error) error {
+ var (
+ dirList = make(map[string]*finalizeFileInfo)
+ fileList = make([]*finalizeFileInfo, 0)
+ entry *finalizeFileInfo
+ serial uint64
+ )
+ err := filepath.WalkDir(workspace, func(actualPath string, d fs.DirEntry, err error) error {
if err != nil {
- return fmt.Errorf("error walking path %s: %v", fp, err)
+ return fmt.Errorf("error walking path %s: %v", actualPath, err)
+ }
+ fp := strings.TrimPrefix(actualPath, workspace)
+ fp = strings.TrimPrefix(fp, string(filepath.Separator))
+ if fp == "" {
+ fp = "."
}
- isRoot := fp == "."
- name := fi.Name()
- shortname, extension := calculateShortnameExtension(name)
+ name := d.Name()
+ _, extension := calculateShortnameExtension(name)
- if isRoot {
- name = string([]byte{0x00})
- shortname = name
+ fi, err := d.Info()
+ if err != nil {
+ return fmt.Errorf("could not get file info for %s: %v", fp, err)
+ }
+ entry, err = finalizeFileInfoFromFile(fp, actualPath, fi)
+ if err != nil {
+ return err
}
- entry = &finalizeFileInfo{path: fp, name: name, isDir: fi.IsDir(), isRoot: isRoot, modTime: fi.ModTime(), mode: fi.Mode(), size: fi.Size(), shortname: shortname}
+ entry.serial = serial
+ serial++
// we will have to save it as its parent
parentDir := filepath.Dir(fp)
@@ -841,7 +944,7 @@ func walkTree(workspace string) ([]*finalizeFileInfo, map[string]*finalizeFileIn
if fi.IsDir() {
entry.children = make([]*finalizeFileInfo, 0, 20)
dirList[fp] = entry
- if !isRoot {
+ if !entry.isRoot {
parentDirInfo.children = append(parentDirInfo.children, entry)
dirList[parentDir] = parentDirInfo
}
@@ -858,8 +961,6 @@ func walkTree(workspace string) ([]*finalizeFileInfo, map[string]*finalizeFileIn
if err != nil {
return nil, nil, err
}
- // reset the workspace
- _ = os.Chdir(cwd)
return fileList, dirList, nil
}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/iso9660.go b/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/iso9660.go
index c6c1321c6462..64b28ed2ee11 100644
--- a/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/iso9660.go
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/iso9660.go
@@ -34,15 +34,15 @@ type FileSystem struct {
}
// Equal compare if two filesystems are equal
-func (fs *FileSystem) Equal(a *FileSystem) bool {
- localMatch := fs.file == a.file && fs.size == a.size
- vdMatch := fs.volumes.equal(&a.volumes)
+func (fsm *FileSystem) Equal(a *FileSystem) bool {
+ localMatch := fsm.file == a.file && fsm.size == a.size
+ vdMatch := fsm.volumes.equal(&a.volumes)
return localMatch && vdMatch
}
// Workspace get the workspace path
-func (fs *FileSystem) Workspace() string {
- return fs.workspace
+func (fsm *FileSystem) Workspace() string {
+ return fsm.workspace
}
// Create creates an ISO9660 filesystem in a given directory
@@ -283,7 +283,7 @@ func Read(file util.File, size, start, blocksize int64) (*FileSystem, error) {
}
// Type returns the type code for the filesystem. Always returns filesystem.TypeFat32
-func (fs *FileSystem) Type() filesystem.Type {
+func (fsm *FileSystem) Type() filesystem.Type {
return filesystem.TypeISO9660
}
@@ -293,11 +293,11 @@ func (fs *FileSystem) Type() filesystem.Type {
// * It will not return an error if the path already exists
//
// if readonly and not in workspace, will return an error
-func (fs *FileSystem) Mkdir(p string) error {
- if fs.workspace == "" {
+func (fsm *FileSystem) Mkdir(p string) error {
+ if fsm.workspace == "" {
return fmt.Errorf("cannot write to read-only filesystem")
}
- err := os.MkdirAll(path.Join(fs.workspace, p), 0o755)
+ err := os.MkdirAll(path.Join(fsm.workspace, p), 0o755)
if err != nil {
return fmt.Errorf("could not create directory %s: %v", p, err)
}
@@ -310,12 +310,12 @@ func (fs *FileSystem) Mkdir(p string) error {
// Returns a slice of os.FileInfo with all of the entries in the directory.
//
// Will return an error if the directory does not exist or is a regular file and not a directory
-func (fs *FileSystem) ReadDir(p string) ([]os.FileInfo, error) {
+func (fsm *FileSystem) ReadDir(p string) ([]os.FileInfo, error) {
var fi []os.FileInfo
// non-workspace: read from iso9660
// workspace: read from regular filesystem
- if fs.workspace != "" {
- fullPath := path.Join(fs.workspace, p)
+ if fsm.workspace != "" {
+ fullPath := path.Join(fsm.workspace, p)
// read the entries
dirEntries, err := os.ReadDir(fullPath)
if err != nil {
@@ -329,7 +329,7 @@ func (fs *FileSystem) ReadDir(p string) ([]os.FileInfo, error) {
fi = append(fi, info)
}
} else {
- dirEntries, err := fs.readDirectory(p)
+ dirEntries, err := fsm.readDirectory(p)
if err != nil {
return nil, fmt.Errorf("error reading directory %s: %v", p, err)
}
@@ -351,7 +351,7 @@ func (fs *FileSystem) ReadDir(p string) ([]os.FileInfo, error) {
// accepts normal os.OpenFile flags
//
// returns an error if the file does not exist
-func (fs *FileSystem) OpenFile(p string, flag int) (filesystem.File, error) {
+func (fsm *FileSystem) OpenFile(p string, flag int) (filesystem.File, error) {
var f filesystem.File
var err error
@@ -366,14 +366,14 @@ func (fs *FileSystem) OpenFile(p string, flag int) (filesystem.File, error) {
// cannot open to write or append or create if we do not have a workspace
writeMode := flag&os.O_WRONLY != 0 || flag&os.O_RDWR != 0 || flag&os.O_APPEND != 0 || flag&os.O_CREATE != 0 || flag&os.O_TRUNC != 0 || flag&os.O_EXCL != 0
- if fs.workspace == "" {
+ if fsm.workspace == "" {
if writeMode {
return nil, fmt.Errorf("cannot write to read-only filesystem")
}
// get the directory entries
var entries []*directoryEntry
- entries, err = fs.readDirectory(dir)
+ entries, err = fsm.readDirectory(dir)
if err != nil {
return nil, fmt.Errorf("could not read directory entries for %s", dir)
}
@@ -405,7 +405,7 @@ func (fs *FileSystem) OpenFile(p string, flag int) (filesystem.File, error) {
offset: 0,
}
} else {
- f, err = os.OpenFile(path.Join(fs.workspace, p), flag, 0o644)
+ f, err = os.OpenFile(path.Join(fsm.workspace, p), flag, 0o644)
if err != nil {
return nil, fmt.Errorf("target file %s does not exist: %v", p, err)
}
@@ -415,7 +415,7 @@ func (fs *FileSystem) OpenFile(p string, flag int) (filesystem.File, error) {
}
// readDirectory - read directory entry on iso only (not workspace)
-func (fs *FileSystem) readDirectory(p string) ([]*directoryEntry, error) {
+func (fsm *FileSystem) readDirectory(p string) ([]*directoryEntry, error) {
var (
location, size uint32
err error
@@ -424,7 +424,7 @@ func (fs *FileSystem) readDirectory(p string) ([]*directoryEntry, error) {
// try from path table, then walk the directory tree, unless we were told explicitly not to
usePathtable := true
- for _, e := range fs.suspExtensions {
+ for _, e := range fsm.suspExtensions {
usePathtable = e.UsePathtable()
if !usePathtable {
break
@@ -432,14 +432,14 @@ func (fs *FileSystem) readDirectory(p string) ([]*directoryEntry, error) {
}
if usePathtable {
- location = fs.pathTable.getLocation(p)
+ location = fsm.pathTable.getLocation(p)
}
// if we found it, read the first directory entry to get the size
if location != 0 {
// we need 4 bytes to read the size of the directory; it is at offset 10 from beginning
dirb := make([]byte, 4)
- n, err = fs.file.ReadAt(dirb, int64(location)*fs.blocksize+10)
+ n, err = fsm.file.ReadAt(dirb, int64(location)*fsm.blocksize+10)
if err != nil {
return nil, fmt.Errorf("could not read directory %s: %v", p, err)
}
@@ -451,7 +451,7 @@ func (fs *FileSystem) readDirectory(p string) ([]*directoryEntry, error) {
} else {
// if we could not find the location in the path table, try reading directly from the disk
// it is slow, but this is how Unix does it, since many iso creators *do* create illegitimate disks
- location, size, err = fs.rootDir.getLocation(p)
+ location, size, err = fsm.rootDir.getLocation(p)
if err != nil {
return nil, fmt.Errorf("unable to read directory tree for %s: %v", p, err)
}
@@ -464,7 +464,7 @@ func (fs *FileSystem) readDirectory(p string) ([]*directoryEntry, error) {
// we have a location, let's read the directories from it
b := make([]byte, size)
- n, err = fs.file.ReadAt(b, int64(location)*fs.blocksize)
+ n, err = fsm.file.ReadAt(b, int64(location)*fsm.blocksize)
if err != nil {
return nil, fmt.Errorf("could not read directory entries for %s: %v", p, err)
}
@@ -472,7 +472,7 @@ func (fs *FileSystem) readDirectory(p string) ([]*directoryEntry, error) {
return nil, fmt.Errorf("reading directory %s returned %d bytes read instead of expected %d", p, n, size)
}
// parse the entries
- entries, err := parseDirEntries(b, fs)
+ entries, err := parseDirEntries(b, fsm)
if err != nil {
return nil, fmt.Errorf("could not parse directory entries for %s: %v", p, err)
}
@@ -488,13 +488,13 @@ func validateBlocksize(blocksize int64) error {
}
}
-func (fs *FileSystem) Label() string {
- if fs.volumes.primary == nil {
+func (fsm *FileSystem) Label() string {
+ if fsm.volumes.primary == nil {
return ""
}
- return fs.volumes.primary.volumeIdentifier
+ return fsm.volumes.primary.volumeIdentifier
}
-func (fs *FileSystem) SetLabel(string) error {
+func (fsm *FileSystem) SetLabel(string) error {
return fmt.Errorf("ISO9660 filesystem is read-only")
}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/rockridge.go b/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/rockridge.go
index 8a8c80a13408..ed20a1d79714 100644
--- a/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/rockridge.go
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/iso9660/rockridge.go
@@ -6,8 +6,6 @@ import (
"os"
"sort"
"time"
-
- "gopkg.in/djherbis/times.v1"
)
const (
@@ -96,53 +94,37 @@ func (r *rockRidgeExtension) GetFilename(de *directoryEntry) (string, error) {
}
return name, nil
}
-func (r *rockRidgeExtension) GetFileExtensions(fp string, isSelf, isParent bool) ([]directoryEntrySystemUseExtension, error) {
+func (r *rockRidgeExtension) GetFileExtensions(ffi *finalizeFileInfo, isSelf, isParent bool) ([]directoryEntrySystemUseExtension, error) {
// we always do PX, TF, NM, SL order
ret := []directoryEntrySystemUseExtension{}
- // do not follow symlinks
- fi, err := os.Lstat(fp)
- if err != nil {
- return nil, fmt.Errorf("error reading file %s: %v", fp, err)
- }
-
- t, err := times.Lstat(fp)
- if err != nil {
- return nil, fmt.Errorf("error reading times %s: %v", fp, err)
- }
// PX
- nlink, uid, gid := statt(fi)
- mtime := fi.ModTime()
- atime := t.AccessTime()
- ctime := t.ChangeTime()
+ mtime := ffi.ModTime()
ret = append(ret, rockRidgePosixAttributes{
- mode: fi.Mode(),
- linkCount: nlink,
- uid: uid,
- gid: gid,
+ mode: ffi.Mode(),
+ linkCount: ffi.Nlink(),
+ uid: ffi.UID(),
+ gid: ffi.GID(),
length: r.pxLength,
+ serial: ffi.serial,
})
// TF
tf := rockRidgeTimestamps{longForm: false, stamps: []rockRidgeTimestamp{
{timestampType: rockRidgeTimestampModify, time: mtime},
- {timestampType: rockRidgeTimestampAccess, time: atime},
- {timestampType: rockRidgeTimestampAttribute, time: ctime},
+ {timestampType: rockRidgeTimestampAccess, time: ffi.AccessTime()},
+ {timestampType: rockRidgeTimestampAttribute, time: ffi.ChangeTime()},
}}
ret = append(ret, tf)
// NM
if !isSelf && !isParent {
- ret = append(ret, rockRidgeName{name: fi.Name()})
+ ret = append(ret, rockRidgeName{name: ffi.name})
}
// SL
- if fi.Mode()&os.ModeSymlink == os.ModeSymlink {
+ if ffi.Mode()&os.ModeSymlink == os.ModeSymlink {
// need the target if it is a symlink
- target, err := os.Readlink(fp)
- if err != nil {
- return nil, fmt.Errorf("error reading symlink target at %s", fp)
- }
- ret = append(ret, rockRidgeSymlink{continued: false, name: target})
+ ret = append(ret, rockRidgeSymlink{continued: false, name: ffi.LinkTarget()})
}
return ret, nil
@@ -293,7 +275,7 @@ type rockRidgePosixAttributes struct {
linkCount uint32
uid uint32
gid uint32
- serial uint32
+ serial uint64
}
func (d rockRidgePosixAttributes) Equal(o directoryEntrySystemUseExtension) bool {
@@ -362,8 +344,7 @@ func (d rockRidgePosixAttributes) Data() []byte {
binary.LittleEndian.PutUint32(ret[24:28], d.gid)
binary.BigEndian.PutUint32(ret[28:32], d.gid)
if d.length == 44 {
- binary.LittleEndian.PutUint32(ret[32:36], d.serial)
- binary.BigEndian.PutUint32(ret[36:40], d.serial)
+ binary.LittleEndian.PutUint64(ret[32:40], d.serial)
}
return ret
}
@@ -427,9 +408,9 @@ func (r *rockRidgeExtension) parsePosixAttributes(b []byte) (directoryEntrySyste
m |= uint32(os.ModeNamedPipe)
}
- var serial uint32
+ var serial uint64
if len(b) == 44 {
- serial = binary.LittleEndian.Uint32(b[36:40])
+ serial = binary.LittleEndian.Uint64(b[36:44])
}
return rockRidgePosixAttributes{
mode: os.FileMode(m),
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/compressor.go b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/compressor.go
index b608d551604f..173edabf80f8 100644
--- a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/compressor.go
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/compressor.go
@@ -7,6 +7,7 @@ import (
"fmt"
"io"
+ "github.com/klauspost/compress/zstd"
"github.com/pierrec/lz4/v4"
"github.com/ulikunitz/xz"
"github.com/ulikunitz/xz/lzma"
@@ -51,6 +52,8 @@ func (c *CompressorLzma) decompress(in []byte) ([]byte, error) {
}
return p, nil
}
+
+//nolint:unused,revive // it is important to implement the interface
func (c *CompressorLzma) loadOptions(b []byte) error {
// lzma has no supported optiosn
return nil
@@ -107,6 +110,9 @@ func (c *CompressorGzip) decompress(in []byte) ([]byte, error) {
if err != nil {
return nil, fmt.Errorf("error decompressing: %v", err)
}
+ if err := gz.Close(); err != nil {
+ return nil, err
+ }
return p, nil
}
@@ -326,6 +332,32 @@ func (c *CompressorZstd) optionsBytes() []byte {
func (c *CompressorZstd) flavour() compression {
return compressionZstd
}
+func (c *CompressorZstd) compress(in []byte) ([]byte, error) {
+ var b bytes.Buffer
+ z, err := zstd.NewWriter(&b)
+ if err != nil {
+ return nil, fmt.Errorf("failed to create zstd compressor: %w", err)
+ }
+ if _, err := z.Write(in); err != nil {
+ return nil, err
+ }
+ if err := z.Close(); err != nil {
+ return nil, err
+ }
+ return b.Bytes(), nil
+}
+func (c *CompressorZstd) decompress(in []byte) ([]byte, error) {
+ z, err := zstd.NewReader(nil)
+ if err != nil {
+ return nil, fmt.Errorf("failed to create zstd decompressor: %w", err)
+ }
+ defer z.Close()
+ p, err := z.DecodeAll(in, nil)
+ if err != nil {
+ return nil, fmt.Errorf("error decompressing zstd: %w", err)
+ }
+ return p, nil
+}
func newCompressor(flavour compression) (Compressor, error) {
var c Compressor
@@ -343,7 +375,7 @@ func newCompressor(flavour compression) (Compressor, error) {
case compressionLz4:
c = &CompressorLz4{}
case compressionZstd:
- return nil, fmt.Errorf("zstd compression not yet supported")
+ c = &CompressorZstd{}
default:
return nil, fmt.Errorf("unknown compression type: %d", flavour)
}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/directory.go b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/directory.go
index 0f5bd8d5c341..ce7627b382db 100644
--- a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/directory.go
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/directory.go
@@ -54,18 +54,17 @@ type directoryEntryGroup struct {
// parse raw bytes of a directory to get the contents
func parseDirectory(b []byte) (*directory, error) {
- // must have at least one header
- if _, err := parseDirectoryHeader(b); err != nil {
- return nil, fmt.Errorf("could not parse directory header: %v", err)
- }
entries := make([]*directoryEntryRaw, 0)
- for pos := 0; pos+dirHeaderSize < len(b); {
+ for pos := 0; pos+dirHeaderSize <= len(b); {
directoryHeader, err := parseDirectoryHeader(b[pos:])
if err != nil {
return nil, fmt.Errorf("could not parse directory header: %v", err)
}
- if directoryHeader.count+1 > maxDirEntries {
- return nil, fmt.Errorf("corrupted directory, had %d entries instead of max %d", directoryHeader.count+1, maxDirEntries)
+ if directoryHeader.count == 0 {
+ return nil, fmt.Errorf("corrupted directory, must have at least one entry")
+ }
+ if directoryHeader.count > maxDirEntries {
+ return nil, fmt.Errorf("corrupted directory, had %d entries instead of max %d", directoryHeader.count, maxDirEntries)
}
pos += dirHeaderSize
for count := uint32(0); count < directoryHeader.count; count++ {
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/directoryentry.go b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/directoryentry.go
index cc5beb75de40..040212a58257 100644
--- a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/directoryentry.go
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/directoryentry.go
@@ -1,50 +1,16 @@
package squashfs
import (
+ "fmt"
+ "io/fs"
"os"
"time"
+
+ "github.com/diskfs/go-diskfs/filesystem"
)
// FileStat is the extended data underlying a single file, similar to https://golang.org/pkg/syscall/#Stat_t
-type FileStat struct {
- uid uint32
- gid uint32
- xattrs map[string]string
-}
-
-func (f *FileStat) equal(o *FileStat) bool {
- if f.uid != o.uid || f.gid != o.gid {
- return false
- }
- if len(f.xattrs) != len(o.xattrs) {
- return false
- }
- for k, v := range f.xattrs {
- ov, ok := o.xattrs[k]
- if !ok {
- return false
- }
- if ov != v {
- return false
- }
- }
- return true
-}
-
-// UID get uid of file
-func (f *FileStat) UID() uint32 {
- return f.uid
-}
-
-// GID get gid of file
-func (f *FileStat) GID() uint32 {
- return f.gid
-}
-
-// Xattrs get extended attributes of file
-func (f *FileStat) Xattrs() map[string]string {
- return f.xattrs
-}
+type FileStat = *directoryEntry
// directoryEntry is a single directory entry
// it combines information from inode and the actual entry
@@ -57,22 +23,22 @@ func (f *FileStat) Xattrs() map[string]string {
// IsDir() bool // abbreviation for Mode().IsDir()
// Sys() interface{} // underlying data source (can return nil)
type directoryEntry struct {
- isSubdirectory bool
+ fs *FileSystem // the FileSystem this entry is part of
name string
size int64
modTime time.Time
mode os.FileMode
inode inode
- sys FileStat
+ uid uint32
+ gid uint32
+ xattrs map[string]string
+ isSubdirectory bool
}
func (d *directoryEntry) equal(o *directoryEntry) bool {
if o == nil {
return false
}
- if !d.sys.equal(&o.sys) {
- return false
- }
if d.inode == nil && o.inode == nil {
return true
}
@@ -107,10 +73,127 @@ func (d *directoryEntry) ModTime() time.Time {
// Mode FileMode // file mode bits
func (d *directoryEntry) Mode() os.FileMode {
- return d.mode
+ mode := d.mode
+
+ // We need to adjust the Linux mode into a Go mode
+ // The bottom 3*3 bits are the traditional unix permissions.
+
+ // Clear the non permissions bits
+ mode &= os.ModePerm
+
+ if d.inode == nil {
+ return mode
+ }
+ switch d.inode.inodeType() {
+ case inodeBasicDirectory, inodeExtendedDirectory:
+ mode |= os.ModeDir // d: is a directory
+ case inodeBasicFile, inodeExtendedFile:
+ // zero mode
+ case inodeBasicSymlink, inodeExtendedSymlink:
+ mode |= os.ModeSymlink // L: symbolic link
+ case inodeBasicBlock, inodeExtendedBlock:
+ mode |= os.ModeDevice // D: device file
+ case inodeBasicChar, inodeExtendedChar:
+ mode |= os.ModeDevice // D: device file
+ mode |= os.ModeCharDevice // c: Unix character device, when ModeDevice is set
+ case inodeBasicFifo, inodeExtendedFifo:
+ mode |= os.ModeNamedPipe // p: named pipe (FIFO)
+ case inodeBasicSocket, inodeExtendedSocket:
+ mode |= os.ModeSocket // S: Unix domain socket
+ default:
+ mode |= os.ModeIrregular // ?: non-regular file; nothing else is known about this file
+ }
+
+ // Not currently translated
+ // mode |= os.ModeAppend // a: append-only
+ // mode |= os.ModeExclusive // l: exclusive use
+ // mode |= os.ModeTemporary // T: temporary file; Plan 9 only
+ // mode |= os.ModeSetuid // u: setuid
+ // mode |= os.ModeSetgid // g: setgid
+ // mode |= os.ModeSticky // t: sticky
+
+ return mode
}
// Sys interface{} // underlying data source (can return nil)
func (d *directoryEntry) Sys() interface{} {
- return d.sys
+ return d
+}
+
+// UID get uid of file
+func (d *directoryEntry) UID() uint32 {
+ return d.uid
+}
+
+// GID get gid of file
+func (d *directoryEntry) GID() uint32 {
+ return d.gid
+}
+
+// Xattrs get extended attributes of file
+func (d *directoryEntry) Xattrs() map[string]string {
+ return d.xattrs
+}
+
+// Readlink returns the destination of the symbolic link if this entry
+// is a symbolic link.
+//
+// If this entry is not a symbolic link then it will return fs.ErrNotExist
+func (d *directoryEntry) Readlink() (string, error) {
+ var target string
+ body := d.inode.getBody()
+ //nolint:exhaustive // all other cases fall under default
+ switch d.inode.inodeType() {
+ case inodeBasicSymlink:
+ link, ok := body.(*basicSymlink)
+ if !ok {
+ return "", fmt.Errorf("internal error: inode wasn't basic symlink: %T", body)
+ }
+ target = link.target
+ case inodeExtendedSymlink:
+ link, ok := body.(*extendedSymlink)
+ if !ok {
+ return "", fmt.Errorf("internal error: inode wasn't extended symlink: %T", body)
+ }
+ target = link.target
+ default:
+ return "", fs.ErrNotExist
+ }
+ return target, nil
+}
+
+// Open returns an filesystem.File from which you can read the
+// contents of a file.
+//
+// Calling this on anything but a file will return an error.
+//
+// Calling this Open method is more efficient than calling
+// FileSystem.OpenFile as it doesn't have to find the file by
+// traversing the directory entries first.
+func (d *directoryEntry) Open() (filesystem.File, error) {
+ // get the inode data for this file
+ // now open the file
+ // get the inode for the file
+ var eFile *extendedFile
+ in := d.inode
+ iType := in.inodeType()
+ body := in.getBody()
+ //nolint:exhaustive // all other cases fall under default
+ switch iType {
+ case inodeBasicFile:
+ extFile := body.(*basicFile).toExtended()
+ eFile = &extFile
+ case inodeExtendedFile:
+ eFile, _ = body.(*extendedFile)
+ default:
+ return nil, fmt.Errorf("inode is of type %d, neither basic nor extended file", iType)
+ }
+
+ return &File{
+ extendedFile: eFile,
+ isReadWrite: false,
+ isAppend: false,
+ offset: 0,
+ filesystem: d.fs,
+ }, nil
}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/file.go b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/file.go
index 93487dd3ec2a..1b77d9698b7c 100644
--- a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/file.go
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/file.go
@@ -13,10 +13,12 @@ import (
// include all of the data
type File struct {
*extendedFile
- isReadWrite bool
- isAppend bool
- offset int64
- filesystem *FileSystem
+ isReadWrite bool
+ isAppend bool
+ offset int64
+ filesystem *FileSystem
+ blockLocation int64 // the position of the last block decompressed
+ block []byte // the actual last block decompressed
}
// Read reads up to len(b) bytes from the File.
@@ -42,9 +44,9 @@ func (fl *File) Read(b []byte) (int, error) {
// e.g. if starting block is at position 10245, then we want blocks 27,28,29 from the disk
// 5- read in and uncompress the necessary blocks
fs := fl.filesystem
- size := int(fl.size()) - int(fl.offset)
+ size := fl.size() - fl.offset
location := int64(fl.startBlock)
- maxRead := size
+ maxRead := len(b)
// if there is nothing left to read, just return EOF
if size <= 0 {
@@ -54,14 +56,14 @@ func (fl *File) Read(b []byte) (int, error) {
// we stop when we hit the lesser of
// 1- len(b)
// 2- file end
- if len(b) < maxRead {
- maxRead = len(b)
+ if size < int64(maxRead) {
+ maxRead = int(size)
}
// just read the requested number of bytes and change our offset
// figure out which block number has the bytes we are looking for
startBlock := int(fl.offset / fs.blocksize)
- endBlock := int((fl.offset + int64(maxRead)) / fs.blocksize)
+ endBlock := int((fl.offset + int64(maxRead) - 1) / fs.blocksize)
// do we end in fragment territory?
fragments := false
@@ -71,46 +73,80 @@ func (fl *File) Read(b []byte) (int, error) {
}
read := 0
- offset := fl.offset
+ offsetEnd := fl.offset + int64(maxRead)
+ pos := int64(0)
+
+ // send input to b, clipping as appropriate
+ outputBlock := func(input []byte) {
+ inputSize := int64(len(input))
+ start := fl.offset - pos
+ end := offsetEnd - pos
+ if start >= 0 && start < inputSize {
+ if end > inputSize {
+ end = inputSize
+ }
+ n := copy(b[read:], input[start:end])
+ read += n
+ fl.offset += int64(n)
+ }
+ }
+
// we need to cycle through all of the blocks to find where the desired one starts
for i, block := range fl.blockSizes {
- if i > endBlock || read > maxRead {
+ if i > endBlock || read >= maxRead {
break
}
// if we are in the range of desired ones, read it in
if i >= startBlock {
- input, err := fs.readBlock(location, block.compressed, block.size)
- if err != nil {
- return read, fmt.Errorf("error reading data block %d from squashfs: %v", i, err)
+ if int64(block.size) > fs.blocksize {
+ return read, fmt.Errorf("unexpected block.size=%d > fs.blocksize=%d", block.size, fs.blocksize)
}
- // we do not need to limit it to the remaining space of b, since copy() only will copy
- // to what space it has in b
- copy(b[read:], input[offset:])
- read += len(input)
- fl.offset += int64(read)
- offset = 0
+ var input []byte
+ if fl.blockLocation == location && fl.block != nil {
+ // Read last block from cache
+ input = fl.block
+ } else {
+ var err error
+ input, err = fs.readBlock(location, block.compressed, block.size)
+ if err != nil {
+ return read, fmt.Errorf("error reading data block %d from squashfs: %v", i, err)
+ }
+ // Cache the last block
+ fl.blockLocation = location
+ fl.block = input
+ }
+ outputBlock(input)
}
location += int64(block.size)
+ pos += fs.blocksize
}
+
// did we have a fragment to read?
- if fragments {
+ if read < maxRead && fragments {
+ if fl.fragmentBlockIndex == 0xffffffff {
+ return read, fmt.Errorf("expecting fragment to read %d bytes but no fragment found", maxRead-read)
+ }
input, err := fs.readFragment(fl.fragmentBlockIndex, fl.fragmentOffset, fl.size()%fs.blocksize)
if err != nil {
return read, fmt.Errorf("error reading fragment block %d from squashfs: %v", fl.fragmentBlockIndex, err)
}
- copy(b[read:], input)
+ pos = int64(len(fl.blockSizes)) * fs.blocksize
+ outputBlock(input)
}
- fl.offset += int64(maxRead)
var retErr error
- if fl.offset >= int64(size) {
+ if fl.offset >= fl.size() {
retErr = io.EOF
+ } else if read == 0 {
+ retErr = fmt.Errorf("internal error: read no bytes")
}
- return maxRead, retErr
+ return read, retErr
}
// Write writes len(b) bytes to the File.
//
// you cannot write to a finished squashfs, so this returns an error
+//
+//nolint:unused,revive // but it is important to implement the interface
func (fl *File) Write(p []byte) (int, error) {
return 0, fmt.Errorf("cannot write to a read-only squashfs filesystem")
}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/finalize.go b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/finalize.go
index f85c28febf32..7c99e4f2af95 100644
--- a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/finalize.go
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/finalize.go
@@ -4,6 +4,7 @@ import (
"encoding/binary"
"fmt"
"io"
+ iofs "io/fs"
"os"
"path"
"path/filepath"
@@ -415,21 +416,24 @@ func finalizeFragment(buf []byte, to util.File, toOffset int64, c Compressor) (r
// because the inode data is different.
// The first entry in the return always will be the root
func walkTree(workspace string) ([]*finalizeFileInfo, error) {
- cwd, err := os.Getwd()
- if err != nil {
- return nil, fmt.Errorf("could not get pwd: %v", err)
- }
- // make everything relative to the workspace
- _ = os.Chdir(workspace)
dirMap := make(map[string]*finalizeFileInfo)
fileList := make([]*finalizeFileInfo, 0)
var entry *finalizeFileInfo
- _ = filepath.Walk(".", func(fp string, fi os.FileInfo, err error) error {
+ err := filepath.WalkDir(workspace, func(actualPath string, d iofs.DirEntry, err error) error {
if err != nil {
return err
}
+ fp := strings.TrimPrefix(actualPath, workspace)
+ fp = strings.TrimPrefix(fp, string(filepath.Separator))
+ if fp == "" {
+ fp = "."
+ }
isRoot := fp == "."
- name := fi.Name()
+ name := d.Name()
+ fi, err := d.Info()
+ if err != nil {
+ return fmt.Errorf("could not get file info for %s: %v", fp, err)
+ }
m := fi.Mode()
var fType fileType
switch {
@@ -448,7 +452,7 @@ func walkTree(workspace string) ([]*finalizeFileInfo, error) {
default:
fType = fileRegular
}
- xattrNames, err := xattr.List(fp)
+ xattrNames, err := xattr.List(actualPath)
if err != nil {
return fmt.Errorf("unable to list xattrs for %s: %v", fp, err)
}
@@ -495,8 +499,9 @@ func walkTree(workspace string) ([]*finalizeFileInfo, error) {
fileList = append(fileList, entry)
return nil
})
- // reset the workspace
- _ = os.Chdir(cwd)
+ if err != nil {
+ return nil, err
+ }
return fileList, nil
}
@@ -750,7 +755,7 @@ func writeDirectories(dirs []*finalizeFileInfo, f util.File, compressor Compress
// writeFragmentTable write the fragment table
//
-//nolint:unparam // this does not use fragmentBlocksStart yet, but only because we have not yet added support
+//nolint:unparam,unused,revive // this does not use fragmentBlocksStart yet, but only because we have not yet added support
func writeFragmentTable(fragmentBlocks []fragmentBlock, fragmentBlocksStart int64, f util.File, compressor Compressor, location int64) (fragmentsWritten int, finalLocation uint64, err error) {
// now write the actual fragment table entries
var (
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/finalize_wasip1.go b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/finalize_wasip1.go
new file mode 100644
index 000000000000..f848c987f0fb
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/finalize_wasip1.go
@@ -0,0 +1,18 @@
+//go:build wasip1
+// +build wasip1
+
+//nolint:unconvert // linter gets confused in this file
+package squashfs
+
+import (
+ "errors"
+ "os"
+)
+
+func getDeviceNumbers(path string) (major, minor uint32, err error) {
+ return 0, 0, errors.New("not implemented")
+}
+
+func getFileProperties(fi os.FileInfo) (links, uid, gid uint32) {
+ return 0, 0, 0
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/inode.go b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/inode.go
index 7a690ca686c4..a08852b8ba20 100644
--- a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/inode.go
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/inode.go
@@ -143,11 +143,10 @@ func parseBlockData(u uint32) *blockData {
size: u & 0x00ffffff,
}
}
-func parseFileBlockSizes(b []byte, fileSize, blocksize int) []*blockData {
- count := fileSize / blocksize
- blocks := make([]*blockData, 0)
- for j := 0; j < count && j < len(b); j += 4 {
- blocks = append(blocks, parseBlockData(binary.LittleEndian.Uint32(b[j:j+4])))
+func parseFileBlockSizes(b []byte, blockListSize int) []*blockData {
+ blocks := make([]*blockData, 0, blockListSize)
+ for j := 0; j < blockListSize && j < len(b); j++ {
+ blocks = append(blocks, parseBlockData(binary.LittleEndian.Uint32(b[4*j:4*j+4])))
}
return blocks
}
@@ -440,14 +439,14 @@ func parseBasicFile(b []byte, blocksize int) (*basicFile, int, error) {
fileSize: fileSize,
}
// see how many other bytes we need to read
- blockListSize := int(d.fileSize) / blocksize
- if int(d.fileSize)%blocksize > 0 && d.fragmentBlockIndex != 0xffffffff {
+ blockListSize := int(d.fileSize / uint32(blocksize))
+ if d.fileSize%uint32(blocksize) > 0 && d.fragmentBlockIndex == 0xffffffff {
blockListSize++
}
// do we have enough data left to read those?
extra = blockListSize * 4
if len(b[16:]) >= extra {
- d.blockSizes = parseFileBlockSizes(b[16:], int(fileSize), blocksize)
+ d.blockSizes = parseFileBlockSizes(b[16:], blockListSize)
extra = 0
}
@@ -531,14 +530,14 @@ func parseExtendedFile(b []byte, blocksize int) (*extendedFile, int, error) {
xAttrIndex: binary.LittleEndian.Uint32(b[36:40]),
}
// see how many other bytes we need to read
- blockListSize := int(d.fileSize) / blocksize
- if int(d.fileSize)%blocksize > 0 && d.fragmentBlockIndex != 0xffffffff {
+ blockListSize := int(d.fileSize / uint64(blocksize))
+ if d.fileSize%uint64(blocksize) > 0 && d.fragmentBlockIndex == 0xffffffff {
blockListSize++
}
// do we have enough data left to read those?
extra = blockListSize * 4
- if len(b[16:]) >= extra {
- d.blockSizes = parseFileBlockSizes(b[16:], int(fileSize), blocksize)
+ if len(b[40:]) >= extra {
+ d.blockSizes = parseFileBlockSizes(b[40:], blockListSize)
extra = 0
}
return d, extra, nil
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/lru.go b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/lru.go
new file mode 100644
index 000000000000..9185d44c3758
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/lru.go
@@ -0,0 +1,138 @@
+package squashfs
+
+import (
+ "sync"
+)
+
+// A simple least recently used cache
+type lru struct {
+ mu sync.Mutex
+ cache map[int64]*lruBlock // cache keyed on block position in file
+ maxBlocks int // max number of blocks in cache
+ root lruBlock // root block in LRU circular list
+}
+
+// A data block to store in the lru cache
+type lruBlock struct {
+ mu sync.Mutex // lock while fetching
+ data []byte // data block - nil while being fetched
+ prev *lruBlock // prev block in LRU list
+ next *lruBlock // next block in LRU list
+ pos int64 // position it was read off disk
+ size uint16 // compressed size on disk
+}
+
+// Create a new LRU cache of a maximum of maxBlocks blocks of size
+func newLRU(maxBlocks int) *lru {
+ l := &lru{
+ cache: make(map[int64]*lruBlock),
+ maxBlocks: maxBlocks,
+ root: lruBlock{
+ pos: -1,
+ },
+ }
+ l.root.prev = &l.root // circularly link the root node
+ l.root.next = &l.root
+ return l
+}
+
+// Unlink the block from the list
+func (l *lru) unlink(block *lruBlock) {
+ block.prev.next = block.next
+ block.next.prev = block.prev
+ block.prev = nil
+ block.next = nil
+}
+
+// Pop a block from the end of the list
+func (l *lru) pop() *lruBlock {
+ block := l.root.prev
+ if block == &l.root {
+ panic("internal error: list empty")
+ }
+ l.unlink(block)
+ return block
+}
+
+// Add a block to the start of the list
+func (l *lru) push(block *lruBlock) {
+ oldHead := l.root.next
+ l.root.next = block
+ block.prev = &l.root
+ block.next = oldHead
+ oldHead.prev = block
+}
+
+// ensure there are no more than n blocks in the cache
+func (l *lru) trim(maxBlocks int) {
+ for len(l.cache) > maxBlocks && len(l.cache) > 0 {
+ // Remove a block from the cache
+ block := l.pop()
+ delete(l.cache, block.pos)
+ }
+}
+
+// add block to the cache, pruning the cache as appropriate
+func (l *lru) add(block *lruBlock) {
+ l.trim(l.maxBlocks - 1)
+ l.cache[block.pos] = block
+ l.push(block)
+}
+
+// Fetch data returning size used from input and error
+//
+// data should be a subslice of buf
+type fetchFn func() (data []byte, size uint16, err error)
+
+// Get the block at pos from the cache.
+//
+// If it isn't found in the cache then fetch() is called to get it.
+//
+// This does read through caching and takes care not to block parallel
+// calls to the fetch() function.
+func (l *lru) get(pos int64, fetch fetchFn) (data []byte, size uint16, err error) {
+ if l == nil {
+ return fetch()
+ }
+ l.mu.Lock()
+ block, found := l.cache[pos]
+ if !found {
+ // Add an empty block with data == nil
+ block = &lruBlock{
+ pos: pos,
+ }
+ // Add it to the cache and the tail of the list
+ l.add(block)
+ } else {
+ // Remove the block from the list
+ l.unlink(block)
+ // Add it back to the start
+ l.push(block)
+ }
+ block.mu.Lock() // transfer the lock to the block
+ l.mu.Unlock()
+ defer block.mu.Unlock()
+
+ if block.data != nil {
+ return block.data, block.size, nil
+ }
+
+ // Fetch the block
+ data, size, err = fetch()
+ if err != nil {
+ return nil, 0, err
+ }
+ block.data = data
+ block.size = size
+ return data, size, nil
+}
+
+// Sets the number of blocks to be used in the cache
+//
+// It makes sure that there are no more than maxBlocks in the cache.
+func (l *lru) setMaxBlocks(maxBlocks int) {
+ l.mu.Lock()
+ defer l.mu.Unlock()
+ l.maxBlocks = maxBlocks
+ l.trim(l.maxBlocks)
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/metadatablock.go b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/metadatablock.go
index 6711f4ef0f59..8ef65098fd75 100644
--- a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/metadatablock.go
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/metadatablock.go
@@ -26,6 +26,7 @@ func getMetadataSize(b []byte) (size uint16, compressed bool, err error) {
return size, compressed, nil
}
+// FIXME this isn't used anywhere except in the test code
func parseMetadata(b []byte, c Compressor) (block *metadatablock, err error) {
if len(b) < minMetadataBlockSize {
return nil, fmt.Errorf("metadata block was of len %d, less than minimum %d", len(b), minMetadataBlockSize)
@@ -71,33 +72,35 @@ func (m *metadatablock) toBytes(c Compressor) ([]byte, error) {
return b, nil
}
-func readMetaBlock(r io.ReaderAt, c Compressor, location int64) (data []byte, size uint16, err error) {
- // read bytes off the reader to determine how big it is and if compressed
- b := make([]byte, 2)
- _, _ = r.ReadAt(b, location)
- size, compressed, err := getMetadataSize(b)
- if err != nil {
- return nil, 0, fmt.Errorf("error getting size and compression for metadata block at %d: %v", location, err)
- }
- b = make([]byte, size)
- read, err := r.ReadAt(b, location+2)
- if err != nil && err != io.EOF {
- return nil, 0, fmt.Errorf("unable to read metadata block of size %d at location %d: %v", size, location, err)
- }
- if read != len(b) {
- return nil, 0, fmt.Errorf("read %d instead of expected %d bytes for metadata block at location %d", read, size, location)
- }
- data = b
- if compressed {
- if c == nil {
- return nil, 0, fmt.Errorf("metadata block at %d compressed, but no compressor provided", location)
- }
- data, err = c.decompress(b)
+func (fs *FileSystem) readMetaBlock(r io.ReaderAt, c Compressor, location int64) (data []byte, size uint16, err error) {
+ return fs.cache.get(location, func() (data []byte, size uint16, err error) {
+ // read bytes off the reader to determine how big it is and if compressed
+ b := make([]byte, 2)
+ _, _ = r.ReadAt(b, location)
+ size, compressed, err := getMetadataSize(b)
if err != nil {
- return nil, 0, fmt.Errorf("decompress error: %v", err)
+ return nil, 0, fmt.Errorf("error getting size and compression for metadata block at %d: %v", location, err)
}
- }
- return data, size + 2, nil
+ b = make([]byte, size)
+ read, err := r.ReadAt(b, location+2)
+ if err != nil && err != io.EOF {
+ return nil, 0, fmt.Errorf("unable to read metadata block of size %d at location %d: %v", size, location, err)
+ }
+ if read != len(b) {
+ return nil, 0, fmt.Errorf("read %d instead of expected %d bytes for metadata block at location %d", read, size, location)
+ }
+ data = b
+ if compressed {
+ if c == nil {
+ return nil, 0, fmt.Errorf("metadata block at %d compressed, but no compressor provided", location)
+ }
+ data, err = c.decompress(b)
+ if err != nil {
+ return nil, 0, fmt.Errorf("decompress error: %v", err)
+ }
+ }
+ return data, size + 2, nil
+ })
}
// readMetadata read as many bytes of metadata as required for the given size, with the byteOffset provided as a starting
@@ -105,13 +108,13 @@ func readMetaBlock(r io.ReaderAt, c Compressor, location int64) (data []byte, si
// requests to read 500 bytes beginning at offset 8000 into the first block.
// it always returns to the end of the block, even if that is greater than the given size. This makes it easy to use more
// data than expected on first read. The consumer is expected to cut it down, if needed
-func readMetadata(r io.ReaderAt, c Compressor, firstBlock int64, initialBlockOffset uint32, byteOffset uint16, size int) ([]byte, error) {
+func (fs *FileSystem) readMetadata(r io.ReaderAt, c Compressor, firstBlock int64, initialBlockOffset uint32, byteOffset uint16, size int) ([]byte, error) {
var (
b []byte
blockOffset = int(initialBlockOffset)
)
// we know how many blocks, so read them all in
- m, read, err := readMetaBlock(r, c, firstBlock+int64(blockOffset))
+ m, read, err := fs.readMetaBlock(r, c, firstBlock+int64(blockOffset))
if err != nil {
return nil, err
}
@@ -119,7 +122,7 @@ func readMetadata(r io.ReaderAt, c Compressor, firstBlock int64, initialBlockOff
// do we have any more to read?
for len(b) < size {
blockOffset += int(read)
- m, read, err = readMetaBlock(r, c, firstBlock+int64(blockOffset))
+ m, read, err = fs.readMetaBlock(r, c, firstBlock+int64(blockOffset))
if err != nil {
return nil, err
}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/squashfs.go b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/squashfs.go
index 19f88f112780..bdd8d5a7eefd 100644
--- a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/squashfs.go
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/squashfs.go
@@ -17,6 +17,7 @@ const (
metadataBlockSize = 8 * KB
minBlocksize = 4 * KB
maxBlocksize = 1 * MB
+ defaultCacheSize = 128 * MB
)
// FileSystem implements the FileSystem interface
@@ -32,6 +33,7 @@ type FileSystem struct {
uidsGids []uint32
xattrs *xAttrTable
rootDir inode
+ cache *lru
}
// Equal compare if two filesystems are equal
@@ -111,7 +113,38 @@ func Create(f util.File, size, start, blocksize int64) (*FileSystem, error) {
// which allow you to work directly with partitions, rather than having to calculate (and hopefully not make any errors)
// where a partition starts and ends.
//
-// If the provided blocksize is 0, it will use the default of 2K bytes
+// If the provided blocksize is 0, it will use the default of 2K bytes.
+//
+// This will use a cache for the decompressed blocks of 128 MB by
+// default. (You can set this with the SetCacheSize method and read
+// its size with the GetCacheSize method). A block cache is essential
+// for performance when reading. This implements a cache for the
+// fragments (tail ends of files) and the metadata (directory
+// listings) which otherwise would be read, decompressed and discarded
+// many times.
+//
+// Unpacking a 3 GB squashfs made from the tensorflow docker image like this:
+//
+// docker export $(docker create tensorflow/tensorflow:latest-gpu-jupyter) -o tensorflow.tar.gz
+// mkdir -p tensorflow && tar xf tensorflow.tar.gz -C tensorflow
+// [ -f tensorflow.sqfs ] && rm tensorflow.sqfs
+// mksquashfs tensorflow tensorflow.sqfs -comp zstd -Xcompression-level 3 -b 1M -no-xattrs -all-root
+//
+// Gives these timings with and without cache:
+//
+// - no caching: 206s
+// - 256 MB cache: 16.7s
+// - 128 MB cache: 17.5s (the default)
+// - 64 MB cache: 23.4s
+// - 32 MB cache: 54.s
+//
+// The cached versions compare favourably to the C program unsquashfs
+// which takes 12.0s to unpack the same archive.
+//
+// These tests were done using rclone and the archive backend which
+// uses this library like this:
+//
+// rclone -P --transfers 16 --checkers 16 copy :archive:/path/to/tensorflow.sqfs /tmp/tensorflow
func Read(file util.File, size, start, blocksize int64) (*FileSystem, error) {
var (
read int
@@ -147,7 +180,7 @@ func Read(file util.File, size, start, blocksize int64) (*FileSystem, error) {
// create the compressor function we will use
compress, err := newCompressor(s.compression)
if err != nil {
- return nil, fmt.Errorf("unable to create compressor")
+ return nil, fmt.Errorf("unable to create compressor: %v", err)
}
// load fragments
@@ -160,7 +193,7 @@ func Read(file util.File, size, start, blocksize int64) (*FileSystem, error) {
var (
xattrs *xAttrTable
)
- if !s.noXattrs {
+ if !s.noXattrs && s.xattrTableStart != 0xffff_ffff_ffff_ffff {
// xattr is right to the end of the disk
xattrs, err = readXattrsTable(s, file, compress)
if err != nil {
@@ -180,11 +213,12 @@ func Read(file util.File, size, start, blocksize int64) (*FileSystem, error) {
size: size,
file: file,
superblock: s,
- blocksize: blocksize,
+ blocksize: int64(s.blocksize), // use the blocksize in the superblock
xattrs: xattrs,
compressor: compress,
fragments: fragments,
uidsGids: uidsgids,
+ cache: newLRU(int(defaultCacheSize) / int(s.blocksize)),
}
// for efficiency, read in the root inode right now
rootInode, err := fs.getInode(s.rootInode.block, s.rootInode.offset, inodeBasicDirectory)
@@ -200,6 +234,30 @@ func (fs *FileSystem) Type() filesystem.Type {
return filesystem.TypeSquashfs
}
+// SetCacheSize set the maximum memory used by the block cache to cacheSize bytes.
+//
+// The default is 128 MB.
+//
+// If this is <= 0 then the cache will be disabled.
+func (fs *FileSystem) SetCacheSize(cacheSize int) {
+ if fs.cache == nil {
+ return
+ }
+ blocks := cacheSize / int(fs.blocksize)
+ if blocks <= 0 {
+ blocks = 0
+ }
+ fs.cache.setMaxBlocks(blocks)
+}
+
+// GetCacheSize get the maximum memory used by the block cache in bytes.
+func (fs *FileSystem) GetCacheSize() int {
+ if fs.cache == nil {
+ return 0
+ }
+ return fs.cache.maxBlocks * int(fs.blocksize)
+}
+
// Mkdir make a directory at the given path. It is equivalent to `mkdir -p`, i.e. idempotent, in that:
//
// * It will make the entire tree path if it does not exist
@@ -307,30 +365,9 @@ func (fs *FileSystem) OpenFile(p string, flag int) (filesystem.File, error) {
if targetEntry == nil {
return nil, fmt.Errorf("target file %s does not exist", p)
}
- // get the inode data for this file
- // now open the file
- // get the inode for the file
- var eFile *extendedFile
- in := targetEntry.inode
- iType := in.inodeType()
- body := in.getBody()
- //nolint:exhaustive // all other cases fall under default
- switch iType {
- case inodeBasicFile:
- extFile := body.(*basicFile).toExtended()
- eFile = &extFile
- case inodeExtendedFile:
- eFile, _ = body.(*extendedFile)
- default:
- return nil, fmt.Errorf("inode is of type %d, neither basic nor extended directory", iType)
- }
-
- f = &File{
- extendedFile: eFile,
- isReadWrite: false,
- isAppend: false,
- offset: 0,
- filesystem: fs,
+ f, err = targetEntry.Open()
+ if err != nil {
+ return nil, err
}
} else {
f, err = os.OpenFile(path.Join(fs.workspace, p), flag, 0o644)
@@ -440,17 +477,16 @@ func (fs *FileSystem) hydrateDirectoryEntries(entries []*directoryEntryRaw) ([]*
}
}
fullEntries = append(fullEntries, &directoryEntry{
+ fs: fs,
isSubdirectory: e.isSubdirectory,
name: e.name,
size: body.size(),
modTime: header.modTime,
mode: header.mode,
inode: in,
- sys: FileStat{
- uid: fs.uidsGids[header.uidIdx],
- gid: fs.uidsGids[header.gidIdx],
- xattrs: xattrs,
- },
+ uid: fs.uidsGids[header.uidIdx],
+ gid: fs.uidsGids[header.gidIdx],
+ xattrs: xattrs,
})
}
return fullEntries, nil
@@ -464,7 +500,7 @@ func (fs *FileSystem) getInode(blockOffset uint32, byteOffset uint16, iType inod
// get the block
// start by getting the minimum for the proposed type. It very well might be wrong.
size := inodeTypeToSize(iType)
- uncompressed, err := readMetadata(fs.file, fs.compressor, int64(fs.superblock.inodeTableStart), blockOffset, byteOffset, size)
+ uncompressed, err := fs.readMetadata(fs.file, fs.compressor, int64(fs.superblock.inodeTableStart), blockOffset, byteOffset, size)
if err != nil {
return nil, fmt.Errorf("error reading block at position %d: %v", blockOffset, err)
}
@@ -475,6 +511,14 @@ func (fs *FileSystem) getInode(blockOffset uint32, byteOffset uint16, iType inod
}
if header.inodeType != iType {
iType = header.inodeType
+ size = inodeTypeToSize(iType)
+ // Read more data if necessary (quite rare)
+ if size > len(uncompressed) {
+ uncompressed, err = fs.readMetadata(fs.file, fs.compressor, int64(fs.superblock.inodeTableStart), blockOffset, byteOffset, size)
+ if err != nil {
+ return nil, fmt.Errorf("error reading block at position %d: %v", blockOffset, err)
+ }
+ }
}
// now read the body, which may have a variable size
body, extra, err := parseInodeBody(uncompressed[inodeHeaderSize:], int(fs.blocksize), iType)
@@ -484,7 +528,7 @@ func (fs *FileSystem) getInode(blockOffset uint32, byteOffset uint16, iType inod
// if it returns extra > 0, then it needs that many more bytes to be read, and to be reparsed
if extra > 0 {
size += extra
- uncompressed, err = readMetadata(fs.file, fs.compressor, int64(fs.superblock.inodeTableStart), blockOffset, byteOffset, size)
+ uncompressed, err = fs.readMetadata(fs.file, fs.compressor, int64(fs.superblock.inodeTableStart), blockOffset, byteOffset, size)
if err != nil {
return nil, fmt.Errorf("error reading block at position %d: %v", blockOffset, err)
}
@@ -504,7 +548,7 @@ func (fs *FileSystem) getInode(blockOffset uint32, byteOffset uint16, iType inod
// block when uncompressed.
func (fs *FileSystem) getDirectory(blockOffset uint32, byteOffset uint16, size int) (*directory, error) {
// get the block
- uncompressed, err := readMetadata(fs.file, fs.compressor, int64(fs.superblock.directoryTableStart), blockOffset, byteOffset, size)
+ uncompressed, err := fs.readMetadata(fs.file, fs.compressor, int64(fs.superblock.directoryTableStart), blockOffset, byteOffset, size)
if err != nil {
return nil, fmt.Errorf("error reading block at position %d: %v", blockOffset, err)
}
@@ -517,6 +561,10 @@ func (fs *FileSystem) getDirectory(blockOffset uint32, byteOffset uint16, size i
}
func (fs *FileSystem) readBlock(location int64, compressed bool, size uint32) ([]byte, error) {
+ // Zero size is a sparse block of blocksize
+ if size == 0 {
+ return make([]byte, fs.superblock.blocksize), nil
+ }
b := make([]byte, size)
read, err := fs.file.ReadAt(b, location)
if err != nil && err != io.EOF {
@@ -543,25 +591,32 @@ func (fs *FileSystem) readFragment(index, offset uint32, fragmentSize int64) ([]
return nil, fmt.Errorf("cannot find fragment block with index %d", index)
}
fragmentInfo := fs.fragments[index]
- // figure out the size of the compressed block and if it is compressed
- b := make([]byte, fragmentInfo.size)
- read, err := fs.file.ReadAt(b, int64(fragmentInfo.start))
- if err != nil && err != io.EOF {
- return nil, fmt.Errorf("unable to read fragment block %d: %v", index, err)
- }
- if read != len(b) {
- return nil, fmt.Errorf("read %d instead of expected %d bytes for fragment block %d", read, len(b), index)
- }
-
- data := b
- if fragmentInfo.compressed {
- if fs.compressor == nil {
- return nil, fmt.Errorf("fragment compressed but do not have valid compressor")
+ pos := int64(fragmentInfo.start)
+ data, _, err := fs.cache.get(pos, func() (data []byte, size uint16, err error) {
+ // figure out the size of the compressed block and if it is compressed
+ b := make([]byte, fragmentInfo.size)
+ read, err := fs.file.ReadAt(b, pos)
+ if err != nil && err != io.EOF {
+ return nil, 0, fmt.Errorf("unable to read fragment block %d: %v", index, err)
}
- data, err = fs.compressor.decompress(b)
- if err != nil {
- return nil, fmt.Errorf("decompress error: %v", err)
+ if read != len(b) {
+ return nil, 0, fmt.Errorf("read %d instead of expected %d bytes for fragment block %d", read, len(b), index)
}
+
+ data = b
+ if fragmentInfo.compressed {
+ if fs.compressor == nil {
+ return nil, 0, fmt.Errorf("fragment compressed but do not have valid compressor")
+ }
+ data, err = fs.compressor.decompress(b)
+ if err != nil {
+ return nil, 0, fmt.Errorf("decompress error: %v", err)
+ }
+ }
+ return data, 0, nil
+ })
+ if err != nil {
+ return nil, err
}
// now get the data from the offset
return data[offset : int64(offset)+fragmentSize], nil
@@ -604,8 +659,9 @@ func readFragmentTable(s *superblock, file util.File, c Compressor) ([]*fragment
// load in the actual fragment entries
// read each block and uncompress it
var fragmentTable []*fragmentEntry
+ var fs = &FileSystem{}
for i, offset := range offsets {
- uncompressed, _, err := readMetaBlock(file, c, offset)
+ uncompressed, _, err := fs.readMetaBlock(file, c, offset)
if err != nil {
return nil, fmt.Errorf("error reading meta block %d at position %d: %v", i, offset, err)
}
@@ -674,13 +730,14 @@ func readXattrsTable(s *superblock, file util.File, c Compressor) (*xAttrTable,
var (
uncompressed []byte
size uint16
+ fs = &FileSystem{}
)
bIndex := make([]byte, 0)
// convert those into indexes
for i := 0; i+8-1 < len(b); i += 8 {
locn := binary.LittleEndian.Uint64(b[i : i+8])
- uncompressed, _, err = readMetaBlock(file, c, int64(locn))
+ uncompressed, _, err = fs.readMetaBlock(file, c, int64(locn))
if err != nil {
return nil, fmt.Errorf("error reading xattr index meta block %d at position %d: %v", i, locn, err)
}
@@ -691,7 +748,7 @@ func readXattrsTable(s *superblock, file util.File, c Compressor) (*xAttrTable,
xAttrEnd := binary.LittleEndian.Uint64(b[:8])
xAttrData := make([]byte, 0)
for i := xAttrStart; i < xAttrEnd; {
- uncompressed, size, err = readMetaBlock(file, c, int64(i))
+ uncompressed, size, err = fs.readMetaBlock(file, c, int64(i))
if err != nil {
return nil, fmt.Errorf("error reading xattr data meta block at position %d: %v", i, err)
}
@@ -704,7 +761,7 @@ func readXattrsTable(s *superblock, file util.File, c Compressor) (*xAttrTable,
return parseXattrsTable(xAttrData, bIndex, s.idTableStart, c)
}
-//nolint:unparam // this does not use offset or compressor yet, but only because we have not yet added support
+//nolint:unparam,unused,revive // this does not use offset or compressor yet, but only because we have not yet added support
func parseXattrsTable(bUIDXattr, bIndex []byte, offset uint64, c Compressor) (*xAttrTable, error) {
// create the ID list
var (
@@ -765,13 +822,14 @@ func readUidsGids(s *superblock, file util.File, c Compressor) ([]uint32, error)
var (
uncompressed []byte
+ fs = &FileSystem{}
)
data := make([]byte, 0)
// convert those into indexes
for i := 0; i+8-1 < len(b); i += 8 {
locn := binary.LittleEndian.Uint64(b[i : i+8])
- uncompressed, _, err = readMetaBlock(file, c, int64(locn))
+ uncompressed, _, err = fs.readMetaBlock(file, c, int64(locn))
if err != nil {
return nil, fmt.Errorf("error reading uidgid index meta block %d at position %d: %v", i, locn, err)
}
diff --git a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/xattr.go b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/xattr.go
index f63d4029a6ce..e1894217d3d0 100644
--- a/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/xattr.go
+++ b/vendor/github.com/diskfs/go-diskfs/filesystem/squashfs/xattr.go
@@ -45,7 +45,7 @@ func (x *xAttrTable) find(pos int) (map[string]string, error) {
xattrs := map[string]string{}
for i := 0; i < int(count); i++ {
// must be 4 bytes for header
- if len(b[pos:]) < 4 {
+ if len(b[ptr:]) < 4 {
return nil, fmt.Errorf("insufficient bytes %d to read the xattr at position %d", len(b[ptr:]), ptr)
}
// get the type and size
@@ -56,7 +56,7 @@ func (x *xAttrTable) find(pos int) (map[string]string, error) {
valStart := valHeaderStart + 4
// make sure we have enough bytes
if len(b[nameStart:]) < xSize {
- return nil, fmt.Errorf("xattr header has size %d, but only %d bytes available to read at position %d", xSize, len(b[pos+4:]), ptr)
+ return nil, fmt.Errorf("xattr header has size %d, but only %d bytes available to read at position %d", xSize, len(b[ptr+4:]), ptr)
}
if xSize < 1 {
return nil, fmt.Errorf("no name given for xattr at position %d", ptr)
diff --git a/vendor/github.com/diskfs/go-diskfs/partition/gpt/partition.go b/vendor/github.com/diskfs/go-diskfs/partition/gpt/partition.go
index a454ec23e94b..bfa0e66270ac 100644
--- a/vendor/github.com/diskfs/go-diskfs/partition/gpt/partition.go
+++ b/vendor/github.com/diskfs/go-diskfs/partition/gpt/partition.go
@@ -291,3 +291,14 @@ func (p *Partition) sectorSizes() (physical, logical int) {
func (p *Partition) Equal(o *Partition) bool {
return p != nil && o != nil && *p == *o
}
+
+// UUID returns the partitions UUID
+func (p *Partition) UUID() string {
+ return p.GUID
+}
+
+// Expand increases the size of the partition by a number of sectors
+func (p *Partition) Expand(sectors uint64) {
+ p.End += sectors
+ p.Size += sectors * uint64(p.logicalSectorSize)
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/partition/gpt/table.go b/vendor/github.com/diskfs/go-diskfs/partition/gpt/table.go
index bbea768dc174..132b3578e014 100644
--- a/vendor/github.com/diskfs/go-diskfs/partition/gpt/table.go
+++ b/vendor/github.com/diskfs/go-diskfs/partition/gpt/table.go
@@ -20,6 +20,7 @@ const (
// just defaults
physicalSectorSize = 512
logicalSectorSize = 512
+ gptHeaderSector = 1
)
// Table represents a partition table to be applied to a disk or read from a disk
@@ -106,7 +107,7 @@ func (t *Table) initTable(size int64) {
t.secondaryHeader = diskSectors - 1
}
if t.lastDataSector == 0 {
- t.lastDataSector = diskSectors - 1 - partSectors
+ t.lastDataSector = t.secondaryHeader - partSectors - 1
}
t.initialized = true
@@ -347,15 +348,9 @@ func readPartitionArrayBytes(b []byte, entrySize, logicalSectorSize, physicalSec
return parts, nil
}
-// tableFromBytes read a partition table from a byte slice
-func tableFromBytes(b []byte, logicalBlockSize, physicalBlockSize int) (*Table, error) {
- // minimum size - gpt entries + header + LBA0 for (protective) MBR
- if len(b) < logicalBlockSize*2 {
- return nil, fmt.Errorf("data for partition was %d bytes instead of expected minimum %d", len(b), logicalBlockSize*2)
- }
-
- // GPT starts at LBA1
- gpt := b[logicalBlockSize:]
+// readGPTHeader reads the GPT header from the given byte slice
+func readGPTHeader(b []byte) (*Table, error) {
+ gpt := b
// start with fixed headers
efiSignature := gpt[0:8]
efiRevision := gpt[8:12]
@@ -396,12 +391,7 @@ func tableFromBytes(b []byte, logicalBlockSize, physicalBlockSize int) (*Table,
return nil, fmt.Errorf("invalid EFI Header Checksum, expected %v, got %v", checksum, efiHeaderCrc)
}
- // potential protective MBR is at LBA0
- hasProtectiveMBR := readProtectiveMBR(b[:logicalBlockSize], uint32(secondaryHeader))
-
table := Table{
- LogicalSectorSize: logicalBlockSize,
- PhysicalSectorSize: physicalBlockSize,
partitionEntrySize: partitionEntrySize,
primaryHeader: primaryHeader,
secondaryHeader: secondaryHeader,
@@ -409,15 +399,63 @@ func tableFromBytes(b []byte, logicalBlockSize, physicalBlockSize int) (*Table,
lastDataSector: lastDataSector,
partitionArraySize: int(partitionEntryCount),
partitionFirstLBA: partitionEntryFirstLBA,
- ProtectiveMBR: hasProtectiveMBR,
GUID: strings.ToUpper(diskGUID.String()),
partitionEntryChecksum: partitionEntryChecksum,
- initialized: true,
}
return &table, nil
}
+// tableHeaderFromBytes read a partition table from a byte slice, mainly used to validate the secondary header
+func tableHeaderFromBytes(b []byte, logicalBlockSize, physicalBlockSize int, skipMBR bool) (*Table, error) {
+ // minimum size - gpt entries + header + LBA0 for (protective) MBR
+ minSize := logicalBlockSize
+ if len(b) < minSize {
+ return nil, fmt.Errorf("data for partition was %d bytes instead of expected minimum %d", len(b), minSize)
+ }
+ gpt := b
+ if skipMBR {
+ gpt = b[logicalBlockSize:]
+ }
+
+ table, err := readGPTHeader(gpt)
+ if err != nil {
+ return nil, err
+ }
+
+ // potential protective MBR is at LBA0
+ table.ProtectiveMBR = readProtectiveMBR(b[:logicalBlockSize], uint32(table.secondaryHeader))
+ table.LogicalSectorSize = logicalBlockSize
+ table.PhysicalSectorSize = physicalBlockSize
+ table.initialized = true
+
+ return table, nil
+}
+
+// tableFromBytes read a partition table from a byte slice
+func tableFromBytes(b []byte, logicalBlockSize, physicalBlockSize int) (*Table, error) {
+ // minimum size - gpt entries + header + LBA0 for (protective) MBR
+ if len(b) < logicalBlockSize*2 {
+ return nil, fmt.Errorf("data for partition was %d bytes instead of expected minimum %d", len(b), logicalBlockSize*2)
+ }
+
+ // GPT starts at LBA1
+ gpt := b[logicalBlockSize:]
+
+ table, err := readGPTHeader(gpt)
+ if err != nil {
+ return nil, err
+ }
+
+ // potential protective MBR is at LBA0
+ table.ProtectiveMBR = readProtectiveMBR(b[:logicalBlockSize], uint32(table.secondaryHeader))
+ table.LogicalSectorSize = logicalBlockSize
+ table.PhysicalSectorSize = physicalBlockSize
+ table.initialized = true
+
+ return table, nil
+}
+
// Type report the type of table, always "gpt"
func (t *Table) Type() string {
return "gpt"
@@ -550,3 +588,84 @@ func (t *Table) GetPartitions() []part.Partition {
}
return parts
}
+
+// UUID returns the partition table UUID (disk UUID)
+func (t *Table) UUID() string {
+ return t.GUID
+}
+
+// Verify will attempt to evaluate the headers
+func (t *Table) Verify(f util.File, diskSize uint64) error {
+ if t.LogicalSectorSize == 0 {
+ // Avoid divide by zero panic.
+ return fmt.Errorf("table is not initialized")
+ }
+
+ // Determine the size of disk that GPT expects
+ expectedDiskSize := (t.secondaryHeader + 1) * uint64(t.LogicalSectorSize)
+ if diskSize != expectedDiskSize {
+ return fmt.Errorf("secondary Header is not at end of the disk, expected => %d / actual => %d", expectedDiskSize, diskSize)
+ }
+ b := make([]byte, t.LogicalSectorSize)
+ seekAddress := int64(t.secondaryHeader) * int64(t.LogicalSectorSize)
+ _, err := f.ReadAt(b, seekAddress)
+ if err != nil {
+ return fmt.Errorf("error reading GPT from file at %d / disksize %d : %v", seekAddress, diskSize, err)
+ }
+ secondaryTable, err := tableHeaderFromBytes(b, t.LogicalSectorSize, t.PhysicalSectorSize, false)
+ if err != nil {
+ return fmt.Errorf("error reading GPT from file at %d / disksize %d : %v", seekAddress, diskSize, err)
+ }
+ if t.firstDataSector != secondaryTable.firstDataSector {
+ return fmt.Errorf("error comparing GPT headers expected => %d / actual => %d", t.firstDataSector, secondaryTable.firstDataSector)
+ }
+ partSectors := uint64(t.partitionArraySize) * uint64(t.partitionEntrySize) / uint64(t.LogicalSectorSize)
+ lastDataSector := t.secondaryHeader - partSectors - 1
+ if t.lastDataSector != lastDataSector {
+ return fmt.Errorf("error comparing GPT secondary headers expected => %d / actual => %d", t.lastDataSector, lastDataSector)
+ }
+ return nil
+}
+
+// Repair will attempt to evaluate the headers fix the header location and re-write the primary and secondary header
+func (t *Table) Repair(diskSize uint64) error {
+ if t.LogicalSectorSize == 0 {
+ // Avoid divide by zero panic.
+ return fmt.Errorf("table is not initialized")
+ }
+
+ partSectors := uint64(t.partitionArraySize) * uint64(t.partitionEntrySize) / uint64(t.LogicalSectorSize)
+
+ t.secondaryHeader = (diskSize / uint64(t.LogicalSectorSize)) - 1
+ t.lastDataSector = t.secondaryHeader - partSectors - 1
+
+ return nil
+}
+
+// TotalSize returns the total size of the GPT in bytes.
+//
+// This is counted from the start of the MBR to the end of the secondary
+// header.
+func (t *Table) TotalSize() uint64 {
+ return (t.secondaryHeader + gptHeaderSector) * uint64(t.LogicalSectorSize)
+}
+
+func (t *Table) LastDataSector() uint64 {
+ return t.lastDataSector
+}
+
+// Resize changes the size of the GPT.
+//
+// The size argument is in bytes and must be a multiple of the logical sector
+// size.
+// Use this function in case a storage device is not the same as the total
+// size of its GPT.
+func (t *Table) Resize(size uint64) {
+ // how many sectors on the disk?
+ diskSectors := size / uint64(t.LogicalSectorSize)
+ // how many sectors used for partition entries?
+ partSectors := uint64(t.partitionArraySize) * uint64(t.partitionEntrySize) / uint64(t.LogicalSectorSize)
+
+ t.secondaryHeader = diskSectors - 1
+ t.lastDataSector = t.secondaryHeader - 1 - partSectors
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/partition/mbr/partition.go b/vendor/github.com/diskfs/go-diskfs/partition/mbr/partition.go
index 4afab694780e..a63428da9b0e 100644
--- a/vendor/github.com/diskfs/go-diskfs/partition/mbr/partition.go
+++ b/vendor/github.com/diskfs/go-diskfs/partition/mbr/partition.go
@@ -27,6 +27,8 @@ type Partition struct {
// we need this for calculations
logicalSectorSize int
physicalSectorSize int
+ // partitionUUID is set when retrieving partitions from a Table
+ partitionUUID string
}
// PartitionEqualBytes compares if the bytes for 2 partitions are equal, ignoring CHS start and end
@@ -46,7 +48,7 @@ func PartitionEqualBytes(b1, b2 []byte) bool {
bytes.Equal(b1[12:16], b2[12:16])
}
-// Equal compares if another partition is equal to this one, ignoring CHS start and end
+// Equal compares if another partition is equal to this one, ignoring the UUID and CHS start and end
func (p *Partition) Equal(p2 *Partition) bool {
if p2 == nil {
return false
@@ -204,3 +206,9 @@ func (p *Partition) sectorSizes() (physical, logical int) {
}
return physical, logical
}
+
+// UUID returns the partitions UUID. For MBR based partition tables this is the
+// partition table UUID with the partition number as a suffix.
+func (p *Partition) UUID() string {
+ return p.partitionUUID
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/partition/mbr/table.go b/vendor/github.com/diskfs/go-diskfs/partition/mbr/table.go
index 631018a3b00e..c64dab5f0f9e 100644
--- a/vendor/github.com/diskfs/go-diskfs/partition/mbr/table.go
+++ b/vendor/github.com/diskfs/go-diskfs/partition/mbr/table.go
@@ -2,6 +2,7 @@ package mbr
import (
"bytes"
+ "encoding/binary"
"fmt"
"github.com/diskfs/go-diskfs/partition/part"
@@ -13,7 +14,7 @@ type Table struct {
Partitions []*Partition
LogicalSectorSize int // logical size of a sector
PhysicalSectorSize int // physical size of the sector
- initialized bool
+ partitionTableUUID string
}
const (
@@ -23,6 +24,9 @@ const (
partitionEntriesStart = 446
partitionEntriesCount = 4
signatureStart = 510
+ // the partition table UUID is stored in 4 bytes in the MBR
+ partitionTableUUIDStart = 440
+ partitionTableUUIDEnd = 444
)
// partitionEntrySize standard size of an MBR partition
@@ -54,20 +58,7 @@ func comparePartitionArray(p1, p2 []*Partition) bool {
return matches
}
-// ensure that a blank table is initialized
-func (t *Table) initTable() {
- // default settings
- if t.LogicalSectorSize == 0 {
- t.LogicalSectorSize = 512
- }
- if t.PhysicalSectorSize == 0 {
- t.PhysicalSectorSize = 512
- }
-
- t.initialized = true
-}
-
-// Equal check if another table is equal to this one, ignoring CHS start and end for the partitions
+// Equal check if another table is equal to this one, ignoring the partition table UUID and CHS start and end for the partitions
func (t *Table) Equal(t2 *Table) bool {
if t2 == nil {
return false
@@ -85,13 +76,14 @@ func tableFromBytes(b []byte) (*Table, error) {
if len(b) != mbrSize {
return nil, fmt.Errorf("data for partition was %d bytes instead of expected %d", len(b), mbrSize)
}
- mbrSignature := b[signatureStart:]
// validate signature
+ mbrSignature := b[signatureStart:]
if !bytes.Equal(mbrSignature, getMbrSignature()) {
return nil, fmt.Errorf("invalid MBR Signature %v", mbrSignature)
}
+ ptUUID := readPartitionTableUUID(b)
parts := make([]*Partition, 0, partitionEntriesCount)
count := int(partitionEntriesCount)
for i := 0; i < count; i++ {
@@ -102,6 +94,7 @@ func tableFromBytes(b []byte) (*Table, error) {
if err != nil {
return nil, fmt.Errorf("error reading partition entry %d: %v", i, err)
}
+ p.partitionUUID = formatPartitionUUID(ptUUID, i+1)
parts = append(parts, p)
}
@@ -109,17 +102,38 @@ func tableFromBytes(b []byte) (*Table, error) {
Partitions: parts,
LogicalSectorSize: logicalSectorSize,
PhysicalSectorSize: 512,
+ partitionTableUUID: ptUUID,
}
return table, nil
}
+func readPartitionTableUUID(b []byte) string {
+ ptUUID := b[partitionTableUUIDStart:partitionTableUUIDEnd]
+ return fmt.Sprintf("%x", binary.LittleEndian.Uint32(ptUUID))
+}
+
+// UUID returns the partition table UUID used to identify disks
+func (t *Table) UUID() string {
+ return t.partitionTableUUID
+}
+
+// formatPartitionUUID creates the partition UUID which is created by using the
+// partition table UUID and the partition index.
+// Format string taken from libblkid:
+// https://github.com/util-linux/util-linux/blob/master/libblkid/src/partitions/partitions.c#L1387C42-L1387C52
+func formatPartitionUUID(ptUUID string, index int) string {
+ return fmt.Sprintf("%.33s-%02x", ptUUID, index)
+}
+
// Type report the type of table, always the string "mbr"
func (t *Table) Type() string {
return "mbr"
}
// Read read a partition table from a disk, given the logical block size and physical block size
+//
+//nolint:unused,revive // not used in MBR, but it is important to implement the interface
func Read(f util.File, logicalBlockSize, physicalBlockSize int) (*Table, error) {
// read the data off of the disk
b := make([]byte, mbrSize)
@@ -155,6 +169,8 @@ func (t *Table) toBytes() []byte {
// Write writes a given MBR Table to disk.
// Must be passed the util.File to write to and the size of the disk
+//
+//nolint:unused,revive // not used in MBR, but it is important to implement the interface
func (t *Table) Write(f util.File, size int64) error {
b := t.toBytes()
@@ -176,3 +192,17 @@ func (t *Table) GetPartitions() []part.Partition {
}
return parts
}
+
+// Verify will attempt to evaluate the headers
+//
+//nolint:unused,revive // not used in MBR, but it is important to implement the interface
+func (t *Table) Verify(f util.File, diskSize uint64) error {
+ return nil
+}
+
+// Repair will attempt to repair a broken Master Boot Record
+//
+//nolint:unused,revive // not used in MBR, but it is important to implement the interface
+func (t *Table) Repair(diskSize uint64) error {
+ return nil
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/partition/part/partition.go b/vendor/github.com/diskfs/go-diskfs/partition/part/partition.go
index 2a9a3dbec605..f87ba9faa022 100644
--- a/vendor/github.com/diskfs/go-diskfs/partition/part/partition.go
+++ b/vendor/github.com/diskfs/go-diskfs/partition/part/partition.go
@@ -12,4 +12,5 @@ type Partition interface {
GetStart() int64
ReadContents(util.File, io.Writer) (int64, error)
WriteContents(util.File, io.Reader) (uint64, error)
+ UUID() string
}
diff --git a/vendor/github.com/diskfs/go-diskfs/partition/table.go b/vendor/github.com/diskfs/go-diskfs/partition/table.go
index 29cf0046593f..62f56503a4d8 100644
--- a/vendor/github.com/diskfs/go-diskfs/partition/table.go
+++ b/vendor/github.com/diskfs/go-diskfs/partition/table.go
@@ -10,4 +10,7 @@ type Table interface {
Type() string
Write(util.File, int64) error
GetPartitions() []part.Partition
+ Repair(diskSize uint64) error
+ Verify(f util.File, diskSize uint64) error
+ UUID() string
}
diff --git a/vendor/github.com/diskfs/go-diskfs/util/bitmap.go b/vendor/github.com/diskfs/go-diskfs/util/bitmap.go
new file mode 100644
index 000000000000..6fb85a1ba774
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/util/bitmap.go
@@ -0,0 +1,171 @@
+package util
+
+import "fmt"
+
+// Bitmap is a structure holding a bitmap
+type Bitmap struct {
+ bits []byte
+}
+
+// Contiguous a position and count of contiguous bits, either free or set
+type Contiguous struct {
+ Position int
+ Count int
+}
+
+// BitmapFromBytes create a bitmap struct from bytes
+func BitmapFromBytes(b []byte) *Bitmap {
+ // just copy them over
+ bits := make([]byte, len(b))
+ copy(bits, b)
+ bm := Bitmap{
+ bits: bits,
+ }
+
+ return &bm
+}
+
+// NewBitmap creates a new bitmap of size bytes; it is not in bits to force the caller to have
+// a complete set
+func NewBitmap(bytes int) *Bitmap {
+ bm := Bitmap{
+ bits: make([]byte, bytes),
+ }
+ return &bm
+}
+
+// ToBytes returns raw bytes underlying the bitmap
+func (bm *Bitmap) ToBytes() []byte {
+ b := make([]byte, len(bm.bits))
+ copy(b, bm.bits)
+
+ return b
+}
+
+// FromBytes overwrite the existing map with the contents of the bytes.
+// It is the equivalent of BitmapFromBytes, but uses an existing Bitmap.
+func (bm *Bitmap) FromBytes(b []byte) {
+ bm.bits = make([]byte, len(b))
+ copy(bm.bits, b)
+}
+
+// IsSet check if a specific bit location is set
+func (bm *Bitmap) IsSet(location int) (bool, error) {
+ byteNumber, bitNumber := findBitForIndex(location)
+ if byteNumber > len(bm.bits) {
+ return false, fmt.Errorf("location %d is not in %d size bitmap", location, len(bm.bits)*8)
+ }
+ mask := byte(0x1) << bitNumber
+ return bm.bits[byteNumber]&mask == mask, nil
+}
+
+// Clear a specific bit location
+func (bm *Bitmap) Clear(location int) error {
+ byteNumber, bitNumber := findBitForIndex(location)
+ if byteNumber > len(bm.bits) {
+ return fmt.Errorf("location %d is not in %d size bitmap", location, len(bm.bits)*8)
+ }
+ mask := byte(0x1) << bitNumber
+ mask = ^mask
+ bm.bits[byteNumber] &= mask
+ return nil
+}
+
+// Set a specific bit location
+func (bm *Bitmap) Set(location int) error {
+ byteNumber, bitNumber := findBitForIndex(location)
+ if byteNumber > len(bm.bits) {
+ return fmt.Errorf("location %d is not in %d size bitmap", location, len(bm.bits)*8)
+ }
+ mask := byte(0x1) << bitNumber
+ bm.bits[byteNumber] |= mask
+ return nil
+}
+
+// FirstFree returns the first free bit in the bitmap
+// Begins at start, so if you want to find the first free bit, pass start=1.
+// Returns -1 if none found.
+func (bm *Bitmap) FirstFree(start int) int {
+ var location = -1
+ candidates := bm.bits[start/8:]
+ for i, b := range candidates {
+ // if all used, continue to next byte
+ if b&0xff == 0xff {
+ continue
+ }
+ // not all used, so find first bit set to 0
+ for j := uint8(0); j < 8; j++ {
+ mask := byte(0x1) << j
+ if b&mask != mask {
+ location = 8*i + int(j)
+ break
+ }
+ }
+ break
+ }
+ return location
+}
+
+// FirstSet returns location of first set bit in the bitmap
+func (bm *Bitmap) FirstSet() int {
+ var location = -1
+ for i, b := range bm.bits {
+ // if all free, continue to next
+ if b == 0x00 {
+ continue
+ }
+ // not all free, so find first bit set to 1
+ for j := uint8(0); j < 8; j++ {
+ mask := byte(0x1) << j
+ mask = ^mask
+ if b|mask != mask {
+ location = 8*i + (8 - int(j))
+ break
+ }
+ }
+ break
+ }
+ return location
+}
+
+// FreeList returns a slicelist of contiguous free locations by location.
+// It is sorted by location. If you want to sort it by size, uses sort.Slice
+// for example, if the bitmap is 10010010 00100000 10000010, it will return
+//
+// 1: 2, // 2 free bits at position 1
+// 4: 2, // 2 free bits at position 4
+// 8: 3, // 3 free bits at position 8
+// 11: 5 // 5 free bits at position 11
+// 17: 5 // 5 free bits at position 17
+// 23: 1, // 1 free bit at position 23
+//
+// if you want it in reverse order, just reverse the slice.
+func (bm *Bitmap) FreeList() []Contiguous {
+ var list []Contiguous
+ var location = -1
+ var count = 0
+ for i, b := range bm.bits {
+ for j := uint8(0); j < 8; j++ {
+ mask := byte(0x1) << j
+ switch {
+ case b&mask != mask:
+ if location == -1 {
+ location = 8*i + int(j)
+ }
+ count++
+ case location != -1:
+ list = append(list, Contiguous{location, count})
+ location = -1
+ count = 0
+ }
+ }
+ }
+ if location != -1 {
+ list = append(list, Contiguous{location, count})
+ }
+ return list
+}
+
+func findBitForIndex(index int) (byteNumber int, bitNumber uint8) {
+ return index / 8, uint8(index % 8)
+}
diff --git a/vendor/github.com/diskfs/go-diskfs/util/uniqify.go b/vendor/github.com/diskfs/go-diskfs/util/uniqify.go
new file mode 100644
index 000000000000..c091a6ecb8e8
--- /dev/null
+++ b/vendor/github.com/diskfs/go-diskfs/util/uniqify.go
@@ -0,0 +1,13 @@
+package util
+
+func Uniqify[T comparable](s []T) []T {
+ m := make(map[T]bool)
+ for _, v := range s {
+ m[v] = true
+ }
+ var result = make([]T, 0, len(m))
+ for k := range m {
+ result = append(result, k)
+ }
+ return result
+}
diff --git a/vendor/gopkg.in/djherbis/times.v1/LICENSE b/vendor/github.com/djherbis/times/LICENSE
similarity index 100%
rename from vendor/gopkg.in/djherbis/times.v1/LICENSE
rename to vendor/github.com/djherbis/times/LICENSE
diff --git a/vendor/gopkg.in/djherbis/times.v1/README.md b/vendor/github.com/djherbis/times/README.md
similarity index 82%
rename from vendor/gopkg.in/djherbis/times.v1/README.md
rename to vendor/github.com/djherbis/times/README.md
index b68a132bf33b..7c88890489c1 100644
--- a/vendor/gopkg.in/djherbis/times.v1/README.md
+++ b/vendor/github.com/djherbis/times/README.md
@@ -4,7 +4,7 @@ times
[](https://godoc.org/github.com/djherbis/times)
[](https://github.com/djherbis/times/releases/latest)
[](LICENSE.txt)
-[](https://travis-ci.org/djherbis/times)
+[](https://github.com/djherbis/times/actions/workflows/go-test.yml)
[](https://coveralls.io/r/djherbis/times?branch=master)
[](https://goreportcard.com/report/github.com/djherbis/times)
[](https://sourcegraph.com/github.com/djherbis/times?badge)
@@ -21,7 +21,7 @@ package main
import (
"log"
- "gopkg.in/djherbis/times.v1"
+ "github.com/djherbis/times"
)
func main() {
@@ -50,8 +50,11 @@ Supported Times
| atime | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| mtime | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| ctime | ✓* | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ |
-| btime | ✓ | | | | | ✓ | ✓| ✓ | | |
+| btime | ✓ | ✓* | | | | ✓ | ✓| ✓ | | |
+* Linux btime requires kernel 4.11 and filesystem support, so HasBirthTime = false.
+Use Timespec.HasBirthTime() to check if file has birth time.
+Get(FileInfo) never returns btime.
* Windows XP does not have ChangeTime so HasChangeTime = false,
however Vista onward does have ChangeTime so Timespec.HasChangeTime() will
only return false on those platforms when the syscall used to obtain them fails.
@@ -60,5 +63,5 @@ only return false on those platforms when the syscall used to obtain them fails.
Installation
------------
```sh
-go get gopkg.in/djherbis/times.v1
+go get -u github.com/djherbis/times
```
diff --git a/vendor/gopkg.in/djherbis/times.v1/ctime_windows.go b/vendor/github.com/djherbis/times/ctime_windows.go
similarity index 100%
rename from vendor/gopkg.in/djherbis/times.v1/ctime_windows.go
rename to vendor/github.com/djherbis/times/ctime_windows.go
diff --git a/vendor/gopkg.in/djherbis/times.v1/js.cover.dockerfile b/vendor/github.com/djherbis/times/js.cover.dockerfile
similarity index 75%
rename from vendor/gopkg.in/djherbis/times.v1/js.cover.dockerfile
rename to vendor/github.com/djherbis/times/js.cover.dockerfile
index 1f52edccd4a3..f522a5e4f82b 100644
--- a/vendor/gopkg.in/djherbis/times.v1/js.cover.dockerfile
+++ b/vendor/github.com/djherbis/times/js.cover.dockerfile
@@ -1,6 +1,6 @@
-FROM golang:1.16
+FROM golang:1.17
-RUN curl -sL https://deb.nodesource.com/setup_8.x | bash
+RUN curl -sL https://deb.nodesource.com/setup_17.x | bash
RUN apt-get install --yes nodejs
WORKDIR /go/src/github.com/djherbis/times
diff --git a/vendor/gopkg.in/djherbis/times.v1/js.cover.sh b/vendor/github.com/djherbis/times/js.cover.sh
similarity index 100%
rename from vendor/gopkg.in/djherbis/times.v1/js.cover.sh
rename to vendor/github.com/djherbis/times/js.cover.sh
diff --git a/vendor/github.com/djherbis/times/linux.cover.dockerfile b/vendor/github.com/djherbis/times/linux.cover.dockerfile
new file mode 100644
index 000000000000..e1a795927c97
--- /dev/null
+++ b/vendor/github.com/djherbis/times/linux.cover.dockerfile
@@ -0,0 +1,6 @@
+FROM golang:1.17
+
+WORKDIR /go/src/github.com/djherbis/times
+COPY . .
+
+RUN GO111MODULE=auto go test -covermode=count -coverprofile=profile.cov
diff --git a/vendor/github.com/djherbis/times/linux.cover.sh b/vendor/github.com/djherbis/times/linux.cover.sh
new file mode 100644
index 000000000000..83f97431b06d
--- /dev/null
+++ b/vendor/github.com/djherbis/times/linux.cover.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+set -e
+
+docker build -f linux.cover.dockerfile -t linux.cover.djherbis.times .
+docker create --name linux.cover.djherbis.times linux.cover.djherbis.times
+docker cp linux.cover.djherbis.times:/go/src/github.com/djherbis/times/profile.cov .
+docker rm -v linux.cover.djherbis.times
\ No newline at end of file
diff --git a/vendor/gopkg.in/djherbis/times.v1/times.go b/vendor/github.com/djherbis/times/times.go
similarity index 100%
rename from vendor/gopkg.in/djherbis/times.v1/times.go
rename to vendor/github.com/djherbis/times/times.go
diff --git a/vendor/gopkg.in/djherbis/times.v1/times_aix.go b/vendor/github.com/djherbis/times/times_aix.go
similarity index 100%
rename from vendor/gopkg.in/djherbis/times.v1/times_aix.go
rename to vendor/github.com/djherbis/times/times_aix.go
diff --git a/vendor/gopkg.in/djherbis/times.v1/times_darwin.go b/vendor/github.com/djherbis/times/times_darwin.go
similarity index 100%
rename from vendor/gopkg.in/djherbis/times.v1/times_darwin.go
rename to vendor/github.com/djherbis/times/times_darwin.go
diff --git a/vendor/gopkg.in/djherbis/times.v1/times_dragonfly.go b/vendor/github.com/djherbis/times/times_dragonfly.go
similarity index 100%
rename from vendor/gopkg.in/djherbis/times.v1/times_dragonfly.go
rename to vendor/github.com/djherbis/times/times_dragonfly.go
diff --git a/vendor/gopkg.in/djherbis/times.v1/times_freebsd.go b/vendor/github.com/djherbis/times/times_freebsd.go
similarity index 100%
rename from vendor/gopkg.in/djherbis/times.v1/times_freebsd.go
rename to vendor/github.com/djherbis/times/times_freebsd.go
diff --git a/vendor/gopkg.in/djherbis/times.v1/times_js.go b/vendor/github.com/djherbis/times/times_js.go
similarity index 100%
rename from vendor/gopkg.in/djherbis/times.v1/times_js.go
rename to vendor/github.com/djherbis/times/times_js.go
diff --git a/vendor/github.com/djherbis/times/times_linux.go b/vendor/github.com/djherbis/times/times_linux.go
new file mode 100644
index 000000000000..85f87dba3c81
--- /dev/null
+++ b/vendor/github.com/djherbis/times/times_linux.go
@@ -0,0 +1,185 @@
+// Copyright 2009 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.
+
+// http://golang.org/src/os/stat_linux.go
+
+package times
+
+import (
+ "errors"
+ "os"
+ "sync/atomic"
+ "syscall"
+ "time"
+
+ "golang.org/x/sys/unix"
+)
+
+// HasChangeTime and HasBirthTime are true if and only if
+// the target OS supports them.
+const (
+ HasChangeTime = true
+ HasBirthTime = false
+)
+
+type timespec struct {
+ atime
+ mtime
+ ctime
+ nobtime
+}
+
+type timespecBtime struct {
+ atime
+ mtime
+ ctime
+ btime
+}
+
+var (
+ supportsStatx int32 = 1
+ statxFunc = unix.Statx
+)
+
+func isStatXSupported() bool {
+ return atomic.LoadInt32(&supportsStatx) == 1
+}
+
+func isStatXUnsupported(err error) bool {
+ // linux 4.10 and earlier does not support Statx syscall
+ if err != nil && errors.Is(err, unix.ENOSYS) {
+ atomic.StoreInt32(&supportsStatx, 0)
+ return true
+ }
+ return false
+}
+
+// Stat returns the Timespec for the given filename.
+func Stat(name string) (Timespec, error) {
+ if isStatXSupported() {
+ ts, err := statX(name)
+ if err == nil {
+ return ts, nil
+ }
+ if !isStatXUnsupported(err) {
+ return nil, err
+ }
+ // Fallback.
+ }
+ return stat(name, os.Stat)
+}
+
+func statX(name string) (Timespec, error) {
+ // https://man7.org/linux/man-pages/man2/statx.2.html
+ var statx unix.Statx_t
+ err := statxFunc(unix.AT_FDCWD, name, unix.AT_STATX_SYNC_AS_STAT, unix.STATX_ATIME|unix.STATX_MTIME|unix.STATX_CTIME|unix.STATX_BTIME, &statx)
+ if err != nil {
+ return nil, err
+ }
+ return extractTimes(&statx), nil
+}
+
+// Lstat returns the Timespec for the given filename, and does not follow Symlinks.
+func Lstat(name string) (Timespec, error) {
+ if isStatXSupported() {
+ ts, err := lstatx(name)
+ if err == nil {
+ return ts, nil
+ }
+ if !isStatXUnsupported(err) {
+ return nil, err
+ }
+ // Fallback.
+ }
+ return stat(name, os.Lstat)
+}
+
+func lstatx(name string) (Timespec, error) {
+ // https://man7.org/linux/man-pages/man2/statx.2.html
+ var statX unix.Statx_t
+ err := statxFunc(unix.AT_FDCWD, name, unix.AT_STATX_SYNC_AS_STAT|unix.AT_SYMLINK_NOFOLLOW, unix.STATX_ATIME|unix.STATX_MTIME|unix.STATX_CTIME|unix.STATX_BTIME, &statX)
+ if err != nil {
+ return nil, err
+ }
+ return extractTimes(&statX), nil
+}
+
+func statXFile(file *os.File) (Timespec, error) {
+ sc, err := file.SyscallConn()
+ if err != nil {
+ return nil, err
+ }
+
+ var statx unix.Statx_t
+ var statxErr error
+ err = sc.Control(func(fd uintptr) {
+ // https://man7.org/linux/man-pages/man2/statx.2.html
+ statxErr = statxFunc(int(fd), "", unix.AT_EMPTY_PATH|unix.AT_STATX_SYNC_AS_STAT, unix.STATX_ATIME|unix.STATX_MTIME|unix.STATX_CTIME|unix.STATX_BTIME, &statx)
+ })
+ if err != nil {
+ return nil, err
+ }
+
+ if statxErr != nil {
+ return nil, statxErr
+ }
+
+ return extractTimes(&statx), nil
+}
+
+// StatFile returns the Timespec for the given *os.File.
+func StatFile(file *os.File) (Timespec, error) {
+ if isStatXSupported() {
+ ts, err := statXFile(file)
+ if err == nil {
+ return ts, nil
+ }
+ if !isStatXUnsupported(err) {
+ return nil, err
+ }
+ // Fallback.
+ }
+ return statFile(file)
+}
+
+func statFile(file *os.File) (Timespec, error) {
+ fi, err := file.Stat()
+ if err != nil {
+ return nil, err
+ }
+ return getTimespec(fi), nil
+}
+
+func statxTimestampToTime(ts unix.StatxTimestamp) time.Time {
+ return time.Unix(ts.Sec, int64(ts.Nsec))
+}
+
+func extractTimes(statx *unix.Statx_t) Timespec {
+ if statx.Mask&unix.STATX_BTIME == unix.STATX_BTIME {
+ var t timespecBtime
+ t.atime.v = statxTimestampToTime(statx.Atime)
+ t.mtime.v = statxTimestampToTime(statx.Mtime)
+ t.ctime.v = statxTimestampToTime(statx.Ctime)
+ t.btime.v = statxTimestampToTime(statx.Btime)
+ return t
+ }
+
+ var t timespec
+ t.atime.v = statxTimestampToTime(statx.Atime)
+ t.mtime.v = statxTimestampToTime(statx.Mtime)
+ t.ctime.v = statxTimestampToTime(statx.Ctime)
+ return t
+}
+
+func timespecToTime(ts syscall.Timespec) time.Time {
+ return time.Unix(int64(ts.Sec), int64(ts.Nsec))
+}
+
+func getTimespec(fi os.FileInfo) (t timespec) {
+ stat := fi.Sys().(*syscall.Stat_t)
+ t.atime.v = timespecToTime(stat.Atim)
+ t.mtime.v = timespecToTime(stat.Mtim)
+ t.ctime.v = timespecToTime(stat.Ctim)
+ return t
+}
diff --git a/vendor/gopkg.in/djherbis/times.v1/times_nacl.go b/vendor/github.com/djherbis/times/times_nacl.go
similarity index 100%
rename from vendor/gopkg.in/djherbis/times.v1/times_nacl.go
rename to vendor/github.com/djherbis/times/times_nacl.go
diff --git a/vendor/gopkg.in/djherbis/times.v1/times_netbsd.go b/vendor/github.com/djherbis/times/times_netbsd.go
similarity index 100%
rename from vendor/gopkg.in/djherbis/times.v1/times_netbsd.go
rename to vendor/github.com/djherbis/times/times_netbsd.go
diff --git a/vendor/gopkg.in/djherbis/times.v1/times_openbsd.go b/vendor/github.com/djherbis/times/times_openbsd.go
similarity index 100%
rename from vendor/gopkg.in/djherbis/times.v1/times_openbsd.go
rename to vendor/github.com/djherbis/times/times_openbsd.go
diff --git a/vendor/gopkg.in/djherbis/times.v1/times_plan9.go b/vendor/github.com/djherbis/times/times_plan9.go
similarity index 100%
rename from vendor/gopkg.in/djherbis/times.v1/times_plan9.go
rename to vendor/github.com/djherbis/times/times_plan9.go
diff --git a/vendor/gopkg.in/djherbis/times.v1/times_solaris.go b/vendor/github.com/djherbis/times/times_solaris.go
similarity index 100%
rename from vendor/gopkg.in/djherbis/times.v1/times_solaris.go
rename to vendor/github.com/djherbis/times/times_solaris.go
diff --git a/vendor/gopkg.in/djherbis/times.v1/times_linux.go b/vendor/github.com/djherbis/times/times_wasip1.go
similarity index 60%
rename from vendor/gopkg.in/djherbis/times.v1/times_linux.go
rename to vendor/github.com/djherbis/times/times_wasip1.go
index d9eb6976e2c2..5463a8f3c655 100644
--- a/vendor/gopkg.in/djherbis/times.v1/times_linux.go
+++ b/vendor/github.com/djherbis/times/times_wasip1.go
@@ -2,7 +2,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// http://golang.org/src/os/stat_linux.go
+// https://github.com/golang/go/blob/master/src/os/stat_wasip1.go
+
+//go:build wasip1
+// +build wasip1
package times
@@ -26,14 +29,14 @@ type timespec struct {
nobtime
}
-func timespecToTime(ts syscall.Timespec) time.Time {
- return time.Unix(int64(ts.Sec), int64(ts.Nsec))
+func timespecToTime(sec, nsec int64) time.Time {
+ return time.Unix(sec, nsec)
}
func getTimespec(fi os.FileInfo) (t timespec) {
stat := fi.Sys().(*syscall.Stat_t)
- t.atime.v = timespecToTime(stat.Atim)
- t.mtime.v = timespecToTime(stat.Mtim)
- t.ctime.v = timespecToTime(stat.Ctim)
+ t.atime.v = timespecToTime(int64(stat.Atime), 0)
+ t.mtime.v = timespecToTime(int64(stat.Mtime), 0)
+ t.ctime.v = timespecToTime(int64(stat.Ctime), 0)
return t
}
diff --git a/vendor/gopkg.in/djherbis/times.v1/times_windows.go b/vendor/github.com/djherbis/times/times_windows.go
similarity index 100%
rename from vendor/gopkg.in/djherbis/times.v1/times_windows.go
rename to vendor/github.com/djherbis/times/times_windows.go
diff --git a/vendor/gopkg.in/djherbis/times.v1/use_generic_stat.go b/vendor/github.com/djherbis/times/use_generic_stat.go
similarity index 58%
rename from vendor/gopkg.in/djherbis/times.v1/use_generic_stat.go
rename to vendor/github.com/djherbis/times/use_generic_stat.go
index bc51560a8c40..0040aa9dc51e 100644
--- a/vendor/gopkg.in/djherbis/times.v1/use_generic_stat.go
+++ b/vendor/github.com/djherbis/times/use_generic_stat.go
@@ -1,4 +1,4 @@
-// +build !windows
+// +build !windows,!linux
package times
@@ -13,3 +13,12 @@ func Stat(name string) (Timespec, error) {
func Lstat(name string) (Timespec, error) {
return stat(name, os.Lstat)
}
+
+// StatFile returns the Timespec for the given *os.File.
+func StatFile(file *os.File) (Timespec, error) {
+ fi, err := file.Stat()
+ if err != nil {
+ return nil, err
+ }
+ return getTimespec(fi), nil
+}
diff --git a/vendor/github.com/emicklei/go-restful/v3/.travis.yml b/vendor/github.com/emicklei/go-restful/v3/.travis.yml
deleted file mode 100644
index 3a0bf5ff1b81..000000000000
--- a/vendor/github.com/emicklei/go-restful/v3/.travis.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-language: go
-
-go:
- - 1.x
-
-before_install:
- - go test -v
-
-script:
- - go test -race -coverprofile=coverage.txt -covermode=atomic
-
-after_success:
- - bash <(curl -s https://codecov.io/bash)
\ No newline at end of file
diff --git a/vendor/github.com/emicklei/go-restful/v3/CHANGES.md b/vendor/github.com/emicklei/go-restful/v3/CHANGES.md
index 6f24dfff562e..4fcd920abea4 100644
--- a/vendor/github.com/emicklei/go-restful/v3/CHANGES.md
+++ b/vendor/github.com/emicklei/go-restful/v3/CHANGES.md
@@ -1,5 +1,9 @@
# Change history of go-restful
+## [v3.13.0] - 2025-08-14
+
+- optimize performance of path matching in CurlyRouter ( thanks @wenhuang, Wen Huang)
+
## [v3.12.2] - 2025-02-21
- allow empty payloads in post,put,patch, issue #580 ( thanks @liggitt, Jordan Liggitt)
diff --git a/vendor/github.com/emicklei/go-restful/v3/README.md b/vendor/github.com/emicklei/go-restful/v3/README.md
index 3fb40d198087..50a79ab692d7 100644
--- a/vendor/github.com/emicklei/go-restful/v3/README.md
+++ b/vendor/github.com/emicklei/go-restful/v3/README.md
@@ -84,6 +84,7 @@ func (u UserResource) findUser(request *restful.Request, response *restful.Respo
- Configurable (trace) logging
- Customizable gzip/deflate readers and writers using CompressorProvider registration
- Inject your own http.Handler using the `HttpMiddlewareHandlerToFilter` function
+- Added `SetPathTokenCacheEnabled` and `SetCustomVerbCacheEnabled` to disable regexp caching (default=true)
## How to customize
There are several hooks to customize the behavior of the go-restful package.
diff --git a/vendor/github.com/emicklei/go-restful/v3/curly.go b/vendor/github.com/emicklei/go-restful/v3/curly.go
index 6fd2bcd5a117..eec43bfd0674 100644
--- a/vendor/github.com/emicklei/go-restful/v3/curly.go
+++ b/vendor/github.com/emicklei/go-restful/v3/curly.go
@@ -9,11 +9,35 @@ import (
"regexp"
"sort"
"strings"
+ "sync"
)
// CurlyRouter expects Routes with paths that contain zero or more parameters in curly brackets.
type CurlyRouter struct{}
+var (
+ regexCache sync.Map // Cache for compiled regex patterns
+ pathTokenCacheEnabled = true // Enable/disable path token regex caching
+)
+
+// SetPathTokenCacheEnabled enables or disables path token regex caching for CurlyRouter.
+// When disabled, regex patterns will be compiled on every request.
+// When enabled (default), compiled regex patterns are cached for better performance.
+func SetPathTokenCacheEnabled(enabled bool) {
+ pathTokenCacheEnabled = enabled
+}
+
+// getCachedRegexp retrieves a compiled regex from the cache if found and valid.
+// Returns the regex and true if found and valid, nil and false otherwise.
+func getCachedRegexp(cache *sync.Map, pattern string) (*regexp.Regexp, bool) {
+ if cached, found := cache.Load(pattern); found {
+ if regex, ok := cached.(*regexp.Regexp); ok {
+ return regex, true
+ }
+ }
+ return nil, false
+}
+
// SelectRoute is part of the Router interface and returns the best match
// for the WebService and its Route for the given Request.
func (c CurlyRouter) SelectRoute(
@@ -113,8 +137,28 @@ func (c CurlyRouter) regularMatchesPathToken(routeToken string, colon int, reque
}
return true, true
}
- matched, err := regexp.MatchString(regPart, requestToken)
- return (matched && err == nil), false
+
+ // Check cache first (if enabled)
+ if pathTokenCacheEnabled {
+ if regex, found := getCachedRegexp(®exCache, regPart); found {
+ matched := regex.MatchString(requestToken)
+ return matched, false
+ }
+ }
+
+ // Compile the regex
+ regex, err := regexp.Compile(regPart)
+ if err != nil {
+ return false, false
+ }
+
+ // Cache the regex (if enabled)
+ if pathTokenCacheEnabled {
+ regexCache.Store(regPart, regex)
+ }
+
+ matched := regex.MatchString(requestToken)
+ return matched, false
}
var jsr311Router = RouterJSR311{}
@@ -168,7 +212,7 @@ func (c CurlyRouter) computeWebserviceScore(requestTokens []string, routeTokens
if matchesToken {
score++ // extra score for regex match
}
- }
+ }
} else {
// not a parameter
if eachRequestToken != eachRouteToken {
diff --git a/vendor/github.com/emicklei/go-restful/v3/custom_verb.go b/vendor/github.com/emicklei/go-restful/v3/custom_verb.go
index bfc17efde80f..0b98eeb091cd 100644
--- a/vendor/github.com/emicklei/go-restful/v3/custom_verb.go
+++ b/vendor/github.com/emicklei/go-restful/v3/custom_verb.go
@@ -1,14 +1,28 @@
package restful
+// Copyright 2025 Ernest Micklei. All rights reserved.
+// Use of this source code is governed by a license
+// that can be found in the LICENSE file.
+
import (
"fmt"
"regexp"
+ "sync"
)
var (
- customVerbReg = regexp.MustCompile(":([A-Za-z]+)$")
+ customVerbReg = regexp.MustCompile(":([A-Za-z]+)$")
+ customVerbCache sync.Map // Cache for compiled custom verb regexes
+ customVerbCacheEnabled = true // Enable/disable custom verb regex caching
)
+// SetCustomVerbCacheEnabled enables or disables custom verb regex caching.
+// When disabled, custom verb regex patterns will be compiled on every request.
+// When enabled (default), compiled custom verb regex patterns are cached for better performance.
+func SetCustomVerbCacheEnabled(enabled bool) {
+ customVerbCacheEnabled = enabled
+}
+
func hasCustomVerb(routeToken string) bool {
return customVerbReg.MatchString(routeToken)
}
@@ -20,7 +34,23 @@ func isMatchCustomVerb(routeToken string, pathToken string) bool {
}
customVerb := rs[1]
- specificVerbReg := regexp.MustCompile(fmt.Sprintf(":%s$", customVerb))
+ regexPattern := fmt.Sprintf(":%s$", customVerb)
+
+ // Check cache first (if enabled)
+ if customVerbCacheEnabled {
+ if specificVerbReg, found := getCachedRegexp(&customVerbCache, regexPattern); found {
+ return specificVerbReg.MatchString(pathToken)
+ }
+ }
+
+ // Compile the regex
+ specificVerbReg := regexp.MustCompile(regexPattern)
+
+ // Cache the regex (if enabled)
+ if customVerbCacheEnabled {
+ customVerbCache.Store(regexPattern, specificVerbReg)
+ }
+
return specificVerbReg.MatchString(pathToken)
}
diff --git a/vendor/github.com/emicklei/go-restful/v3/doc.go b/vendor/github.com/emicklei/go-restful/v3/doc.go
index 69b13057d017..80809225b8d5 100644
--- a/vendor/github.com/emicklei/go-restful/v3/doc.go
+++ b/vendor/github.com/emicklei/go-restful/v3/doc.go
@@ -1,7 +1,7 @@
/*
Package restful , a lean package for creating REST-style WebServices without magic.
-WebServices and Routes
+### WebServices and Routes
A WebService has a collection of Route objects that dispatch incoming Http Requests to a function calls.
Typically, a WebService has a root path (e.g. /users) and defines common MIME types for its routes.
@@ -30,14 +30,14 @@ The (*Request, *Response) arguments provide functions for reading information fr
See the example https://github.com/emicklei/go-restful/blob/v3/examples/user-resource/restful-user-resource.go with a full implementation.
-Regular expression matching Routes
+### Regular expression matching Routes
A Route parameter can be specified using the format "uri/{var[:regexp]}" or the special version "uri/{var:*}" for matching the tail of the path.
For example, /persons/{name:[A-Z][A-Z]} can be used to restrict values for the parameter "name" to only contain capital alphabetic characters.
Regular expressions must use the standard Go syntax as described in the regexp package. (https://code.google.com/p/re2/wiki/Syntax)
This feature requires the use of a CurlyRouter.
-Containers
+### Containers
A Container holds a collection of WebServices, Filters and a http.ServeMux for multiplexing http requests.
Using the statements "restful.Add(...) and restful.Filter(...)" will register WebServices and Filters to the Default Container.
@@ -47,7 +47,7 @@ You can create your own Container and create a new http.Server for that particul
container := restful.NewContainer()
server := &http.Server{Addr: ":8081", Handler: container}
-Filters
+### Filters
A filter dynamically intercepts requests and responses to transform or use the information contained in the requests or responses.
You can use filters to perform generic logging, measurement, authentication, redirect, set response headers etc.
@@ -60,22 +60,21 @@ Use the following statement to pass the request,response pair to the next filter
chain.ProcessFilter(req, resp)
-Container Filters
+### Container Filters
These are processed before any registered WebService.
// install a (global) filter for the default container (processed before any webservice)
restful.Filter(globalLogging)
-WebService Filters
+### WebService Filters
These are processed before any Route of a WebService.
// install a webservice filter (processed before any route)
ws.Filter(webserviceLogging).Filter(measureTime)
-
-Route Filters
+### Route Filters
These are processed before calling the function associated with the Route.
@@ -84,7 +83,7 @@ These are processed before calling the function associated with the Route.
See the example https://github.com/emicklei/go-restful/blob/v3/examples/filters/restful-filters.go with full implementations.
-Response Encoding
+### Response Encoding
Two encodings are supported: gzip and deflate. To enable this for all responses:
@@ -95,20 +94,20 @@ Alternatively, you can create a Filter that performs the encoding and install it
See the example https://github.com/emicklei/go-restful/blob/v3/examples/encoding/restful-encoding-filter.go
-OPTIONS support
+### OPTIONS support
By installing a pre-defined container filter, your Webservice(s) can respond to the OPTIONS Http request.
Filter(OPTIONSFilter())
-CORS
+### CORS
By installing the filter of a CrossOriginResourceSharing (CORS), your WebService(s) can handle CORS requests.
cors := CrossOriginResourceSharing{ExposeHeaders: []string{"X-My-Header"}, CookiesAllowed: false, Container: DefaultContainer}
Filter(cors.Filter)
-Error Handling
+### Error Handling
Unexpected things happen. If a request cannot be processed because of a failure, your service needs to tell via the response what happened and why.
For this reason HTTP status codes exist and it is important to use the correct code in every exceptional situation.
@@ -137,11 +136,11 @@ The request does not have or has an unknown Accept Header set for this operation
The request does not have or has an unknown Content-Type Header set for this operation.
-ServiceError
+### ServiceError
In addition to setting the correct (error) Http status code, you can choose to write a ServiceError message on the response.
-Performance options
+### Performance options
This package has several options that affect the performance of your service. It is important to understand them and how you can change it.
@@ -156,30 +155,27 @@ Default value is true
If content encoding is enabled then the default strategy for getting new gzip/zlib writers and readers is to use a sync.Pool.
Because writers are expensive structures, performance is even more improved when using a preloaded cache. You can also inject your own implementation.
-Trouble shooting
+### Trouble shooting
This package has the means to produce detail logging of the complete Http request matching process and filter invocation.
Enabling this feature requires you to set an implementation of restful.StdLogger (e.g. log.Logger) instance such as:
restful.TraceLogger(log.New(os.Stdout, "[restful] ", log.LstdFlags|log.Lshortfile))
-Logging
+### Logging
The restful.SetLogger() method allows you to override the logger used by the package. By default restful
uses the standard library `log` package and logs to stdout. Different logging packages are supported as
long as they conform to `StdLogger` interface defined in the `log` sub-package, writing an adapter for your
preferred package is simple.
-Resources
+### Resources
-[project]: https://github.com/emicklei/go-restful
+(c) 2012-2025, http://ernestmicklei.com. MIT License
+[project]: https://github.com/emicklei/go-restful
[examples]: https://github.com/emicklei/go-restful/blob/master/examples
-
-[design]: http://ernestmicklei.com/2012/11/11/go-restful-api-design/
-
+[design]: http://ernestmicklei.com/2012/11/11/go-restful-api-design/
[showcases]: https://github.com/emicklei/mora, https://github.com/emicklei/landskape
-
-(c) 2012-2015, http://ernestmicklei.com. MIT License
*/
package restful
diff --git a/vendor/github.com/evanphx/json-patch/v5/internal/json/encode.go b/vendor/github.com/evanphx/json-patch/v5/internal/json/encode.go
index a1819b16aceb..2e6eca448786 100644
--- a/vendor/github.com/evanphx/json-patch/v5/internal/json/encode.go
+++ b/vendor/github.com/evanphx/json-patch/v5/internal/json/encode.go
@@ -167,6 +167,19 @@ func Marshal(v any) ([]byte, error) {
return buf, nil
}
+func MarshalEscaped(v any, escape bool) ([]byte, error) {
+ e := newEncodeState()
+ defer encodeStatePool.Put(e)
+
+ err := e.marshal(v, encOpts{escapeHTML: escape})
+ if err != nil {
+ return nil, err
+ }
+ buf := append([]byte(nil), e.Bytes()...)
+
+ return buf, nil
+}
+
// MarshalIndent is like Marshal but applies Indent to format the output.
// Each JSON element in the output will begin on a new line beginning with prefix
// followed by one or more copies of indent according to the indentation nesting.
diff --git a/vendor/github.com/evanphx/json-patch/v5/internal/json/stream.go b/vendor/github.com/evanphx/json-patch/v5/internal/json/stream.go
index 1442ef29eff3..5598ce11fe43 100644
--- a/vendor/github.com/evanphx/json-patch/v5/internal/json/stream.go
+++ b/vendor/github.com/evanphx/json-patch/v5/internal/json/stream.go
@@ -6,7 +6,7 @@ package json
import (
"bytes"
- "errors"
+ "encoding/json"
"io"
)
@@ -259,27 +259,7 @@ func (enc *Encoder) SetEscapeHTML(on bool) {
// RawMessage is a raw encoded JSON value.
// It implements Marshaler and Unmarshaler and can
// be used to delay JSON decoding or precompute a JSON encoding.
-type RawMessage []byte
-
-// MarshalJSON returns m as the JSON encoding of m.
-func (m RawMessage) MarshalJSON() ([]byte, error) {
- if m == nil {
- return []byte("null"), nil
- }
- return m, nil
-}
-
-// UnmarshalJSON sets *m to a copy of data.
-func (m *RawMessage) UnmarshalJSON(data []byte) error {
- if m == nil {
- return errors.New("json.RawMessage: UnmarshalJSON on nil pointer")
- }
- *m = append((*m)[0:0], data...)
- return nil
-}
-
-var _ Marshaler = (*RawMessage)(nil)
-var _ Unmarshaler = (*RawMessage)(nil)
+type RawMessage = json.RawMessage
// A Token holds a value of one of these types:
//
diff --git a/vendor/github.com/evanphx/json-patch/v5/merge.go b/vendor/github.com/evanphx/json-patch/v5/merge.go
index bbe9f85f28e1..d60afadcf1e8 100644
--- a/vendor/github.com/evanphx/json-patch/v5/merge.go
+++ b/vendor/github.com/evanphx/json-patch/v5/merge.go
@@ -10,26 +10,26 @@ import (
"github.com/evanphx/json-patch/v5/internal/json"
)
-func merge(cur, patch *lazyNode, mergeMerge bool) *lazyNode {
- curDoc, err := cur.intoDoc()
+func merge(cur, patch *lazyNode, mergeMerge bool, options *ApplyOptions) *lazyNode {
+ curDoc, err := cur.intoDoc(options)
if err != nil {
- pruneNulls(patch)
+ pruneNulls(patch, options)
return patch
}
- patchDoc, err := patch.intoDoc()
+ patchDoc, err := patch.intoDoc(options)
if err != nil {
return patch
}
- mergeDocs(curDoc, patchDoc, mergeMerge)
+ mergeDocs(curDoc, patchDoc, mergeMerge, options)
return cur
}
-func mergeDocs(doc, patch *partialDoc, mergeMerge bool) {
+func mergeDocs(doc, patch *partialDoc, mergeMerge bool, options *ApplyOptions) {
for k, v := range patch.obj {
if v == nil {
if mergeMerge {
@@ -45,55 +45,55 @@ func mergeDocs(doc, patch *partialDoc, mergeMerge bool) {
}
doc.obj[k] = nil
} else {
- _ = doc.remove(k, &ApplyOptions{})
+ _ = doc.remove(k, options)
}
} else {
cur, ok := doc.obj[k]
if !ok || cur == nil {
if !mergeMerge {
- pruneNulls(v)
+ pruneNulls(v, options)
}
- _ = doc.set(k, v, &ApplyOptions{})
+ _ = doc.set(k, v, options)
} else {
- _ = doc.set(k, merge(cur, v, mergeMerge), &ApplyOptions{})
+ _ = doc.set(k, merge(cur, v, mergeMerge, options), options)
}
}
}
}
-func pruneNulls(n *lazyNode) {
- sub, err := n.intoDoc()
+func pruneNulls(n *lazyNode, options *ApplyOptions) {
+ sub, err := n.intoDoc(options)
if err == nil {
- pruneDocNulls(sub)
+ pruneDocNulls(sub, options)
} else {
ary, err := n.intoAry()
if err == nil {
- pruneAryNulls(ary)
+ pruneAryNulls(ary, options)
}
}
}
-func pruneDocNulls(doc *partialDoc) *partialDoc {
+func pruneDocNulls(doc *partialDoc, options *ApplyOptions) *partialDoc {
for k, v := range doc.obj {
if v == nil {
_ = doc.remove(k, &ApplyOptions{})
} else {
- pruneNulls(v)
+ pruneNulls(v, options)
}
}
return doc
}
-func pruneAryNulls(ary *partialArray) *partialArray {
+func pruneAryNulls(ary *partialArray, options *ApplyOptions) *partialArray {
newAry := []*lazyNode{}
for _, v := range ary.nodes {
if v != nil {
- pruneNulls(v)
+ pruneNulls(v, options)
}
newAry = append(newAry, v)
}
@@ -103,8 +103,8 @@ func pruneAryNulls(ary *partialArray) *partialArray {
return ary
}
-var errBadJSONDoc = fmt.Errorf("Invalid JSON Document")
-var errBadJSONPatch = fmt.Errorf("Invalid JSON Patch")
+var ErrBadJSONDoc = fmt.Errorf("Invalid JSON Document")
+var ErrBadJSONPatch = fmt.Errorf("Invalid JSON Patch")
var errBadMergeTypes = fmt.Errorf("Mismatched JSON Documents")
// MergeMergePatches merges two merge patches together, such that
@@ -121,23 +121,29 @@ func MergePatch(docData, patchData []byte) ([]byte, error) {
func doMergePatch(docData, patchData []byte, mergeMerge bool) ([]byte, error) {
if !json.Valid(docData) {
- return nil, errBadJSONDoc
+ return nil, ErrBadJSONDoc
}
if !json.Valid(patchData) {
- return nil, errBadJSONPatch
+ return nil, ErrBadJSONPatch
}
- doc := &partialDoc{}
+ options := NewApplyOptions()
+
+ doc := &partialDoc{
+ opts: options,
+ }
docErr := doc.UnmarshalJSON(docData)
- patch := &partialDoc{}
+ patch := &partialDoc{
+ opts: options,
+ }
patchErr := patch.UnmarshalJSON(patchData)
if isSyntaxError(docErr) {
- return nil, errBadJSONDoc
+ return nil, ErrBadJSONDoc
}
if isSyntaxError(patchErr) {
@@ -145,7 +151,7 @@ func doMergePatch(docData, patchData []byte, mergeMerge bool) ([]byte, error) {
}
if docErr == nil && doc.obj == nil {
- return nil, errBadJSONDoc
+ return nil, ErrBadJSONDoc
}
if patchErr == nil && patch.obj == nil {
@@ -158,7 +164,7 @@ func doMergePatch(docData, patchData []byte, mergeMerge bool) ([]byte, error) {
if mergeMerge {
doc = patch
} else {
- doc = pruneDocNulls(patch)
+ doc = pruneDocNulls(patch, options)
}
} else {
patchAry := &partialArray{}
@@ -169,21 +175,21 @@ func doMergePatch(docData, patchData []byte, mergeMerge bool) ([]byte, error) {
if json.Valid(patchData) {
return patchData, nil
}
- return nil, errBadJSONPatch
+ return nil, ErrBadJSONPatch
}
- pruneAryNulls(patchAry)
+ pruneAryNulls(patchAry, options)
out, patchErr := json.Marshal(patchAry.nodes)
if patchErr != nil {
- return nil, errBadJSONPatch
+ return nil, ErrBadJSONPatch
}
return out, nil
}
} else {
- mergeDocs(doc, patch, mergeMerge)
+ mergeDocs(doc, patch, mergeMerge, options)
}
return json.Marshal(doc)
@@ -250,12 +256,12 @@ func createObjectMergePatch(originalJSON, modifiedJSON []byte) ([]byte, error) {
err := unmarshal(originalJSON, &originalDoc)
if err != nil {
- return nil, errBadJSONDoc
+ return nil, ErrBadJSONDoc
}
err = unmarshal(modifiedJSON, &modifiedDoc)
if err != nil {
- return nil, errBadJSONDoc
+ return nil, ErrBadJSONDoc
}
dest, err := getDiff(originalDoc, modifiedDoc)
@@ -280,17 +286,17 @@ func createArrayMergePatch(originalJSON, modifiedJSON []byte) ([]byte, error) {
err := unmarshal(originalJSON, &originalDocs)
if err != nil {
- return nil, errBadJSONDoc
+ return nil, ErrBadJSONDoc
}
err = unmarshal(modifiedJSON, &modifiedDocs)
if err != nil {
- return nil, errBadJSONDoc
+ return nil, ErrBadJSONDoc
}
total := len(originalDocs)
if len(modifiedDocs) != total {
- return nil, errBadJSONDoc
+ return nil, ErrBadJSONDoc
}
result := []json.RawMessage{}
diff --git a/vendor/github.com/evanphx/json-patch/v5/patch.go b/vendor/github.com/evanphx/json-patch/v5/patch.go
index a3bbf1c73b81..83102e5570ad 100644
--- a/vendor/github.com/evanphx/json-patch/v5/patch.go
+++ b/vendor/github.com/evanphx/json-patch/v5/patch.go
@@ -2,13 +2,13 @@ package jsonpatch
import (
"bytes"
+ "errors"
"fmt"
"strconv"
"strings"
"unicode"
"github.com/evanphx/json-patch/v5/internal/json"
- "github.com/pkg/errors"
)
const (
@@ -38,6 +38,8 @@ var (
ErrInvalid = errors.New("invalid state detected")
ErrInvalidIndex = errors.New("invalid index referenced")
+ ErrExpectedObject = errors.New("invalid value, expected object")
+
rawJSONArray = []byte("[]")
rawJSONObject = []byte("{}")
rawJSONNull = []byte("null")
@@ -60,6 +62,8 @@ type partialDoc struct {
self *lazyNode
keys []string
obj map[string]*lazyNode
+
+ opts *ApplyOptions
}
type partialArray struct {
@@ -90,6 +94,8 @@ type ApplyOptions struct {
// EnsurePathExistsOnAdd instructs json-patch to recursively create the missing parts of path on "add" operation.
// Default to false.
EnsurePathExistsOnAdd bool
+
+ EscapeHTML bool
}
// NewApplyOptions creates a default set of options for calls to ApplyWithOptions.
@@ -99,6 +105,7 @@ func NewApplyOptions() *ApplyOptions {
AccumulatedCopySizeLimit: AccumulatedCopySizeLimit,
AllowMissingPathOnRemove: false,
EnsurePathExistsOnAdd: false,
+ EscapeHTML: true,
}
}
@@ -134,16 +141,28 @@ func (n *lazyNode) UnmarshalJSON(data []byte) error {
}
func (n *partialDoc) TrustMarshalJSON(buf *bytes.Buffer) error {
+ if n.obj == nil {
+ return ErrExpectedObject
+ }
+
if err := buf.WriteByte('{'); err != nil {
return err
}
+ escaped := true
+
+ // n.opts should always be set, but in case we missed a case,
+ // guard.
+ if n.opts != nil {
+ escaped = n.opts.EscapeHTML
+ }
+
for i, k := range n.keys {
if i > 0 {
if err := buf.WriteByte(','); err != nil {
return err
}
}
- key, err := json.Marshal(k)
+ key, err := json.MarshalEscaped(k, escaped)
if err != nil {
return err
}
@@ -153,7 +172,7 @@ func (n *partialDoc) TrustMarshalJSON(buf *bytes.Buffer) error {
if err := buf.WriteByte(':'); err != nil {
return err
}
- value, err := json.Marshal(n.obj[k])
+ value, err := json.MarshalEscaped(n.obj[k], escaped)
if err != nil {
return err
}
@@ -194,11 +213,11 @@ func (n *partialArray) RedirectMarshalJSON() (interface{}, error) {
return n.nodes, nil
}
-func deepCopy(src *lazyNode) (*lazyNode, int, error) {
+func deepCopy(src *lazyNode, options *ApplyOptions) (*lazyNode, int, error) {
if src == nil {
return nil, 0, nil
}
- a, err := json.Marshal(src)
+ a, err := json.MarshalEscaped(src, options.EscapeHTML)
if err != nil {
return nil, 0, err
}
@@ -216,7 +235,7 @@ func (n *lazyNode) nextByte() byte {
return s[0]
}
-func (n *lazyNode) intoDoc() (*partialDoc, error) {
+func (n *lazyNode) intoDoc(options *ApplyOptions) (*partialDoc, error) {
if n.which == eDoc {
return n.doc, nil
}
@@ -235,6 +254,7 @@ func (n *lazyNode) intoDoc() (*partialDoc, error) {
return nil, ErrInvalid
}
+ n.doc.opts = options
if err != nil {
return nil, err
}
@@ -441,7 +461,7 @@ func (o Operation) Path() (string, error) {
return op, nil
}
- return "unknown", errors.Wrapf(ErrMissing, "operation missing path field")
+ return "unknown", fmt.Errorf("operation missing path field: %w", ErrMissing)
}
// From reads the "from" field of the Operation.
@@ -458,7 +478,7 @@ func (o Operation) From() (string, error) {
return op, nil
}
- return "unknown", errors.Wrapf(ErrMissing, "operation, missing from field")
+ return "unknown", fmt.Errorf("operation, missing from field: %w", ErrMissing)
}
func (o Operation) value() *lazyNode {
@@ -491,7 +511,7 @@ func (o Operation) ValueInterface() (interface{}, error) {
return v, nil
}
- return nil, errors.Wrapf(ErrMissing, "operation, missing value field")
+ return nil, fmt.Errorf("operation, missing value field: %w", ErrMissing)
}
func isArray(buf []byte) bool {
@@ -545,7 +565,7 @@ func findObject(pd *container, path string, options *ApplyOptions) (container, s
return nil, ""
}
} else {
- doc, err = next.intoDoc()
+ doc, err = next.intoDoc(options)
if err != nil {
return nil, ""
@@ -557,6 +577,10 @@ func findObject(pd *container, path string, options *ApplyOptions) (container, s
}
func (d *partialDoc) set(key string, val *lazyNode, options *ApplyOptions) error {
+ if d.obj == nil {
+ return ErrExpectedObject
+ }
+
found := false
for _, k := range d.keys {
if k == key {
@@ -579,20 +603,29 @@ func (d *partialDoc) get(key string, options *ApplyOptions) (*lazyNode, error) {
if key == "" {
return d.self, nil
}
+
+ if d.obj == nil {
+ return nil, ErrExpectedObject
+ }
+
v, ok := d.obj[key]
if !ok {
- return v, errors.Wrapf(ErrMissing, "unable to get nonexistent key: %s", key)
+ return v, fmt.Errorf("unable to get nonexistent key: %s: %w", key, ErrMissing)
}
return v, nil
}
func (d *partialDoc) remove(key string, options *ApplyOptions) error {
+ if d.obj == nil {
+ return ErrExpectedObject
+ }
+
_, ok := d.obj[key]
if !ok {
if options.AllowMissingPathOnRemove {
return nil
}
- return errors.Wrapf(ErrMissing, "unable to remove nonexistent key: %s", key)
+ return fmt.Errorf("unable to remove nonexistent key: %s: %w", key, ErrMissing)
}
idx := -1
for i, k := range d.keys {
@@ -616,10 +649,10 @@ func (d *partialArray) set(key string, val *lazyNode, options *ApplyOptions) err
if idx < 0 {
if !options.SupportNegativeIndices {
- return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
+ return fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
if idx < -len(d.nodes) {
- return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
+ return fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
idx += len(d.nodes)
}
@@ -636,7 +669,7 @@ func (d *partialArray) add(key string, val *lazyNode, options *ApplyOptions) err
idx, err := strconv.Atoi(key)
if err != nil {
- return errors.Wrapf(err, "value was not a proper array index: '%s'", key)
+ return fmt.Errorf("value was not a proper array index: '%s': %w", key, err)
}
sz := len(d.nodes) + 1
@@ -646,15 +679,15 @@ func (d *partialArray) add(key string, val *lazyNode, options *ApplyOptions) err
cur := d
if idx >= len(ary) {
- return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
+ return fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
if idx < 0 {
if !options.SupportNegativeIndices {
- return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
+ return fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
if idx < -len(ary) {
- return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
+ return fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
idx += len(ary)
}
@@ -680,16 +713,16 @@ func (d *partialArray) get(key string, options *ApplyOptions) (*lazyNode, error)
if idx < 0 {
if !options.SupportNegativeIndices {
- return nil, errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
+ return nil, fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
if idx < -len(d.nodes) {
- return nil, errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
+ return nil, fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
idx += len(d.nodes)
}
if idx >= len(d.nodes) {
- return nil, errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
+ return nil, fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
return d.nodes[idx], nil
@@ -707,18 +740,18 @@ func (d *partialArray) remove(key string, options *ApplyOptions) error {
if options.AllowMissingPathOnRemove {
return nil
}
- return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
+ return fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
if idx < 0 {
if !options.SupportNegativeIndices {
- return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
+ return fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
if idx < -len(cur.nodes) {
if options.AllowMissingPathOnRemove {
return nil
}
- return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx)
+ return fmt.Errorf("Unable to access invalid index: %d: %w", idx, ErrInvalidIndex)
}
idx += len(cur.nodes)
}
@@ -735,7 +768,7 @@ func (d *partialArray) remove(key string, options *ApplyOptions) error {
func (p Patch) add(doc *container, op Operation, options *ApplyOptions) error {
path, err := op.Path()
if err != nil {
- return errors.Wrapf(ErrMissing, "add operation failed to decode path")
+ return fmt.Errorf("add operation failed to decode path: %w", ErrMissing)
}
// special case, adding to empty means replacing the container with the value given
@@ -750,6 +783,7 @@ func (p Patch) add(doc *container, op Operation, options *ApplyOptions) error {
} else {
pd = &partialDoc{
self: val,
+ opts: options,
}
}
@@ -775,12 +809,12 @@ func (p Patch) add(doc *container, op Operation, options *ApplyOptions) error {
con, key := findObject(doc, path, options)
if con == nil {
- return errors.Wrapf(ErrMissing, "add operation does not apply: doc is missing path: \"%s\"", path)
+ return fmt.Errorf("add operation does not apply: doc is missing path: \"%s\": %w", path, ErrMissing)
}
err = con.add(key, op.value(), options)
if err != nil {
- return errors.Wrapf(err, "error in add for path: '%s'", path)
+ return fmt.Errorf("error in add for path: '%s': %w", path, err)
}
return nil
@@ -833,11 +867,11 @@ func ensurePathExists(pd *container, path string, options *ApplyOptions) error {
if arrIndex < 0 {
if !options.SupportNegativeIndices {
- return errors.Wrapf(ErrInvalidIndex, "Unable to ensure path for invalid index: %d", arrIndex)
+ return fmt.Errorf("Unable to ensure path for invalid index: %d: %w", arrIndex, ErrInvalidIndex)
}
if arrIndex < -1 {
- return errors.Wrapf(ErrInvalidIndex, "Unable to ensure path for negative index other than -1: %d", arrIndex)
+ return fmt.Errorf("Unable to ensure path for negative index other than -1: %d: %w", arrIndex, ErrInvalidIndex)
}
arrIndex = 0
@@ -855,7 +889,7 @@ func ensurePathExists(pd *container, path string, options *ApplyOptions) error {
newNode := newLazyNode(newRawMessage(rawJSONObject))
doc.add(part, newNode, options)
- doc, err = newNode.intoDoc()
+ doc, err = newNode.intoDoc(options)
if err != nil {
return err
}
@@ -868,7 +902,7 @@ func ensurePathExists(pd *container, path string, options *ApplyOptions) error {
return err
}
} else {
- doc, err = target.intoDoc()
+ doc, err = target.intoDoc(options)
if err != nil {
return err
@@ -884,11 +918,11 @@ func validateOperation(op Operation) error {
switch op.Kind() {
case "add", "replace":
if _, err := op.ValueInterface(); err != nil {
- return errors.Wrapf(err, "failed to decode 'value'")
+ return fmt.Errorf("failed to decode 'value': %w", err)
}
case "move", "copy":
if _, err := op.From(); err != nil {
- return errors.Wrapf(err, "failed to decode 'from'")
+ return fmt.Errorf("failed to decode 'from': %w", err)
}
case "remove", "test":
default:
@@ -896,7 +930,7 @@ func validateOperation(op Operation) error {
}
if _, err := op.Path(); err != nil {
- return errors.Wrapf(err, "failed to decode 'path'")
+ return fmt.Errorf("failed to decode 'path': %w", err)
}
return nil
@@ -907,10 +941,10 @@ func validatePatch(p Patch) error {
if err := validateOperation(op); err != nil {
opData, infoErr := json.Marshal(op)
if infoErr != nil {
- return errors.Wrapf(err, "invalid operation")
+ return fmt.Errorf("invalid operation: %w", err)
}
- return errors.Wrapf(err, "invalid operation %s", opData)
+ return fmt.Errorf("invalid operation %s: %w", opData, err)
}
}
@@ -920,7 +954,7 @@ func validatePatch(p Patch) error {
func (p Patch) remove(doc *container, op Operation, options *ApplyOptions) error {
path, err := op.Path()
if err != nil {
- return errors.Wrapf(ErrMissing, "remove operation failed to decode path")
+ return fmt.Errorf("remove operation failed to decode path: %w", ErrMissing)
}
con, key := findObject(doc, path, options)
@@ -929,12 +963,12 @@ func (p Patch) remove(doc *container, op Operation, options *ApplyOptions) error
if options.AllowMissingPathOnRemove {
return nil
}
- return errors.Wrapf(ErrMissing, "remove operation does not apply: doc is missing path: \"%s\"", path)
+ return fmt.Errorf("remove operation does not apply: doc is missing path: \"%s\": %w", path, ErrMissing)
}
err = con.remove(key, options)
if err != nil {
- return errors.Wrapf(err, "error in remove for path: '%s'", path)
+ return fmt.Errorf("error in remove for path: '%s': %w", path, err)
}
return nil
@@ -943,7 +977,7 @@ func (p Patch) remove(doc *container, op Operation, options *ApplyOptions) error
func (p Patch) replace(doc *container, op Operation, options *ApplyOptions) error {
path, err := op.Path()
if err != nil {
- return errors.Wrapf(err, "replace operation failed to decode path")
+ return fmt.Errorf("replace operation failed to decode path: %w", err)
}
if path == "" {
@@ -952,8 +986,10 @@ func (p Patch) replace(doc *container, op Operation, options *ApplyOptions) erro
if val.which == eRaw {
if !val.tryDoc() {
if !val.tryAry() {
- return errors.Wrapf(err, "replace operation value must be object or array")
+ return fmt.Errorf("replace operation value must be object or array: %w", err)
}
+ } else {
+ val.doc.opts = options
}
}
@@ -963,7 +999,7 @@ func (p Patch) replace(doc *container, op Operation, options *ApplyOptions) erro
case eDoc:
*doc = val.doc
case eRaw:
- return errors.Wrapf(err, "replace operation hit impossible case")
+ return fmt.Errorf("replace operation hit impossible case: %w", err)
}
return nil
@@ -972,17 +1008,17 @@ func (p Patch) replace(doc *container, op Operation, options *ApplyOptions) erro
con, key := findObject(doc, path, options)
if con == nil {
- return errors.Wrapf(ErrMissing, "replace operation does not apply: doc is missing path: %s", path)
+ return fmt.Errorf("replace operation does not apply: doc is missing path: %s: %w", path, ErrMissing)
}
_, ok := con.get(key, options)
if ok != nil {
- return errors.Wrapf(ErrMissing, "replace operation does not apply: doc is missing key: %s", path)
+ return fmt.Errorf("replace operation does not apply: doc is missing key: %s: %w", path, ErrMissing)
}
err = con.set(key, op.value(), options)
if err != nil {
- return errors.Wrapf(err, "error in remove for path: '%s'", path)
+ return fmt.Errorf("error in remove for path: '%s': %w", path, err)
}
return nil
@@ -991,43 +1027,43 @@ func (p Patch) replace(doc *container, op Operation, options *ApplyOptions) erro
func (p Patch) move(doc *container, op Operation, options *ApplyOptions) error {
from, err := op.From()
if err != nil {
- return errors.Wrapf(err, "move operation failed to decode from")
+ return fmt.Errorf("move operation failed to decode from: %w", err)
}
if from == "" {
- return errors.Wrapf(ErrInvalid, "unable to move entire document to another path")
+ return fmt.Errorf("unable to move entire document to another path: %w", ErrInvalid)
}
con, key := findObject(doc, from, options)
if con == nil {
- return errors.Wrapf(ErrMissing, "move operation does not apply: doc is missing from path: %s", from)
+ return fmt.Errorf("move operation does not apply: doc is missing from path: %s: %w", from, ErrMissing)
}
val, err := con.get(key, options)
if err != nil {
- return errors.Wrapf(err, "error in move for path: '%s'", key)
+ return fmt.Errorf("error in move for path: '%s': %w", key, err)
}
err = con.remove(key, options)
if err != nil {
- return errors.Wrapf(err, "error in move for path: '%s'", key)
+ return fmt.Errorf("error in move for path: '%s': %w", key, err)
}
path, err := op.Path()
if err != nil {
- return errors.Wrapf(err, "move operation failed to decode path")
+ return fmt.Errorf("move operation failed to decode path: %w", err)
}
con, key = findObject(doc, path, options)
if con == nil {
- return errors.Wrapf(ErrMissing, "move operation does not apply: doc is missing destination path: %s", path)
+ return fmt.Errorf("move operation does not apply: doc is missing destination path: %s: %w", path, ErrMissing)
}
err = con.add(key, val, options)
if err != nil {
- return errors.Wrapf(err, "error in move for path: '%s'", path)
+ return fmt.Errorf("error in move for path: '%s': %w", path, err)
}
return nil
@@ -1036,7 +1072,7 @@ func (p Patch) move(doc *container, op Operation, options *ApplyOptions) error {
func (p Patch) test(doc *container, op Operation, options *ApplyOptions) error {
path, err := op.Path()
if err != nil {
- return errors.Wrapf(err, "test operation failed to decode path")
+ return fmt.Errorf("test operation failed to decode path: %w", err)
}
if path == "" {
@@ -1055,18 +1091,18 @@ func (p Patch) test(doc *container, op Operation, options *ApplyOptions) error {
return nil
}
- return errors.Wrapf(ErrTestFailed, "testing value %s failed", path)
+ return fmt.Errorf("testing value %s failed: %w", path, ErrTestFailed)
}
con, key := findObject(doc, path, options)
if con == nil {
- return errors.Wrapf(ErrMissing, "test operation does not apply: is missing path: %s", path)
+ return fmt.Errorf("test operation does not apply: is missing path: %s: %w", path, ErrMissing)
}
val, err := con.get(key, options)
- if err != nil && errors.Cause(err) != ErrMissing {
- return errors.Wrapf(err, "error in test for path: '%s'", path)
+ if err != nil && errors.Unwrap(err) != ErrMissing {
+ return fmt.Errorf("error in test for path: '%s': %w", path, err)
}
ov := op.value()
@@ -1075,49 +1111,49 @@ func (p Patch) test(doc *container, op Operation, options *ApplyOptions) error {
if ov.isNull() {
return nil
}
- return errors.Wrapf(ErrTestFailed, "testing value %s failed", path)
+ return fmt.Errorf("testing value %s failed: %w", path, ErrTestFailed)
} else if ov.isNull() {
- return errors.Wrapf(ErrTestFailed, "testing value %s failed", path)
+ return fmt.Errorf("testing value %s failed: %w", path, ErrTestFailed)
}
if val.equal(op.value()) {
return nil
}
- return errors.Wrapf(ErrTestFailed, "testing value %s failed", path)
+ return fmt.Errorf("testing value %s failed: %w", path, ErrTestFailed)
}
func (p Patch) copy(doc *container, op Operation, accumulatedCopySize *int64, options *ApplyOptions) error {
from, err := op.From()
if err != nil {
- return errors.Wrapf(err, "copy operation failed to decode from")
+ return fmt.Errorf("copy operation failed to decode from: %w", err)
}
con, key := findObject(doc, from, options)
if con == nil {
- return errors.Wrapf(ErrMissing, "copy operation does not apply: doc is missing from path: \"%s\"", from)
+ return fmt.Errorf("copy operation does not apply: doc is missing from path: \"%s\": %w", from, ErrMissing)
}
val, err := con.get(key, options)
if err != nil {
- return errors.Wrapf(err, "error in copy for from: '%s'", from)
+ return fmt.Errorf("error in copy for from: '%s': %w", from, err)
}
path, err := op.Path()
if err != nil {
- return errors.Wrapf(ErrMissing, "copy operation failed to decode path")
+ return fmt.Errorf("copy operation failed to decode path: %w", ErrMissing)
}
con, key = findObject(doc, path, options)
if con == nil {
- return errors.Wrapf(ErrMissing, "copy operation does not apply: doc is missing destination path: %s", path)
+ return fmt.Errorf("copy operation does not apply: doc is missing destination path: %s: %w", path, ErrMissing)
}
- valCopy, sz, err := deepCopy(val)
+ valCopy, sz, err := deepCopy(val, options)
if err != nil {
- return errors.Wrapf(err, "error while performing deep copy")
+ return fmt.Errorf("error while performing deep copy: %w", err)
}
(*accumulatedCopySize) += int64(sz)
@@ -1127,7 +1163,7 @@ func (p Patch) copy(doc *container, op Operation, accumulatedCopySize *int64, op
err = con.add(key, valCopy, options)
if err != nil {
- return errors.Wrapf(err, "error while adding value during copy")
+ return fmt.Errorf("error while adding value during copy: %w", err)
}
return nil
@@ -1202,6 +1238,7 @@ func (p Patch) ApplyIndentWithOptions(doc []byte, indent string, options *ApplyO
} else {
pd = &partialDoc{
self: self,
+ opts: options,
}
}
@@ -1238,11 +1275,18 @@ func (p Patch) ApplyIndentWithOptions(doc []byte, indent string, options *ApplyO
}
}
- if indent != "" {
- return json.MarshalIndent(pd, "", indent)
+ data, err := json.MarshalEscaped(pd, options.EscapeHTML)
+ if err != nil {
+ return nil, err
+ }
+
+ if indent == "" {
+ return data, nil
}
- return json.Marshal(pd)
+ var buf bytes.Buffer
+ json.Indent(&buf, data, "", indent)
+ return buf.Bytes(), nil
}
// From http://tools.ietf.org/html/rfc6901#section-4 :
diff --git a/vendor/github.com/exponent-io/jsonpath/.travis.yml b/vendor/github.com/exponent-io/jsonpath/.travis.yml
index f4f458a416d4..53bb8b3f9529 100644
--- a/vendor/github.com/exponent-io/jsonpath/.travis.yml
+++ b/vendor/github.com/exponent-io/jsonpath/.travis.yml
@@ -1,5 +1,7 @@
language: go
-
+arch:
+ - amd64
+ - ppc64le
go:
- - 1.5
+ - 1.15
- tip
diff --git a/vendor/github.com/exponent-io/jsonpath/decoder.go b/vendor/github.com/exponent-io/jsonpath/decoder.go
index 31de46c73813..5e3a06548afd 100644
--- a/vendor/github.com/exponent-io/jsonpath/decoder.go
+++ b/vendor/github.com/exponent-io/jsonpath/decoder.go
@@ -39,16 +39,15 @@ func NewDecoder(r io.Reader) *Decoder {
// Decoder is intended to be used with a stream of tokens. As a result it navigates forward only.
func (d *Decoder) SeekTo(path ...interface{}) (bool, error) {
- if len(path) == 0 {
- return len(d.path) == 0, nil
- }
- last := len(path) - 1
- if i, ok := path[last].(int); ok {
- path[last] = i - 1
+ if len(path) > 0 {
+ last := len(path) - 1
+ if i, ok := path[last].(int); ok {
+ path[last] = i - 1
+ }
}
for {
- if d.path.Equal(path) {
+ if len(path) == len(d.path) && d.path.Equal(path) {
return true, nil
}
_, err := d.Token()
diff --git a/vendor/github.com/fsnotify/fsnotify/.cirrus.yml b/vendor/github.com/fsnotify/fsnotify/.cirrus.yml
index ffc7b992b3c7..7f257e99ac9e 100644
--- a/vendor/github.com/fsnotify/fsnotify/.cirrus.yml
+++ b/vendor/github.com/fsnotify/fsnotify/.cirrus.yml
@@ -1,7 +1,7 @@
freebsd_task:
name: 'FreeBSD'
freebsd_instance:
- image_family: freebsd-13-2
+ image_family: freebsd-14-2
install_script:
- pkg update -f
- pkg install -y go
@@ -9,5 +9,6 @@ freebsd_task:
# run tests as user "cirrus" instead of root
- pw useradd cirrus -m
- chown -R cirrus:cirrus .
- - FSNOTIFY_BUFFER=4096 sudo --preserve-env=FSNOTIFY_BUFFER -u cirrus go test -parallel 1 -race ./...
- - sudo --preserve-env=FSNOTIFY_BUFFER -u cirrus go test -parallel 1 -race ./...
+ - FSNOTIFY_BUFFER=4096 sudo --preserve-env=FSNOTIFY_BUFFER -u cirrus go test -parallel 1 -race ./...
+ - sudo --preserve-env=FSNOTIFY_BUFFER -u cirrus go test -parallel 1 -race ./...
+ - FSNOTIFY_DEBUG=1 sudo --preserve-env=FSNOTIFY_BUFFER -u cirrus go test -parallel 1 -race -v ./...
diff --git a/vendor/github.com/fsnotify/fsnotify/.editorconfig b/vendor/github.com/fsnotify/fsnotify/.editorconfig
deleted file mode 100644
index fad895851e56..000000000000
--- a/vendor/github.com/fsnotify/fsnotify/.editorconfig
+++ /dev/null
@@ -1,12 +0,0 @@
-root = true
-
-[*.go]
-indent_style = tab
-indent_size = 4
-insert_final_newline = true
-
-[*.{yml,yaml}]
-indent_style = space
-indent_size = 2
-insert_final_newline = true
-trim_trailing_whitespace = true
diff --git a/vendor/github.com/fsnotify/fsnotify/.gitattributes b/vendor/github.com/fsnotify/fsnotify/.gitattributes
deleted file mode 100644
index 32f1001be0a5..000000000000
--- a/vendor/github.com/fsnotify/fsnotify/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-go.sum linguist-generated
diff --git a/vendor/github.com/fsnotify/fsnotify/.gitignore b/vendor/github.com/fsnotify/fsnotify/.gitignore
index 391cc076b126..daea9dd6d6d2 100644
--- a/vendor/github.com/fsnotify/fsnotify/.gitignore
+++ b/vendor/github.com/fsnotify/fsnotify/.gitignore
@@ -5,3 +5,6 @@
# Output of go build ./cmd/fsnotify
/fsnotify
/fsnotify.exe
+
+/test/kqueue
+/test/a.out
diff --git a/vendor/github.com/fsnotify/fsnotify/CHANGELOG.md b/vendor/github.com/fsnotify/fsnotify/CHANGELOG.md
index e0e57575496c..6468d2cf400f 100644
--- a/vendor/github.com/fsnotify/fsnotify/CHANGELOG.md
+++ b/vendor/github.com/fsnotify/fsnotify/CHANGELOG.md
@@ -1,8 +1,69 @@
# Changelog
-Unreleased
-----------
-Nothing yet.
+1.9.0 2024-04-04
+----------------
+
+### Changes and fixes
+
+- all: make BufferedWatcher buffered again ([#657])
+
+- inotify: fix race when adding/removing watches while a watched path is being
+ deleted ([#678], [#686])
+
+- inotify: don't send empty event if a watched path is unmounted ([#655])
+
+- inotify: don't register duplicate watches when watching both a symlink and its
+ target; previously that would get "half-added" and removing the second would
+ panic ([#679])
+
+- kqueue: fix watching relative symlinks ([#681])
+
+- kqueue: correctly mark pre-existing entries when watching a link to a dir on
+ kqueue ([#682])
+
+- illumos: don't send error if changed file is deleted while processing the
+ event ([#678])
+
+
+[#657]: https://github.com/fsnotify/fsnotify/pull/657
+[#678]: https://github.com/fsnotify/fsnotify/pull/678
+[#686]: https://github.com/fsnotify/fsnotify/pull/686
+[#655]: https://github.com/fsnotify/fsnotify/pull/655
+[#681]: https://github.com/fsnotify/fsnotify/pull/681
+[#679]: https://github.com/fsnotify/fsnotify/pull/679
+[#682]: https://github.com/fsnotify/fsnotify/pull/682
+
+1.8.0 2024-10-31
+----------------
+
+### Additions
+
+- all: add `FSNOTIFY_DEBUG` to print debug logs to stderr ([#619])
+
+### Changes and fixes
+
+- windows: fix behaviour of `WatchList()` to be consistent with other platforms ([#610])
+
+- kqueue: ignore events with Ident=0 ([#590])
+
+- kqueue: set O_CLOEXEC to prevent passing file descriptors to children ([#617])
+
+- kqueue: emit events as "/path/dir/file" instead of "path/link/file" when watching a symlink ([#625])
+
+- inotify: don't send event for IN_DELETE_SELF when also watching the parent ([#620])
+
+- inotify: fix panic when calling Remove() in a goroutine ([#650])
+
+- fen: allow watching subdirectories of watched directories ([#621])
+
+[#590]: https://github.com/fsnotify/fsnotify/pull/590
+[#610]: https://github.com/fsnotify/fsnotify/pull/610
+[#617]: https://github.com/fsnotify/fsnotify/pull/617
+[#619]: https://github.com/fsnotify/fsnotify/pull/619
+[#620]: https://github.com/fsnotify/fsnotify/pull/620
+[#621]: https://github.com/fsnotify/fsnotify/pull/621
+[#625]: https://github.com/fsnotify/fsnotify/pull/625
+[#650]: https://github.com/fsnotify/fsnotify/pull/650
1.7.0 - 2023-10-22
------------------
diff --git a/vendor/github.com/fsnotify/fsnotify/CONTRIBUTING.md b/vendor/github.com/fsnotify/fsnotify/CONTRIBUTING.md
index ea379759d51a..4cc40fa597d8 100644
--- a/vendor/github.com/fsnotify/fsnotify/CONTRIBUTING.md
+++ b/vendor/github.com/fsnotify/fsnotify/CONTRIBUTING.md
@@ -1,7 +1,7 @@
Thank you for your interest in contributing to fsnotify! We try to review and
merge PRs in a reasonable timeframe, but please be aware that:
-- To avoid "wasted" work, please discus changes on the issue tracker first. You
+- To avoid "wasted" work, please discuss changes on the issue tracker first. You
can just send PRs, but they may end up being rejected for one reason or the
other.
@@ -20,6 +20,125 @@ platforms. Testing different platforms locally can be done with something like
Use the `-short` flag to make the "stress test" run faster.
+Writing new tests
+-----------------
+Scripts in the testdata directory allow creating test cases in a "shell-like"
+syntax. The basic format is:
+
+ script
+
+ Output:
+ desired output
+
+For example:
+
+ # Create a new empty file with some data.
+ watch /
+ echo data >/file
+
+ Output:
+ create /file
+ write /file
+
+Just create a new file to add a new test; select which tests to run with
+`-run TestScript/[path]`.
+
+script
+------
+The script is a "shell-like" script:
+
+ cmd arg arg
+
+Comments are supported with `#`:
+
+ # Comment
+ cmd arg arg # Comment
+
+All operations are done in a temp directory; a path like "/foo" is rewritten to
+"/tmp/TestFoo/foo".
+
+Arguments can be quoted with `"` or `'`; there are no escapes and they're
+functionally identical right now, but this may change in the future, so best to
+assume shell-like rules.
+
+ touch "/file with spaces"
+
+End-of-line escapes with `\` are not supported.
+
+### Supported commands
+
+ watch path [ops] # Watch the path, reporting events for it. Nothing is
+ # watched by default. Optionally a list of ops can be
+ # given, as with AddWith(path, WithOps(...)).
+ unwatch path # Stop watching the path.
+ watchlist n # Assert watchlist length.
+
+ stop # Stop running the script; for debugging.
+ debug [yes/no] # Enable/disable FSNOTIFY_DEBUG (tests are run in
+ parallel by default, so -parallel=1 is probably a good
+ idea).
+ print [any strings] # Print text to stdout; for debugging.
+
+ touch path
+ mkdir [-p] dir
+ ln -s target link # Only ln -s supported.
+ mkfifo path
+ mknod dev path
+ mv src dst
+ rm [-r] path
+ chmod mode path # Octal only
+ sleep time-in-ms
+
+ cat path # Read path (does nothing with the data; just reads it).
+ echo str >>path # Append "str" to "path".
+ echo str >path # Truncate "path" and write "str".
+
+ require reason # Skip the test if "reason" is true; "skip" and
+ skip reason # "require" behave identical; it supports both for
+ # readability. Possible reasons are:
+ #
+ # always Always skip this test.
+ # symlink Symlinks are supported (requires admin
+ # permissions on Windows).
+ # mkfifo Platform doesn't support FIFO named sockets.
+ # mknod Platform doesn't support device nodes.
+
+
+output
+------
+After `Output:` the desired output is given; this is indented by convention, but
+that's not required.
+
+The format of that is:
+
+ # Comment
+ event path # Comment
+
+ system:
+ event path
+ system2:
+ event path
+
+Every event is one line, and any whitespace between the event and path are
+ignored. The path can optionally be surrounded in ". Anything after a "#" is
+ignored.
+
+Platform-specific tests can be added after GOOS; for example:
+
+ watch /
+ touch /file
+
+ Output:
+ # Tested if nothing else matches
+ create /file
+
+ # Windows-specific test.
+ windows:
+ write /file
+
+You can specify multiple platforms with a comma (e.g. "windows, linux:").
+"kqueue" is a shortcut for all kqueue systems (BSD, macOS).
+
[goon]: https://github.com/arp242/goon
[Vagrant]: https://www.vagrantup.com/
diff --git a/vendor/github.com/fsnotify/fsnotify/README.md b/vendor/github.com/fsnotify/fsnotify/README.md
index e480733d16cb..1f4eb583d50b 100644
--- a/vendor/github.com/fsnotify/fsnotify/README.md
+++ b/vendor/github.com/fsnotify/fsnotify/README.md
@@ -15,7 +15,6 @@ Platform support:
| ReadDirectoryChangesW | Windows | Supported |
| FEN | illumos | Supported |
| fanotify | Linux 5.9+ | [Not yet](https://github.com/fsnotify/fsnotify/issues/114) |
-| AHAFS | AIX | [aix branch]; experimental due to lack of maintainer and test environment |
| FSEvents | macOS | [Needs support in x/sys/unix][fsevents] |
| USN Journals | Windows | [Needs support in x/sys/windows][usn] |
| Polling | *All* | [Not yet](https://github.com/fsnotify/fsnotify/issues/9) |
@@ -25,7 +24,6 @@ untested.
[fsevents]: https://github.com/fsnotify/fsnotify/issues/11#issuecomment-1279133120
[usn]: https://github.com/fsnotify/fsnotify/issues/53#issuecomment-1279829847
-[aix branch]: https://github.com/fsnotify/fsnotify/issues/353#issuecomment-1284590129
Usage
-----
diff --git a/vendor/github.com/fsnotify/fsnotify/backend_fen.go b/vendor/github.com/fsnotify/fsnotify/backend_fen.go
index 28497f1dd8e6..57fc69284845 100644
--- a/vendor/github.com/fsnotify/fsnotify/backend_fen.go
+++ b/vendor/github.com/fsnotify/fsnotify/backend_fen.go
@@ -1,162 +1,44 @@
//go:build solaris
-// +build solaris
-// Note: the documentation on the Watcher type and methods is generated from
-// mkdoc.zsh
+// FEN backend for illumos (supported) and Solaris (untested, but should work).
+//
+// See port_create(3c) etc. for docs. https://www.illumos.org/man/3C/port_create
package fsnotify
import (
"errors"
"fmt"
+ "io/fs"
"os"
"path/filepath"
"sync"
+ "time"
+ "github.com/fsnotify/fsnotify/internal"
"golang.org/x/sys/unix"
)
-// Watcher watches a set of paths, delivering events on a channel.
-//
-// A watcher should not be copied (e.g. pass it by pointer, rather than by
-// value).
-//
-// # Linux notes
-//
-// When a file is removed a Remove event won't be emitted until all file
-// descriptors are closed, and deletes will always emit a Chmod. For example:
-//
-// fp := os.Open("file")
-// os.Remove("file") // Triggers Chmod
-// fp.Close() // Triggers Remove
-//
-// This is the event that inotify sends, so not much can be changed about this.
-//
-// The fs.inotify.max_user_watches sysctl variable specifies the upper limit
-// for the number of watches per user, and fs.inotify.max_user_instances
-// specifies the maximum number of inotify instances per user. Every Watcher you
-// create is an "instance", and every path you add is a "watch".
-//
-// These are also exposed in /proc as /proc/sys/fs/inotify/max_user_watches and
-// /proc/sys/fs/inotify/max_user_instances
-//
-// To increase them you can use sysctl or write the value to the /proc file:
-//
-// # Default values on Linux 5.18
-// sysctl fs.inotify.max_user_watches=124983
-// sysctl fs.inotify.max_user_instances=128
-//
-// To make the changes persist on reboot edit /etc/sysctl.conf or
-// /usr/lib/sysctl.d/50-default.conf (details differ per Linux distro; check
-// your distro's documentation):
-//
-// fs.inotify.max_user_watches=124983
-// fs.inotify.max_user_instances=128
-//
-// Reaching the limit will result in a "no space left on device" or "too many open
-// files" error.
-//
-// # kqueue notes (macOS, BSD)
-//
-// kqueue requires opening a file descriptor for every file that's being watched;
-// so if you're watching a directory with five files then that's six file
-// descriptors. You will run in to your system's "max open files" limit faster on
-// these platforms.
-//
-// The sysctl variables kern.maxfiles and kern.maxfilesperproc can be used to
-// control the maximum number of open files, as well as /etc/login.conf on BSD
-// systems.
-//
-// # Windows notes
-//
-// Paths can be added as "C:\path\to\dir", but forward slashes
-// ("C:/path/to/dir") will also work.
-//
-// When a watched directory is removed it will always send an event for the
-// directory itself, but may not send events for all files in that directory.
-// Sometimes it will send events for all times, sometimes it will send no
-// events, and often only for some files.
-//
-// The default ReadDirectoryChangesW() buffer size is 64K, which is the largest
-// value that is guaranteed to work with SMB filesystems. If you have many
-// events in quick succession this may not be enough, and you will have to use
-// [WithBufferSize] to increase the value.
-type Watcher struct {
- // Events sends the filesystem change events.
- //
- // fsnotify can send the following events; a "path" here can refer to a
- // file, directory, symbolic link, or special file like a FIFO.
- //
- // fsnotify.Create A new path was created; this may be followed by one
- // or more Write events if data also gets written to a
- // file.
- //
- // fsnotify.Remove A path was removed.
- //
- // fsnotify.Rename A path was renamed. A rename is always sent with the
- // old path as Event.Name, and a Create event will be
- // sent with the new name. Renames are only sent for
- // paths that are currently watched; e.g. moving an
- // unmonitored file into a monitored directory will
- // show up as just a Create. Similarly, renaming a file
- // to outside a monitored directory will show up as
- // only a Rename.
- //
- // fsnotify.Write A file or named pipe was written to. A Truncate will
- // also trigger a Write. A single "write action"
- // initiated by the user may show up as one or multiple
- // writes, depending on when the system syncs things to
- // disk. For example when compiling a large Go program
- // you may get hundreds of Write events, and you may
- // want to wait until you've stopped receiving them
- // (see the dedup example in cmd/fsnotify).
- //
- // Some systems may send Write event for directories
- // when the directory content changes.
- //
- // fsnotify.Chmod Attributes were changed. On Linux this is also sent
- // when a file is removed (or more accurately, when a
- // link to an inode is removed). On kqueue it's sent
- // when a file is truncated. On Windows it's never
- // sent.
+type fen struct {
+ *shared
Events chan Event
-
- // Errors sends any errors.
- //
- // ErrEventOverflow is used to indicate there are too many events:
- //
- // - inotify: There are too many queued events (fs.inotify.max_queued_events sysctl)
- // - windows: The buffer size is too small; WithBufferSize() can be used to increase it.
- // - kqueue, fen: Not used.
Errors chan error
mu sync.Mutex
port *unix.EventPort
- done chan struct{} // Channel for sending a "quit message" to the reader goroutine
- dirs map[string]struct{} // Explicitly watched directories
- watches map[string]struct{} // Explicitly watched non-directories
+ dirs map[string]Op // Explicitly watched directories
+ watches map[string]Op // Explicitly watched non-directories
}
-// NewWatcher creates a new Watcher.
-func NewWatcher() (*Watcher, error) {
- return NewBufferedWatcher(0)
-}
+var defaultBufferSize = 0
-// NewBufferedWatcher creates a new Watcher with a buffered Watcher.Events
-// channel.
-//
-// The main use case for this is situations with a very large number of events
-// where the kernel buffer size can't be increased (e.g. due to lack of
-// permissions). An unbuffered Watcher will perform better for almost all use
-// cases, and whenever possible you will be better off increasing the kernel
-// buffers instead of adding a large userspace buffer.
-func NewBufferedWatcher(sz uint) (*Watcher, error) {
- w := &Watcher{
- Events: make(chan Event, sz),
- Errors: make(chan error),
- dirs: make(map[string]struct{}),
- watches: make(map[string]struct{}),
- done: make(chan struct{}),
+func newBackend(ev chan Event, errs chan error) (backend, error) {
+ w := &fen{
+ shared: newShared(ev, errs),
+ Events: ev,
+ Errors: errs,
+ dirs: make(map[string]Op),
+ watches: make(map[string]Op),
}
var err error
@@ -169,104 +51,28 @@ func NewBufferedWatcher(sz uint) (*Watcher, error) {
return w, nil
}
-// sendEvent attempts to send an event to the user, returning true if the event
-// was put in the channel successfully and false if the watcher has been closed.
-func (w *Watcher) sendEvent(name string, op Op) (sent bool) {
- select {
- case w.Events <- Event{Name: name, Op: op}:
- return true
- case <-w.done:
- return false
- }
-}
-
-// sendError attempts to send an error to the user, returning true if the error
-// was put in the channel successfully and false if the watcher has been closed.
-func (w *Watcher) sendError(err error) (sent bool) {
- select {
- case w.Errors <- err:
- return true
- case <-w.done:
- return false
- }
-}
-
-func (w *Watcher) isClosed() bool {
- select {
- case <-w.done:
- return true
- default:
- return false
- }
-}
-
-// Close removes all watches and closes the Events channel.
-func (w *Watcher) Close() error {
- // Take the lock used by associateFile to prevent lingering events from
- // being processed after the close
- w.mu.Lock()
- defer w.mu.Unlock()
- if w.isClosed() {
+func (w *fen) Close() error {
+ if w.shared.close() {
return nil
}
- close(w.done)
return w.port.Close()
}
-// Add starts monitoring the path for changes.
-//
-// A path can only be watched once; watching it more than once is a no-op and will
-// not return an error. Paths that do not yet exist on the filesystem cannot be
-// watched.
-//
-// A watch will be automatically removed if the watched path is deleted or
-// renamed. The exception is the Windows backend, which doesn't remove the
-// watcher on renames.
-//
-// Notifications on network filesystems (NFS, SMB, FUSE, etc.) or special
-// filesystems (/proc, /sys, etc.) generally don't work.
-//
-// Returns [ErrClosed] if [Watcher.Close] was called.
-//
-// See [Watcher.AddWith] for a version that allows adding options.
-//
-// # Watching directories
-//
-// All files in a directory are monitored, including new files that are created
-// after the watcher is started. Subdirectories are not watched (i.e. it's
-// non-recursive).
-//
-// # Watching files
-//
-// Watching individual files (rather than directories) is generally not
-// recommended as many programs (especially editors) update files atomically: it
-// will write to a temporary file which is then moved to to destination,
-// overwriting the original (or some variant thereof). The watcher on the
-// original file is now lost, as that no longer exists.
-//
-// The upshot of this is that a power failure or crash won't leave a
-// half-written file.
-//
-// Watch the parent directory and use Event.Name to filter out files you're not
-// interested in. There is an example of this in cmd/fsnotify/file.go.
-func (w *Watcher) Add(name string) error { return w.AddWith(name) }
+func (w *fen) Add(name string) error { return w.AddWith(name) }
-// AddWith is like [Watcher.Add], but allows adding options. When using Add()
-// the defaults described below are used.
-//
-// Possible options are:
-//
-// - [WithBufferSize] sets the buffer size for the Windows backend; no-op on
-// other platforms. The default is 64K (65536 bytes).
-func (w *Watcher) AddWith(name string, opts ...addOpt) error {
+func (w *fen) AddWith(name string, opts ...addOpt) error {
if w.isClosed() {
return ErrClosed
}
- if w.port.PathIsWatched(name) {
- return nil
+ if debug {
+ fmt.Fprintf(os.Stderr, "FSNOTIFY_DEBUG: %s AddWith(%q)\n",
+ time.Now().Format("15:04:05.000000000"), name)
}
- _ = getOptions(opts...)
+ with := getOptions(opts...)
+ if !w.xSupports(with.op) {
+ return fmt.Errorf("%w: %s", xErrUnsupported, with.op)
+ }
// Currently we resolve symlinks that were explicitly requested to be
// watched. Otherwise we would use LStat here.
@@ -283,7 +89,7 @@ func (w *Watcher) AddWith(name string, opts ...addOpt) error {
}
w.mu.Lock()
- w.dirs[name] = struct{}{}
+ w.dirs[name] = with.op
w.mu.Unlock()
return nil
}
@@ -294,26 +100,22 @@ func (w *Watcher) AddWith(name string, opts ...addOpt) error {
}
w.mu.Lock()
- w.watches[name] = struct{}{}
+ w.watches[name] = with.op
w.mu.Unlock()
return nil
}
-// Remove stops monitoring the path for changes.
-//
-// Directories are always removed non-recursively. For example, if you added
-// /tmp/dir and /tmp/dir/subdir then you will need to remove both.
-//
-// Removing a path that has not yet been added returns [ErrNonExistentWatch].
-//
-// Returns nil if [Watcher.Close] was called.
-func (w *Watcher) Remove(name string) error {
+func (w *fen) Remove(name string) error {
if w.isClosed() {
return nil
}
if !w.port.PathIsWatched(name) {
return fmt.Errorf("%w: %s", ErrNonExistentWatch, name)
}
+ if debug {
+ fmt.Fprintf(os.Stderr, "FSNOTIFY_DEBUG: %s Remove(%q)\n",
+ time.Now().Format("15:04:05.000000000"), name)
+ }
// The user has expressed an intent. Immediately remove this name from
// whichever watch list it might be in. If it's not in there the delete
@@ -346,7 +148,7 @@ func (w *Watcher) Remove(name string) error {
}
// readEvents contains the main loop that runs in a goroutine watching for events.
-func (w *Watcher) readEvents() {
+func (w *fen) readEvents() {
// If this function returns, the watcher has been closed and we can close
// these channels
defer func() {
@@ -367,7 +169,7 @@ func (w *Watcher) readEvents() {
return
}
// There was an error not caused by calling w.Close()
- if !w.sendError(err) {
+ if !w.sendError(fmt.Errorf("port.Get: %w", err)) {
return
}
}
@@ -382,17 +184,19 @@ func (w *Watcher) readEvents() {
continue
}
+ if debug {
+ internal.Debug(pevent.Path, pevent.Events)
+ }
+
err = w.handleEvent(&pevent)
- if err != nil {
- if !w.sendError(err) {
- return
- }
+ if !w.sendError(err) {
+ return
}
}
}
}
-func (w *Watcher) handleDirectory(path string, stat os.FileInfo, follow bool, handler func(string, os.FileInfo, bool) error) error {
+func (w *fen) handleDirectory(path string, stat os.FileInfo, follow bool, handler func(string, os.FileInfo, bool) error) error {
files, err := os.ReadDir(path)
if err != nil {
return err
@@ -418,7 +222,7 @@ func (w *Watcher) handleDirectory(path string, stat os.FileInfo, follow bool, ha
// bitmap matches more than one event type (e.g. the file was both modified and
// had the attributes changed between when the association was created and the
// when event was returned)
-func (w *Watcher) handleEvent(event *unix.PortEvent) error {
+func (w *fen) handleEvent(event *unix.PortEvent) error {
var (
events = event.Events
path = event.Path
@@ -433,13 +237,13 @@ func (w *Watcher) handleEvent(event *unix.PortEvent) error {
isWatched := watchedDir || watchedPath
if events&unix.FILE_DELETE != 0 {
- if !w.sendEvent(path, Remove) {
+ if !w.sendEvent(Event{Name: path, Op: Remove}) {
return nil
}
reRegister = false
}
if events&unix.FILE_RENAME_FROM != 0 {
- if !w.sendEvent(path, Rename) {
+ if !w.sendEvent(Event{Name: path, Op: Rename}) {
return nil
}
// Don't keep watching the new file name
@@ -453,7 +257,7 @@ func (w *Watcher) handleEvent(event *unix.PortEvent) error {
// inotify reports a Remove event in this case, so we simulate this
// here.
- if !w.sendEvent(path, Remove) {
+ if !w.sendEvent(Event{Name: path, Op: Remove}) {
return nil
}
// Don't keep watching the file that was removed
@@ -487,7 +291,7 @@ func (w *Watcher) handleEvent(event *unix.PortEvent) error {
// get here, the sudirectory is already gone. Clearly we were watching
// this path but now it is gone. Let's tell the user that it was
// removed.
- if !w.sendEvent(path, Remove) {
+ if !w.sendEvent(Event{Name: path, Op: Remove}) {
return nil
}
// Suppress extra write events on removed directories; they are not
@@ -502,7 +306,7 @@ func (w *Watcher) handleEvent(event *unix.PortEvent) error {
if err != nil {
// The symlink still exists, but the target is gone. Report the
// Remove similar to above.
- if !w.sendEvent(path, Remove) {
+ if !w.sendEvent(Event{Name: path, Op: Remove}) {
return nil
}
// Don't return the error
@@ -510,18 +314,12 @@ func (w *Watcher) handleEvent(event *unix.PortEvent) error {
}
if events&unix.FILE_MODIFIED != 0 {
- if fmode.IsDir() {
- if watchedDir {
- if err := w.updateDirectory(path); err != nil {
- return err
- }
- } else {
- if !w.sendEvent(path, Write) {
- return nil
- }
+ if fmode.IsDir() && watchedDir {
+ if err := w.updateDirectory(path); err != nil {
+ return err
}
} else {
- if !w.sendEvent(path, Write) {
+ if !w.sendEvent(Event{Name: path, Op: Write}) {
return nil
}
}
@@ -529,7 +327,7 @@ func (w *Watcher) handleEvent(event *unix.PortEvent) error {
if events&unix.FILE_ATTRIB != 0 && stat != nil {
// Only send Chmod if perms changed
if stat.Mode().Perm() != fmode.Perm() {
- if !w.sendEvent(path, Chmod) {
+ if !w.sendEvent(Event{Name: path, Op: Chmod}) {
return nil
}
}
@@ -538,17 +336,27 @@ func (w *Watcher) handleEvent(event *unix.PortEvent) error {
if stat != nil {
// If we get here, it means we've hit an event above that requires us to
// continue watching the file or directory
- return w.associateFile(path, stat, isWatched)
+ err := w.associateFile(path, stat, isWatched)
+ if errors.Is(err, fs.ErrNotExist) {
+ // Path may have been removed since the stat.
+ err = nil
+ }
+ return err
}
return nil
}
-func (w *Watcher) updateDirectory(path string) error {
- // The directory was modified, so we must find unwatched entities and watch
- // them. If something was removed from the directory, nothing will happen,
- // as everything else should still be watched.
+// The directory was modified, so we must find unwatched entities and watch
+// them. If something was removed from the directory, nothing will happen, as
+// everything else should still be watched.
+func (w *fen) updateDirectory(path string) error {
files, err := os.ReadDir(path)
if err != nil {
+ // Directory no longer exists: probably just deleted since we got the
+ // event.
+ if errors.Is(err, fs.ErrNotExist) {
+ return nil
+ }
return err
}
@@ -563,19 +371,22 @@ func (w *Watcher) updateDirectory(path string) error {
return err
}
err = w.associateFile(path, finfo, false)
- if err != nil {
- if !w.sendError(err) {
- return nil
- }
+ if errors.Is(err, fs.ErrNotExist) {
+ // File may have disappeared between getting the dir listing and
+ // adding the port: that's okay to ignore.
+ continue
}
- if !w.sendEvent(path, Create) {
+ if !w.sendError(err) {
+ return nil
+ }
+ if !w.sendEvent(Event{Name: path, Op: Create}) {
return nil
}
}
return nil
}
-func (w *Watcher) associateFile(path string, stat os.FileInfo, follow bool) error {
+func (w *fen) associateFile(path string, stat os.FileInfo, follow bool) error {
if w.isClosed() {
return ErrClosed
}
@@ -593,34 +404,42 @@ func (w *Watcher) associateFile(path string, stat os.FileInfo, follow bool) erro
// cleared up that discrepancy. The most likely cause is that the event
// has fired but we haven't processed it yet.
err := w.port.DissociatePath(path)
- if err != nil && err != unix.ENOENT {
- return err
+ if err != nil && !errors.Is(err, unix.ENOENT) {
+ return fmt.Errorf("port.DissociatePath(%q): %w", path, err)
}
}
- // FILE_NOFOLLOW means we watch symlinks themselves rather than their
- // targets.
- events := unix.FILE_MODIFIED | unix.FILE_ATTRIB | unix.FILE_NOFOLLOW
- if follow {
- // We *DO* follow symlinks for explicitly watched entries.
- events = unix.FILE_MODIFIED | unix.FILE_ATTRIB
+
+ var events int
+ if !follow {
+ // Watch symlinks themselves rather than their targets unless this entry
+ // is explicitly watched.
+ events |= unix.FILE_NOFOLLOW
+ }
+ if true { // TODO: implement withOps()
+ events |= unix.FILE_MODIFIED
+ }
+ if true {
+ events |= unix.FILE_ATTRIB
}
- return w.port.AssociatePath(path, stat,
- events,
- stat.Mode())
+ err := w.port.AssociatePath(path, stat, events, stat.Mode())
+ if err != nil {
+ return fmt.Errorf("port.AssociatePath(%q): %w", path, err)
+ }
+ return nil
}
-func (w *Watcher) dissociateFile(path string, stat os.FileInfo, unused bool) error {
+func (w *fen) dissociateFile(path string, stat os.FileInfo, unused bool) error {
if !w.port.PathIsWatched(path) {
return nil
}
- return w.port.DissociatePath(path)
+ err := w.port.DissociatePath(path)
+ if err != nil {
+ return fmt.Errorf("port.DissociatePath(%q): %w", path, err)
+ }
+ return nil
}
-// WatchList returns all paths explicitly added with [Watcher.Add] (and are not
-// yet removed).
-//
-// Returns nil if [Watcher.Close] was called.
-func (w *Watcher) WatchList() []string {
+func (w *fen) WatchList() []string {
if w.isClosed() {
return nil
}
@@ -638,3 +457,11 @@ func (w *Watcher) WatchList() []string {
return entries
}
+
+func (w *fen) xSupports(op Op) bool {
+ if op.Has(xUnportableOpen) || op.Has(xUnportableRead) ||
+ op.Has(xUnportableCloseWrite) || op.Has(xUnportableCloseRead) {
+ return false
+ }
+ return true
+}
diff --git a/vendor/github.com/fsnotify/fsnotify/backend_inotify.go b/vendor/github.com/fsnotify/fsnotify/backend_inotify.go
index 921c1c1e4012..a36cb89d7361 100644
--- a/vendor/github.com/fsnotify/fsnotify/backend_inotify.go
+++ b/vendor/github.com/fsnotify/fsnotify/backend_inotify.go
@@ -1,8 +1,4 @@
//go:build linux && !appengine
-// +build linux,!appengine
-
-// Note: the documentation on the Watcher type and methods is generated from
-// mkdoc.zsh
package fsnotify
@@ -10,127 +6,21 @@ import (
"errors"
"fmt"
"io"
+ "io/fs"
"os"
"path/filepath"
"strings"
"sync"
+ "time"
"unsafe"
+ "github.com/fsnotify/fsnotify/internal"
"golang.org/x/sys/unix"
)
-// Watcher watches a set of paths, delivering events on a channel.
-//
-// A watcher should not be copied (e.g. pass it by pointer, rather than by
-// value).
-//
-// # Linux notes
-//
-// When a file is removed a Remove event won't be emitted until all file
-// descriptors are closed, and deletes will always emit a Chmod. For example:
-//
-// fp := os.Open("file")
-// os.Remove("file") // Triggers Chmod
-// fp.Close() // Triggers Remove
-//
-// This is the event that inotify sends, so not much can be changed about this.
-//
-// The fs.inotify.max_user_watches sysctl variable specifies the upper limit
-// for the number of watches per user, and fs.inotify.max_user_instances
-// specifies the maximum number of inotify instances per user. Every Watcher you
-// create is an "instance", and every path you add is a "watch".
-//
-// These are also exposed in /proc as /proc/sys/fs/inotify/max_user_watches and
-// /proc/sys/fs/inotify/max_user_instances
-//
-// To increase them you can use sysctl or write the value to the /proc file:
-//
-// # Default values on Linux 5.18
-// sysctl fs.inotify.max_user_watches=124983
-// sysctl fs.inotify.max_user_instances=128
-//
-// To make the changes persist on reboot edit /etc/sysctl.conf or
-// /usr/lib/sysctl.d/50-default.conf (details differ per Linux distro; check
-// your distro's documentation):
-//
-// fs.inotify.max_user_watches=124983
-// fs.inotify.max_user_instances=128
-//
-// Reaching the limit will result in a "no space left on device" or "too many open
-// files" error.
-//
-// # kqueue notes (macOS, BSD)
-//
-// kqueue requires opening a file descriptor for every file that's being watched;
-// so if you're watching a directory with five files then that's six file
-// descriptors. You will run in to your system's "max open files" limit faster on
-// these platforms.
-//
-// The sysctl variables kern.maxfiles and kern.maxfilesperproc can be used to
-// control the maximum number of open files, as well as /etc/login.conf on BSD
-// systems.
-//
-// # Windows notes
-//
-// Paths can be added as "C:\path\to\dir", but forward slashes
-// ("C:/path/to/dir") will also work.
-//
-// When a watched directory is removed it will always send an event for the
-// directory itself, but may not send events for all files in that directory.
-// Sometimes it will send events for all times, sometimes it will send no
-// events, and often only for some files.
-//
-// The default ReadDirectoryChangesW() buffer size is 64K, which is the largest
-// value that is guaranteed to work with SMB filesystems. If you have many
-// events in quick succession this may not be enough, and you will have to use
-// [WithBufferSize] to increase the value.
-type Watcher struct {
- // Events sends the filesystem change events.
- //
- // fsnotify can send the following events; a "path" here can refer to a
- // file, directory, symbolic link, or special file like a FIFO.
- //
- // fsnotify.Create A new path was created; this may be followed by one
- // or more Write events if data also gets written to a
- // file.
- //
- // fsnotify.Remove A path was removed.
- //
- // fsnotify.Rename A path was renamed. A rename is always sent with the
- // old path as Event.Name, and a Create event will be
- // sent with the new name. Renames are only sent for
- // paths that are currently watched; e.g. moving an
- // unmonitored file into a monitored directory will
- // show up as just a Create. Similarly, renaming a file
- // to outside a monitored directory will show up as
- // only a Rename.
- //
- // fsnotify.Write A file or named pipe was written to. A Truncate will
- // also trigger a Write. A single "write action"
- // initiated by the user may show up as one or multiple
- // writes, depending on when the system syncs things to
- // disk. For example when compiling a large Go program
- // you may get hundreds of Write events, and you may
- // want to wait until you've stopped receiving them
- // (see the dedup example in cmd/fsnotify).
- //
- // Some systems may send Write event for directories
- // when the directory content changes.
- //
- // fsnotify.Chmod Attributes were changed. On Linux this is also sent
- // when a file is removed (or more accurately, when a
- // link to an inode is removed). On kqueue it's sent
- // when a file is truncated. On Windows it's never
- // sent.
+type inotify struct {
+ *shared
Events chan Event
-
- // Errors sends any errors.
- //
- // ErrEventOverflow is used to indicate there are too many events:
- //
- // - inotify: There are too many queued events (fs.inotify.max_queued_events sysctl)
- // - windows: The buffer size is too small; WithBufferSize() can be used to increase it.
- // - kqueue, fen: Not used.
Errors chan error
// Store fd here as os.File.Read() will no longer return on close after
@@ -138,21 +28,41 @@ type Watcher struct {
fd int
inotifyFile *os.File
watches *watches
- done chan struct{} // Channel for sending a "quit message" to the reader goroutine
- closeMu sync.Mutex
doneResp chan struct{} // Channel to respond to Close
+
+ // Store rename cookies in an array, with the index wrapping to 0. Almost
+ // all of the time what we get is a MOVED_FROM to set the cookie and the
+ // next event inotify sends will be MOVED_TO to read it. However, this is
+ // not guaranteed – as described in inotify(7) – and we may get other events
+ // between the two MOVED_* events (including other MOVED_* ones).
+ //
+ // A second issue is that moving a file outside the watched directory will
+ // trigger a MOVED_FROM to set the cookie, but we never see the MOVED_TO to
+ // read and delete it. So just storing it in a map would slowly leak memory.
+ //
+ // Doing it like this gives us a simple fast LRU-cache that won't allocate.
+ // Ten items should be more than enough for our purpose, and a loop over
+ // such a short array is faster than a map access anyway (not that it hugely
+ // matters since we're talking about hundreds of ns at the most, but still).
+ cookies [10]koekje
+ cookieIndex uint8
+ cookiesMu sync.Mutex
}
type (
watches struct {
- mu sync.RWMutex
wd map[uint32]*watch // wd → watch
path map[string]uint32 // pathname → wd
}
watch struct {
- wd uint32 // Watch descriptor (as returned by the inotify_add_watch() syscall)
- flags uint32 // inotify flags of this watch (see inotify(7) for the list of valid flags)
- path string // Watch path.
+ wd uint32 // Watch descriptor (as returned by the inotify_add_watch() syscall)
+ flags uint32 // inotify flags of this watch (see inotify(7) for the list of valid flags)
+ path string // Watch path.
+ recurse bool // Recursion with ./...?
+ }
+ koekje struct {
+ cookie uint32
+ path string
}
)
@@ -163,57 +73,43 @@ func newWatches() *watches {
}
}
-func (w *watches) len() int {
- w.mu.RLock()
- defer w.mu.RUnlock()
- return len(w.wd)
-}
-
-func (w *watches) add(ww *watch) {
- w.mu.Lock()
- defer w.mu.Unlock()
- w.wd[ww.wd] = ww
- w.path[ww.path] = ww.wd
-}
-
-func (w *watches) remove(wd uint32) {
- w.mu.Lock()
- defer w.mu.Unlock()
- delete(w.path, w.wd[wd].path)
- delete(w.wd, wd)
-}
-
-func (w *watches) removePath(path string) (uint32, bool) {
- w.mu.Lock()
- defer w.mu.Unlock()
+func (w *watches) byPath(path string) *watch { return w.wd[w.path[path]] }
+func (w *watches) byWd(wd uint32) *watch { return w.wd[wd] }
+func (w *watches) len() int { return len(w.wd) }
+func (w *watches) add(ww *watch) { w.wd[ww.wd] = ww; w.path[ww.path] = ww.wd }
+func (w *watches) remove(watch *watch) { delete(w.path, watch.path); delete(w.wd, watch.wd) }
+func (w *watches) removePath(path string) ([]uint32, error) {
+ path, recurse := recursivePath(path)
wd, ok := w.path[path]
if !ok {
- return 0, false
+ return nil, fmt.Errorf("%w: %s", ErrNonExistentWatch, path)
+ }
+
+ watch := w.wd[wd]
+ if recurse && !watch.recurse {
+ return nil, fmt.Errorf("can't use /... with non-recursive watch %q", path)
}
delete(w.path, path)
delete(w.wd, wd)
+ if !watch.recurse {
+ return []uint32{wd}, nil
+ }
- return wd, true
-}
-
-func (w *watches) byPath(path string) *watch {
- w.mu.RLock()
- defer w.mu.RUnlock()
- return w.wd[w.path[path]]
-}
-
-func (w *watches) byWd(wd uint32) *watch {
- w.mu.RLock()
- defer w.mu.RUnlock()
- return w.wd[wd]
+ wds := make([]uint32, 0, 8)
+ wds = append(wds, wd)
+ for p, rwd := range w.path {
+ if strings.HasPrefix(p, path) {
+ delete(w.path, p)
+ delete(w.wd, rwd)
+ wds = append(wds, rwd)
+ }
+ }
+ return wds, nil
}
func (w *watches) updatePath(path string, f func(*watch) (*watch, error)) error {
- w.mu.Lock()
- defer w.mu.Unlock()
-
var existing *watch
wd, ok := w.path[path]
if ok {
@@ -236,20 +132,9 @@ func (w *watches) updatePath(path string, f func(*watch) (*watch, error)) error
return nil
}
-// NewWatcher creates a new Watcher.
-func NewWatcher() (*Watcher, error) {
- return NewBufferedWatcher(0)
-}
+var defaultBufferSize = 0
-// NewBufferedWatcher creates a new Watcher with a buffered Watcher.Events
-// channel.
-//
-// The main use case for this is situations with a very large number of events
-// where the kernel buffer size can't be increased (e.g. due to lack of
-// permissions). An unbuffered Watcher will perform better for almost all use
-// cases, and whenever possible you will be better off increasing the kernel
-// buffers instead of adding a large userspace buffer.
-func NewBufferedWatcher(sz uint) (*Watcher, error) {
+func newBackend(ev chan Event, errs chan error) (backend, error) {
// Need to set nonblocking mode for SetDeadline to work, otherwise blocking
// I/O operations won't terminate on close.
fd, errno := unix.InotifyInit1(unix.IN_CLOEXEC | unix.IN_NONBLOCK)
@@ -257,13 +142,13 @@ func NewBufferedWatcher(sz uint) (*Watcher, error) {
return nil, errno
}
- w := &Watcher{
+ w := &inotify{
+ shared: newShared(ev, errs),
+ Events: ev,
+ Errors: errs,
fd: fd,
inotifyFile: os.NewFile(uintptr(fd), ""),
watches: newWatches(),
- Events: make(chan Event, sz),
- Errors: make(chan error),
- done: make(chan struct{}),
doneResp: make(chan struct{}),
}
@@ -271,44 +156,10 @@ func NewBufferedWatcher(sz uint) (*Watcher, error) {
return w, nil
}
-// Returns true if the event was sent, or false if watcher is closed.
-func (w *Watcher) sendEvent(e Event) bool {
- select {
- case w.Events <- e:
- return true
- case <-w.done:
- return false
- }
-}
-
-// Returns true if the error was sent, or false if watcher is closed.
-func (w *Watcher) sendError(err error) bool {
- select {
- case w.Errors <- err:
- return true
- case <-w.done:
- return false
- }
-}
-
-func (w *Watcher) isClosed() bool {
- select {
- case <-w.done:
- return true
- default:
- return false
- }
-}
-
-// Close removes all watches and closes the Events channel.
-func (w *Watcher) Close() error {
- w.closeMu.Lock()
- if w.isClosed() {
- w.closeMu.Unlock()
+func (w *inotify) Close() error {
+ if w.shared.close() {
return nil
}
- close(w.done)
- w.closeMu.Unlock()
// Causes any blocking reads to return with an error, provided the file
// still supports deadline operations.
@@ -317,84 +168,114 @@ func (w *Watcher) Close() error {
return err
}
- // Wait for goroutine to close
- <-w.doneResp
-
+ <-w.doneResp // Wait for readEvents() to finish.
return nil
}
-// Add starts monitoring the path for changes.
-//
-// A path can only be watched once; watching it more than once is a no-op and will
-// not return an error. Paths that do not yet exist on the filesystem cannot be
-// watched.
-//
-// A watch will be automatically removed if the watched path is deleted or
-// renamed. The exception is the Windows backend, which doesn't remove the
-// watcher on renames.
-//
-// Notifications on network filesystems (NFS, SMB, FUSE, etc.) or special
-// filesystems (/proc, /sys, etc.) generally don't work.
-//
-// Returns [ErrClosed] if [Watcher.Close] was called.
-//
-// See [Watcher.AddWith] for a version that allows adding options.
-//
-// # Watching directories
-//
-// All files in a directory are monitored, including new files that are created
-// after the watcher is started. Subdirectories are not watched (i.e. it's
-// non-recursive).
-//
-// # Watching files
-//
-// Watching individual files (rather than directories) is generally not
-// recommended as many programs (especially editors) update files atomically: it
-// will write to a temporary file which is then moved to to destination,
-// overwriting the original (or some variant thereof). The watcher on the
-// original file is now lost, as that no longer exists.
-//
-// The upshot of this is that a power failure or crash won't leave a
-// half-written file.
-//
-// Watch the parent directory and use Event.Name to filter out files you're not
-// interested in. There is an example of this in cmd/fsnotify/file.go.
-func (w *Watcher) Add(name string) error { return w.AddWith(name) }
-
-// AddWith is like [Watcher.Add], but allows adding options. When using Add()
-// the defaults described below are used.
-//
-// Possible options are:
-//
-// - [WithBufferSize] sets the buffer size for the Windows backend; no-op on
-// other platforms. The default is 64K (65536 bytes).
-func (w *Watcher) AddWith(name string, opts ...addOpt) error {
+func (w *inotify) Add(name string) error { return w.AddWith(name) }
+
+func (w *inotify) AddWith(path string, opts ...addOpt) error {
if w.isClosed() {
return ErrClosed
}
+ if debug {
+ fmt.Fprintf(os.Stderr, "FSNOTIFY_DEBUG: %s AddWith(%q)\n",
+ time.Now().Format("15:04:05.000000000"), path)
+ }
+
+ with := getOptions(opts...)
+ if !w.xSupports(with.op) {
+ return fmt.Errorf("%w: %s", xErrUnsupported, with.op)
+ }
+
+ add := func(path string, with withOpts, recurse bool) error {
+ var flags uint32
+ if with.noFollow {
+ flags |= unix.IN_DONT_FOLLOW
+ }
+ if with.op.Has(Create) {
+ flags |= unix.IN_CREATE
+ }
+ if with.op.Has(Write) {
+ flags |= unix.IN_MODIFY
+ }
+ if with.op.Has(Remove) {
+ flags |= unix.IN_DELETE | unix.IN_DELETE_SELF
+ }
+ if with.op.Has(Rename) {
+ flags |= unix.IN_MOVED_TO | unix.IN_MOVED_FROM | unix.IN_MOVE_SELF
+ }
+ if with.op.Has(Chmod) {
+ flags |= unix.IN_ATTRIB
+ }
+ if with.op.Has(xUnportableOpen) {
+ flags |= unix.IN_OPEN
+ }
+ if with.op.Has(xUnportableRead) {
+ flags |= unix.IN_ACCESS
+ }
+ if with.op.Has(xUnportableCloseWrite) {
+ flags |= unix.IN_CLOSE_WRITE
+ }
+ if with.op.Has(xUnportableCloseRead) {
+ flags |= unix.IN_CLOSE_NOWRITE
+ }
+ return w.register(path, flags, recurse)
+ }
+
+ w.mu.Lock()
+ defer w.mu.Unlock()
+ path, recurse := recursivePath(path)
+ if recurse {
+ return filepath.WalkDir(path, func(root string, d fs.DirEntry, err error) error {
+ if err != nil {
+ return err
+ }
+ if !d.IsDir() {
+ if root == path {
+ return fmt.Errorf("fsnotify: not a directory: %q", path)
+ }
+ return nil
+ }
+
+ // Send a Create event when adding new directory from a recursive
+ // watch; this is for "mkdir -p one/two/three". Usually all those
+ // directories will be created before we can set up watchers on the
+ // subdirectories, so only "one" would be sent as a Create event and
+ // not "one/two" and "one/two/three" (inotifywait -r has the same
+ // problem).
+ if with.sendCreate && root != path {
+ w.sendEvent(Event{Name: root, Op: Create})
+ }
- name = filepath.Clean(name)
- _ = getOptions(opts...)
+ return add(root, with, true)
+ })
+ }
- var flags uint32 = unix.IN_MOVED_TO | unix.IN_MOVED_FROM |
- unix.IN_CREATE | unix.IN_ATTRIB | unix.IN_MODIFY |
- unix.IN_MOVE_SELF | unix.IN_DELETE | unix.IN_DELETE_SELF
+ return add(path, with, false)
+}
- return w.watches.updatePath(name, func(existing *watch) (*watch, error) {
+func (w *inotify) register(path string, flags uint32, recurse bool) error {
+ return w.watches.updatePath(path, func(existing *watch) (*watch, error) {
if existing != nil {
flags |= existing.flags | unix.IN_MASK_ADD
}
- wd, err := unix.InotifyAddWatch(w.fd, name, flags)
+ wd, err := unix.InotifyAddWatch(w.fd, path, flags)
if wd == -1 {
return nil, err
}
+ if e, ok := w.watches.wd[uint32(wd)]; ok {
+ return e, nil
+ }
+
if existing == nil {
return &watch{
- wd: uint32(wd),
- path: name,
- flags: flags,
+ wd: uint32(wd),
+ path: path,
+ flags: flags,
+ recurse: recurse,
}, nil
}
@@ -404,87 +285,80 @@ func (w *Watcher) AddWith(name string, opts ...addOpt) error {
})
}
-// Remove stops monitoring the path for changes.
-//
-// Directories are always removed non-recursively. For example, if you added
-// /tmp/dir and /tmp/dir/subdir then you will need to remove both.
-//
-// Removing a path that has not yet been added returns [ErrNonExistentWatch].
-//
-// Returns nil if [Watcher.Close] was called.
-func (w *Watcher) Remove(name string) error {
+func (w *inotify) Remove(name string) error {
if w.isClosed() {
return nil
}
+ if debug {
+ fmt.Fprintf(os.Stderr, "FSNOTIFY_DEBUG: %s Remove(%q)\n",
+ time.Now().Format("15:04:05.000000000"), name)
+ }
+
+ w.mu.Lock()
+ defer w.mu.Unlock()
return w.remove(filepath.Clean(name))
}
-func (w *Watcher) remove(name string) error {
- wd, ok := w.watches.removePath(name)
- if !ok {
- return fmt.Errorf("%w: %s", ErrNonExistentWatch, name)
- }
-
- success, errno := unix.InotifyRmWatch(w.fd, wd)
- if success == -1 {
- // TODO: Perhaps it's not helpful to return an error here in every case;
- // The only two possible errors are:
- //
- // - EBADF, which happens when w.fd is not a valid file descriptor
- // of any kind.
- // - EINVAL, which is when fd is not an inotify descriptor or wd
- // is not a valid watch descriptor. Watch descriptors are
- // invalidated when they are removed explicitly or implicitly;
- // explicitly by inotify_rm_watch, implicitly when the file they
- // are watching is deleted.
- return errno
+func (w *inotify) remove(name string) error {
+ wds, err := w.watches.removePath(name)
+ if err != nil {
+ return err
+ }
+
+ for _, wd := range wds {
+ _, err := unix.InotifyRmWatch(w.fd, wd)
+ if err != nil {
+ // TODO: Perhaps it's not helpful to return an error here in every
+ // case; the only two possible errors are:
+ //
+ // EBADF, which happens when w.fd is not a valid file descriptor of
+ // any kind.
+ //
+ // EINVAL, which is when fd is not an inotify descriptor or wd is
+ // not a valid watch descriptor. Watch descriptors are invalidated
+ // when they are removed explicitly or implicitly; explicitly by
+ // inotify_rm_watch, implicitly when the file they are watching is
+ // deleted.
+ return err
+ }
}
return nil
}
-// WatchList returns all paths explicitly added with [Watcher.Add] (and are not
-// yet removed).
-//
-// Returns nil if [Watcher.Close] was called.
-func (w *Watcher) WatchList() []string {
+func (w *inotify) WatchList() []string {
if w.isClosed() {
return nil
}
+ w.mu.Lock()
+ defer w.mu.Unlock()
entries := make([]string, 0, w.watches.len())
- w.watches.mu.RLock()
for pathname := range w.watches.path {
entries = append(entries, pathname)
}
- w.watches.mu.RUnlock()
-
return entries
}
// readEvents reads from the inotify file descriptor, converts the
// received events into Event objects and sends them via the Events channel
-func (w *Watcher) readEvents() {
+func (w *inotify) readEvents() {
defer func() {
close(w.doneResp)
close(w.Errors)
close(w.Events)
}()
- var (
- buf [unix.SizeofInotifyEvent * 4096]byte // Buffer for a maximum of 4096 raw events
- errno error // Syscall errno
- )
+ var buf [unix.SizeofInotifyEvent * 4096]byte // Buffer for a maximum of 4096 raw events
for {
- // See if we have been closed.
if w.isClosed() {
return
}
n, err := w.inotifyFile.Read(buf[:])
- switch {
- case errors.Unwrap(err) == os.ErrClosed:
- return
- case err != nil:
+ if err != nil {
+ if errors.Is(err, os.ErrClosed) {
+ return
+ }
if !w.sendError(err) {
return
}
@@ -492,13 +366,9 @@ func (w *Watcher) readEvents() {
}
if n < unix.SizeofInotifyEvent {
- var err error
+ err := errors.New("notify: short read in readEvents()") // Read was too short.
if n == 0 {
err = io.EOF // If EOF is received. This should really never happen.
- } else if n < 0 {
- err = errno // If an error occurred while reading.
- } else {
- err = errors.New("notify: short read in readEvents()") // Read was too short.
}
if !w.sendError(err) {
return
@@ -506,74 +376,146 @@ func (w *Watcher) readEvents() {
continue
}
+ // We don't know how many events we just read into the buffer While the
+ // offset points to at least one whole event.
var offset uint32
- // We don't know how many events we just read into the buffer
- // While the offset points to at least one whole event...
for offset <= uint32(n-unix.SizeofInotifyEvent) {
- var (
- // Point "raw" to the event in the buffer
- raw = (*unix.InotifyEvent)(unsafe.Pointer(&buf[offset]))
- mask = uint32(raw.Mask)
- nameLen = uint32(raw.Len)
- )
-
- if mask&unix.IN_Q_OVERFLOW != 0 {
+ // Point to the event in the buffer.
+ inEvent := (*unix.InotifyEvent)(unsafe.Pointer(&buf[offset]))
+
+ if inEvent.Mask&unix.IN_Q_OVERFLOW != 0 {
if !w.sendError(ErrEventOverflow) {
return
}
}
- // If the event happened to the watched directory or the watched file, the kernel
- // doesn't append the filename to the event, but we would like to always fill the
- // the "Name" field with a valid filename. We retrieve the path of the watch from
- // the "paths" map.
- watch := w.watches.byWd(uint32(raw.Wd))
-
- // inotify will automatically remove the watch on deletes; just need
- // to clean our state here.
- if watch != nil && mask&unix.IN_DELETE_SELF == unix.IN_DELETE_SELF {
- w.watches.remove(watch.wd)
+ ev, ok := w.handleEvent(inEvent, &buf, offset)
+ if !ok {
+ return
}
- // We can't really update the state when a watched path is moved;
- // only IN_MOVE_SELF is sent and not IN_MOVED_{FROM,TO}. So remove
- // the watch.
- if watch != nil && mask&unix.IN_MOVE_SELF == unix.IN_MOVE_SELF {
- err := w.remove(watch.path)
- if err != nil && !errors.Is(err, ErrNonExistentWatch) {
- if !w.sendError(err) {
- return
- }
- }
+ if !w.sendEvent(ev) {
+ return
}
- var name string
- if watch != nil {
- name = watch.path
- }
- if nameLen > 0 {
- // Point "bytes" at the first byte of the filename
- bytes := (*[unix.PathMax]byte)(unsafe.Pointer(&buf[offset+unix.SizeofInotifyEvent]))[:nameLen:nameLen]
- // The filename is padded with NULL bytes. TrimRight() gets rid of those.
- name += "/" + strings.TrimRight(string(bytes[0:nameLen]), "\000")
+ // Move to the next event in the buffer
+ offset += unix.SizeofInotifyEvent + inEvent.Len
+ }
+ }
+}
+
+func (w *inotify) handleEvent(inEvent *unix.InotifyEvent, buf *[65536]byte, offset uint32) (Event, bool) {
+ w.mu.Lock()
+ defer w.mu.Unlock()
+
+ /// If the event happened to the watched directory or the watched file, the
+ /// kernel doesn't append the filename to the event, but we would like to
+ /// always fill the the "Name" field with a valid filename. We retrieve the
+ /// path of the watch from the "paths" map.
+ ///
+ /// Can be nil if Remove() was called in another goroutine for this path
+ /// inbetween reading the events from the kernel and reading the internal
+ /// state. Not much we can do about it, so just skip. See #616.
+ watch := w.watches.byWd(uint32(inEvent.Wd))
+ if watch == nil {
+ return Event{}, true
+ }
+
+ var (
+ name = watch.path
+ nameLen = uint32(inEvent.Len)
+ )
+ if nameLen > 0 {
+ /// Point "bytes" at the first byte of the filename
+ bb := *buf
+ bytes := (*[unix.PathMax]byte)(unsafe.Pointer(&bb[offset+unix.SizeofInotifyEvent]))[:nameLen:nameLen]
+ /// The filename is padded with NULL bytes. TrimRight() gets rid of those.
+ name += "/" + strings.TrimRight(string(bytes[0:nameLen]), "\x00")
+ }
+
+ if debug {
+ internal.Debug(name, inEvent.Mask, inEvent.Cookie)
+ }
+
+ if inEvent.Mask&unix.IN_IGNORED != 0 || inEvent.Mask&unix.IN_UNMOUNT != 0 {
+ w.watches.remove(watch)
+ return Event{}, true
+ }
+
+ // inotify will automatically remove the watch on deletes; just need
+ // to clean our state here.
+ if inEvent.Mask&unix.IN_DELETE_SELF == unix.IN_DELETE_SELF {
+ w.watches.remove(watch)
+ }
+
+ // We can't really update the state when a watched path is moved; only
+ // IN_MOVE_SELF is sent and not IN_MOVED_{FROM,TO}. So remove the watch.
+ if inEvent.Mask&unix.IN_MOVE_SELF == unix.IN_MOVE_SELF {
+ if watch.recurse { // Do nothing
+ return Event{}, true
+ }
+
+ err := w.remove(watch.path)
+ if err != nil && !errors.Is(err, ErrNonExistentWatch) {
+ if !w.sendError(err) {
+ return Event{}, false
}
+ }
+ }
+
+ /// Skip if we're watching both this path and the parent; the parent will
+ /// already send a delete so no need to do it twice.
+ if inEvent.Mask&unix.IN_DELETE_SELF != 0 {
+ _, ok := w.watches.path[filepath.Dir(watch.path)]
+ if ok {
+ return Event{}, true
+ }
+ }
- event := w.newEvent(name, mask)
+ ev := w.newEvent(name, inEvent.Mask, inEvent.Cookie)
+ // Need to update watch path for recurse.
+ if watch.recurse {
+ isDir := inEvent.Mask&unix.IN_ISDIR == unix.IN_ISDIR
+ /// New directory created: set up watch on it.
+ if isDir && ev.Has(Create) {
+ err := w.register(ev.Name, watch.flags, true)
+ if !w.sendError(err) {
+ return Event{}, false
+ }
- // Send the events that are not ignored on the events channel
- if mask&unix.IN_IGNORED == 0 {
- if !w.sendEvent(event) {
- return
+ // This was a directory rename, so we need to update all the
+ // children.
+ //
+ // TODO: this is of course pretty slow; we should use a better data
+ // structure for storing all of this, e.g. store children in the
+ // watch. I have some code for this in my kqueue refactor we can use
+ // in the future. For now I'm okay with this as it's not publicly
+ // available. Correctness first, performance second.
+ if ev.renamedFrom != "" {
+ for k, ww := range w.watches.wd {
+ if k == watch.wd || ww.path == ev.Name {
+ continue
+ }
+ if strings.HasPrefix(ww.path, ev.renamedFrom) {
+ ww.path = strings.Replace(ww.path, ev.renamedFrom, ev.Name, 1)
+ w.watches.wd[k] = ww
+ }
}
}
-
- // Move to the next event in the buffer
- offset += unix.SizeofInotifyEvent + nameLen
}
}
+
+ return ev, true
+}
+
+func (w *inotify) isRecursive(path string) bool {
+ ww := w.watches.byPath(path)
+ if ww == nil { // path could be a file, so also check the Dir.
+ ww = w.watches.byPath(filepath.Dir(path))
+ }
+ return ww != nil && ww.recurse
}
-// newEvent returns an platform-independent Event based on an inotify mask.
-func (w *Watcher) newEvent(name string, mask uint32) Event {
+func (w *inotify) newEvent(name string, mask, cookie uint32) Event {
e := Event{Name: name}
if mask&unix.IN_CREATE == unix.IN_CREATE || mask&unix.IN_MOVED_TO == unix.IN_MOVED_TO {
e.Op |= Create
@@ -584,11 +526,58 @@ func (w *Watcher) newEvent(name string, mask uint32) Event {
if mask&unix.IN_MODIFY == unix.IN_MODIFY {
e.Op |= Write
}
+ if mask&unix.IN_OPEN == unix.IN_OPEN {
+ e.Op |= xUnportableOpen
+ }
+ if mask&unix.IN_ACCESS == unix.IN_ACCESS {
+ e.Op |= xUnportableRead
+ }
+ if mask&unix.IN_CLOSE_WRITE == unix.IN_CLOSE_WRITE {
+ e.Op |= xUnportableCloseWrite
+ }
+ if mask&unix.IN_CLOSE_NOWRITE == unix.IN_CLOSE_NOWRITE {
+ e.Op |= xUnportableCloseRead
+ }
if mask&unix.IN_MOVE_SELF == unix.IN_MOVE_SELF || mask&unix.IN_MOVED_FROM == unix.IN_MOVED_FROM {
e.Op |= Rename
}
if mask&unix.IN_ATTRIB == unix.IN_ATTRIB {
e.Op |= Chmod
}
+
+ if cookie != 0 {
+ if mask&unix.IN_MOVED_FROM == unix.IN_MOVED_FROM {
+ w.cookiesMu.Lock()
+ w.cookies[w.cookieIndex] = koekje{cookie: cookie, path: e.Name}
+ w.cookieIndex++
+ if w.cookieIndex > 9 {
+ w.cookieIndex = 0
+ }
+ w.cookiesMu.Unlock()
+ } else if mask&unix.IN_MOVED_TO == unix.IN_MOVED_TO {
+ w.cookiesMu.Lock()
+ var prev string
+ for _, c := range w.cookies {
+ if c.cookie == cookie {
+ prev = c.path
+ break
+ }
+ }
+ w.cookiesMu.Unlock()
+ e.renamedFrom = prev
+ }
+ }
return e
}
+
+func (w *inotify) xSupports(op Op) bool {
+ return true // Supports everything.
+}
+
+func (w *inotify) state() {
+ w.mu.Lock()
+ defer w.mu.Unlock()
+ for wd, ww := range w.watches.wd {
+ fmt.Fprintf(os.Stderr, "%4d: recurse=%t %q\n", wd, ww.recurse, ww.path)
+ }
+}
diff --git a/vendor/github.com/fsnotify/fsnotify/backend_kqueue.go b/vendor/github.com/fsnotify/fsnotify/backend_kqueue.go
index 063a0915a07a..340aeec061c1 100644
--- a/vendor/github.com/fsnotify/fsnotify/backend_kqueue.go
+++ b/vendor/github.com/fsnotify/fsnotify/backend_kqueue.go
@@ -1,8 +1,4 @@
//go:build freebsd || openbsd || netbsd || dragonfly || darwin
-// +build freebsd openbsd netbsd dragonfly darwin
-
-// Note: the documentation on the Watcher type and methods is generated from
-// mkdoc.zsh
package fsnotify
@@ -11,174 +7,196 @@ import (
"fmt"
"os"
"path/filepath"
+ "runtime"
"sync"
+ "time"
+ "github.com/fsnotify/fsnotify/internal"
"golang.org/x/sys/unix"
)
-// Watcher watches a set of paths, delivering events on a channel.
-//
-// A watcher should not be copied (e.g. pass it by pointer, rather than by
-// value).
-//
-// # Linux notes
-//
-// When a file is removed a Remove event won't be emitted until all file
-// descriptors are closed, and deletes will always emit a Chmod. For example:
-//
-// fp := os.Open("file")
-// os.Remove("file") // Triggers Chmod
-// fp.Close() // Triggers Remove
-//
-// This is the event that inotify sends, so not much can be changed about this.
-//
-// The fs.inotify.max_user_watches sysctl variable specifies the upper limit
-// for the number of watches per user, and fs.inotify.max_user_instances
-// specifies the maximum number of inotify instances per user. Every Watcher you
-// create is an "instance", and every path you add is a "watch".
-//
-// These are also exposed in /proc as /proc/sys/fs/inotify/max_user_watches and
-// /proc/sys/fs/inotify/max_user_instances
-//
-// To increase them you can use sysctl or write the value to the /proc file:
-//
-// # Default values on Linux 5.18
-// sysctl fs.inotify.max_user_watches=124983
-// sysctl fs.inotify.max_user_instances=128
-//
-// To make the changes persist on reboot edit /etc/sysctl.conf or
-// /usr/lib/sysctl.d/50-default.conf (details differ per Linux distro; check
-// your distro's documentation):
-//
-// fs.inotify.max_user_watches=124983
-// fs.inotify.max_user_instances=128
-//
-// Reaching the limit will result in a "no space left on device" or "too many open
-// files" error.
-//
-// # kqueue notes (macOS, BSD)
-//
-// kqueue requires opening a file descriptor for every file that's being watched;
-// so if you're watching a directory with five files then that's six file
-// descriptors. You will run in to your system's "max open files" limit faster on
-// these platforms.
-//
-// The sysctl variables kern.maxfiles and kern.maxfilesperproc can be used to
-// control the maximum number of open files, as well as /etc/login.conf on BSD
-// systems.
-//
-// # Windows notes
-//
-// Paths can be added as "C:\path\to\dir", but forward slashes
-// ("C:/path/to/dir") will also work.
-//
-// When a watched directory is removed it will always send an event for the
-// directory itself, but may not send events for all files in that directory.
-// Sometimes it will send events for all times, sometimes it will send no
-// events, and often only for some files.
-//
-// The default ReadDirectoryChangesW() buffer size is 64K, which is the largest
-// value that is guaranteed to work with SMB filesystems. If you have many
-// events in quick succession this may not be enough, and you will have to use
-// [WithBufferSize] to increase the value.
-type Watcher struct {
- // Events sends the filesystem change events.
- //
- // fsnotify can send the following events; a "path" here can refer to a
- // file, directory, symbolic link, or special file like a FIFO.
- //
- // fsnotify.Create A new path was created; this may be followed by one
- // or more Write events if data also gets written to a
- // file.
- //
- // fsnotify.Remove A path was removed.
- //
- // fsnotify.Rename A path was renamed. A rename is always sent with the
- // old path as Event.Name, and a Create event will be
- // sent with the new name. Renames are only sent for
- // paths that are currently watched; e.g. moving an
- // unmonitored file into a monitored directory will
- // show up as just a Create. Similarly, renaming a file
- // to outside a monitored directory will show up as
- // only a Rename.
- //
- // fsnotify.Write A file or named pipe was written to. A Truncate will
- // also trigger a Write. A single "write action"
- // initiated by the user may show up as one or multiple
- // writes, depending on when the system syncs things to
- // disk. For example when compiling a large Go program
- // you may get hundreds of Write events, and you may
- // want to wait until you've stopped receiving them
- // (see the dedup example in cmd/fsnotify).
- //
- // Some systems may send Write event for directories
- // when the directory content changes.
- //
- // fsnotify.Chmod Attributes were changed. On Linux this is also sent
- // when a file is removed (or more accurately, when a
- // link to an inode is removed). On kqueue it's sent
- // when a file is truncated. On Windows it's never
- // sent.
+type kqueue struct {
+ *shared
Events chan Event
-
- // Errors sends any errors.
- //
- // ErrEventOverflow is used to indicate there are too many events:
- //
- // - inotify: There are too many queued events (fs.inotify.max_queued_events sysctl)
- // - windows: The buffer size is too small; WithBufferSize() can be used to increase it.
- // - kqueue, fen: Not used.
Errors chan error
- done chan struct{}
- kq int // File descriptor (as returned by the kqueue() syscall).
- closepipe [2]int // Pipe used for closing.
- mu sync.Mutex // Protects access to watcher data
- watches map[string]int // Watched file descriptors (key: path).
- watchesByDir map[string]map[int]struct{} // Watched file descriptors indexed by the parent directory (key: dirname(path)).
- userWatches map[string]struct{} // Watches added with Watcher.Add()
- dirFlags map[string]uint32 // Watched directories to fflags used in kqueue.
- paths map[int]pathInfo // File descriptors to path names for processing kqueue events.
- fileExists map[string]struct{} // Keep track of if we know this file exists (to stop duplicate create events).
- isClosed bool // Set to true when Close() is first called
+ kq int // File descriptor (as returned by the kqueue() syscall).
+ closepipe [2]int // Pipe used for closing kq.
+ watches *watches
}
-type pathInfo struct {
- name string
- isDir bool
+type (
+ watches struct {
+ mu sync.RWMutex
+ wd map[int]watch // wd → watch
+ path map[string]int // pathname → wd
+ byDir map[string]map[int]struct{} // dirname(path) → wd
+ seen map[string]struct{} // Keep track of if we know this file exists.
+ byUser map[string]struct{} // Watches added with Watcher.Add()
+ }
+ watch struct {
+ wd int
+ name string
+ linkName string // In case of links; name is the target, and this is the link.
+ isDir bool
+ dirFlags uint32
+ }
+)
+
+func newWatches() *watches {
+ return &watches{
+ wd: make(map[int]watch),
+ path: make(map[string]int),
+ byDir: make(map[string]map[int]struct{}),
+ seen: make(map[string]struct{}),
+ byUser: make(map[string]struct{}),
+ }
}
-// NewWatcher creates a new Watcher.
-func NewWatcher() (*Watcher, error) {
- return NewBufferedWatcher(0)
+func (w *watches) listPaths(userOnly bool) []string {
+ w.mu.RLock()
+ defer w.mu.RUnlock()
+
+ if userOnly {
+ l := make([]string, 0, len(w.byUser))
+ for p := range w.byUser {
+ l = append(l, p)
+ }
+ return l
+ }
+
+ l := make([]string, 0, len(w.path))
+ for p := range w.path {
+ l = append(l, p)
+ }
+ return l
}
-// NewBufferedWatcher creates a new Watcher with a buffered Watcher.Events
-// channel.
-//
-// The main use case for this is situations with a very large number of events
-// where the kernel buffer size can't be increased (e.g. due to lack of
-// permissions). An unbuffered Watcher will perform better for almost all use
-// cases, and whenever possible you will be better off increasing the kernel
-// buffers instead of adding a large userspace buffer.
-func NewBufferedWatcher(sz uint) (*Watcher, error) {
+func (w *watches) watchesInDir(path string) []string {
+ w.mu.RLock()
+ defer w.mu.RUnlock()
+
+ l := make([]string, 0, 4)
+ for fd := range w.byDir[path] {
+ info := w.wd[fd]
+ if _, ok := w.byUser[info.name]; !ok {
+ l = append(l, info.name)
+ }
+ }
+ return l
+}
+
+// Mark path as added by the user.
+func (w *watches) addUserWatch(path string) {
+ w.mu.Lock()
+ defer w.mu.Unlock()
+ w.byUser[path] = struct{}{}
+}
+
+func (w *watches) addLink(path string, fd int) {
+ w.mu.Lock()
+ defer w.mu.Unlock()
+
+ w.path[path] = fd
+ w.seen[path] = struct{}{}
+}
+
+func (w *watches) add(path, linkPath string, fd int, isDir bool) {
+ w.mu.Lock()
+ defer w.mu.Unlock()
+
+ w.path[path] = fd
+ w.wd[fd] = watch{wd: fd, name: path, linkName: linkPath, isDir: isDir}
+
+ parent := filepath.Dir(path)
+ byDir, ok := w.byDir[parent]
+ if !ok {
+ byDir = make(map[int]struct{}, 1)
+ w.byDir[parent] = byDir
+ }
+ byDir[fd] = struct{}{}
+}
+
+func (w *watches) byWd(fd int) (watch, bool) {
+ w.mu.RLock()
+ defer w.mu.RUnlock()
+ info, ok := w.wd[fd]
+ return info, ok
+}
+
+func (w *watches) byPath(path string) (watch, bool) {
+ w.mu.RLock()
+ defer w.mu.RUnlock()
+ info, ok := w.wd[w.path[path]]
+ return info, ok
+}
+
+func (w *watches) updateDirFlags(path string, flags uint32) bool {
+ w.mu.Lock()
+ defer w.mu.Unlock()
+
+ fd, ok := w.path[path]
+ if !ok { // Already deleted: don't re-set it here.
+ return false
+ }
+ info := w.wd[fd]
+ info.dirFlags = flags
+ w.wd[fd] = info
+ return true
+}
+
+func (w *watches) remove(fd int, path string) bool {
+ w.mu.Lock()
+ defer w.mu.Unlock()
+
+ isDir := w.wd[fd].isDir
+ delete(w.path, path)
+ delete(w.byUser, path)
+
+ parent := filepath.Dir(path)
+ delete(w.byDir[parent], fd)
+
+ if len(w.byDir[parent]) == 0 {
+ delete(w.byDir, parent)
+ }
+
+ delete(w.wd, fd)
+ delete(w.seen, path)
+ return isDir
+}
+
+func (w *watches) markSeen(path string, exists bool) {
+ w.mu.Lock()
+ defer w.mu.Unlock()
+ if exists {
+ w.seen[path] = struct{}{}
+ } else {
+ delete(w.seen, path)
+ }
+}
+
+func (w *watches) seenBefore(path string) bool {
+ w.mu.RLock()
+ defer w.mu.RUnlock()
+ _, ok := w.seen[path]
+ return ok
+}
+
+var defaultBufferSize = 0
+
+func newBackend(ev chan Event, errs chan error) (backend, error) {
kq, closepipe, err := newKqueue()
if err != nil {
return nil, err
}
- w := &Watcher{
- kq: kq,
- closepipe: closepipe,
- watches: make(map[string]int),
- watchesByDir: make(map[string]map[int]struct{}),
- dirFlags: make(map[string]uint32),
- paths: make(map[int]pathInfo),
- fileExists: make(map[string]struct{}),
- userWatches: make(map[string]struct{}),
- Events: make(chan Event, sz),
- Errors: make(chan error),
- done: make(chan struct{}),
+ w := &kqueue{
+ shared: newShared(ev, errs),
+ Events: ev,
+ Errors: errs,
+ kq: kq,
+ closepipe: closepipe,
+ watches: newWatches(),
}
go w.readEvents()
@@ -193,7 +211,7 @@ func NewBufferedWatcher(sz uint) (*Watcher, error) {
// all.
func newKqueue() (kq int, closepipe [2]int, err error) {
kq, err = unix.Kqueue()
- if kq == -1 {
+ if err != nil {
return kq, closepipe, err
}
@@ -203,6 +221,8 @@ func newKqueue() (kq int, closepipe [2]int, err error) {
unix.Close(kq)
return kq, closepipe, err
}
+ unix.CloseOnExec(closepipe[0])
+ unix.CloseOnExec(closepipe[1])
// Register changes to listen on the closepipe.
changes := make([]unix.Kevent_t, 1)
@@ -220,167 +240,72 @@ func newKqueue() (kq int, closepipe [2]int, err error) {
return kq, closepipe, nil
}
-// Returns true if the event was sent, or false if watcher is closed.
-func (w *Watcher) sendEvent(e Event) bool {
- select {
- case w.Events <- e:
- return true
- case <-w.done:
- return false
- }
-}
-
-// Returns true if the error was sent, or false if watcher is closed.
-func (w *Watcher) sendError(err error) bool {
- select {
- case w.Errors <- err:
- return true
- case <-w.done:
- return false
- }
-}
-
-// Close removes all watches and closes the Events channel.
-func (w *Watcher) Close() error {
- w.mu.Lock()
- if w.isClosed {
- w.mu.Unlock()
+func (w *kqueue) Close() error {
+ if w.shared.close() {
return nil
}
- w.isClosed = true
- // copy paths to remove while locked
- pathsToRemove := make([]string, 0, len(w.watches))
- for name := range w.watches {
- pathsToRemove = append(pathsToRemove, name)
- }
- w.mu.Unlock() // Unlock before calling Remove, which also locks
+ pathsToRemove := w.watches.listPaths(false)
for _, name := range pathsToRemove {
w.Remove(name)
}
- // Send "quit" message to the reader goroutine.
- unix.Close(w.closepipe[1])
- close(w.done)
-
+ unix.Close(w.closepipe[1]) // Send "quit" message to readEvents
return nil
}
-// Add starts monitoring the path for changes.
-//
-// A path can only be watched once; watching it more than once is a no-op and will
-// not return an error. Paths that do not yet exist on the filesystem cannot be
-// watched.
-//
-// A watch will be automatically removed if the watched path is deleted or
-// renamed. The exception is the Windows backend, which doesn't remove the
-// watcher on renames.
-//
-// Notifications on network filesystems (NFS, SMB, FUSE, etc.) or special
-// filesystems (/proc, /sys, etc.) generally don't work.
-//
-// Returns [ErrClosed] if [Watcher.Close] was called.
-//
-// See [Watcher.AddWith] for a version that allows adding options.
-//
-// # Watching directories
-//
-// All files in a directory are monitored, including new files that are created
-// after the watcher is started. Subdirectories are not watched (i.e. it's
-// non-recursive).
-//
-// # Watching files
-//
-// Watching individual files (rather than directories) is generally not
-// recommended as many programs (especially editors) update files atomically: it
-// will write to a temporary file which is then moved to to destination,
-// overwriting the original (or some variant thereof). The watcher on the
-// original file is now lost, as that no longer exists.
-//
-// The upshot of this is that a power failure or crash won't leave a
-// half-written file.
-//
-// Watch the parent directory and use Event.Name to filter out files you're not
-// interested in. There is an example of this in cmd/fsnotify/file.go.
-func (w *Watcher) Add(name string) error { return w.AddWith(name) }
+func (w *kqueue) Add(name string) error { return w.AddWith(name) }
-// AddWith is like [Watcher.Add], but allows adding options. When using Add()
-// the defaults described below are used.
-//
-// Possible options are:
-//
-// - [WithBufferSize] sets the buffer size for the Windows backend; no-op on
-// other platforms. The default is 64K (65536 bytes).
-func (w *Watcher) AddWith(name string, opts ...addOpt) error {
- _ = getOptions(opts...)
+func (w *kqueue) AddWith(name string, opts ...addOpt) error {
+ if debug {
+ fmt.Fprintf(os.Stderr, "FSNOTIFY_DEBUG: %s AddWith(%q)\n",
+ time.Now().Format("15:04:05.000000000"), name)
+ }
- w.mu.Lock()
- w.userWatches[name] = struct{}{}
- w.mu.Unlock()
- _, err := w.addWatch(name, noteAllEvents)
- return err
+ with := getOptions(opts...)
+ if !w.xSupports(with.op) {
+ return fmt.Errorf("%w: %s", xErrUnsupported, with.op)
+ }
+
+ _, err := w.addWatch(name, noteAllEvents, false)
+ if err != nil {
+ return err
+ }
+ w.watches.addUserWatch(name)
+ return nil
}
-// Remove stops monitoring the path for changes.
-//
-// Directories are always removed non-recursively. For example, if you added
-// /tmp/dir and /tmp/dir/subdir then you will need to remove both.
-//
-// Removing a path that has not yet been added returns [ErrNonExistentWatch].
-//
-// Returns nil if [Watcher.Close] was called.
-func (w *Watcher) Remove(name string) error {
+func (w *kqueue) Remove(name string) error {
+ if debug {
+ fmt.Fprintf(os.Stderr, "FSNOTIFY_DEBUG: %s Remove(%q)\n",
+ time.Now().Format("15:04:05.000000000"), name)
+ }
return w.remove(name, true)
}
-func (w *Watcher) remove(name string, unwatchFiles bool) error {
- name = filepath.Clean(name)
- w.mu.Lock()
- if w.isClosed {
- w.mu.Unlock()
+func (w *kqueue) remove(name string, unwatchFiles bool) error {
+ if w.isClosed() {
return nil
}
- watchfd, ok := w.watches[name]
- w.mu.Unlock()
+
+ name = filepath.Clean(name)
+ info, ok := w.watches.byPath(name)
if !ok {
return fmt.Errorf("%w: %s", ErrNonExistentWatch, name)
}
- err := w.register([]int{watchfd}, unix.EV_DELETE, 0)
+ err := w.register([]int{info.wd}, unix.EV_DELETE, 0)
if err != nil {
return err
}
- unix.Close(watchfd)
-
- w.mu.Lock()
- isDir := w.paths[watchfd].isDir
- delete(w.watches, name)
- delete(w.userWatches, name)
-
- parentName := filepath.Dir(name)
- delete(w.watchesByDir[parentName], watchfd)
-
- if len(w.watchesByDir[parentName]) == 0 {
- delete(w.watchesByDir, parentName)
- }
+ unix.Close(info.wd)
- delete(w.paths, watchfd)
- delete(w.dirFlags, name)
- delete(w.fileExists, name)
- w.mu.Unlock()
+ isDir := w.watches.remove(info.wd, name)
// Find all watched paths that are in this directory that are not external.
if unwatchFiles && isDir {
- var pathsToRemove []string
- w.mu.Lock()
- for fd := range w.watchesByDir[name] {
- path := w.paths[fd]
- if _, ok := w.userWatches[path.name]; !ok {
- pathsToRemove = append(pathsToRemove, path.name)
- }
- }
- w.mu.Unlock()
+ pathsToRemove := w.watches.watchesInDir(name)
for _, name := range pathsToRemove {
// Since these are internal, not much sense in propagating error to
// the user, as that will just confuse them with an error about a
@@ -391,23 +316,11 @@ func (w *Watcher) remove(name string, unwatchFiles bool) error {
return nil
}
-// WatchList returns all paths explicitly added with [Watcher.Add] (and are not
-// yet removed).
-//
-// Returns nil if [Watcher.Close] was called.
-func (w *Watcher) WatchList() []string {
- w.mu.Lock()
- defer w.mu.Unlock()
- if w.isClosed {
+func (w *kqueue) WatchList() []string {
+ if w.isClosed() {
return nil
}
-
- entries := make([]string, 0, len(w.userWatches))
- for pathname := range w.userWatches {
- entries = append(entries, pathname)
- }
-
- return entries
+ return w.watches.listPaths(true)
}
// Watch all events (except NOTE_EXTEND, NOTE_LINK, NOTE_REVOKE)
@@ -417,114 +330,93 @@ const noteAllEvents = unix.NOTE_DELETE | unix.NOTE_WRITE | unix.NOTE_ATTRIB | un
// described in kevent(2).
//
// Returns the real path to the file which was added, with symlinks resolved.
-func (w *Watcher) addWatch(name string, flags uint32) (string, error) {
- var isDir bool
- name = filepath.Clean(name)
-
- w.mu.Lock()
- if w.isClosed {
- w.mu.Unlock()
+func (w *kqueue) addWatch(name string, flags uint32, listDir bool) (string, error) {
+ if w.isClosed() {
return "", ErrClosed
}
- watchfd, alreadyWatching := w.watches[name]
- // We already have a watch, but we can still override flags.
- if alreadyWatching {
- isDir = w.paths[watchfd].isDir
- }
- w.mu.Unlock()
+ name = filepath.Clean(name)
+
+ info, alreadyWatching := w.watches.byPath(name)
if !alreadyWatching {
fi, err := os.Lstat(name)
if err != nil {
return "", err
}
- // Don't watch sockets or named pipes
+ // Don't watch sockets or named pipes.
if (fi.Mode()&os.ModeSocket == os.ModeSocket) || (fi.Mode()&os.ModeNamedPipe == os.ModeNamedPipe) {
return "", nil
}
- // Follow Symlinks.
- if fi.Mode()&os.ModeSymlink == os.ModeSymlink {
+ // Follow symlinks, but only for paths added with Add(), and not paths
+ // we're adding from internalWatch from a listdir.
+ if !listDir && fi.Mode()&os.ModeSymlink == os.ModeSymlink {
link, err := os.Readlink(name)
if err != nil {
- // Return nil because Linux can add unresolvable symlinks to the
- // watch list without problems, so maintain consistency with
- // that. There will be no file events for broken symlinks.
- // TODO: more specific check; returns os.PathError; ENOENT?
- return "", nil
+ return "", err
+ }
+ if !filepath.IsAbs(link) {
+ link = filepath.Join(filepath.Dir(name), link)
}
- w.mu.Lock()
- _, alreadyWatching = w.watches[link]
- w.mu.Unlock()
-
+ _, alreadyWatching = w.watches.byPath(link)
if alreadyWatching {
// Add to watches so we don't get spurious Create events later
// on when we diff the directories.
- w.watches[name] = 0
- w.fileExists[name] = struct{}{}
+ w.watches.addLink(name, 0)
return link, nil
}
+ info.linkName = name
name = link
fi, err = os.Lstat(name)
if err != nil {
- return "", nil
+ return "", err
}
}
// Retry on EINTR; open() can return EINTR in practice on macOS.
// See #354, and Go issues 11180 and 39237.
for {
- watchfd, err = unix.Open(name, openMode, 0)
+ info.wd, err = unix.Open(name, openMode, 0)
if err == nil {
break
}
if errors.Is(err, unix.EINTR) {
continue
}
-
return "", err
}
- isDir = fi.IsDir()
+ info.isDir = fi.IsDir()
}
- err := w.register([]int{watchfd}, unix.EV_ADD|unix.EV_CLEAR|unix.EV_ENABLE, flags)
+ err := w.register([]int{info.wd}, unix.EV_ADD|unix.EV_CLEAR|unix.EV_ENABLE, flags)
if err != nil {
- unix.Close(watchfd)
+ unix.Close(info.wd)
return "", err
}
if !alreadyWatching {
- w.mu.Lock()
- parentName := filepath.Dir(name)
- w.watches[name] = watchfd
-
- watchesByDir, ok := w.watchesByDir[parentName]
- if !ok {
- watchesByDir = make(map[int]struct{}, 1)
- w.watchesByDir[parentName] = watchesByDir
- }
- watchesByDir[watchfd] = struct{}{}
- w.paths[watchfd] = pathInfo{name: name, isDir: isDir}
- w.mu.Unlock()
+ w.watches.add(name, info.linkName, info.wd, info.isDir)
}
- if isDir {
- // Watch the directory if it has not been watched before, or if it was
- // watched before, but perhaps only a NOTE_DELETE (watchDirectoryFiles)
- w.mu.Lock()
-
+ // Watch the directory if it has not been watched before, or if it was
+ // watched before, but perhaps only a NOTE_DELETE (watchDirectoryFiles)
+ if info.isDir {
watchDir := (flags&unix.NOTE_WRITE) == unix.NOTE_WRITE &&
- (!alreadyWatching || (w.dirFlags[name]&unix.NOTE_WRITE) != unix.NOTE_WRITE)
- // Store flags so this watch can be updated later
- w.dirFlags[name] = flags
- w.mu.Unlock()
+ (!alreadyWatching || (info.dirFlags&unix.NOTE_WRITE) != unix.NOTE_WRITE)
+ if !w.watches.updateDirFlags(name, flags) {
+ return "", nil
+ }
if watchDir {
- if err := w.watchDirectoryFiles(name); err != nil {
+ d := name
+ if info.linkName != "" {
+ d = info.linkName
+ }
+ if err := w.watchDirectoryFiles(d); err != nil {
return "", err
}
}
@@ -534,7 +426,7 @@ func (w *Watcher) addWatch(name string, flags uint32) (string, error) {
// readEvents reads from kqueue and converts the received kevents into
// Event values that it sends down the Events channel.
-func (w *Watcher) readEvents() {
+func (w *kqueue) readEvents() {
defer func() {
close(w.Events)
close(w.Errors)
@@ -543,50 +435,65 @@ func (w *Watcher) readEvents() {
}()
eventBuffer := make([]unix.Kevent_t, 10)
- for closed := false; !closed; {
+ for {
kevents, err := w.read(eventBuffer)
// EINTR is okay, the syscall was interrupted before timeout expired.
if err != nil && err != unix.EINTR {
if !w.sendError(fmt.Errorf("fsnotify.readEvents: %w", err)) {
- closed = true
+ return
}
- continue
}
- // Flush the events we received to the Events channel
for _, kevent := range kevents {
var (
- watchfd = int(kevent.Ident)
- mask = uint32(kevent.Fflags)
+ wd = int(kevent.Ident)
+ mask = uint32(kevent.Fflags)
)
// Shut down the loop when the pipe is closed, but only after all
// other events have been processed.
- if watchfd == w.closepipe[0] {
- closed = true
- continue
+ if wd == w.closepipe[0] {
+ return
+ }
+
+ path, ok := w.watches.byWd(wd)
+ if debug {
+ internal.Debug(path.name, &kevent)
}
- w.mu.Lock()
- path := w.paths[watchfd]
- w.mu.Unlock()
+ // On macOS it seems that sometimes an event with Ident=0 is
+ // delivered, and no other flags/information beyond that, even
+ // though we never saw such a file descriptor. For example in
+ // TestWatchSymlink/277 (usually at the end, but sometimes sooner):
+ //
+ // fmt.Printf("READ: %2d %#v\n", kevent.Ident, kevent)
+ // unix.Kevent_t{Ident:0x2a, Filter:-4, Flags:0x25, Fflags:0x2, Data:0, Udata:(*uint8)(nil)}
+ // unix.Kevent_t{Ident:0x0, Filter:-4, Flags:0x25, Fflags:0x2, Data:0, Udata:(*uint8)(nil)}
+ //
+ // The first is a normal event, the second with Ident 0. No error
+ // flag, no data, no ... nothing.
+ //
+ // I read a bit through bsd/kern_event.c from the xnu source, but I
+ // don't really see an obvious location where this is triggered –
+ // this doesn't seem intentional, but idk...
+ //
+ // Technically fd 0 is a valid descriptor, so only skip it if
+ // there's no path, and if we're on macOS.
+ if !ok && kevent.Ident == 0 && runtime.GOOS == "darwin" {
+ continue
+ }
- event := w.newEvent(path.name, mask)
+ event := w.newEvent(path.name, path.linkName, mask)
if event.Has(Rename) || event.Has(Remove) {
w.remove(event.Name, false)
- w.mu.Lock()
- delete(w.fileExists, event.Name)
- w.mu.Unlock()
+ w.watches.markSeen(event.Name, false)
}
if path.isDir && event.Has(Write) && !event.Has(Remove) {
- w.sendDirectoryChangeEvents(event.Name)
- } else {
- if !w.sendEvent(event) {
- closed = true
- continue
- }
+ w.dirChange(event.Name)
+ } else if !w.sendEvent(event) {
+ return
}
if event.Has(Remove) {
@@ -594,25 +501,34 @@ func (w *Watcher) readEvents() {
// mv f1 f2 will delete f2, then create f2.
if path.isDir {
fileDir := filepath.Clean(event.Name)
- w.mu.Lock()
- _, found := w.watches[fileDir]
- w.mu.Unlock()
+ _, found := w.watches.byPath(fileDir)
if found {
- err := w.sendDirectoryChangeEvents(fileDir)
- if err != nil {
- if !w.sendError(err) {
- closed = true
- }
+ // TODO: this branch is never triggered in any test.
+ // Added in d6220df (2012).
+ // isDir check added in 8611c35 (2016): https://github.com/fsnotify/fsnotify/pull/111
+ //
+ // I don't really get how this can be triggered either.
+ // And it wasn't triggered in the patch that added it,
+ // either.
+ //
+ // Original also had a comment:
+ // make sure the directory exists before we watch for
+ // changes. When we do a recursive watch and perform
+ // rm -rf, the parent directory might have gone
+ // missing, ignore the missing directory and let the
+ // upcoming delete event remove the watch from the
+ // parent directory.
+ err := w.dirChange(fileDir)
+ if !w.sendError(err) {
+ return
}
}
} else {
- filePath := filepath.Clean(event.Name)
- if fi, err := os.Lstat(filePath); err == nil {
- err := w.sendFileCreatedEventIfNew(filePath, fi)
- if err != nil {
- if !w.sendError(err) {
- closed = true
- }
+ path := filepath.Clean(event.Name)
+ if fi, err := os.Lstat(path); err == nil {
+ err := w.sendCreateIfNew(path, fi)
+ if !w.sendError(err) {
+ return
}
}
}
@@ -622,8 +538,14 @@ func (w *Watcher) readEvents() {
}
// newEvent returns an platform-independent Event based on kqueue Fflags.
-func (w *Watcher) newEvent(name string, mask uint32) Event {
+func (w *kqueue) newEvent(name, linkName string, mask uint32) Event {
e := Event{Name: name}
+ if linkName != "" {
+ // If the user watched "/path/link" then emit events as "/path/link"
+ // rather than "/path/target".
+ e.Name = linkName
+ }
+
if mask&unix.NOTE_DELETE == unix.NOTE_DELETE {
e.Op |= Remove
}
@@ -645,8 +567,7 @@ func (w *Watcher) newEvent(name string, mask uint32) Event {
}
// watchDirectoryFiles to mimic inotify when adding a watch on a directory
-func (w *Watcher) watchDirectoryFiles(dirPath string) error {
- // Get all files
+func (w *kqueue) watchDirectoryFiles(dirPath string) error {
files, err := os.ReadDir(dirPath)
if err != nil {
return err
@@ -674,9 +595,7 @@ func (w *Watcher) watchDirectoryFiles(dirPath string) error {
}
}
- w.mu.Lock()
- w.fileExists[cleanPath] = struct{}{}
- w.mu.Unlock()
+ w.watches.markSeen(cleanPath, true)
}
return nil
@@ -686,7 +605,7 @@ func (w *Watcher) watchDirectoryFiles(dirPath string) error {
//
// This functionality is to have the BSD watcher match the inotify, which sends
// a create event for files created in a watched directory.
-func (w *Watcher) sendDirectoryChangeEvents(dir string) error {
+func (w *kqueue) dirChange(dir string) error {
files, err := os.ReadDir(dir)
if err != nil {
// Directory no longer exists: we can ignore this safely. kqueue will
@@ -694,69 +613,62 @@ func (w *Watcher) sendDirectoryChangeEvents(dir string) error {
if errors.Is(err, os.ErrNotExist) {
return nil
}
- return fmt.Errorf("fsnotify.sendDirectoryChangeEvents: %w", err)
+ return fmt.Errorf("fsnotify.dirChange %q: %w", dir, err)
}
for _, f := range files {
fi, err := f.Info()
if err != nil {
- return fmt.Errorf("fsnotify.sendDirectoryChangeEvents: %w", err)
+ if errors.Is(err, os.ErrNotExist) {
+ return nil
+ }
+ return fmt.Errorf("fsnotify.dirChange: %w", err)
}
- err = w.sendFileCreatedEventIfNew(filepath.Join(dir, fi.Name()), fi)
+ err = w.sendCreateIfNew(filepath.Join(dir, fi.Name()), fi)
if err != nil {
// Don't need to send an error if this file isn't readable.
- if errors.Is(err, unix.EACCES) || errors.Is(err, unix.EPERM) {
+ if errors.Is(err, unix.EACCES) || errors.Is(err, unix.EPERM) || errors.Is(err, os.ErrNotExist) {
return nil
}
- return fmt.Errorf("fsnotify.sendDirectoryChangeEvents: %w", err)
+ return fmt.Errorf("fsnotify.dirChange: %w", err)
}
}
return nil
}
-// sendFileCreatedEvent sends a create event if the file isn't already being tracked.
-func (w *Watcher) sendFileCreatedEventIfNew(filePath string, fi os.FileInfo) (err error) {
- w.mu.Lock()
- _, doesExist := w.fileExists[filePath]
- w.mu.Unlock()
- if !doesExist {
- if !w.sendEvent(Event{Name: filePath, Op: Create}) {
- return
+// Send a create event if the file isn't already being tracked, and start
+// watching this file.
+func (w *kqueue) sendCreateIfNew(path string, fi os.FileInfo) error {
+ if !w.watches.seenBefore(path) {
+ if !w.sendEvent(Event{Name: path, Op: Create}) {
+ return nil
}
}
- // like watchDirectoryFiles (but without doing another ReadDir)
- filePath, err = w.internalWatch(filePath, fi)
+ // Like watchDirectoryFiles, but without doing another ReadDir.
+ path, err := w.internalWatch(path, fi)
if err != nil {
return err
}
-
- w.mu.Lock()
- w.fileExists[filePath] = struct{}{}
- w.mu.Unlock()
-
+ w.watches.markSeen(path, true)
return nil
}
-func (w *Watcher) internalWatch(name string, fi os.FileInfo) (string, error) {
+func (w *kqueue) internalWatch(name string, fi os.FileInfo) (string, error) {
if fi.IsDir() {
// mimic Linux providing delete events for subdirectories, but preserve
// the flags used if currently watching subdirectory
- w.mu.Lock()
- flags := w.dirFlags[name]
- w.mu.Unlock()
-
- flags |= unix.NOTE_DELETE | unix.NOTE_RENAME
- return w.addWatch(name, flags)
+ info, _ := w.watches.byPath(name)
+ return w.addWatch(name, info.dirFlags|unix.NOTE_DELETE|unix.NOTE_RENAME, true)
}
- // watch file to mimic Linux inotify
- return w.addWatch(name, noteAllEvents)
+ // Watch file to mimic Linux inotify.
+ return w.addWatch(name, noteAllEvents, true)
}
// Register events with the queue.
-func (w *Watcher) register(fds []int, flags int, fflags uint32) error {
+func (w *kqueue) register(fds []int, flags int, fflags uint32) error {
changes := make([]unix.Kevent_t, len(fds))
for i, fd := range fds {
// SetKevent converts int to the platform-specific types.
@@ -773,10 +685,21 @@ func (w *Watcher) register(fds []int, flags int, fflags uint32) error {
}
// read retrieves pending events, or waits until an event occurs.
-func (w *Watcher) read(events []unix.Kevent_t) ([]unix.Kevent_t, error) {
+func (w *kqueue) read(events []unix.Kevent_t) ([]unix.Kevent_t, error) {
n, err := unix.Kevent(w.kq, nil, events, nil)
if err != nil {
return nil, err
}
return events[0:n], nil
}
+
+func (w *kqueue) xSupports(op Op) bool {
+ //if runtime.GOOS == "freebsd" {
+ // return true // Supports everything.
+ //}
+ if op.Has(xUnportableOpen) || op.Has(xUnportableRead) ||
+ op.Has(xUnportableCloseWrite) || op.Has(xUnportableCloseRead) {
+ return false
+ }
+ return true
+}
diff --git a/vendor/github.com/fsnotify/fsnotify/backend_other.go b/vendor/github.com/fsnotify/fsnotify/backend_other.go
index d34a23c015f8..b8c0ad722675 100644
--- a/vendor/github.com/fsnotify/fsnotify/backend_other.go
+++ b/vendor/github.com/fsnotify/fsnotify/backend_other.go
@@ -1,205 +1,22 @@
//go:build appengine || (!darwin && !dragonfly && !freebsd && !openbsd && !linux && !netbsd && !solaris && !windows)
-// +build appengine !darwin,!dragonfly,!freebsd,!openbsd,!linux,!netbsd,!solaris,!windows
-
-// Note: the documentation on the Watcher type and methods is generated from
-// mkdoc.zsh
package fsnotify
import "errors"
-// Watcher watches a set of paths, delivering events on a channel.
-//
-// A watcher should not be copied (e.g. pass it by pointer, rather than by
-// value).
-//
-// # Linux notes
-//
-// When a file is removed a Remove event won't be emitted until all file
-// descriptors are closed, and deletes will always emit a Chmod. For example:
-//
-// fp := os.Open("file")
-// os.Remove("file") // Triggers Chmod
-// fp.Close() // Triggers Remove
-//
-// This is the event that inotify sends, so not much can be changed about this.
-//
-// The fs.inotify.max_user_watches sysctl variable specifies the upper limit
-// for the number of watches per user, and fs.inotify.max_user_instances
-// specifies the maximum number of inotify instances per user. Every Watcher you
-// create is an "instance", and every path you add is a "watch".
-//
-// These are also exposed in /proc as /proc/sys/fs/inotify/max_user_watches and
-// /proc/sys/fs/inotify/max_user_instances
-//
-// To increase them you can use sysctl or write the value to the /proc file:
-//
-// # Default values on Linux 5.18
-// sysctl fs.inotify.max_user_watches=124983
-// sysctl fs.inotify.max_user_instances=128
-//
-// To make the changes persist on reboot edit /etc/sysctl.conf or
-// /usr/lib/sysctl.d/50-default.conf (details differ per Linux distro; check
-// your distro's documentation):
-//
-// fs.inotify.max_user_watches=124983
-// fs.inotify.max_user_instances=128
-//
-// Reaching the limit will result in a "no space left on device" or "too many open
-// files" error.
-//
-// # kqueue notes (macOS, BSD)
-//
-// kqueue requires opening a file descriptor for every file that's being watched;
-// so if you're watching a directory with five files then that's six file
-// descriptors. You will run in to your system's "max open files" limit faster on
-// these platforms.
-//
-// The sysctl variables kern.maxfiles and kern.maxfilesperproc can be used to
-// control the maximum number of open files, as well as /etc/login.conf on BSD
-// systems.
-//
-// # Windows notes
-//
-// Paths can be added as "C:\path\to\dir", but forward slashes
-// ("C:/path/to/dir") will also work.
-//
-// When a watched directory is removed it will always send an event for the
-// directory itself, but may not send events for all files in that directory.
-// Sometimes it will send events for all times, sometimes it will send no
-// events, and often only for some files.
-//
-// The default ReadDirectoryChangesW() buffer size is 64K, which is the largest
-// value that is guaranteed to work with SMB filesystems. If you have many
-// events in quick succession this may not be enough, and you will have to use
-// [WithBufferSize] to increase the value.
-type Watcher struct {
- // Events sends the filesystem change events.
- //
- // fsnotify can send the following events; a "path" here can refer to a
- // file, directory, symbolic link, or special file like a FIFO.
- //
- // fsnotify.Create A new path was created; this may be followed by one
- // or more Write events if data also gets written to a
- // file.
- //
- // fsnotify.Remove A path was removed.
- //
- // fsnotify.Rename A path was renamed. A rename is always sent with the
- // old path as Event.Name, and a Create event will be
- // sent with the new name. Renames are only sent for
- // paths that are currently watched; e.g. moving an
- // unmonitored file into a monitored directory will
- // show up as just a Create. Similarly, renaming a file
- // to outside a monitored directory will show up as
- // only a Rename.
- //
- // fsnotify.Write A file or named pipe was written to. A Truncate will
- // also trigger a Write. A single "write action"
- // initiated by the user may show up as one or multiple
- // writes, depending on when the system syncs things to
- // disk. For example when compiling a large Go program
- // you may get hundreds of Write events, and you may
- // want to wait until you've stopped receiving them
- // (see the dedup example in cmd/fsnotify).
- //
- // Some systems may send Write event for directories
- // when the directory content changes.
- //
- // fsnotify.Chmod Attributes were changed. On Linux this is also sent
- // when a file is removed (or more accurately, when a
- // link to an inode is removed). On kqueue it's sent
- // when a file is truncated. On Windows it's never
- // sent.
+type other struct {
Events chan Event
-
- // Errors sends any errors.
- //
- // ErrEventOverflow is used to indicate there are too many events:
- //
- // - inotify: There are too many queued events (fs.inotify.max_queued_events sysctl)
- // - windows: The buffer size is too small; WithBufferSize() can be used to increase it.
- // - kqueue, fen: Not used.
Errors chan error
}
-// NewWatcher creates a new Watcher.
-func NewWatcher() (*Watcher, error) {
+var defaultBufferSize = 0
+
+func newBackend(ev chan Event, errs chan error) (backend, error) {
return nil, errors.New("fsnotify not supported on the current platform")
}
-
-// NewBufferedWatcher creates a new Watcher with a buffered Watcher.Events
-// channel.
-//
-// The main use case for this is situations with a very large number of events
-// where the kernel buffer size can't be increased (e.g. due to lack of
-// permissions). An unbuffered Watcher will perform better for almost all use
-// cases, and whenever possible you will be better off increasing the kernel
-// buffers instead of adding a large userspace buffer.
-func NewBufferedWatcher(sz uint) (*Watcher, error) { return NewWatcher() }
-
-// Close removes all watches and closes the Events channel.
-func (w *Watcher) Close() error { return nil }
-
-// WatchList returns all paths explicitly added with [Watcher.Add] (and are not
-// yet removed).
-//
-// Returns nil if [Watcher.Close] was called.
-func (w *Watcher) WatchList() []string { return nil }
-
-// Add starts monitoring the path for changes.
-//
-// A path can only be watched once; watching it more than once is a no-op and will
-// not return an error. Paths that do not yet exist on the filesystem cannot be
-// watched.
-//
-// A watch will be automatically removed if the watched path is deleted or
-// renamed. The exception is the Windows backend, which doesn't remove the
-// watcher on renames.
-//
-// Notifications on network filesystems (NFS, SMB, FUSE, etc.) or special
-// filesystems (/proc, /sys, etc.) generally don't work.
-//
-// Returns [ErrClosed] if [Watcher.Close] was called.
-//
-// See [Watcher.AddWith] for a version that allows adding options.
-//
-// # Watching directories
-//
-// All files in a directory are monitored, including new files that are created
-// after the watcher is started. Subdirectories are not watched (i.e. it's
-// non-recursive).
-//
-// # Watching files
-//
-// Watching individual files (rather than directories) is generally not
-// recommended as many programs (especially editors) update files atomically: it
-// will write to a temporary file which is then moved to to destination,
-// overwriting the original (or some variant thereof). The watcher on the
-// original file is now lost, as that no longer exists.
-//
-// The upshot of this is that a power failure or crash won't leave a
-// half-written file.
-//
-// Watch the parent directory and use Event.Name to filter out files you're not
-// interested in. There is an example of this in cmd/fsnotify/file.go.
-func (w *Watcher) Add(name string) error { return nil }
-
-// AddWith is like [Watcher.Add], but allows adding options. When using Add()
-// the defaults described below are used.
-//
-// Possible options are:
-//
-// - [WithBufferSize] sets the buffer size for the Windows backend; no-op on
-// other platforms. The default is 64K (65536 bytes).
-func (w *Watcher) AddWith(name string, opts ...addOpt) error { return nil }
-
-// Remove stops monitoring the path for changes.
-//
-// Directories are always removed non-recursively. For example, if you added
-// /tmp/dir and /tmp/dir/subdir then you will need to remove both.
-//
-// Removing a path that has not yet been added returns [ErrNonExistentWatch].
-//
-// Returns nil if [Watcher.Close] was called.
-func (w *Watcher) Remove(name string) error { return nil }
+func (w *other) Close() error { return nil }
+func (w *other) WatchList() []string { return nil }
+func (w *other) Add(name string) error { return nil }
+func (w *other) AddWith(name string, opts ...addOpt) error { return nil }
+func (w *other) Remove(name string) error { return nil }
+func (w *other) xSupports(op Op) bool { return false }
diff --git a/vendor/github.com/fsnotify/fsnotify/backend_windows.go b/vendor/github.com/fsnotify/fsnotify/backend_windows.go
index 9bc91e5d613f..3433642d6419 100644
--- a/vendor/github.com/fsnotify/fsnotify/backend_windows.go
+++ b/vendor/github.com/fsnotify/fsnotify/backend_windows.go
@@ -1,12 +1,8 @@
//go:build windows
-// +build windows
// Windows backend based on ReadDirectoryChangesW()
//
// https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-readdirectorychangesw
-//
-// Note: the documentation on the Watcher type and methods is generated from
-// mkdoc.zsh
package fsnotify
@@ -19,196 +15,80 @@ import (
"runtime"
"strings"
"sync"
+ "time"
"unsafe"
+ "github.com/fsnotify/fsnotify/internal"
"golang.org/x/sys/windows"
)
-// Watcher watches a set of paths, delivering events on a channel.
-//
-// A watcher should not be copied (e.g. pass it by pointer, rather than by
-// value).
-//
-// # Linux notes
-//
-// When a file is removed a Remove event won't be emitted until all file
-// descriptors are closed, and deletes will always emit a Chmod. For example:
-//
-// fp := os.Open("file")
-// os.Remove("file") // Triggers Chmod
-// fp.Close() // Triggers Remove
-//
-// This is the event that inotify sends, so not much can be changed about this.
-//
-// The fs.inotify.max_user_watches sysctl variable specifies the upper limit
-// for the number of watches per user, and fs.inotify.max_user_instances
-// specifies the maximum number of inotify instances per user. Every Watcher you
-// create is an "instance", and every path you add is a "watch".
-//
-// These are also exposed in /proc as /proc/sys/fs/inotify/max_user_watches and
-// /proc/sys/fs/inotify/max_user_instances
-//
-// To increase them you can use sysctl or write the value to the /proc file:
-//
-// # Default values on Linux 5.18
-// sysctl fs.inotify.max_user_watches=124983
-// sysctl fs.inotify.max_user_instances=128
-//
-// To make the changes persist on reboot edit /etc/sysctl.conf or
-// /usr/lib/sysctl.d/50-default.conf (details differ per Linux distro; check
-// your distro's documentation):
-//
-// fs.inotify.max_user_watches=124983
-// fs.inotify.max_user_instances=128
-//
-// Reaching the limit will result in a "no space left on device" or "too many open
-// files" error.
-//
-// # kqueue notes (macOS, BSD)
-//
-// kqueue requires opening a file descriptor for every file that's being watched;
-// so if you're watching a directory with five files then that's six file
-// descriptors. You will run in to your system's "max open files" limit faster on
-// these platforms.
-//
-// The sysctl variables kern.maxfiles and kern.maxfilesperproc can be used to
-// control the maximum number of open files, as well as /etc/login.conf on BSD
-// systems.
-//
-// # Windows notes
-//
-// Paths can be added as "C:\path\to\dir", but forward slashes
-// ("C:/path/to/dir") will also work.
-//
-// When a watched directory is removed it will always send an event for the
-// directory itself, but may not send events for all files in that directory.
-// Sometimes it will send events for all times, sometimes it will send no
-// events, and often only for some files.
-//
-// The default ReadDirectoryChangesW() buffer size is 64K, which is the largest
-// value that is guaranteed to work with SMB filesystems. If you have many
-// events in quick succession this may not be enough, and you will have to use
-// [WithBufferSize] to increase the value.
-type Watcher struct {
- // Events sends the filesystem change events.
- //
- // fsnotify can send the following events; a "path" here can refer to a
- // file, directory, symbolic link, or special file like a FIFO.
- //
- // fsnotify.Create A new path was created; this may be followed by one
- // or more Write events if data also gets written to a
- // file.
- //
- // fsnotify.Remove A path was removed.
- //
- // fsnotify.Rename A path was renamed. A rename is always sent with the
- // old path as Event.Name, and a Create event will be
- // sent with the new name. Renames are only sent for
- // paths that are currently watched; e.g. moving an
- // unmonitored file into a monitored directory will
- // show up as just a Create. Similarly, renaming a file
- // to outside a monitored directory will show up as
- // only a Rename.
- //
- // fsnotify.Write A file or named pipe was written to. A Truncate will
- // also trigger a Write. A single "write action"
- // initiated by the user may show up as one or multiple
- // writes, depending on when the system syncs things to
- // disk. For example when compiling a large Go program
- // you may get hundreds of Write events, and you may
- // want to wait until you've stopped receiving them
- // (see the dedup example in cmd/fsnotify).
- //
- // Some systems may send Write event for directories
- // when the directory content changes.
- //
- // fsnotify.Chmod Attributes were changed. On Linux this is also sent
- // when a file is removed (or more accurately, when a
- // link to an inode is removed). On kqueue it's sent
- // when a file is truncated. On Windows it's never
- // sent.
+type readDirChangesW struct {
Events chan Event
-
- // Errors sends any errors.
- //
- // ErrEventOverflow is used to indicate there are too many events:
- //
- // - inotify: There are too many queued events (fs.inotify.max_queued_events sysctl)
- // - windows: The buffer size is too small; WithBufferSize() can be used to increase it.
- // - kqueue, fen: Not used.
Errors chan error
port windows.Handle // Handle to completion port
input chan *input // Inputs to the reader are sent on this channel
- quit chan chan<- error
+ done chan chan<- error
mu sync.Mutex // Protects access to watches, closed
watches watchMap // Map of watches (key: i-number)
closed bool // Set to true when Close() is first called
}
-// NewWatcher creates a new Watcher.
-func NewWatcher() (*Watcher, error) {
- return NewBufferedWatcher(50)
-}
+var defaultBufferSize = 50
-// NewBufferedWatcher creates a new Watcher with a buffered Watcher.Events
-// channel.
-//
-// The main use case for this is situations with a very large number of events
-// where the kernel buffer size can't be increased (e.g. due to lack of
-// permissions). An unbuffered Watcher will perform better for almost all use
-// cases, and whenever possible you will be better off increasing the kernel
-// buffers instead of adding a large userspace buffer.
-func NewBufferedWatcher(sz uint) (*Watcher, error) {
+func newBackend(ev chan Event, errs chan error) (backend, error) {
port, err := windows.CreateIoCompletionPort(windows.InvalidHandle, 0, 0, 0)
if err != nil {
return nil, os.NewSyscallError("CreateIoCompletionPort", err)
}
- w := &Watcher{
+ w := &readDirChangesW{
+ Events: ev,
+ Errors: errs,
port: port,
watches: make(watchMap),
input: make(chan *input, 1),
- Events: make(chan Event, sz),
- Errors: make(chan error),
- quit: make(chan chan<- error, 1),
+ done: make(chan chan<- error, 1),
}
go w.readEvents()
return w, nil
}
-func (w *Watcher) isClosed() bool {
+func (w *readDirChangesW) isClosed() bool {
w.mu.Lock()
defer w.mu.Unlock()
return w.closed
}
-func (w *Watcher) sendEvent(name string, mask uint64) bool {
+func (w *readDirChangesW) sendEvent(name, renamedFrom string, mask uint64) bool {
if mask == 0 {
return false
}
event := w.newEvent(name, uint32(mask))
+ event.renamedFrom = renamedFrom
select {
- case ch := <-w.quit:
- w.quit <- ch
+ case ch := <-w.done:
+ w.done <- ch
case w.Events <- event:
}
return true
}
// Returns true if the error was sent, or false if watcher is closed.
-func (w *Watcher) sendError(err error) bool {
+func (w *readDirChangesW) sendError(err error) bool {
+ if err == nil {
+ return true
+ }
select {
+ case <-w.done:
+ return false
case w.Errors <- err:
return true
- case <-w.quit:
}
- return false
}
-// Close removes all watches and closes the Events channel.
-func (w *Watcher) Close() error {
+func (w *readDirChangesW) Close() error {
if w.isClosed() {
return nil
}
@@ -217,66 +97,30 @@ func (w *Watcher) Close() error {
w.closed = true
w.mu.Unlock()
- // Send "quit" message to the reader goroutine
+ // Send "done" message to the reader goroutine
ch := make(chan error)
- w.quit <- ch
+ w.done <- ch
if err := w.wakeupReader(); err != nil {
return err
}
return <-ch
}
-// Add starts monitoring the path for changes.
-//
-// A path can only be watched once; watching it more than once is a no-op and will
-// not return an error. Paths that do not yet exist on the filesystem cannot be
-// watched.
-//
-// A watch will be automatically removed if the watched path is deleted or
-// renamed. The exception is the Windows backend, which doesn't remove the
-// watcher on renames.
-//
-// Notifications on network filesystems (NFS, SMB, FUSE, etc.) or special
-// filesystems (/proc, /sys, etc.) generally don't work.
-//
-// Returns [ErrClosed] if [Watcher.Close] was called.
-//
-// See [Watcher.AddWith] for a version that allows adding options.
-//
-// # Watching directories
-//
-// All files in a directory are monitored, including new files that are created
-// after the watcher is started. Subdirectories are not watched (i.e. it's
-// non-recursive).
-//
-// # Watching files
-//
-// Watching individual files (rather than directories) is generally not
-// recommended as many programs (especially editors) update files atomically: it
-// will write to a temporary file which is then moved to to destination,
-// overwriting the original (or some variant thereof). The watcher on the
-// original file is now lost, as that no longer exists.
-//
-// The upshot of this is that a power failure or crash won't leave a
-// half-written file.
-//
-// Watch the parent directory and use Event.Name to filter out files you're not
-// interested in. There is an example of this in cmd/fsnotify/file.go.
-func (w *Watcher) Add(name string) error { return w.AddWith(name) }
+func (w *readDirChangesW) Add(name string) error { return w.AddWith(name) }
-// AddWith is like [Watcher.Add], but allows adding options. When using Add()
-// the defaults described below are used.
-//
-// Possible options are:
-//
-// - [WithBufferSize] sets the buffer size for the Windows backend; no-op on
-// other platforms. The default is 64K (65536 bytes).
-func (w *Watcher) AddWith(name string, opts ...addOpt) error {
+func (w *readDirChangesW) AddWith(name string, opts ...addOpt) error {
if w.isClosed() {
return ErrClosed
}
+ if debug {
+ fmt.Fprintf(os.Stderr, "FSNOTIFY_DEBUG: %s AddWith(%q)\n",
+ time.Now().Format("15:04:05.000000000"), filepath.ToSlash(name))
+ }
with := getOptions(opts...)
+ if !w.xSupports(with.op) {
+ return fmt.Errorf("%w: %s", xErrUnsupported, with.op)
+ }
if with.bufsize < 4096 {
return fmt.Errorf("fsnotify.WithBufferSize: buffer size cannot be smaller than 4096 bytes")
}
@@ -295,18 +139,14 @@ func (w *Watcher) AddWith(name string, opts ...addOpt) error {
return <-in.reply
}
-// Remove stops monitoring the path for changes.
-//
-// Directories are always removed non-recursively. For example, if you added
-// /tmp/dir and /tmp/dir/subdir then you will need to remove both.
-//
-// Removing a path that has not yet been added returns [ErrNonExistentWatch].
-//
-// Returns nil if [Watcher.Close] was called.
-func (w *Watcher) Remove(name string) error {
+func (w *readDirChangesW) Remove(name string) error {
if w.isClosed() {
return nil
}
+ if debug {
+ fmt.Fprintf(os.Stderr, "FSNOTIFY_DEBUG: %s Remove(%q)\n",
+ time.Now().Format("15:04:05.000000000"), filepath.ToSlash(name))
+ }
in := &input{
op: opRemoveWatch,
@@ -320,11 +160,7 @@ func (w *Watcher) Remove(name string) error {
return <-in.reply
}
-// WatchList returns all paths explicitly added with [Watcher.Add] (and are not
-// yet removed).
-//
-// Returns nil if [Watcher.Close] was called.
-func (w *Watcher) WatchList() []string {
+func (w *readDirChangesW) WatchList() []string {
if w.isClosed() {
return nil
}
@@ -335,7 +171,13 @@ func (w *Watcher) WatchList() []string {
entries := make([]string, 0, len(w.watches))
for _, entry := range w.watches {
for _, watchEntry := range entry {
- entries = append(entries, watchEntry.path)
+ for name := range watchEntry.names {
+ entries = append(entries, filepath.Join(watchEntry.path, name))
+ }
+ // the directory itself is being watched
+ if watchEntry.mask != 0 {
+ entries = append(entries, watchEntry.path)
+ }
}
}
@@ -361,7 +203,7 @@ const (
sysFSIGNORED = 0x8000
)
-func (w *Watcher) newEvent(name string, mask uint32) Event {
+func (w *readDirChangesW) newEvent(name string, mask uint32) Event {
e := Event{Name: name}
if mask&sysFSCREATE == sysFSCREATE || mask&sysFSMOVEDTO == sysFSMOVEDTO {
e.Op |= Create
@@ -417,7 +259,7 @@ type (
watchMap map[uint32]indexMap
)
-func (w *Watcher) wakeupReader() error {
+func (w *readDirChangesW) wakeupReader() error {
err := windows.PostQueuedCompletionStatus(w.port, 0, 0, nil)
if err != nil {
return os.NewSyscallError("PostQueuedCompletionStatus", err)
@@ -425,7 +267,7 @@ func (w *Watcher) wakeupReader() error {
return nil
}
-func (w *Watcher) getDir(pathname string) (dir string, err error) {
+func (w *readDirChangesW) getDir(pathname string) (dir string, err error) {
attr, err := windows.GetFileAttributes(windows.StringToUTF16Ptr(pathname))
if err != nil {
return "", os.NewSyscallError("GetFileAttributes", err)
@@ -439,7 +281,7 @@ func (w *Watcher) getDir(pathname string) (dir string, err error) {
return
}
-func (w *Watcher) getIno(path string) (ino *inode, err error) {
+func (w *readDirChangesW) getIno(path string) (ino *inode, err error) {
h, err := windows.CreateFile(windows.StringToUTF16Ptr(path),
windows.FILE_LIST_DIRECTORY,
windows.FILE_SHARE_READ|windows.FILE_SHARE_WRITE|windows.FILE_SHARE_DELETE,
@@ -482,9 +324,8 @@ func (m watchMap) set(ino *inode, watch *watch) {
}
// Must run within the I/O thread.
-func (w *Watcher) addWatch(pathname string, flags uint64, bufsize int) error {
- //pathname, recurse := recursivePath(pathname)
- recurse := false
+func (w *readDirChangesW) addWatch(pathname string, flags uint64, bufsize int) error {
+ pathname, recurse := recursivePath(pathname)
dir, err := w.getDir(pathname)
if err != nil {
@@ -538,7 +379,7 @@ func (w *Watcher) addWatch(pathname string, flags uint64, bufsize int) error {
}
// Must run within the I/O thread.
-func (w *Watcher) remWatch(pathname string) error {
+func (w *readDirChangesW) remWatch(pathname string) error {
pathname, recurse := recursivePath(pathname)
dir, err := w.getDir(pathname)
@@ -566,11 +407,11 @@ func (w *Watcher) remWatch(pathname string) error {
return fmt.Errorf("%w: %s", ErrNonExistentWatch, pathname)
}
if pathname == dir {
- w.sendEvent(watch.path, watch.mask&sysFSIGNORED)
+ w.sendEvent(watch.path, "", watch.mask&sysFSIGNORED)
watch.mask = 0
} else {
name := filepath.Base(pathname)
- w.sendEvent(filepath.Join(watch.path, name), watch.names[name]&sysFSIGNORED)
+ w.sendEvent(filepath.Join(watch.path, name), "", watch.names[name]&sysFSIGNORED)
delete(watch.names, name)
}
@@ -578,23 +419,23 @@ func (w *Watcher) remWatch(pathname string) error {
}
// Must run within the I/O thread.
-func (w *Watcher) deleteWatch(watch *watch) {
+func (w *readDirChangesW) deleteWatch(watch *watch) {
for name, mask := range watch.names {
if mask&provisional == 0 {
- w.sendEvent(filepath.Join(watch.path, name), mask&sysFSIGNORED)
+ w.sendEvent(filepath.Join(watch.path, name), "", mask&sysFSIGNORED)
}
delete(watch.names, name)
}
if watch.mask != 0 {
if watch.mask&provisional == 0 {
- w.sendEvent(watch.path, watch.mask&sysFSIGNORED)
+ w.sendEvent(watch.path, "", watch.mask&sysFSIGNORED)
}
watch.mask = 0
}
}
// Must run within the I/O thread.
-func (w *Watcher) startRead(watch *watch) error {
+func (w *readDirChangesW) startRead(watch *watch) error {
err := windows.CancelIo(watch.ino.handle)
if err != nil {
w.sendError(os.NewSyscallError("CancelIo", err))
@@ -624,7 +465,7 @@ func (w *Watcher) startRead(watch *watch) error {
err := os.NewSyscallError("ReadDirectoryChanges", rdErr)
if rdErr == windows.ERROR_ACCESS_DENIED && watch.mask&provisional == 0 {
// Watched directory was probably removed
- w.sendEvent(watch.path, watch.mask&sysFSDELETESELF)
+ w.sendEvent(watch.path, "", watch.mask&sysFSDELETESELF)
err = nil
}
w.deleteWatch(watch)
@@ -637,7 +478,7 @@ func (w *Watcher) startRead(watch *watch) error {
// readEvents reads from the I/O completion port, converts the
// received events into Event objects and sends them via the Events channel.
// Entry point to the I/O thread.
-func (w *Watcher) readEvents() {
+func (w *readDirChangesW) readEvents() {
var (
n uint32
key uintptr
@@ -652,7 +493,7 @@ func (w *Watcher) readEvents() {
watch := (*watch)(unsafe.Pointer(ov))
if watch == nil {
select {
- case ch := <-w.quit:
+ case ch := <-w.done:
w.mu.Lock()
var indexes []indexMap
for _, index := range w.watches {
@@ -700,7 +541,7 @@ func (w *Watcher) readEvents() {
}
case windows.ERROR_ACCESS_DENIED:
// Watched directory was probably removed
- w.sendEvent(watch.path, watch.mask&sysFSDELETESELF)
+ w.sendEvent(watch.path, "", watch.mask&sysFSDELETESELF)
w.deleteWatch(watch)
w.startRead(watch)
continue
@@ -733,6 +574,10 @@ func (w *Watcher) readEvents() {
name := windows.UTF16ToString(buf)
fullname := filepath.Join(watch.path, name)
+ if debug {
+ internal.Debug(fullname, raw.Action)
+ }
+
var mask uint64
switch raw.Action {
case windows.FILE_ACTION_REMOVED:
@@ -761,21 +606,22 @@ func (w *Watcher) readEvents() {
}
}
- sendNameEvent := func() {
- w.sendEvent(fullname, watch.names[name]&mask)
- }
if raw.Action != windows.FILE_ACTION_RENAMED_NEW_NAME {
- sendNameEvent()
+ w.sendEvent(fullname, "", watch.names[name]&mask)
}
if raw.Action == windows.FILE_ACTION_REMOVED {
- w.sendEvent(fullname, watch.names[name]&sysFSIGNORED)
+ w.sendEvent(fullname, "", watch.names[name]&sysFSIGNORED)
delete(watch.names, name)
}
- w.sendEvent(fullname, watch.mask&w.toFSnotifyFlags(raw.Action))
+ if watch.rename != "" && raw.Action == windows.FILE_ACTION_RENAMED_NEW_NAME {
+ w.sendEvent(fullname, filepath.Join(watch.path, watch.rename), watch.mask&w.toFSnotifyFlags(raw.Action))
+ } else {
+ w.sendEvent(fullname, "", watch.mask&w.toFSnotifyFlags(raw.Action))
+ }
+
if raw.Action == windows.FILE_ACTION_RENAMED_NEW_NAME {
- fullname = filepath.Join(watch.path, watch.rename)
- sendNameEvent()
+ w.sendEvent(filepath.Join(watch.path, watch.rename), "", watch.names[name]&mask)
}
// Move to the next event in the buffer
@@ -787,8 +633,7 @@ func (w *Watcher) readEvents() {
// Error!
if offset >= n {
//lint:ignore ST1005 Windows should be capitalized
- w.sendError(errors.New(
- "Windows system assumed buffer larger than it is, events have likely been missed"))
+ w.sendError(errors.New("Windows system assumed buffer larger than it is, events have likely been missed"))
break
}
}
@@ -799,7 +644,7 @@ func (w *Watcher) readEvents() {
}
}
-func (w *Watcher) toWindowsFlags(mask uint64) uint32 {
+func (w *readDirChangesW) toWindowsFlags(mask uint64) uint32 {
var m uint32
if mask&sysFSMODIFY != 0 {
m |= windows.FILE_NOTIFY_CHANGE_LAST_WRITE
@@ -810,7 +655,7 @@ func (w *Watcher) toWindowsFlags(mask uint64) uint32 {
return m
}
-func (w *Watcher) toFSnotifyFlags(action uint32) uint64 {
+func (w *readDirChangesW) toFSnotifyFlags(action uint32) uint64 {
switch action {
case windows.FILE_ACTION_ADDED:
return sysFSCREATE
@@ -825,3 +670,11 @@ func (w *Watcher) toFSnotifyFlags(action uint32) uint64 {
}
return 0
}
+
+func (w *readDirChangesW) xSupports(op Op) bool {
+ if op.Has(xUnportableOpen) || op.Has(xUnportableRead) ||
+ op.Has(xUnportableCloseWrite) || op.Has(xUnportableCloseRead) {
+ return false
+ }
+ return true
+}
diff --git a/vendor/github.com/fsnotify/fsnotify/fsnotify.go b/vendor/github.com/fsnotify/fsnotify/fsnotify.go
index 24c99cc4999e..f64be4bf98ee 100644
--- a/vendor/github.com/fsnotify/fsnotify/fsnotify.go
+++ b/vendor/github.com/fsnotify/fsnotify/fsnotify.go
@@ -3,19 +3,146 @@
//
// Currently supported systems:
//
-// Linux 2.6.32+ via inotify
-// BSD, macOS via kqueue
-// Windows via ReadDirectoryChangesW
-// illumos via FEN
+// - Linux via inotify
+// - BSD, macOS via kqueue
+// - Windows via ReadDirectoryChangesW
+// - illumos via FEN
+//
+// # FSNOTIFY_DEBUG
+//
+// Set the FSNOTIFY_DEBUG environment variable to "1" to print debug messages to
+// stderr. This can be useful to track down some problems, especially in cases
+// where fsnotify is used as an indirect dependency.
+//
+// Every event will be printed as soon as there's something useful to print,
+// with as little processing from fsnotify.
+//
+// Example output:
+//
+// FSNOTIFY_DEBUG: 11:34:23.633087586 256:IN_CREATE → "/tmp/file-1"
+// FSNOTIFY_DEBUG: 11:34:23.633202319 4:IN_ATTRIB → "/tmp/file-1"
+// FSNOTIFY_DEBUG: 11:34:28.989728764 512:IN_DELETE → "/tmp/file-1"
package fsnotify
import (
"errors"
"fmt"
+ "os"
"path/filepath"
"strings"
)
+// Watcher watches a set of paths, delivering events on a channel.
+//
+// A watcher should not be copied (e.g. pass it by pointer, rather than by
+// value).
+//
+// # Linux notes
+//
+// When a file is removed a Remove event won't be emitted until all file
+// descriptors are closed, and deletes will always emit a Chmod. For example:
+//
+// fp := os.Open("file")
+// os.Remove("file") // Triggers Chmod
+// fp.Close() // Triggers Remove
+//
+// This is the event that inotify sends, so not much can be changed about this.
+//
+// The fs.inotify.max_user_watches sysctl variable specifies the upper limit
+// for the number of watches per user, and fs.inotify.max_user_instances
+// specifies the maximum number of inotify instances per user. Every Watcher you
+// create is an "instance", and every path you add is a "watch".
+//
+// These are also exposed in /proc as /proc/sys/fs/inotify/max_user_watches and
+// /proc/sys/fs/inotify/max_user_instances
+//
+// To increase them you can use sysctl or write the value to the /proc file:
+//
+// # Default values on Linux 5.18
+// sysctl fs.inotify.max_user_watches=124983
+// sysctl fs.inotify.max_user_instances=128
+//
+// To make the changes persist on reboot edit /etc/sysctl.conf or
+// /usr/lib/sysctl.d/50-default.conf (details differ per Linux distro; check
+// your distro's documentation):
+//
+// fs.inotify.max_user_watches=124983
+// fs.inotify.max_user_instances=128
+//
+// Reaching the limit will result in a "no space left on device" or "too many open
+// files" error.
+//
+// # kqueue notes (macOS, BSD)
+//
+// kqueue requires opening a file descriptor for every file that's being watched;
+// so if you're watching a directory with five files then that's six file
+// descriptors. You will run in to your system's "max open files" limit faster on
+// these platforms.
+//
+// The sysctl variables kern.maxfiles and kern.maxfilesperproc can be used to
+// control the maximum number of open files, as well as /etc/login.conf on BSD
+// systems.
+//
+// # Windows notes
+//
+// Paths can be added as "C:\\path\\to\\dir", but forward slashes
+// ("C:/path/to/dir") will also work.
+//
+// When a watched directory is removed it will always send an event for the
+// directory itself, but may not send events for all files in that directory.
+// Sometimes it will send events for all files, sometimes it will send no
+// events, and often only for some files.
+//
+// The default ReadDirectoryChangesW() buffer size is 64K, which is the largest
+// value that is guaranteed to work with SMB filesystems. If you have many
+// events in quick succession this may not be enough, and you will have to use
+// [WithBufferSize] to increase the value.
+type Watcher struct {
+ b backend
+
+ // Events sends the filesystem change events.
+ //
+ // fsnotify can send the following events; a "path" here can refer to a
+ // file, directory, symbolic link, or special file like a FIFO.
+ //
+ // fsnotify.Create A new path was created; this may be followed by one
+ // or more Write events if data also gets written to a
+ // file.
+ //
+ // fsnotify.Remove A path was removed.
+ //
+ // fsnotify.Rename A path was renamed. A rename is always sent with the
+ // old path as Event.Name, and a Create event will be
+ // sent with the new name. Renames are only sent for
+ // paths that are currently watched; e.g. moving an
+ // unmonitored file into a monitored directory will
+ // show up as just a Create. Similarly, renaming a file
+ // to outside a monitored directory will show up as
+ // only a Rename.
+ //
+ // fsnotify.Write A file or named pipe was written to. A Truncate will
+ // also trigger a Write. A single "write action"
+ // initiated by the user may show up as one or multiple
+ // writes, depending on when the system syncs things to
+ // disk. For example when compiling a large Go program
+ // you may get hundreds of Write events, and you may
+ // want to wait until you've stopped receiving them
+ // (see the dedup example in cmd/fsnotify).
+ //
+ // Some systems may send Write event for directories
+ // when the directory content changes.
+ //
+ // fsnotify.Chmod Attributes were changed. On Linux this is also sent
+ // when a file is removed (or more accurately, when a
+ // link to an inode is removed). On kqueue it's sent
+ // when a file is truncated. On Windows it's never
+ // sent.
+ Events chan Event
+
+ // Errors sends any errors.
+ Errors chan error
+}
+
// Event represents a file system notification.
type Event struct {
// Path to the file or directory.
@@ -30,6 +157,16 @@ type Event struct {
// This is a bitmask and some systems may send multiple operations at once.
// Use the Event.Has() method instead of comparing with ==.
Op Op
+
+ // Create events will have this set to the old path if it's a rename. This
+ // only works when both the source and destination are watched. It's not
+ // reliable when watching individual files, only directories.
+ //
+ // For example "mv /tmp/file /tmp/rename" will emit:
+ //
+ // Event{Op: Rename, Name: "/tmp/file"}
+ // Event{Op: Create, Name: "/tmp/rename", RenamedFrom: "/tmp/file"}
+ renamedFrom string
}
// Op describes a set of file operations.
@@ -50,7 +187,7 @@ const (
// example "remove to trash" is often a rename).
Remove
- // The path was renamed to something else; any watched on it will be
+ // The path was renamed to something else; any watches on it will be
// removed.
Rename
@@ -60,15 +197,157 @@ const (
// get triggered very frequently by some software. For example, Spotlight
// indexing on macOS, anti-virus software, backup software, etc.
Chmod
+
+ // File descriptor was opened.
+ //
+ // Only works on Linux and FreeBSD.
+ xUnportableOpen
+
+ // File was read from.
+ //
+ // Only works on Linux and FreeBSD.
+ xUnportableRead
+
+ // File opened for writing was closed.
+ //
+ // Only works on Linux and FreeBSD.
+ //
+ // The advantage of using this over Write is that it's more reliable than
+ // waiting for Write events to stop. It's also faster (if you're not
+ // listening to Write events): copying a file of a few GB can easily
+ // generate tens of thousands of Write events in a short span of time.
+ xUnportableCloseWrite
+
+ // File opened for reading was closed.
+ //
+ // Only works on Linux and FreeBSD.
+ xUnportableCloseRead
)
-// Common errors that can be reported.
var (
+ // ErrNonExistentWatch is used when Remove() is called on a path that's not
+ // added.
ErrNonExistentWatch = errors.New("fsnotify: can't remove non-existent watch")
- ErrEventOverflow = errors.New("fsnotify: queue or buffer overflow")
- ErrClosed = errors.New("fsnotify: watcher already closed")
+
+ // ErrClosed is used when trying to operate on a closed Watcher.
+ ErrClosed = errors.New("fsnotify: watcher already closed")
+
+ // ErrEventOverflow is reported from the Errors channel when there are too
+ // many events:
+ //
+ // - inotify: inotify returns IN_Q_OVERFLOW – because there are too
+ // many queued events (the fs.inotify.max_queued_events
+ // sysctl can be used to increase this).
+ // - windows: The buffer size is too small; WithBufferSize() can be used to increase it.
+ // - kqueue, fen: Not used.
+ ErrEventOverflow = errors.New("fsnotify: queue or buffer overflow")
+
+ // ErrUnsupported is returned by AddWith() when WithOps() specified an
+ // Unportable event that's not supported on this platform.
+ //lint:ignore ST1012 not relevant
+ xErrUnsupported = errors.New("fsnotify: not supported with this backend")
)
+// NewWatcher creates a new Watcher.
+func NewWatcher() (*Watcher, error) {
+ ev, errs := make(chan Event, defaultBufferSize), make(chan error)
+ b, err := newBackend(ev, errs)
+ if err != nil {
+ return nil, err
+ }
+ return &Watcher{b: b, Events: ev, Errors: errs}, nil
+}
+
+// NewBufferedWatcher creates a new Watcher with a buffered Watcher.Events
+// channel.
+//
+// The main use case for this is situations with a very large number of events
+// where the kernel buffer size can't be increased (e.g. due to lack of
+// permissions). An unbuffered Watcher will perform better for almost all use
+// cases, and whenever possible you will be better off increasing the kernel
+// buffers instead of adding a large userspace buffer.
+func NewBufferedWatcher(sz uint) (*Watcher, error) {
+ ev, errs := make(chan Event, sz), make(chan error)
+ b, err := newBackend(ev, errs)
+ if err != nil {
+ return nil, err
+ }
+ return &Watcher{b: b, Events: ev, Errors: errs}, nil
+}
+
+// Add starts monitoring the path for changes.
+//
+// A path can only be watched once; watching it more than once is a no-op and will
+// not return an error. Paths that do not yet exist on the filesystem cannot be
+// watched.
+//
+// A watch will be automatically removed if the watched path is deleted or
+// renamed. The exception is the Windows backend, which doesn't remove the
+// watcher on renames.
+//
+// Notifications on network filesystems (NFS, SMB, FUSE, etc.) or special
+// filesystems (/proc, /sys, etc.) generally don't work.
+//
+// Returns [ErrClosed] if [Watcher.Close] was called.
+//
+// See [Watcher.AddWith] for a version that allows adding options.
+//
+// # Watching directories
+//
+// All files in a directory are monitored, including new files that are created
+// after the watcher is started. Subdirectories are not watched (i.e. it's
+// non-recursive).
+//
+// # Watching files
+//
+// Watching individual files (rather than directories) is generally not
+// recommended as many programs (especially editors) update files atomically: it
+// will write to a temporary file which is then moved to destination,
+// overwriting the original (or some variant thereof). The watcher on the
+// original file is now lost, as that no longer exists.
+//
+// The upshot of this is that a power failure or crash won't leave a
+// half-written file.
+//
+// Watch the parent directory and use Event.Name to filter out files you're not
+// interested in. There is an example of this in cmd/fsnotify/file.go.
+func (w *Watcher) Add(path string) error { return w.b.Add(path) }
+
+// AddWith is like [Watcher.Add], but allows adding options. When using Add()
+// the defaults described below are used.
+//
+// Possible options are:
+//
+// - [WithBufferSize] sets the buffer size for the Windows backend; no-op on
+// other platforms. The default is 64K (65536 bytes).
+func (w *Watcher) AddWith(path string, opts ...addOpt) error { return w.b.AddWith(path, opts...) }
+
+// Remove stops monitoring the path for changes.
+//
+// Directories are always removed non-recursively. For example, if you added
+// /tmp/dir and /tmp/dir/subdir then you will need to remove both.
+//
+// Removing a path that has not yet been added returns [ErrNonExistentWatch].
+//
+// Returns nil if [Watcher.Close] was called.
+func (w *Watcher) Remove(path string) error { return w.b.Remove(path) }
+
+// Close removes all watches and closes the Events channel.
+func (w *Watcher) Close() error { return w.b.Close() }
+
+// WatchList returns all paths explicitly added with [Watcher.Add] (and are not
+// yet removed).
+//
+// The order is undefined, and may differ per call. Returns nil if
+// [Watcher.Close] was called.
+func (w *Watcher) WatchList() []string { return w.b.WatchList() }
+
+// Supports reports if all the listed operations are supported by this platform.
+//
+// Create, Write, Remove, Rename, and Chmod are always supported. It can only
+// return false for an Op starting with Unportable.
+func (w *Watcher) xSupports(op Op) bool { return w.b.xSupports(op) }
+
func (o Op) String() string {
var b strings.Builder
if o.Has(Create) {
@@ -80,6 +359,18 @@ func (o Op) String() string {
if o.Has(Write) {
b.WriteString("|WRITE")
}
+ if o.Has(xUnportableOpen) {
+ b.WriteString("|OPEN")
+ }
+ if o.Has(xUnportableRead) {
+ b.WriteString("|READ")
+ }
+ if o.Has(xUnportableCloseWrite) {
+ b.WriteString("|CLOSE_WRITE")
+ }
+ if o.Has(xUnportableCloseRead) {
+ b.WriteString("|CLOSE_READ")
+ }
if o.Has(Rename) {
b.WriteString("|RENAME")
}
@@ -100,24 +391,48 @@ func (e Event) Has(op Op) bool { return e.Op.Has(op) }
// String returns a string representation of the event with their path.
func (e Event) String() string {
+ if e.renamedFrom != "" {
+ return fmt.Sprintf("%-13s %q ← %q", e.Op.String(), e.Name, e.renamedFrom)
+ }
return fmt.Sprintf("%-13s %q", e.Op.String(), e.Name)
}
type (
+ backend interface {
+ Add(string) error
+ AddWith(string, ...addOpt) error
+ Remove(string) error
+ WatchList() []string
+ Close() error
+ xSupports(Op) bool
+ }
addOpt func(opt *withOpts)
withOpts struct {
- bufsize int
+ bufsize int
+ op Op
+ noFollow bool
+ sendCreate bool
}
)
+var debug = func() bool {
+ // Check for exactly "1" (rather than mere existence) so we can add
+ // options/flags in the future. I don't know if we ever want that, but it's
+ // nice to leave the option open.
+ return os.Getenv("FSNOTIFY_DEBUG") == "1"
+}()
+
var defaultOpts = withOpts{
bufsize: 65536, // 64K
+ op: Create | Write | Remove | Rename | Chmod,
}
func getOptions(opts ...addOpt) withOpts {
with := defaultOpts
for _, o := range opts {
- o(&with)
+ if o != nil {
+ o(&with)
+ }
}
return with
}
@@ -136,9 +451,44 @@ func WithBufferSize(bytes int) addOpt {
return func(opt *withOpts) { opt.bufsize = bytes }
}
+// WithOps sets which operations to listen for. The default is [Create],
+// [Write], [Remove], [Rename], and [Chmod].
+//
+// Excluding operations you're not interested in can save quite a bit of CPU
+// time; in some use cases there may be hundreds of thousands of useless Write
+// or Chmod operations per second.
+//
+// This can also be used to add unportable operations not supported by all
+// platforms; unportable operations all start with "Unportable":
+// [UnportableOpen], [UnportableRead], [UnportableCloseWrite], and
+// [UnportableCloseRead].
+//
+// AddWith returns an error when using an unportable operation that's not
+// supported. Use [Watcher.Support] to check for support.
+func withOps(op Op) addOpt {
+ return func(opt *withOpts) { opt.op = op }
+}
+
+// WithNoFollow disables following symlinks, so the symlinks themselves are
+// watched.
+func withNoFollow() addOpt {
+ return func(opt *withOpts) { opt.noFollow = true }
+}
+
+// "Internal" option for recursive watches on inotify.
+func withCreate() addOpt {
+ return func(opt *withOpts) { opt.sendCreate = true }
+}
+
+var enableRecurse = false
+
// Check if this path is recursive (ends with "/..." or "\..."), and return the
// path with the /... stripped.
func recursivePath(path string) (string, bool) {
+ path = filepath.Clean(path)
+ if !enableRecurse { // Only enabled in tests for now.
+ return path, false
+ }
if filepath.Base(path) == "..." {
return filepath.Dir(path), true
}
diff --git a/vendor/github.com/fsnotify/fsnotify/internal/darwin.go b/vendor/github.com/fsnotify/fsnotify/internal/darwin.go
new file mode 100644
index 000000000000..0b01bc182a1e
--- /dev/null
+++ b/vendor/github.com/fsnotify/fsnotify/internal/darwin.go
@@ -0,0 +1,39 @@
+//go:build darwin
+
+package internal
+
+import (
+ "syscall"
+
+ "golang.org/x/sys/unix"
+)
+
+var (
+ ErrSyscallEACCES = syscall.EACCES
+ ErrUnixEACCES = unix.EACCES
+)
+
+var maxfiles uint64
+
+func SetRlimit() {
+ // Go 1.19 will do this automatically: https://go-review.googlesource.com/c/go/+/393354/
+ var l syscall.Rlimit
+ err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &l)
+ if err == nil && l.Cur != l.Max {
+ l.Cur = l.Max
+ syscall.Setrlimit(syscall.RLIMIT_NOFILE, &l)
+ }
+ maxfiles = l.Cur
+
+ if n, err := syscall.SysctlUint32("kern.maxfiles"); err == nil && uint64(n) < maxfiles {
+ maxfiles = uint64(n)
+ }
+
+ if n, err := syscall.SysctlUint32("kern.maxfilesperproc"); err == nil && uint64(n) < maxfiles {
+ maxfiles = uint64(n)
+ }
+}
+
+func Maxfiles() uint64 { return maxfiles }
+func Mkfifo(path string, mode uint32) error { return unix.Mkfifo(path, mode) }
+func Mknod(path string, mode uint32, dev int) error { return unix.Mknod(path, mode, dev) }
diff --git a/vendor/github.com/fsnotify/fsnotify/internal/debug_darwin.go b/vendor/github.com/fsnotify/fsnotify/internal/debug_darwin.go
new file mode 100644
index 000000000000..928319fb09ab
--- /dev/null
+++ b/vendor/github.com/fsnotify/fsnotify/internal/debug_darwin.go
@@ -0,0 +1,57 @@
+package internal
+
+import "golang.org/x/sys/unix"
+
+var names = []struct {
+ n string
+ m uint32
+}{
+ {"NOTE_ABSOLUTE", unix.NOTE_ABSOLUTE},
+ {"NOTE_ATTRIB", unix.NOTE_ATTRIB},
+ {"NOTE_BACKGROUND", unix.NOTE_BACKGROUND},
+ {"NOTE_CHILD", unix.NOTE_CHILD},
+ {"NOTE_CRITICAL", unix.NOTE_CRITICAL},
+ {"NOTE_DELETE", unix.NOTE_DELETE},
+ {"NOTE_EXEC", unix.NOTE_EXEC},
+ {"NOTE_EXIT", unix.NOTE_EXIT},
+ {"NOTE_EXITSTATUS", unix.NOTE_EXITSTATUS},
+ {"NOTE_EXIT_CSERROR", unix.NOTE_EXIT_CSERROR},
+ {"NOTE_EXIT_DECRYPTFAIL", unix.NOTE_EXIT_DECRYPTFAIL},
+ {"NOTE_EXIT_DETAIL", unix.NOTE_EXIT_DETAIL},
+ {"NOTE_EXIT_DETAIL_MASK", unix.NOTE_EXIT_DETAIL_MASK},
+ {"NOTE_EXIT_MEMORY", unix.NOTE_EXIT_MEMORY},
+ {"NOTE_EXIT_REPARENTED", unix.NOTE_EXIT_REPARENTED},
+ {"NOTE_EXTEND", unix.NOTE_EXTEND},
+ {"NOTE_FFAND", unix.NOTE_FFAND},
+ {"NOTE_FFCOPY", unix.NOTE_FFCOPY},
+ {"NOTE_FFCTRLMASK", unix.NOTE_FFCTRLMASK},
+ {"NOTE_FFLAGSMASK", unix.NOTE_FFLAGSMASK},
+ {"NOTE_FFNOP", unix.NOTE_FFNOP},
+ {"NOTE_FFOR", unix.NOTE_FFOR},
+ {"NOTE_FORK", unix.NOTE_FORK},
+ {"NOTE_FUNLOCK", unix.NOTE_FUNLOCK},
+ {"NOTE_LEEWAY", unix.NOTE_LEEWAY},
+ {"NOTE_LINK", unix.NOTE_LINK},
+ {"NOTE_LOWAT", unix.NOTE_LOWAT},
+ {"NOTE_MACHTIME", unix.NOTE_MACHTIME},
+ {"NOTE_MACH_CONTINUOUS_TIME", unix.NOTE_MACH_CONTINUOUS_TIME},
+ {"NOTE_NONE", unix.NOTE_NONE},
+ {"NOTE_NSECONDS", unix.NOTE_NSECONDS},
+ {"NOTE_OOB", unix.NOTE_OOB},
+ //{"NOTE_PCTRLMASK", unix.NOTE_PCTRLMASK}, -0x100000 (?!)
+ {"NOTE_PDATAMASK", unix.NOTE_PDATAMASK},
+ {"NOTE_REAP", unix.NOTE_REAP},
+ {"NOTE_RENAME", unix.NOTE_RENAME},
+ {"NOTE_REVOKE", unix.NOTE_REVOKE},
+ {"NOTE_SECONDS", unix.NOTE_SECONDS},
+ {"NOTE_SIGNAL", unix.NOTE_SIGNAL},
+ {"NOTE_TRACK", unix.NOTE_TRACK},
+ {"NOTE_TRACKERR", unix.NOTE_TRACKERR},
+ {"NOTE_TRIGGER", unix.NOTE_TRIGGER},
+ {"NOTE_USECONDS", unix.NOTE_USECONDS},
+ {"NOTE_VM_ERROR", unix.NOTE_VM_ERROR},
+ {"NOTE_VM_PRESSURE", unix.NOTE_VM_PRESSURE},
+ {"NOTE_VM_PRESSURE_SUDDEN_TERMINATE", unix.NOTE_VM_PRESSURE_SUDDEN_TERMINATE},
+ {"NOTE_VM_PRESSURE_TERMINATE", unix.NOTE_VM_PRESSURE_TERMINATE},
+ {"NOTE_WRITE", unix.NOTE_WRITE},
+}
diff --git a/vendor/github.com/fsnotify/fsnotify/internal/debug_dragonfly.go b/vendor/github.com/fsnotify/fsnotify/internal/debug_dragonfly.go
new file mode 100644
index 000000000000..3186b0c3491d
--- /dev/null
+++ b/vendor/github.com/fsnotify/fsnotify/internal/debug_dragonfly.go
@@ -0,0 +1,33 @@
+package internal
+
+import "golang.org/x/sys/unix"
+
+var names = []struct {
+ n string
+ m uint32
+}{
+ {"NOTE_ATTRIB", unix.NOTE_ATTRIB},
+ {"NOTE_CHILD", unix.NOTE_CHILD},
+ {"NOTE_DELETE", unix.NOTE_DELETE},
+ {"NOTE_EXEC", unix.NOTE_EXEC},
+ {"NOTE_EXIT", unix.NOTE_EXIT},
+ {"NOTE_EXTEND", unix.NOTE_EXTEND},
+ {"NOTE_FFAND", unix.NOTE_FFAND},
+ {"NOTE_FFCOPY", unix.NOTE_FFCOPY},
+ {"NOTE_FFCTRLMASK", unix.NOTE_FFCTRLMASK},
+ {"NOTE_FFLAGSMASK", unix.NOTE_FFLAGSMASK},
+ {"NOTE_FFNOP", unix.NOTE_FFNOP},
+ {"NOTE_FFOR", unix.NOTE_FFOR},
+ {"NOTE_FORK", unix.NOTE_FORK},
+ {"NOTE_LINK", unix.NOTE_LINK},
+ {"NOTE_LOWAT", unix.NOTE_LOWAT},
+ {"NOTE_OOB", unix.NOTE_OOB},
+ {"NOTE_PCTRLMASK", unix.NOTE_PCTRLMASK},
+ {"NOTE_PDATAMASK", unix.NOTE_PDATAMASK},
+ {"NOTE_RENAME", unix.NOTE_RENAME},
+ {"NOTE_REVOKE", unix.NOTE_REVOKE},
+ {"NOTE_TRACK", unix.NOTE_TRACK},
+ {"NOTE_TRACKERR", unix.NOTE_TRACKERR},
+ {"NOTE_TRIGGER", unix.NOTE_TRIGGER},
+ {"NOTE_WRITE", unix.NOTE_WRITE},
+}
diff --git a/vendor/github.com/fsnotify/fsnotify/internal/debug_freebsd.go b/vendor/github.com/fsnotify/fsnotify/internal/debug_freebsd.go
new file mode 100644
index 000000000000..f69fdb930f5f
--- /dev/null
+++ b/vendor/github.com/fsnotify/fsnotify/internal/debug_freebsd.go
@@ -0,0 +1,42 @@
+package internal
+
+import "golang.org/x/sys/unix"
+
+var names = []struct {
+ n string
+ m uint32
+}{
+ {"NOTE_ABSTIME", unix.NOTE_ABSTIME},
+ {"NOTE_ATTRIB", unix.NOTE_ATTRIB},
+ {"NOTE_CHILD", unix.NOTE_CHILD},
+ {"NOTE_CLOSE", unix.NOTE_CLOSE},
+ {"NOTE_CLOSE_WRITE", unix.NOTE_CLOSE_WRITE},
+ {"NOTE_DELETE", unix.NOTE_DELETE},
+ {"NOTE_EXEC", unix.NOTE_EXEC},
+ {"NOTE_EXIT", unix.NOTE_EXIT},
+ {"NOTE_EXTEND", unix.NOTE_EXTEND},
+ {"NOTE_FFAND", unix.NOTE_FFAND},
+ {"NOTE_FFCOPY", unix.NOTE_FFCOPY},
+ {"NOTE_FFCTRLMASK", unix.NOTE_FFCTRLMASK},
+ {"NOTE_FFLAGSMASK", unix.NOTE_FFLAGSMASK},
+ {"NOTE_FFNOP", unix.NOTE_FFNOP},
+ {"NOTE_FFOR", unix.NOTE_FFOR},
+ {"NOTE_FILE_POLL", unix.NOTE_FILE_POLL},
+ {"NOTE_FORK", unix.NOTE_FORK},
+ {"NOTE_LINK", unix.NOTE_LINK},
+ {"NOTE_LOWAT", unix.NOTE_LOWAT},
+ {"NOTE_MSECONDS", unix.NOTE_MSECONDS},
+ {"NOTE_NSECONDS", unix.NOTE_NSECONDS},
+ {"NOTE_OPEN", unix.NOTE_OPEN},
+ {"NOTE_PCTRLMASK", unix.NOTE_PCTRLMASK},
+ {"NOTE_PDATAMASK", unix.NOTE_PDATAMASK},
+ {"NOTE_READ", unix.NOTE_READ},
+ {"NOTE_RENAME", unix.NOTE_RENAME},
+ {"NOTE_REVOKE", unix.NOTE_REVOKE},
+ {"NOTE_SECONDS", unix.NOTE_SECONDS},
+ {"NOTE_TRACK", unix.NOTE_TRACK},
+ {"NOTE_TRACKERR", unix.NOTE_TRACKERR},
+ {"NOTE_TRIGGER", unix.NOTE_TRIGGER},
+ {"NOTE_USECONDS", unix.NOTE_USECONDS},
+ {"NOTE_WRITE", unix.NOTE_WRITE},
+}
diff --git a/vendor/github.com/fsnotify/fsnotify/internal/debug_kqueue.go b/vendor/github.com/fsnotify/fsnotify/internal/debug_kqueue.go
new file mode 100644
index 000000000000..607e683bd731
--- /dev/null
+++ b/vendor/github.com/fsnotify/fsnotify/internal/debug_kqueue.go
@@ -0,0 +1,32 @@
+//go:build freebsd || openbsd || netbsd || dragonfly || darwin
+
+package internal
+
+import (
+ "fmt"
+ "os"
+ "strings"
+ "time"
+
+ "golang.org/x/sys/unix"
+)
+
+func Debug(name string, kevent *unix.Kevent_t) {
+ mask := uint32(kevent.Fflags)
+
+ var (
+ l []string
+ unknown = mask
+ )
+ for _, n := range names {
+ if mask&n.m == n.m {
+ l = append(l, n.n)
+ unknown ^= n.m
+ }
+ }
+ if unknown > 0 {
+ l = append(l, fmt.Sprintf("0x%x", unknown))
+ }
+ fmt.Fprintf(os.Stderr, "FSNOTIFY_DEBUG: %s %10d:%-60s → %q\n",
+ time.Now().Format("15:04:05.000000000"), mask, strings.Join(l, " | "), name)
+}
diff --git a/vendor/github.com/fsnotify/fsnotify/internal/debug_linux.go b/vendor/github.com/fsnotify/fsnotify/internal/debug_linux.go
new file mode 100644
index 000000000000..35c734be4311
--- /dev/null
+++ b/vendor/github.com/fsnotify/fsnotify/internal/debug_linux.go
@@ -0,0 +1,56 @@
+package internal
+
+import (
+ "fmt"
+ "os"
+ "strings"
+ "time"
+
+ "golang.org/x/sys/unix"
+)
+
+func Debug(name string, mask, cookie uint32) {
+ names := []struct {
+ n string
+ m uint32
+ }{
+ {"IN_ACCESS", unix.IN_ACCESS},
+ {"IN_ATTRIB", unix.IN_ATTRIB},
+ {"IN_CLOSE", unix.IN_CLOSE},
+ {"IN_CLOSE_NOWRITE", unix.IN_CLOSE_NOWRITE},
+ {"IN_CLOSE_WRITE", unix.IN_CLOSE_WRITE},
+ {"IN_CREATE", unix.IN_CREATE},
+ {"IN_DELETE", unix.IN_DELETE},
+ {"IN_DELETE_SELF", unix.IN_DELETE_SELF},
+ {"IN_IGNORED", unix.IN_IGNORED},
+ {"IN_ISDIR", unix.IN_ISDIR},
+ {"IN_MODIFY", unix.IN_MODIFY},
+ {"IN_MOVE", unix.IN_MOVE},
+ {"IN_MOVED_FROM", unix.IN_MOVED_FROM},
+ {"IN_MOVED_TO", unix.IN_MOVED_TO},
+ {"IN_MOVE_SELF", unix.IN_MOVE_SELF},
+ {"IN_OPEN", unix.IN_OPEN},
+ {"IN_Q_OVERFLOW", unix.IN_Q_OVERFLOW},
+ {"IN_UNMOUNT", unix.IN_UNMOUNT},
+ }
+
+ var (
+ l []string
+ unknown = mask
+ )
+ for _, n := range names {
+ if mask&n.m == n.m {
+ l = append(l, n.n)
+ unknown ^= n.m
+ }
+ }
+ if unknown > 0 {
+ l = append(l, fmt.Sprintf("0x%x", unknown))
+ }
+ var c string
+ if cookie > 0 {
+ c = fmt.Sprintf("(cookie: %d) ", cookie)
+ }
+ fmt.Fprintf(os.Stderr, "FSNOTIFY_DEBUG: %s %-30s → %s%q\n",
+ time.Now().Format("15:04:05.000000000"), strings.Join(l, "|"), c, name)
+}
diff --git a/vendor/github.com/fsnotify/fsnotify/internal/debug_netbsd.go b/vendor/github.com/fsnotify/fsnotify/internal/debug_netbsd.go
new file mode 100644
index 000000000000..e5b3b6f69433
--- /dev/null
+++ b/vendor/github.com/fsnotify/fsnotify/internal/debug_netbsd.go
@@ -0,0 +1,25 @@
+package internal
+
+import "golang.org/x/sys/unix"
+
+var names = []struct {
+ n string
+ m uint32
+}{
+ {"NOTE_ATTRIB", unix.NOTE_ATTRIB},
+ {"NOTE_CHILD", unix.NOTE_CHILD},
+ {"NOTE_DELETE", unix.NOTE_DELETE},
+ {"NOTE_EXEC", unix.NOTE_EXEC},
+ {"NOTE_EXIT", unix.NOTE_EXIT},
+ {"NOTE_EXTEND", unix.NOTE_EXTEND},
+ {"NOTE_FORK", unix.NOTE_FORK},
+ {"NOTE_LINK", unix.NOTE_LINK},
+ {"NOTE_LOWAT", unix.NOTE_LOWAT},
+ {"NOTE_PCTRLMASK", unix.NOTE_PCTRLMASK},
+ {"NOTE_PDATAMASK", unix.NOTE_PDATAMASK},
+ {"NOTE_RENAME", unix.NOTE_RENAME},
+ {"NOTE_REVOKE", unix.NOTE_REVOKE},
+ {"NOTE_TRACK", unix.NOTE_TRACK},
+ {"NOTE_TRACKERR", unix.NOTE_TRACKERR},
+ {"NOTE_WRITE", unix.NOTE_WRITE},
+}
diff --git a/vendor/github.com/fsnotify/fsnotify/internal/debug_openbsd.go b/vendor/github.com/fsnotify/fsnotify/internal/debug_openbsd.go
new file mode 100644
index 000000000000..1dd455bc5a4e
--- /dev/null
+++ b/vendor/github.com/fsnotify/fsnotify/internal/debug_openbsd.go
@@ -0,0 +1,28 @@
+package internal
+
+import "golang.org/x/sys/unix"
+
+var names = []struct {
+ n string
+ m uint32
+}{
+ {"NOTE_ATTRIB", unix.NOTE_ATTRIB},
+ // {"NOTE_CHANGE", unix.NOTE_CHANGE}, // Not on 386?
+ {"NOTE_CHILD", unix.NOTE_CHILD},
+ {"NOTE_DELETE", unix.NOTE_DELETE},
+ {"NOTE_EOF", unix.NOTE_EOF},
+ {"NOTE_EXEC", unix.NOTE_EXEC},
+ {"NOTE_EXIT", unix.NOTE_EXIT},
+ {"NOTE_EXTEND", unix.NOTE_EXTEND},
+ {"NOTE_FORK", unix.NOTE_FORK},
+ {"NOTE_LINK", unix.NOTE_LINK},
+ {"NOTE_LOWAT", unix.NOTE_LOWAT},
+ {"NOTE_PCTRLMASK", unix.NOTE_PCTRLMASK},
+ {"NOTE_PDATAMASK", unix.NOTE_PDATAMASK},
+ {"NOTE_RENAME", unix.NOTE_RENAME},
+ {"NOTE_REVOKE", unix.NOTE_REVOKE},
+ {"NOTE_TRACK", unix.NOTE_TRACK},
+ {"NOTE_TRACKERR", unix.NOTE_TRACKERR},
+ {"NOTE_TRUNCATE", unix.NOTE_TRUNCATE},
+ {"NOTE_WRITE", unix.NOTE_WRITE},
+}
diff --git a/vendor/github.com/fsnotify/fsnotify/internal/debug_solaris.go b/vendor/github.com/fsnotify/fsnotify/internal/debug_solaris.go
new file mode 100644
index 000000000000..f1b2e73bd5ba
--- /dev/null
+++ b/vendor/github.com/fsnotify/fsnotify/internal/debug_solaris.go
@@ -0,0 +1,45 @@
+package internal
+
+import (
+ "fmt"
+ "os"
+ "strings"
+ "time"
+
+ "golang.org/x/sys/unix"
+)
+
+func Debug(name string, mask int32) {
+ names := []struct {
+ n string
+ m int32
+ }{
+ {"FILE_ACCESS", unix.FILE_ACCESS},
+ {"FILE_MODIFIED", unix.FILE_MODIFIED},
+ {"FILE_ATTRIB", unix.FILE_ATTRIB},
+ {"FILE_TRUNC", unix.FILE_TRUNC},
+ {"FILE_NOFOLLOW", unix.FILE_NOFOLLOW},
+ {"FILE_DELETE", unix.FILE_DELETE},
+ {"FILE_RENAME_TO", unix.FILE_RENAME_TO},
+ {"FILE_RENAME_FROM", unix.FILE_RENAME_FROM},
+ {"UNMOUNTED", unix.UNMOUNTED},
+ {"MOUNTEDOVER", unix.MOUNTEDOVER},
+ {"FILE_EXCEPTION", unix.FILE_EXCEPTION},
+ }
+
+ var (
+ l []string
+ unknown = mask
+ )
+ for _, n := range names {
+ if mask&n.m == n.m {
+ l = append(l, n.n)
+ unknown ^= n.m
+ }
+ }
+ if unknown > 0 {
+ l = append(l, fmt.Sprintf("0x%x", unknown))
+ }
+ fmt.Fprintf(os.Stderr, "FSNOTIFY_DEBUG: %s %10d:%-30s → %q\n",
+ time.Now().Format("15:04:05.000000000"), mask, strings.Join(l, " | "), name)
+}
diff --git a/vendor/github.com/fsnotify/fsnotify/internal/debug_windows.go b/vendor/github.com/fsnotify/fsnotify/internal/debug_windows.go
new file mode 100644
index 000000000000..52bf4ce53b56
--- /dev/null
+++ b/vendor/github.com/fsnotify/fsnotify/internal/debug_windows.go
@@ -0,0 +1,40 @@
+package internal
+
+import (
+ "fmt"
+ "os"
+ "path/filepath"
+ "strings"
+ "time"
+
+ "golang.org/x/sys/windows"
+)
+
+func Debug(name string, mask uint32) {
+ names := []struct {
+ n string
+ m uint32
+ }{
+ {"FILE_ACTION_ADDED", windows.FILE_ACTION_ADDED},
+ {"FILE_ACTION_REMOVED", windows.FILE_ACTION_REMOVED},
+ {"FILE_ACTION_MODIFIED", windows.FILE_ACTION_MODIFIED},
+ {"FILE_ACTION_RENAMED_OLD_NAME", windows.FILE_ACTION_RENAMED_OLD_NAME},
+ {"FILE_ACTION_RENAMED_NEW_NAME", windows.FILE_ACTION_RENAMED_NEW_NAME},
+ }
+
+ var (
+ l []string
+ unknown = mask
+ )
+ for _, n := range names {
+ if mask&n.m == n.m {
+ l = append(l, n.n)
+ unknown ^= n.m
+ }
+ }
+ if unknown > 0 {
+ l = append(l, fmt.Sprintf("0x%x", unknown))
+ }
+ fmt.Fprintf(os.Stderr, "FSNOTIFY_DEBUG: %s %-65s → %q\n",
+ time.Now().Format("15:04:05.000000000"), strings.Join(l, " | "), filepath.ToSlash(name))
+}
diff --git a/vendor/github.com/fsnotify/fsnotify/internal/freebsd.go b/vendor/github.com/fsnotify/fsnotify/internal/freebsd.go
new file mode 100644
index 000000000000..5ac8b507978f
--- /dev/null
+++ b/vendor/github.com/fsnotify/fsnotify/internal/freebsd.go
@@ -0,0 +1,31 @@
+//go:build freebsd
+
+package internal
+
+import (
+ "syscall"
+
+ "golang.org/x/sys/unix"
+)
+
+var (
+ ErrSyscallEACCES = syscall.EACCES
+ ErrUnixEACCES = unix.EACCES
+)
+
+var maxfiles uint64
+
+func SetRlimit() {
+ // Go 1.19 will do this automatically: https://go-review.googlesource.com/c/go/+/393354/
+ var l syscall.Rlimit
+ err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &l)
+ if err == nil && l.Cur != l.Max {
+ l.Cur = l.Max
+ syscall.Setrlimit(syscall.RLIMIT_NOFILE, &l)
+ }
+ maxfiles = uint64(l.Cur)
+}
+
+func Maxfiles() uint64 { return maxfiles }
+func Mkfifo(path string, mode uint32) error { return unix.Mkfifo(path, mode) }
+func Mknod(path string, mode uint32, dev int) error { return unix.Mknod(path, mode, uint64(dev)) }
diff --git a/vendor/github.com/fsnotify/fsnotify/internal/internal.go b/vendor/github.com/fsnotify/fsnotify/internal/internal.go
new file mode 100644
index 000000000000..7daa45e19eec
--- /dev/null
+++ b/vendor/github.com/fsnotify/fsnotify/internal/internal.go
@@ -0,0 +1,2 @@
+// Package internal contains some helpers.
+package internal
diff --git a/vendor/github.com/fsnotify/fsnotify/internal/unix.go b/vendor/github.com/fsnotify/fsnotify/internal/unix.go
new file mode 100644
index 000000000000..b251fb803869
--- /dev/null
+++ b/vendor/github.com/fsnotify/fsnotify/internal/unix.go
@@ -0,0 +1,31 @@
+//go:build !windows && !darwin && !freebsd && !plan9
+
+package internal
+
+import (
+ "syscall"
+
+ "golang.org/x/sys/unix"
+)
+
+var (
+ ErrSyscallEACCES = syscall.EACCES
+ ErrUnixEACCES = unix.EACCES
+)
+
+var maxfiles uint64
+
+func SetRlimit() {
+ // Go 1.19 will do this automatically: https://go-review.googlesource.com/c/go/+/393354/
+ var l syscall.Rlimit
+ err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &l)
+ if err == nil && l.Cur != l.Max {
+ l.Cur = l.Max
+ syscall.Setrlimit(syscall.RLIMIT_NOFILE, &l)
+ }
+ maxfiles = uint64(l.Cur)
+}
+
+func Maxfiles() uint64 { return maxfiles }
+func Mkfifo(path string, mode uint32) error { return unix.Mkfifo(path, mode) }
+func Mknod(path string, mode uint32, dev int) error { return unix.Mknod(path, mode, dev) }
diff --git a/vendor/github.com/fsnotify/fsnotify/internal/unix2.go b/vendor/github.com/fsnotify/fsnotify/internal/unix2.go
new file mode 100644
index 000000000000..37dfeddc2896
--- /dev/null
+++ b/vendor/github.com/fsnotify/fsnotify/internal/unix2.go
@@ -0,0 +1,7 @@
+//go:build !windows
+
+package internal
+
+func HasPrivilegesForSymlink() bool {
+ return true
+}
diff --git a/vendor/github.com/fsnotify/fsnotify/internal/windows.go b/vendor/github.com/fsnotify/fsnotify/internal/windows.go
new file mode 100644
index 000000000000..896bc2e5a2f3
--- /dev/null
+++ b/vendor/github.com/fsnotify/fsnotify/internal/windows.go
@@ -0,0 +1,41 @@
+//go:build windows
+
+package internal
+
+import (
+ "errors"
+
+ "golang.org/x/sys/windows"
+)
+
+// Just a dummy.
+var (
+ ErrSyscallEACCES = errors.New("dummy")
+ ErrUnixEACCES = errors.New("dummy")
+)
+
+func SetRlimit() {}
+func Maxfiles() uint64 { return 1<<64 - 1 }
+func Mkfifo(path string, mode uint32) error { return errors.New("no FIFOs on Windows") }
+func Mknod(path string, mode uint32, dev int) error { return errors.New("no device nodes on Windows") }
+
+func HasPrivilegesForSymlink() bool {
+ var sid *windows.SID
+ err := windows.AllocateAndInitializeSid(
+ &windows.SECURITY_NT_AUTHORITY,
+ 2,
+ windows.SECURITY_BUILTIN_DOMAIN_RID,
+ windows.DOMAIN_ALIAS_RID_ADMINS,
+ 0, 0, 0, 0, 0, 0,
+ &sid)
+ if err != nil {
+ return false
+ }
+ defer windows.FreeSid(sid)
+ token := windows.Token(0)
+ member, err := token.IsMember(sid)
+ if err != nil {
+ return false
+ }
+ return member || token.IsElevated()
+}
diff --git a/vendor/github.com/fsnotify/fsnotify/mkdoc.zsh b/vendor/github.com/fsnotify/fsnotify/mkdoc.zsh
deleted file mode 100644
index 99012ae6539e..000000000000
--- a/vendor/github.com/fsnotify/fsnotify/mkdoc.zsh
+++ /dev/null
@@ -1,259 +0,0 @@
-#!/usr/bin/env zsh
-[ "${ZSH_VERSION:-}" = "" ] && echo >&2 "Only works with zsh" && exit 1
-setopt err_exit no_unset pipefail extended_glob
-
-# Simple script to update the godoc comments on all watchers so you don't need
-# to update the same comment 5 times.
-
-watcher=$(</tmp/x
- print -r -- $cmt >>/tmp/x
- tail -n+$(( end + 1 )) $file >>/tmp/x
- mv /tmp/x $file
- done
-}
-
-set-cmt '^type Watcher struct ' $watcher
-set-cmt '^func NewWatcher(' $new
-set-cmt '^func NewBufferedWatcher(' $newbuffered
-set-cmt '^func (w \*Watcher) Add(' $add
-set-cmt '^func (w \*Watcher) AddWith(' $addwith
-set-cmt '^func (w \*Watcher) Remove(' $remove
-set-cmt '^func (w \*Watcher) Close(' $close
-set-cmt '^func (w \*Watcher) WatchList(' $watchlist
-set-cmt '^[[:space:]]*Events *chan Event$' $events
-set-cmt '^[[:space:]]*Errors *chan error$' $errors
diff --git a/vendor/github.com/fsnotify/fsnotify/shared.go b/vendor/github.com/fsnotify/fsnotify/shared.go
new file mode 100644
index 000000000000..3ee9b58f1d2b
--- /dev/null
+++ b/vendor/github.com/fsnotify/fsnotify/shared.go
@@ -0,0 +1,64 @@
+package fsnotify
+
+import "sync"
+
+type shared struct {
+ Events chan Event
+ Errors chan error
+ done chan struct{}
+ mu sync.Mutex
+}
+
+func newShared(ev chan Event, errs chan error) *shared {
+ return &shared{
+ Events: ev,
+ Errors: errs,
+ done: make(chan struct{}),
+ }
+}
+
+// Returns true if the event was sent, or false if watcher is closed.
+func (w *shared) sendEvent(e Event) bool {
+ if e.Op == 0 {
+ return true
+ }
+ select {
+ case <-w.done:
+ return false
+ case w.Events <- e:
+ return true
+ }
+}
+
+// Returns true if the error was sent, or false if watcher is closed.
+func (w *shared) sendError(err error) bool {
+ if err == nil {
+ return true
+ }
+ select {
+ case <-w.done:
+ return false
+ case w.Errors <- err:
+ return true
+ }
+}
+
+func (w *shared) isClosed() bool {
+ select {
+ case <-w.done:
+ return true
+ default:
+ return false
+ }
+}
+
+// Mark as closed; returns true if it was already closed.
+func (w *shared) close() bool {
+ w.mu.Lock()
+ defer w.mu.Unlock()
+ if w.isClosed() {
+ return true
+ }
+ close(w.done)
+ return false
+}
diff --git a/vendor/github.com/fsnotify/fsnotify/staticcheck.conf b/vendor/github.com/fsnotify/fsnotify/staticcheck.conf
new file mode 100644
index 000000000000..8fa7351f0c24
--- /dev/null
+++ b/vendor/github.com/fsnotify/fsnotify/staticcheck.conf
@@ -0,0 +1,3 @@
+checks = ['all',
+ '-U1000', # Don't complain about unused functions.
+]
diff --git a/vendor/github.com/fsnotify/fsnotify/system_bsd.go b/vendor/github.com/fsnotify/fsnotify/system_bsd.go
index 4322b0b88557..f65e8fe3edce 100644
--- a/vendor/github.com/fsnotify/fsnotify/system_bsd.go
+++ b/vendor/github.com/fsnotify/fsnotify/system_bsd.go
@@ -1,5 +1,4 @@
//go:build freebsd || openbsd || netbsd || dragonfly
-// +build freebsd openbsd netbsd dragonfly
package fsnotify
diff --git a/vendor/github.com/fsnotify/fsnotify/system_darwin.go b/vendor/github.com/fsnotify/fsnotify/system_darwin.go
index 5da5ffa78fe7..a29fc7aab620 100644
--- a/vendor/github.com/fsnotify/fsnotify/system_darwin.go
+++ b/vendor/github.com/fsnotify/fsnotify/system_darwin.go
@@ -1,5 +1,4 @@
//go:build darwin
-// +build darwin
package fsnotify
diff --git a/vendor/github.com/fxamacker/cbor/v2/.gitignore b/vendor/github.com/fxamacker/cbor/v2/.gitignore
new file mode 100644
index 000000000000..f1c181ec9c5c
--- /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 000000000000..38cb9ae101b8
--- /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 000000000000..c794b2b0c666
--- /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 000000000000..de0965e12d17
--- /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/josharian/intern/license.md b/vendor/github.com/fxamacker/cbor/v2/LICENSE
similarity index 95%
rename from vendor/github.com/josharian/intern/license.md
rename to vendor/github.com/fxamacker/cbor/v2/LICENSE
index 353d3055f0b4..eaa850492144 100644
--- a/vendor/github.com/josharian/intern/license.md
+++ b/vendor/github.com/fxamacker/cbor/v2/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2019 Josh Bleecher Snyder
+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
@@ -18,4 +18,4 @@ 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 000000000000..d072b81c7300
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/README.md
@@ -0,0 +1,934 @@
+CBOR Codec 
+
+[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., EdgeX Foundry, Flow Foundation, Fraunhofer‑AISEC, IBM, Kubernetes[*](https://github.com/search?q=org%3Akubernetes%20fxamacker%2Fcbor&type=code), Let's Encrypt, Linux Foundation, Microsoft, Oasis Protocol, Red Hat[*](https://github.com/search?q=org%3Aopenshift+fxamacker%2Fcbor&type=code), Tailscale[*](https://github.com/search?q=org%3Atailscale+fxamacker%2Fcbor&type=code), Veraison[*](https://github.com/search?q=org%3Averaison+fxamacker%2Fcbor&type=code), [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. `MarshalToBuffer` and `UserBufferEncMode` accepts user-specified buffer.
+
+## fxamacker/cbor
+
+[](https://github.com/fxamacker/cbor/actions?query=workflow%3Aci)
+[](https://github.com/fxamacker/cbor/actions?query=workflow%3A%22cover+%E2%89%A597%25%22)
+[](https://github.com/fxamacker/cbor/actions/workflows/codeql-analysis.yml)
+[](#fuzzing-and-code-coverage)
+[](https://goreportcard.com/report/github.com/fxamacker/cbor)
+[](https://github.com/fxamacker/cbor#fuzzing-and-code-coverage)
+
+`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.
+
+API is mostly same as `encoding/json`, plus interfaces that simplify concurrency and CBOR options.
+
+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 tag options (`toarray`, `keyasint`, `omitempty`, `omitzero`) and field tag "-" 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.
+
+Notably, `fxamacker/cbor` is fast at rejecting malformed CBOR data.
+
+> [!NOTE]
+> Benchmarks rejecting 10 bytes of malicious CBOR data decoding to `[]byte`:
+>
+> | Codec | Speed (ns/op) | Memory | Allocs |
+> | :---- | ------------: | -----: | -----: |
+> | fxamacker/cbor 2.7.0 | 47 ± 7% | 32 B/op | 2 allocs/op |
+> | ugorji/go 1.2.12 | 5878187 ± 3% | 67111556 B/op | 13 allocs/op |
+>
+> Faster hardware (overclocked DDR4 or DDR5) can reduce speed difference.
+>
+> 🔎 Benchmark details
+>
+> Latest comparison for decoding CBOR data to Go `[]byte`:
+> - Input: `[]byte{0x9B, 0x00, 0x00, 0x42, 0xFA, 0x42, 0xFA, 0x42, 0xFA, 0x42}`
+> - go1.22.7, linux/amd64, i5-13600K (DDR4-2933, disabled e-cores)
+> - 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
+>
+>
+
+In contrast, some codecs can crash or use excessive resources while decoding bad data.
+
+> [!WARNING]
+> Go's `encoding/gob` is [not designed to be hardened against adversarial inputs](https://pkg.go.dev/encoding/gob#hdr-Security).
+>
+> 🔎 gob fatal error (out of memory) 💥 decoding 181 bytes
+>
+> ```Go
+> // Example of encoding/gob having "fatal error: runtime: out of memory"
+> // while decoding 181 bytes (all Go versions as of Dec. 8, 2024).
+> 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.")
+> }
+> ```
+>
+>
+>
+
+### Smaller Encodings with Struct Tag Options
+
+Struct tags automatically reduce encoded size of structs and improve speed.
+
+We can write less code by using struct tag options:
+- `toarray`: encode without field names (decode back to original struct)
+- `keyasint`: encode field names as integers (decode back to original struct)
+- `omitempty`: omit empty field when encoding
+- `omitzero`: omit zero-value field when encoding
+
+As a special case, struct field tag "-" omits the field.
+
+NOTE: When a struct uses `toarray`, the encoder will ignore `omitempty` and `omitzero` to prevent position of encoded array elements from changing. This allows decoder to match encoded elements to their Go struct field.
+
+
+
+> [!NOTE]
+> `fxamacker/cbor` can encode a 3-level nested Go struct to 1 byte!
+> - `encoding/json`: 18 bytes of JSON
+> - `fxamacker/cbor`: 1 byte of CBOR
+>
+> 🔎 Encoding 3-level nested Go struct with omitempty
+>
+> 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":{}}}
+> ```
+>
+>
+
+
+## Quick Start
+
+__Install__: `go get github.com/fxamacker/cbor/v2` and `import "github.com/fxamacker/cbor/v2"`.
+
+> [!TIP]
+>
+> Tinygo users can try beta/experimental branch [feature/cbor-tinygo-beta](https://github.com/fxamacker/cbor/tree/feature/cbor-tinygo-beta).
+>
+> 🔎 More about tinygo feature branch
+>
+> ### Tinygo
+>
+> Branch [feature/cbor-tinygo-beta](https://github.com/fxamacker/cbor/tree/feature/cbor-tinygo-beta) is based on fxamacker/cbor v2.7.0 and it can be compiled using tinygo v0.33 (also compiles with golang/go).
+>
+> It passes unit tests (with both go1.22 and tinygo v0.33) and is considered beta/experimental for tinygo.
+>
+> :warning: The `feature/cbor-tinygo-beta` branch does not get fuzz tested yet.
+>
+> Changes in this feature branch only affect tinygo compiled software. Summary of changes:
+> - default `DecOptions.MaxNestedLevels` is reduced to 16 (was 32). User can specify higher limit but 24+ crashes tests when compiled with tinygo v0.33.
+> - disabled decoding CBOR tag data to Go interface because tinygo v0.33 is missing needed feature.
+> - encoding error message can be different when encoding function type.
+>
+> Related tinygo issues:
+> - https://github.com/tinygo-org/tinygo/issues/4277
+> - https://github.com/tinygo-org/tinygo/issues/4458
+>
+>
+
+
+### 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
+// UnmarshalFirst() and DiagnoseFirst() allow trailing bytes.
+```
+
+> [!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 tag options (`toarray`, `keyasint`, `omitempty`, `omitzero`) reduce encoded size of structs.
+
+As a special case, struct field tag "-" omits the field.
+
+ 🔎 Example encoding with struct field tag "-"
+
+https://go.dev/play/p/aWEIFxd7InX
+
+```Go
+// https://github.com/fxamacker/cbor/issues/652
+package main
+
+import (
+ "encoding/json"
+ "fmt"
+
+ "github.com/fxamacker/cbor/v2"
+)
+
+// The `cbor:"-"` tag omits the Type field when encoding to CBOR.
+type Entity struct {
+ _ struct{} `cbor:",toarray"`
+ ID uint64 `json:"id"`
+ Type string `cbor:"-" json:"typeOf"`
+ Name string `json:"name"`
+}
+
+func main() {
+ entity := Entity{
+ ID: 1,
+ Type: "int64",
+ Name: "Identifier",
+ }
+
+ c, _ := cbor.Marshal(entity)
+ diag, _ := cbor.Diagnose(c)
+ fmt.Printf("CBOR in hex: %x\n", c)
+ fmt.Printf("CBOR in edn: %s\n", diag)
+
+ j, _ := json.Marshal(entity)
+ fmt.Printf("JSON: %s\n", string(j))
+
+ fmt.Printf("JSON encoding is %d bytes\n", len(j))
+ fmt.Printf("CBOR encoding is %d bytes\n", len(c))
+
+ // Output:
+ // CBOR in hex: 82016a4964656e746966696572
+ // CBOR in edn: [1, "Identifier"]
+ // JSON: {"id":1,"typeOf":"int64","name":"Identifier"}
+ // JSON encoding is 45 bytes
+ // CBOR encoding is 13 bytes
+}
+```
+
+
+
+ 🔎 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 struct tag options
+
+
+
+
+
+Struct tag options 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 := em.Marshal(v); err != nil {
+ return err
+}
+```
+
+
+
+👉 `fxamacker/cbor` allows user apps to use almost any current or future CBOR tag number by implementing `cbor.Marshaler` and `cbor.Unmarshaler` interfaces.
+
+Basically, `MarshalCBOR` and `UnmarshalCBOR` functions can be implemented by user apps and those functions will automatically be called by this CBOR codec's `Marshal`, `Unmarshal`, etc.
+
+The following [example](https://github.com/fxamacker/cbor/blob/master/example_embedded_json_tag_for_cbor_test.go) shows how to encode and decode a tagged CBOR data item with tag number 262. The tag content is a JSON object "embedded" as a CBOR byte string (major type 2).
+
+ 🔎 Example using Embedded JSON Tag for CBOR (tag 262)
+
+```go
+// https://github.com/fxamacker/cbor/issues/657
+
+package cbor_test
+
+// NOTE: RFC 8949 does not mention tag number 262. IANA assigned
+// CBOR tag number 262 as "Embedded JSON Object" specified by the
+// document Embedded JSON Tag for CBOR:
+//
+// "Tag 262 can be applied to a byte string (major type 2) to indicate
+// that the byte string is a JSON Object. The length of the byte string
+// indicates the content."
+//
+// For more info, see Embedded JSON Tag for CBOR at:
+// https://github.com/toravir/CBOR-Tag-Specs/blob/master/embeddedJSON.md
+
+import (
+ "bytes"
+ "encoding/json"
+ "fmt"
+
+ "github.com/fxamacker/cbor/v2"
+)
+
+// cborTagNumForEmbeddedJSON is the CBOR tag number 262.
+const cborTagNumForEmbeddedJSON = 262
+
+// EmbeddedJSON represents a Go value to be encoded as a tagged CBOR data item
+// with tag number 262 and the tag content is a JSON object "embedded" as a
+// CBOR byte string (major type 2).
+type EmbeddedJSON struct {
+ any
+}
+
+func NewEmbeddedJSON(val any) EmbeddedJSON {
+ return EmbeddedJSON{val}
+}
+
+// MarshalCBOR encodes EmbeddedJSON to a tagged CBOR data item with the
+// tag number 262 and the tag content is a JSON object that is
+// "embedded" as a CBOR byte string.
+func (v EmbeddedJSON) MarshalCBOR() ([]byte, error) {
+ // Encode v to JSON object.
+ data, err := json.Marshal(v)
+ if err != nil {
+ return nil, err
+ }
+
+ // Create cbor.Tag representing a tagged CBOR data item.
+ tag := cbor.Tag{
+ Number: cborTagNumForEmbeddedJSON,
+ Content: data,
+ }
+
+ // Marshal to a tagged CBOR data item.
+ return cbor.Marshal(tag)
+}
+
+// UnmarshalCBOR decodes a tagged CBOR data item to EmbeddedJSON.
+// The byte slice provided to this function must contain a single
+// tagged CBOR data item with the tag number 262 and tag content
+// must be a JSON object "embedded" as a CBOR byte string.
+func (v *EmbeddedJSON) UnmarshalCBOR(b []byte) error {
+ // Unmarshal tagged CBOR data item.
+ var tag cbor.Tag
+ if err := cbor.Unmarshal(b, &tag); err != nil {
+ return err
+ }
+
+ // Check tag number.
+ if tag.Number != cborTagNumForEmbeddedJSON {
+ return fmt.Errorf("got tag number %d, expect tag number %d", tag.Number, cborTagNumForEmbeddedJSON)
+ }
+
+ // Check tag content.
+ jsonData, isByteString := tag.Content.([]byte)
+ if !isByteString {
+ return fmt.Errorf("got tag content type %T, expect tag content []byte", tag.Content)
+ }
+
+ // Unmarshal JSON object.
+ return json.Unmarshal(jsonData, v)
+}
+
+// MarshalJSON encodes EmbeddedJSON to a JSON object.
+func (v EmbeddedJSON) MarshalJSON() ([]byte, error) {
+ return json.Marshal(v.any)
+}
+
+// UnmarshalJSON decodes a JSON object.
+func (v *EmbeddedJSON) UnmarshalJSON(b []byte) error {
+ dec := json.NewDecoder(bytes.NewReader(b))
+ dec.UseNumber()
+ return dec.Decode(&v.any)
+}
+
+func Example_embeddedJSONTagForCBOR() {
+ value := NewEmbeddedJSON(map[string]any{
+ "name": "gopher",
+ "id": json.Number("42"),
+ })
+
+ data, err := cbor.Marshal(value)
+ if err != nil {
+ panic(err)
+ }
+
+ fmt.Printf("cbor: %x\n", data)
+
+ var v EmbeddedJSON
+ err = cbor.Unmarshal(data, &v)
+ if err != nil {
+ panic(err)
+ }
+
+ fmt.Printf("%+v\n", v.any)
+ for k, v := range v.any.(map[string]any) {
+ fmt.Printf(" %s: %v (%T)\n", k, v, v)
+ }
+}
+```
+
+
+
+
+### 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 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.9.0](https://github.com/fxamacker/cbor/releases/tag/v2.9.0) (Jul 13, 2025) improved interoperability/transcoding between CBOR & JSON, refactored tests, and improved docs.
+- Add opt-in support for `encoding.TextMarshaler` and `encoding.TextUnmarshaler` to encode and decode from CBOR text string.
+- Add opt-in support for `json.Marshaler` and `json.Unmarshaler` via user-provided transcoding function.
+- Update docs for TimeMode, Tag, RawTag, and add example for Embedded JSON Tag for CBOR.
+
+v2.9.0 passed fuzz tests and is production quality.
+
+The minimum version of Go required to build:
+- v2.8.0 and newer releases require go 1.20+.
+- v2.7.1 and older releases require go 1.17+.
+
+For more details, see [release notes](https://github.com/fxamacker/cbor/releases).
+
+### Prior Releases
+
+[v2.8.0](https://github.com/fxamacker/cbor/releases/tag/v2.8.0) (March 30, 2025) is a small release primarily to add `omitzero` option to struct field tags and fix bugs. It passed fuzz tests (billions of executions) and is production quality.
+
+[v2.7.0](https://github.com/fxamacker/cbor/releases/tag/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.
+
+[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](https://github.com/fxamacker/cbor/releases/tag/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, Confidential Computing Consortium, ConsenSys, EdgeX Foundry, F5, Flow Foundation, Fraunhofer‑AISEC, IBM, Kubernetes, Let's Encrypt (ISRG), Linaro, Linux Foundation, Matrix.org, Microsoft, National Cybersecurity Agency of France (govt), Netherlands (govt), Oasis Protocol, Red Hat OpenShift, Smallstep, Tailscale, Taurus SA, TIBCO, Veraison, and others.
+
+`fxamacker/cbor` passed multiple confidential security assessments in 2022. 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) assessed a subset of fxamacker/cbor v2.4.
+
+## 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 000000000000..9c05146d16cf
--- /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 000000000000..23c5724d2e41
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/bytestring.go
@@ -0,0 +1,90 @@
+// 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.
+//
+// Deprecated: No longer used by this codec; kept for compatibility
+// with user apps that directly call this function.
+func (bs *ByteString) UnmarshalCBOR(data []byte) error {
+ if bs == nil {
+ return errors.New("cbor.ByteString: UnmarshalCBOR on nil pointer")
+ }
+
+ d := decoder{data: data, dm: defaultDecMode}
+
+ // Check well-formedness of CBOR data item.
+ // ByteString.UnmarshalCBOR() is exported, so
+ // the codec needs to support same behavior for:
+ // - Unmarshal(data, *ByteString)
+ // - ByteString.UnmarshalCBOR(data)
+ err := d.wellformed(false, false)
+ if err != nil {
+ return err
+ }
+
+ return bs.unmarshalCBOR(data)
+}
+
+// unmarshalCBOR decodes CBOR byte string (major type 2) to ByteString.
+// Decoding CBOR null and CBOR undefined sets ByteString to be empty.
+// This function assumes data is well-formed, and does not perform bounds checking.
+// This function is called by Unmarshal().
+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 000000000000..5051f110fbb3
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/cache.go
@@ -0,0 +1,370 @@
+// 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
+ izf isZeroFunc
+}
+
+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
+ specialTypeUnexportedUnmarshalerIface
+ specialTypeEmptyIface
+ specialTypeIface
+ specialTypeTag
+ specialTypeTime
+ specialTypeJSONUnmarshalerIface
+)
+
+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.Pointer {
+ 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.PointerTo(t).Implements(typeUnexportedUnmarshaler) {
+ tInfo.spclType = specialTypeUnexportedUnmarshalerIface
+ } else if reflect.PointerTo(t).Implements(typeUnmarshaler) {
+ tInfo.spclType = specialTypeUnmarshalerIface
+ } else if reflect.PointerTo(t).Implements(typeJSONUnmarshaler) {
+ tInfo.spclType = specialTypeJSONUnmarshalerIface
+ }
+
+ 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, flds[i].izf = 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, flds[i].izf = 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, isZeroFunc) {
+ if v, _ := encodeFuncCache.Load(t); v != nil {
+ fs := v.(encodeFuncs)
+ return fs.ef, fs.ief, fs.izf
+ }
+ ef, ief, izf := getEncodeFuncInternal(t)
+ encodeFuncCache.Store(t, encodeFuncs{ef, ief, izf})
+ return ef, ief, izf
+}
+
+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 000000000000..9cf33cd2090d
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/common.go
@@ -0,0 +1,191 @@
+// 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"
+ "io"
+ "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
+}
+
+// Transcoder is a scheme for transcoding a single CBOR encoded data item to or from a different
+// data format.
+type Transcoder interface {
+ // Transcode reads the data item in its source format from a Reader and writes a
+ // corresponding representation in its destination format to a Writer.
+ Transcode(dst io.Writer, src io.Reader) error
+}
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 000000000000..f0bdc3b38dd2
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/decode.go
@@ -0,0 +1,3318 @@
+// 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/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", unmarshaling 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 any) 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 any) (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
+}
+
+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 any
+ 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
+
+ // IntDecConvertSignedOrBigInt 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 unmarshaling into a Go interface{}.
+ BigIntDecodeValue BigIntDecMode = iota
+
+ // BigIntDecodePointer makes CBOR bignum decode to *big.Int when
+ // unmarshaling 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
+}
+
+// TextUnmarshalerMode specifies how to decode into types that implement
+// encoding.TextUnmarshaler.
+type TextUnmarshalerMode int
+
+const (
+ // TextUnmarshalerNone does not recognize TextUnmarshaler implementations during decode.
+ TextUnmarshalerNone TextUnmarshalerMode = iota
+
+ // TextUnmarshalerTextString will invoke UnmarshalText on the contents of a CBOR text
+ // string when decoding into a value that implements TextUnmarshaler.
+ TextUnmarshalerTextString
+
+ maxTextUnmarshalerMode
+)
+
+func (tum TextUnmarshalerMode) valid() bool {
+ return tum >= 0 && tum < maxTextUnmarshalerMode
+}
+
+// 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, uint64, or [big.Int]) 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 unmarshaling 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
+
+ // TextUnmarshaler specifies how to decode into types that implement
+ // encoding.TextUnmarshaler.
+ TextUnmarshaler TextUnmarshalerMode
+
+ // JSONUnmarshalerTranscoder sets the transcoding scheme used to unmarshal types that
+ // implement json.Unmarshaler but do not also implement cbor.Unmarshaler. If nil, decoding
+ // behavior is not influenced by whether or not a type implements json.Unmarshaler.
+ JSONUnmarshalerTranscoder Transcoder
+}
+
+// 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)))
+ }
+
+ if !opts.TextUnmarshaler.valid() {
+ return nil, errors.New("cbor: invalid TextUnmarshaler " + strconv.Itoa(int(opts.TextUnmarshaler)))
+ }
+
+ 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,
+ textUnmarshaler: opts.TextUnmarshaler,
+ jsonUnmarshalerTranscoder: opts.JSONUnmarshalerTranscoder,
+ }
+
+ 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 any) 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 any) (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
+ textUnmarshaler TextUnmarshalerMode
+ jsonUnmarshalerTranscoder Transcoder
+}
+
+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,
+ TextUnmarshaler: dm.textUnmarshaler,
+ JSONUnmarshalerTranscoder: dm.jsonUnmarshalerTranscoder,
+ }
+}
+
+// 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 any) 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 any) (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 any) 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.Pointer {
+ 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.Pointer {
+ d.skip()
+ v.SetZero()
+ 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.PointerTo(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.Pointer {
+ 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)
+
+ case specialTypeUnexportedUnmarshalerIface:
+ return d.parseToUnexportedUnmarshaler(v)
+
+ case specialTypeJSONUnmarshalerIface:
+ // This special type implies that the type does not also implement
+ // cbor.Umarshaler.
+ if d.dm.jsonUnmarshalerTranscoder == nil {
+ break
+ }
+ return d.parseToJSONUnmarshaler(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, d.dm.textUnmarshaler)
+
+ case cborTypeTextString:
+ b, err := d.parseTextString()
+ if err != nil {
+ return err
+ }
+ return fillTextString(t, b, v, d.dm.textUnmarshaler)
+
+ 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, d.dm.textUnmarshaler)
+ }
+ 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, d.dm.textUnmarshaler)
+ }
+ 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.Pointer && v.IsNil() {
+ d.skip()
+ return nil
+ }
+
+ if v.Kind() != reflect.Pointer && 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")
+}
+
+// parseToUnexportedUnmarshaler parses CBOR data to value implementing unmarshaler interface.
+// It assumes data is well-formed, and does not perform bounds checking.
+func (d *decoder) parseToUnexportedUnmarshaler(v reflect.Value) error {
+ if d.nextCBORNil() && v.Kind() == reflect.Pointer && v.IsNil() {
+ d.skip()
+ return nil
+ }
+
+ if v.Kind() != reflect.Pointer && 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")
+}
+
+// parseToJSONUnmarshaler parses CBOR data to be transcoded to JSON and passed to the value's
+// implementation of the json.Unmarshaler interface. It assumes data is well-formed, and does not
+// perform bounds checking.
+func (d *decoder) parseToJSONUnmarshaler(v reflect.Value) error {
+ if d.nextCBORNil() && v.Kind() == reflect.Pointer && v.IsNil() {
+ d.skip()
+ return nil
+ }
+
+ if v.Kind() != reflect.Pointer && v.CanAddr() {
+ v = v.Addr()
+ }
+ if u, ok := v.Interface().(jsonUnmarshaler); ok {
+ start := d.off
+ d.skip()
+ e := getEncodeBuffer()
+ defer putEncodeBuffer(e)
+ if err := d.dm.jsonUnmarshalerTranscoder.Transcode(e, bytes.NewReader(d.data[start:d.off])); err != nil {
+ return &TranscodeError{err: err, rtype: v.Type(), sourceFormat: "cbor", targetFormat: "json"}
+ }
+ return u.UnmarshalJSON(e.Bytes())
+ }
+ d.skip()
+ return errors.New("cbor: failed to assert " + v.Type().String() + " as json.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) (any, 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() ([]any, 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([]any, count)
+ var e any
+ 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 {
+ for ; gi < vLen; gi++ {
+ v.Index(gi).SetZero()
+ }
+ }
+ return err
+}
+
+func (d *decoder) parseMap() (any, error) {
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+ m := make(map[any]any)
+ var k, e any
+ 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 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[any]bool // Store existing map keys, used for detecting duplicate map key.
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ existingKeys = make(map[any]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 {
+ keyValue.SetZero()
+ }
+ 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 any
+ 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 {
+ eleValue.SetZero()
+ }
+ 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[any]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 any
+
+ 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[any]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
+}
+
+type jsonUnmarshaler interface{ UnmarshalJSON([]byte) error }
+
+var (
+ typeIntf = reflect.TypeOf([]any(nil)).Elem()
+ typeTime = reflect.TypeOf(time.Time{})
+ typeBigInt = reflect.TypeOf(big.Int{})
+ typeUnmarshaler = reflect.TypeOf((*Unmarshaler)(nil)).Elem()
+ typeUnexportedUnmarshaler = reflect.TypeOf((*unmarshaler)(nil)).Elem()
+ typeBinaryUnmarshaler = reflect.TypeOf((*encoding.BinaryUnmarshaler)(nil)).Elem()
+ typeTextUnmarshaler = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem()
+ typeJSONUnmarshaler = reflect.TypeOf((*jsonUnmarshaler)(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.Pointer:
+ v.SetZero()
+ 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, tum TextUnmarshalerMode) error {
+ if bum == BinaryUnmarshalerByteString && reflect.PointerTo(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 {
+ if tum == TextUnmarshalerTextString && reflect.PointerTo(v.Type()).Implements(typeTextUnmarshaler) {
+ if v.CanAddr() {
+ v = v.Addr()
+ if u, ok := v.Interface().(encoding.TextUnmarshaler); ok {
+ // The contract of TextUnmarshaler forbids retaining the input
+ // bytes, so no copying is required even if val is shared.
+ if err := u.UnmarshalText(val); err != nil {
+ return fmt.Errorf("cbor: cannot unmarshal text for %s: %w", v.Type(), err)
+ }
+ return nil
+ }
+ }
+ return errors.New("cbor: cannot set new value for " + v.Type().String())
+ }
+
+ if 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 {
+ for ; i < vLen; i++ {
+ v.Index(i).SetZero()
+ }
+ }
+ return nil
+ }
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
+}
+
+func fillTextString(t cborType, val []byte, v reflect.Value, tum TextUnmarshalerMode) error {
+ // Check if the value implements TextUnmarshaler and the mode allows it
+ if tum == TextUnmarshalerTextString && reflect.PointerTo(v.Type()).Implements(typeTextUnmarshaler) {
+ if v.CanAddr() {
+ v = v.Addr()
+ if u, ok := v.Interface().(encoding.TextUnmarshaler); ok {
+ // The contract of TextUnmarshaler forbids retaining the input
+ // bytes, so no copying is required even if val is shared.
+ if err := u.UnmarshalText(val); err != nil {
+ return fmt.Errorf("cbor: cannot unmarshal text for %s: %w", v.Type(), err)
+ }
+ return nil
+ }
+ }
+ return errors.New("cbor: cannot set new value for " + v.Type().String())
+ }
+
+ 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 any) (any, 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 000000000000..44afb866089c
--- /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 000000000000..c758b7374893
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/doc.go
@@ -0,0 +1,152 @@
+// 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 8742) with CBOR tags,
+Go struct tag options (toarray/keyasint/omitempty/omitzero), 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 tag options "keyasint", "toarray", "omitempty", and "omitzero" reduce encoding size
+and reduce programming effort.
+
+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
+
+Diagnostic functions translate CBOR data item into Diagnostic Notation:
+
+ Diagnose, DiagnoseFirst
+
+Functions that simplify using CBOR Sequences (RFC 8742) include:
+
+ UnmarshalFirst
+
+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)
+
+Using Default Mode of UnmarshalFirst to Decode CBOR Sequences
+
+ // Decode the first CBOR data item and return remaining bytes:
+ rest, err = cbor.UnmarshalFirst(b, &v) // decode []byte b to v
+
+Using Extended Diagnostic Notation (EDN) to represent CBOR data
+
+ // Translate the first CBOR data item into text and return remaining bytes.
+ text, rest, err = cbor.DiagnoseFirst(b) // decode []byte b to text
+
+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 tag options like "keyasint", "toarray", "omitempty", and "omitzero" make it easy to use
+very compact formats like COSE and CWT (CBOR Web Tokens) with structs.
+
+The "omitzero" option omits zero values from encoding, matching
+[stdlib encoding/json behavior](https://pkg.go.dev/encoding/json#Marshal).
+When specified in the `cbor` tag, the option is always honored.
+When specified in the `json` tag, the option is honored when building with Go 1.24+.
+
+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 tag options 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 000000000000..c550617c3873
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/encode.go
@@ -0,0 +1,2299 @@
+// 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", "omitzero" and "keyasint" options, and special case "-" for
+// field omission. If "cbor" key is absent, Marshal uses "json" key.
+// When using the "json" key, the "omitzero" option is honored when building
+// with Go 1.24+ to match stdlib encoding/json behavior.
+//
+// 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" and "omitzero" are 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 any) ([]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 any, 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
+}
+
+type TranscodeError struct {
+ err error
+ rtype reflect.Type
+ sourceFormat, targetFormat string
+}
+
+func (e TranscodeError) Error() string {
+ return "cbor: cannot transcode from " + e.sourceFormat + " to " + e.targetFormat + ": " + e.err.Error()
+}
+
+func (e TranscodeError) 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 in compliance with RFC 8949 (CBOR):
+// - Section 3.4.1: Standard Date/Time String
+// - Section 3.4.2: Epoch-Based Date/Time
+// For more info, see:
+// - https://www.rfc-editor.org/rfc/rfc8949.html
+// NOTE: User applications that prefer to encode time with fractional seconds to an integer
+// (instead of floating point or text string) can use a CBOR tag number not assigned by IANA:
+// 1. Define a user-defined type in Go with just a time.Time or int64 as its data.
+// 2. Implement the cbor.Marshaler and cbor.Unmarshaler interface for that user-defined type
+// to encode or decode the tagged data item with an enclosed integer content.
+type TimeMode int
+
+const (
+ // TimeUnix causes time.Time to encode to a CBOR time (tag 1) with an integer content
+ // representing seconds elapsed (with 1-second precision) since UNIX Epoch UTC.
+ // The TimeUnix option is location independent and has a clear precision guarantee.
+ TimeUnix TimeMode = iota
+
+ // TimeUnixMicro causes time.Time to encode to a CBOR time (tag 1) with a floating point content
+ // representing seconds elapsed (with up to 1-microsecond precision) since UNIX Epoch UTC.
+ // NOTE: The floating point content is encoded to the shortest floating-point encoding that preserves
+ // the 64-bit floating point value. I.e., the floating point encoding can be IEEE 764:
+ // binary64, binary32, or binary16 depending on the content's value.
+ TimeUnixMicro
+
+ // TimeUnixDynamic causes time.Time to encode to a CBOR time (tag 1) with either an integer content or
+ // a floating point content, depending on the content's value. This option is equivalent to dynamically
+ // choosing TimeUnix if time.Time doesn't have fractional seconds, and using TimeUnixMicro if time.Time
+ // has fractional seconds.
+ TimeUnixDynamic
+
+ // TimeRFC3339 causes time.Time to encode to a CBOR time (tag 0) with a text string content
+ // representing the time using 1-second precision in RFC3339 format. If the time.Time has a
+ // non-UTC timezone then a "localtime - UTC" numeric offset will be included as specified in RFC3339.
+ // NOTE: User applications can avoid including the RFC3339 numeric offset by:
+ // - providing a time.Time value set to UTC, or
+ // - using the TimeUnix, TimeUnixMicro, or TimeUnixDynamic option instead of TimeRFC3339.
+ TimeRFC3339
+
+ // TimeRFC3339Nano causes time.Time to encode to a CBOR time (tag 0) with a text string content
+ // representing the time using 1-nanosecond precision in RFC3339 format. If the time.Time has a
+ // non-UTC timezone then a "localtime - UTC" numeric offset will be included as specified in RFC3339.
+ // NOTE: User applications can avoid including the RFC3339 numeric offset by:
+ // - providing a time.Time value set to UTC, or
+ // - using the TimeUnix, TimeUnixMicro, or TimeUnixDynamic option instead of TimeRFC3339Nano.
+ 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
+}
+
+// TextMarshalerMode specifies how to encode types that implement encoding.TextMarshaler.
+type TextMarshalerMode int
+
+const (
+ // TextMarshalerNone does not recognize TextMarshaler implementations during encode.
+ // This is the default behavior.
+ TextMarshalerNone TextMarshalerMode = iota
+
+ // TextMarshalerTextString encodes the output of MarshalText to a CBOR text string.
+ TextMarshalerTextString
+
+ maxTextMarshalerMode
+)
+
+func (tmm TextMarshalerMode) valid() bool {
+ return tmm >= 0 && tmm < maxTextMarshalerMode
+}
+
+// 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
+
+ // TextMarshaler specifies how to encode types that implement encoding.TextMarshaler.
+ TextMarshaler TextMarshalerMode
+
+ // JSONMarshalerTranscoder sets the transcoding scheme used to marshal types that implement
+ // json.Marshaler but do not also implement cbor.Marshaler. If nil, encoding behavior is not
+ // influenced by whether or not a type implements json.Marshaler.
+ JSONMarshalerTranscoder Transcoder
+}
+
+// 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)))
+ }
+ if !opts.TextMarshaler.valid() {
+ return nil, errors.New("cbor: invalid TextMarshaler " + strconv.Itoa(int(opts.TextMarshaler)))
+ }
+ 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,
+ textMarshaler: opts.TextMarshaler,
+ jsonMarshalerTranscoder: opts.JSONMarshalerTranscoder,
+ }
+ return &em, nil
+}
+
+// EncMode is the main interface for CBOR encoding.
+type EncMode interface {
+ Marshal(v any) ([]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 any, 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
+ textMarshaler TextMarshalerMode
+ jsonMarshalerTranscoder Transcoder
+}
+
+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,
+ TextMarshaler: em.textMarshaler,
+ JSONMarshalerTranscoder: em.jsonMarshalerTranscoder,
+ }
+}
+
+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 any) ([]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 any, 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() any {
+ 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)
+type isZeroFunc func(v reflect.Value) (zero 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.omitZero {
+ zero, err := f.izf(fv)
+ if err != nil {
+ return err
+ }
+ if zero {
+ 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
+}
+
+type textMarshalerEncoder struct {
+ alternateEncode encodeFunc
+ alternateIsEmpty isEmptyFunc
+}
+
+func (tme textMarshalerEncoder) encode(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if em.textMarshaler == TextMarshalerNone {
+ return tme.alternateEncode(e, em, v)
+ }
+
+ vt := v.Type()
+ m, ok := v.Interface().(encoding.TextMarshaler)
+ if !ok {
+ pv := reflect.New(vt)
+ pv.Elem().Set(v)
+ m = pv.Interface().(encoding.TextMarshaler)
+ }
+ data, err := m.MarshalText()
+ if err != nil {
+ return fmt.Errorf("cbor: cannot marshal text for %s: %w", vt, err)
+ }
+ if b := em.encTagBytes(vt); b != nil {
+ e.Write(b)
+ }
+
+ encodeHead(e, byte(cborTypeTextString), uint64(len(data)))
+ e.Write(data)
+ return nil
+}
+
+func (tme textMarshalerEncoder) isEmpty(em *encMode, v reflect.Value) (bool, error) {
+ if em.textMarshaler == TextMarshalerNone {
+ return tme.alternateIsEmpty(em, v)
+ }
+
+ m, ok := v.Interface().(encoding.TextMarshaler)
+ if !ok {
+ pv := reflect.New(v.Type())
+ pv.Elem().Set(v)
+ m = pv.Interface().(encoding.TextMarshaler)
+ }
+ data, err := m.MarshalText()
+ if err != nil {
+ return false, fmt.Errorf("cbor: cannot marshal text for %s: %w", v.Type(), err)
+ }
+ return len(data) == 0, nil
+}
+
+type jsonMarshalerEncoder struct {
+ alternateEncode encodeFunc
+ alternateIsEmpty isEmptyFunc
+}
+
+func (jme jsonMarshalerEncoder) encode(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if em.jsonMarshalerTranscoder == nil {
+ return jme.alternateEncode(e, em, v)
+ }
+
+ vt := v.Type()
+ m, ok := v.Interface().(jsonMarshaler)
+ if !ok {
+ pv := reflect.New(vt)
+ pv.Elem().Set(v)
+ m = pv.Interface().(jsonMarshaler)
+ }
+
+ json, err := m.MarshalJSON()
+ if err != nil {
+ return err
+ }
+
+ offset := e.Len()
+
+ if b := em.encTagBytes(vt); b != nil {
+ e.Write(b)
+ }
+
+ if err := em.jsonMarshalerTranscoder.Transcode(e, bytes.NewReader(json)); err != nil {
+ return &TranscodeError{err: err, rtype: vt, sourceFormat: "json", targetFormat: "cbor"}
+ }
+
+ // Validate that the transcode function has written exactly one well-formed data item.
+ d := decoder{data: e.Bytes()[offset:], dm: getMarshalerDecMode(em.indefLength, em.tagsMd)}
+ if err := d.wellformed(false, true); err != nil {
+ e.Truncate(offset)
+ return &TranscodeError{err: err, rtype: vt, sourceFormat: "json", targetFormat: "cbor"}
+ }
+
+ return nil
+}
+
+func (jme jsonMarshalerEncoder) isEmpty(em *encMode, v reflect.Value) (bool, error) {
+ if em.jsonMarshalerTranscoder == nil {
+ return jme.alternateIsEmpty(em, v)
+ }
+
+ // As with types implementing cbor.Marshaler, transcoded json.Marshaler values always encode
+ // as exactly one complete CBOR data item.
+ return false, 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
+}
+
+type jsonMarshaler interface{ MarshalJSON() ([]byte, error) }
+
+var (
+ typeMarshaler = reflect.TypeOf((*Marshaler)(nil)).Elem()
+ typeBinaryMarshaler = reflect.TypeOf((*encoding.BinaryMarshaler)(nil)).Elem()
+ typeTextMarshaler = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem()
+ typeJSONMarshaler = reflect.TypeOf((*jsonMarshaler)(nil)).Elem()
+ typeRawMessage = reflect.TypeOf(RawMessage(nil))
+ typeByteString = reflect.TypeOf(ByteString(""))
+)
+
+func getEncodeFuncInternal(t reflect.Type) (ef encodeFunc, ief isEmptyFunc, izf isZeroFunc) {
+ k := t.Kind()
+ if k == reflect.Pointer {
+ return getEncodeIndirectValueFunc(t), isEmptyPtr, getIsZeroFunc(t)
+ }
+ switch t {
+ case typeSimpleValue:
+ return encodeMarshalerType, isEmptyUint, getIsZeroFunc(t)
+
+ case typeTag:
+ return encodeTag, alwaysNotEmpty, getIsZeroFunc(t)
+
+ case typeTime:
+ return encodeTime, alwaysNotEmpty, getIsZeroFunc(t)
+
+ case typeBigInt:
+ return encodeBigInt, alwaysNotEmpty, getIsZeroFunc(t)
+
+ case typeRawMessage:
+ return encodeMarshalerType, isEmptySlice, getIsZeroFunc(t)
+
+ case typeByteString:
+ return encodeMarshalerType, isEmptyString, getIsZeroFunc(t)
+ }
+ if reflect.PointerTo(t).Implements(typeMarshaler) {
+ return encodeMarshalerType, alwaysNotEmpty, getIsZeroFunc(t)
+ }
+ if reflect.PointerTo(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
+ }()
+ }
+ if reflect.PointerTo(t).Implements(typeTextMarshaler) {
+ defer func() {
+ // capture encoding method used for modes that disable TextMarshaler
+ tme := textMarshalerEncoder{
+ alternateEncode: ef,
+ alternateIsEmpty: ief,
+ }
+ ef = tme.encode
+ ief = tme.isEmpty
+ }()
+ }
+ if reflect.PointerTo(t).Implements(typeJSONMarshaler) {
+ defer func() {
+ // capture encoding method used for modes that don't support transcoding
+ // from types that implement json.Marshaler.
+ jme := jsonMarshalerEncoder{
+ alternateEncode: ef,
+ alternateIsEmpty: ief,
+ }
+ ef = jme.encode
+ ief = jme.isEmpty
+ }()
+ }
+
+ switch k {
+ case reflect.Bool:
+ return encodeBool, isEmptyBool, getIsZeroFunc(t)
+
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ return encodeInt, isEmptyInt, getIsZeroFunc(t)
+
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+ return encodeUint, isEmptyUint, getIsZeroFunc(t)
+
+ case reflect.Float32, reflect.Float64:
+ return encodeFloat, isEmptyFloat, getIsZeroFunc(t)
+
+ case reflect.String:
+ return encodeString, isEmptyString, getIsZeroFunc(t)
+
+ case reflect.Slice:
+ if t.Elem().Kind() == reflect.Uint8 {
+ return encodeByteString, isEmptySlice, getIsZeroFunc(t)
+ }
+ fallthrough
+
+ case reflect.Array:
+ f, _, _ := getEncodeFunc(t.Elem())
+ if f == nil {
+ return nil, nil, nil
+ }
+ return arrayEncodeFunc{f: f}.encode, isEmptySlice, getIsZeroFunc(t)
+
+ case reflect.Map:
+ f := getEncodeMapFunc(t)
+ if f == nil {
+ return nil, nil, nil
+ }
+ return f, isEmptyMap, getIsZeroFunc(t)
+
+ 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, isZeroFieldStruct
+ }
+ }
+ }
+ return encodeStruct, isEmptyStruct, getIsZeroFunc(t)
+
+ case reflect.Interface:
+ return encodeIntf, isEmptyIntf, getIsZeroFunc(t)
+ }
+ return nil, nil, nil
+}
+
+func getEncodeIndirectValueFunc(t reflect.Type) encodeFunc {
+ for t.Kind() == reflect.Pointer {
+ 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.Pointer && !v.IsNil() {
+ v = v.Elem()
+ }
+ if v.Kind() == reflect.Pointer && 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
+}
+
+type isZeroer interface {
+ IsZero() bool
+}
+
+var isZeroerType = reflect.TypeOf((*isZeroer)(nil)).Elem()
+
+// getIsZeroFunc returns a function for the given type that can be called to determine if a given value is zero.
+// Types that implement `IsZero() bool` are delegated to for non-nil values.
+// Types that do not implement `IsZero() bool` use the reflect.Value#IsZero() implementation.
+// The returned function matches behavior of stdlib encoding/json behavior in Go 1.24+.
+func getIsZeroFunc(t reflect.Type) isZeroFunc {
+ // Provide a function that uses a type's IsZero method if defined.
+ switch {
+ case t == nil:
+ return isZeroDefault
+ case t.Kind() == reflect.Interface && t.Implements(isZeroerType):
+ return isZeroInterfaceCustom
+ case t.Kind() == reflect.Pointer && t.Implements(isZeroerType):
+ return isZeroPointerCustom
+ case t.Implements(isZeroerType):
+ return isZeroCustom
+ case reflect.PointerTo(t).Implements(isZeroerType):
+ return isZeroAddrCustom
+ default:
+ return isZeroDefault
+ }
+}
+
+// isZeroInterfaceCustom returns true for nil or pointer-to-nil values,
+// and delegates to the custom IsZero() implementation otherwise.
+func isZeroInterfaceCustom(v reflect.Value) (bool, error) {
+ kind := v.Kind()
+
+ switch kind {
+ case reflect.Chan, reflect.Func, reflect.Map, reflect.Pointer, reflect.Interface, reflect.Slice:
+ if v.IsNil() {
+ return true, nil
+ }
+ }
+
+ switch kind {
+ case reflect.Interface, reflect.Pointer:
+ if elem := v.Elem(); elem.Kind() == reflect.Pointer && elem.IsNil() {
+ return true, nil
+ }
+ }
+
+ return v.Interface().(isZeroer).IsZero(), nil
+}
+
+// isZeroPointerCustom returns true for nil values,
+// and delegates to the custom IsZero() implementation otherwise.
+func isZeroPointerCustom(v reflect.Value) (bool, error) {
+ if v.IsNil() {
+ return true, nil
+ }
+ return v.Interface().(isZeroer).IsZero(), nil
+}
+
+// isZeroCustom delegates to the custom IsZero() implementation.
+func isZeroCustom(v reflect.Value) (bool, error) {
+ return v.Interface().(isZeroer).IsZero(), nil
+}
+
+// isZeroAddrCustom delegates to the custom IsZero() implementation of the addr of the value.
+func isZeroAddrCustom(v reflect.Value) (bool, error) {
+ if !v.CanAddr() {
+ // Temporarily box v so we can take the address.
+ v2 := reflect.New(v.Type()).Elem()
+ v2.Set(v)
+ v = v2
+ }
+ return v.Addr().Interface().(isZeroer).IsZero(), nil
+}
+
+// isZeroDefault calls reflect.Value#IsZero()
+func isZeroDefault(v reflect.Value) (bool, error) {
+ if !v.IsValid() {
+ // v is zero value
+ return true, nil
+ }
+ return v.IsZero(), nil
+}
+
+// isZeroFieldStruct is used to determine whether to omit toarray structs
+func isZeroFieldStruct(v reflect.Value) (bool, error) {
+ structType, err := getEncodingStructType(v.Type())
+ if err != nil {
+ return false, err
+ }
+ return len(structType.fields) == 0, nil
+}
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 000000000000..2871bfdab95d
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/encode_map.go
@@ -0,0 +1,92 @@
+// 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"
+ "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() any {
+ rk := reflect.New(t.Key()).Elem()
+ return &rk
+ },
+ },
+ vpool: sync.Pool{
+ New: func() any {
+ rv := reflect.New(t.Elem()).Elem()
+ return &rv
+ },
+ },
+ }
+ return mapEncodeFunc{
+ e: mkv.encodeKeyValues,
+ }.encode
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/omitzero_go124.go b/vendor/github.com/fxamacker/cbor/v2/omitzero_go124.go
new file mode 100644
index 000000000000..c893a411da67
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/omitzero_go124.go
@@ -0,0 +1,8 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+//go:build go1.24
+
+package cbor
+
+var jsonStdlibSupportsOmitzero = true
diff --git a/vendor/github.com/fxamacker/cbor/v2/omitzero_pre_go124.go b/vendor/github.com/fxamacker/cbor/v2/omitzero_pre_go124.go
new file mode 100644
index 000000000000..db86a6321738
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/omitzero_pre_go124.go
@@ -0,0 +1,8 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+//go:build !go1.24
+
+package cbor
+
+var jsonStdlibSupportsOmitzero = false
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 000000000000..30f72814f60d
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/simplevalue.go
@@ -0,0 +1,98 @@
+// 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"
+ "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.
+//
+// Deprecated: No longer used by this codec; kept for compatibility
+// with user apps that directly call this function.
+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}
+
+ // Check well-formedness of CBOR data item.
+ // SimpleValue.UnmarshalCBOR() is exported, so
+ // the codec needs to support same behavior for:
+ // - Unmarshal(data, *SimpleValue)
+ // - SimpleValue.UnmarshalCBOR(data)
+ err := d.wellformed(false, false)
+ if err != nil {
+ return err
+ }
+
+ return sv.unmarshalCBOR(data)
+}
+
+// unmarshalCBOR decodes CBOR simple value (major type 7) to SimpleValue.
+// This function assumes data is well-formed, and does not perform bounds checking.
+// This function is called by Unmarshal().
+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 000000000000..7ac6d7d67129
--- /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 any) 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 any) 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 000000000000..cf0a922cd7cb
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/structfields.go
@@ -0,0 +1,268 @@
+// 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
+ izf isZeroFunc
+ 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
+ omitZero bool // used to skip zero 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.Pointer {
+ ft = ft.Elem()
+ }
+
+ if !isFieldExportable(f, ft.Kind()) {
+ continue
+ }
+
+ cborTag := true
+ tag := f.Tag.Get("cbor")
+ if tag == "" {
+ tag = f.Tag.Get("json")
+ cborTag = false
+ }
+ if tag == "-" {
+ continue
+ }
+
+ tagged := tag != ""
+
+ // Parse field tag options
+ var tagFieldName string
+ var omitempty, omitzero, 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 "omitzero":
+ if cborTag || jsonStdlibSupportsOmitzero {
+ omitzero = 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,
+ omitZero: omitzero,
+ 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
+ return f.IsExported() || (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.Pointer && 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 000000000000..bd8b773f54b6
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/tag.go
@@ -0,0 +1,329 @@
+// 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"
+ "fmt"
+ "reflect"
+ "sync"
+)
+
+// Tag represents a tagged data item (CBOR major type 6), comprising a tag number and the unmarshaled tag content.
+// NOTE: The same encoding and decoding options that apply to untagged CBOR data items also applies to tag content
+// during encoding and decoding.
+type Tag struct {
+ Number uint64
+ Content any
+}
+
+// RawTag represents a tagged data item (CBOR major type 6), comprising a tag number and the raw tag content.
+// The raw tag content (enclosed data item) is a CBOR-encoded data item.
+// RawTag can be used to delay decoding a CBOR data item or precompute encoding a CBOR data item.
+type RawTag struct {
+ Number uint64
+ Content RawMessage
+}
+
+// UnmarshalCBOR sets *t with the tag number and the raw tag content copied from data.
+//
+// Deprecated: No longer used by this codec; kept for compatibility
+// with user apps that directly call this function.
+func (t *RawTag) UnmarshalCBOR(data []byte) error {
+ if t == nil {
+ return errors.New("cbor.RawTag: UnmarshalCBOR on nil pointer")
+ }
+
+ d := decoder{data: data, dm: defaultDecMode}
+
+ // Check if data is a well-formed CBOR data item.
+ // RawTag.UnmarshalCBOR() is exported, so
+ // the codec needs to support same behavior for:
+ // - Unmarshal(data, *RawTag)
+ // - RawTag.UnmarshalCBOR(data)
+ err := d.wellformed(false, false)
+ if err != nil {
+ return err
+ }
+
+ return t.unmarshalCBOR(data)
+}
+
+// unmarshalCBOR sets *t with the tag number and the raw tag content copied from data.
+// This function assumes data is well-formed, and does not perform bounds checking.
+// This function is called by Unmarshal().
+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.Pointer {
+ 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.Pointer {
+ 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 000000000000..b40793b95e3f
--- /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/ghodss/yaml/.gitignore b/vendor/github.com/ghodss/yaml/.gitignore
deleted file mode 100644
index e256a31e00a5..000000000000
--- a/vendor/github.com/ghodss/yaml/.gitignore
+++ /dev/null
@@ -1,20 +0,0 @@
-# OSX leaves these everywhere on SMB shares
-._*
-
-# Eclipse files
-.classpath
-.project
-.settings/**
-
-# Emacs save files
-*~
-
-# Vim-related files
-[._]*.s[a-w][a-z]
-[._]s[a-w][a-z]
-*.un~
-Session.vim
-.netrwhist
-
-# Go test binaries
-*.test
diff --git a/vendor/github.com/ghodss/yaml/.travis.yml b/vendor/github.com/ghodss/yaml/.travis.yml
deleted file mode 100644
index 0e9d6edc010a..000000000000
--- a/vendor/github.com/ghodss/yaml/.travis.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-language: go
-go:
- - 1.3
- - 1.4
-script:
- - go test
- - go build
diff --git a/vendor/github.com/ghodss/yaml/LICENSE b/vendor/github.com/ghodss/yaml/LICENSE
deleted file mode 100644
index 7805d36de730..000000000000
--- a/vendor/github.com/ghodss/yaml/LICENSE
+++ /dev/null
@@ -1,50 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Sam Ghods
-
-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.
-
-
-Copyright (c) 2012 The Go Authors. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * 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.
- * Neither the name of Google Inc. 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
-OWNER 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/ghodss/yaml/README.md b/vendor/github.com/ghodss/yaml/README.md
deleted file mode 100644
index 0200f75b4d12..000000000000
--- a/vendor/github.com/ghodss/yaml/README.md
+++ /dev/null
@@ -1,121 +0,0 @@
-# YAML marshaling and unmarshaling support for Go
-
-[](https://travis-ci.org/ghodss/yaml)
-
-## Introduction
-
-A wrapper around [go-yaml](https://github.com/go-yaml/yaml) designed to enable a better way of handling YAML when marshaling to and from structs.
-
-In short, this library first converts YAML to JSON using go-yaml and then uses `json.Marshal` and `json.Unmarshal` to convert to or from the struct. This means that it effectively reuses the JSON struct tags as well as the custom JSON methods `MarshalJSON` and `UnmarshalJSON` unlike go-yaml. For a detailed overview of the rationale behind this method, [see this blog post](http://ghodss.com/2014/the-right-way-to-handle-yaml-in-golang/).
-
-## Compatibility
-
-This package uses [go-yaml](https://github.com/go-yaml/yaml) and therefore supports [everything go-yaml supports](https://github.com/go-yaml/yaml#compatibility).
-
-## Caveats
-
-**Caveat #1:** When using `yaml.Marshal` and `yaml.Unmarshal`, binary data should NOT be preceded with the `!!binary` YAML tag. If you do, go-yaml will convert the binary data from base64 to native binary data, which is not compatible with JSON. You can still use binary in your YAML files though - just store them without the `!!binary` tag and decode the base64 in your code (e.g. in the custom JSON methods `MarshalJSON` and `UnmarshalJSON`). This also has the benefit that your YAML and your JSON binary data will be decoded exactly the same way. As an example:
-
-```
-BAD:
- exampleKey: !!binary gIGC
-
-GOOD:
- exampleKey: gIGC
-... and decode the base64 data in your code.
-```
-
-**Caveat #2:** When using `YAMLToJSON` directly, maps with keys that are maps will result in an error since this is not supported by JSON. This error will occur in `Unmarshal` as well since you can't unmarshal map keys anyways since struct fields can't be keys.
-
-## Installation and usage
-
-To install, run:
-
-```
-$ go get github.com/ghodss/yaml
-```
-
-And import using:
-
-```
-import "github.com/ghodss/yaml"
-```
-
-Usage is very similar to the JSON library:
-
-```go
-package main
-
-import (
- "fmt"
-
- "github.com/ghodss/yaml"
-)
-
-type Person struct {
- Name string `json:"name"` // Affects YAML field names too.
- Age int `json:"age"`
-}
-
-func main() {
- // Marshal a Person struct to YAML.
- p := Person{"John", 30}
- y, err := yaml.Marshal(p)
- if err != nil {
- fmt.Printf("err: %v\n", err)
- return
- }
- fmt.Println(string(y))
- /* Output:
- age: 30
- name: John
- */
-
- // Unmarshal the YAML back into a Person struct.
- var p2 Person
- err = yaml.Unmarshal(y, &p2)
- if err != nil {
- fmt.Printf("err: %v\n", err)
- return
- }
- fmt.Println(p2)
- /* Output:
- {John 30}
- */
-}
-```
-
-`yaml.YAMLToJSON` and `yaml.JSONToYAML` methods are also available:
-
-```go
-package main
-
-import (
- "fmt"
-
- "github.com/ghodss/yaml"
-)
-
-func main() {
- j := []byte(`{"name": "John", "age": 30}`)
- y, err := yaml.JSONToYAML(j)
- if err != nil {
- fmt.Printf("err: %v\n", err)
- return
- }
- fmt.Println(string(y))
- /* Output:
- name: John
- age: 30
- */
- j2, err := yaml.YAMLToJSON(y)
- if err != nil {
- fmt.Printf("err: %v\n", err)
- return
- }
- fmt.Println(string(j2))
- /* Output:
- {"age":30,"name":"John"}
- */
-}
-```
diff --git a/vendor/github.com/ghodss/yaml/fields.go b/vendor/github.com/ghodss/yaml/fields.go
deleted file mode 100644
index 58600740266c..000000000000
--- a/vendor/github.com/ghodss/yaml/fields.go
+++ /dev/null
@@ -1,501 +0,0 @@
-// Copyright 2013 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 yaml
-
-import (
- "bytes"
- "encoding"
- "encoding/json"
- "reflect"
- "sort"
- "strings"
- "sync"
- "unicode"
- "unicode/utf8"
-)
-
-// indirect walks down v allocating pointers as needed,
-// until it gets to a non-pointer.
-// if it encounters an Unmarshaler, indirect stops and returns that.
-// if decodingNull is true, indirect stops at the last pointer so it can be set to nil.
-func indirect(v reflect.Value, decodingNull bool) (json.Unmarshaler, encoding.TextUnmarshaler, reflect.Value) {
- // If v is a named type and is addressable,
- // start with its address, so that if the type has pointer methods,
- // we find them.
- if v.Kind() != reflect.Ptr && v.Type().Name() != "" && v.CanAddr() {
- v = v.Addr()
- }
- for {
- // Load value from interface, but only if the result will be
- // usefully addressable.
- if v.Kind() == reflect.Interface && !v.IsNil() {
- e := v.Elem()
- if e.Kind() == reflect.Ptr && !e.IsNil() && (!decodingNull || e.Elem().Kind() == reflect.Ptr) {
- v = e
- continue
- }
- }
-
- if v.Kind() != reflect.Ptr {
- break
- }
-
- if v.Elem().Kind() != reflect.Ptr && decodingNull && v.CanSet() {
- break
- }
- if v.IsNil() {
- if v.CanSet() {
- v.Set(reflect.New(v.Type().Elem()))
- } else {
- v = reflect.New(v.Type().Elem())
- }
- }
- if v.Type().NumMethod() > 0 {
- if u, ok := v.Interface().(json.Unmarshaler); ok {
- return u, nil, reflect.Value{}
- }
- if u, ok := v.Interface().(encoding.TextUnmarshaler); ok {
- return nil, u, reflect.Value{}
- }
- }
- v = v.Elem()
- }
- return nil, nil, v
-}
-
-// A field represents a single field found in a struct.
-type field struct {
- name string
- nameBytes []byte // []byte(name)
- equalFold func(s, t []byte) bool // bytes.EqualFold or equivalent
-
- tag bool
- index []int
- typ reflect.Type
- omitEmpty bool
- quoted bool
-}
-
-func fillField(f field) field {
- f.nameBytes = []byte(f.name)
- f.equalFold = foldFunc(f.nameBytes)
- return f
-}
-
-// byName sorts field by name, breaking ties with depth,
-// then breaking ties with "name came from json tag", then
-// breaking ties with index sequence.
-type byName []field
-
-func (x byName) Len() int { return len(x) }
-
-func (x byName) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
-
-func (x byName) Less(i, j int) bool {
- if x[i].name != x[j].name {
- return x[i].name < x[j].name
- }
- if len(x[i].index) != len(x[j].index) {
- return len(x[i].index) < len(x[j].index)
- }
- if x[i].tag != x[j].tag {
- return x[i].tag
- }
- return byIndex(x).Less(i, j)
-}
-
-// byIndex sorts field by index sequence.
-type byIndex []field
-
-func (x byIndex) Len() int { return len(x) }
-
-func (x byIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
-
-func (x byIndex) Less(i, j int) bool {
- for k, xik := range x[i].index {
- if k >= len(x[j].index) {
- return false
- }
- if xik != x[j].index[k] {
- return xik < x[j].index[k]
- }
- }
- return len(x[i].index) < len(x[j].index)
-}
-
-// typeFields returns a list of fields that JSON should recognize for the given type.
-// The algorithm is breadth-first search over the set of structs to include - the top struct
-// and then any reachable anonymous structs.
-func typeFields(t reflect.Type) []field {
- // Anonymous fields to explore at the current level and the next.
- current := []field{}
- next := []field{{typ: t}}
-
- // Count of queued names for current level and the next.
- count := map[reflect.Type]int{}
- nextCount := map[reflect.Type]int{}
-
- // Types already visited at an earlier level.
- visited := map[reflect.Type]bool{}
-
- // Fields found.
- var fields []field
-
- for len(next) > 0 {
- current, next = next, current[:0]
- count, nextCount = nextCount, map[reflect.Type]int{}
-
- for _, f := range current {
- if visited[f.typ] {
- continue
- }
- visited[f.typ] = true
-
- // Scan f.typ for fields to include.
- for i := 0; i < f.typ.NumField(); i++ {
- sf := f.typ.Field(i)
- if sf.PkgPath != "" { // unexported
- continue
- }
- tag := sf.Tag.Get("json")
- if tag == "-" {
- continue
- }
- name, opts := parseTag(tag)
- if !isValidTag(name) {
- name = ""
- }
- index := make([]int, len(f.index)+1)
- copy(index, f.index)
- index[len(f.index)] = i
-
- ft := sf.Type
- if ft.Name() == "" && ft.Kind() == reflect.Ptr {
- // Follow pointer.
- ft = ft.Elem()
- }
-
- // Record found field and index sequence.
- if name != "" || !sf.Anonymous || ft.Kind() != reflect.Struct {
- tagged := name != ""
- if name == "" {
- name = sf.Name
- }
- fields = append(fields, fillField(field{
- name: name,
- tag: tagged,
- index: index,
- typ: ft,
- omitEmpty: opts.Contains("omitempty"),
- quoted: opts.Contains("string"),
- }))
- if count[f.typ] > 1 {
- // If there were multiple instances, add a second,
- // so that the annihilation code will see a duplicate.
- // It only cares about the distinction between 1 or 2,
- // so don't bother generating any more copies.
- fields = append(fields, fields[len(fields)-1])
- }
- continue
- }
-
- // Record new anonymous struct to explore in next round.
- nextCount[ft]++
- if nextCount[ft] == 1 {
- next = append(next, fillField(field{name: ft.Name(), index: index, typ: ft}))
- }
- }
- }
- }
-
- sort.Sort(byName(fields))
-
- // Delete all fields that are hidden by the Go rules for embedded fields,
- // except that fields with JSON tags are promoted.
-
- // The fields are sorted in primary order of name, secondary order
- // of field index length. Loop over names; for each name, delete
- // hidden fields by choosing the one dominant field that survives.
- out := fields[:0]
- for advance, i := 0, 0; i < len(fields); i += advance {
- // One iteration per name.
- // Find the sequence of fields with the name of this first field.
- fi := fields[i]
- name := fi.name
- for advance = 1; i+advance < len(fields); advance++ {
- fj := fields[i+advance]
- if fj.name != name {
- break
- }
- }
- if advance == 1 { // Only one field with this name
- out = append(out, fi)
- continue
- }
- dominant, ok := dominantField(fields[i : i+advance])
- if ok {
- out = append(out, dominant)
- }
- }
-
- fields = out
- sort.Sort(byIndex(fields))
-
- return fields
-}
-
-// dominantField looks through the fields, all of which are known to
-// have the same name, to find the single field that dominates the
-// others using Go's embedding rules, modified by the presence of
-// JSON tags. If there are multiple top-level fields, the boolean
-// will be false: This condition is an error in Go and we skip all
-// the fields.
-func dominantField(fields []field) (field, bool) {
- // The fields are sorted in increasing index-length order. The winner
- // must therefore be one with the shortest index length. Drop all
- // longer entries, which is easy: just truncate the slice.
- length := len(fields[0].index)
- tagged := -1 // Index of first tagged field.
- for i, f := range fields {
- if len(f.index) > length {
- fields = fields[:i]
- break
- }
- if f.tag {
- if tagged >= 0 {
- // Multiple tagged fields at the same level: conflict.
- // Return no field.
- return field{}, false
- }
- tagged = i
- }
- }
- if tagged >= 0 {
- return fields[tagged], true
- }
- // All remaining fields have the same length. If there's more than one,
- // we have a conflict (two fields named "X" at the same level) and we
- // return no field.
- if len(fields) > 1 {
- return field{}, false
- }
- return fields[0], true
-}
-
-var fieldCache struct {
- sync.RWMutex
- m map[reflect.Type][]field
-}
-
-// cachedTypeFields is like typeFields but uses a cache to avoid repeated work.
-func cachedTypeFields(t reflect.Type) []field {
- fieldCache.RLock()
- f := fieldCache.m[t]
- fieldCache.RUnlock()
- if f != nil {
- return f
- }
-
- // Compute fields without lock.
- // Might duplicate effort but won't hold other computations back.
- f = typeFields(t)
- if f == nil {
- f = []field{}
- }
-
- fieldCache.Lock()
- if fieldCache.m == nil {
- fieldCache.m = map[reflect.Type][]field{}
- }
- fieldCache.m[t] = f
- fieldCache.Unlock()
- return f
-}
-
-func isValidTag(s string) bool {
- if s == "" {
- return false
- }
- for _, c := range s {
- switch {
- case strings.ContainsRune("!#$%&()*+-./:<=>?@[]^_{|}~ ", c):
- // Backslash and quote chars are reserved, but
- // otherwise any punctuation chars are allowed
- // in a tag name.
- default:
- if !unicode.IsLetter(c) && !unicode.IsDigit(c) {
- return false
- }
- }
- }
- return true
-}
-
-const (
- caseMask = ^byte(0x20) // Mask to ignore case in ASCII.
- kelvin = '\u212a'
- smallLongEss = '\u017f'
-)
-
-// foldFunc returns one of four different case folding equivalence
-// functions, from most general (and slow) to fastest:
-//
-// 1) bytes.EqualFold, if the key s contains any non-ASCII UTF-8
-// 2) equalFoldRight, if s contains special folding ASCII ('k', 'K', 's', 'S')
-// 3) asciiEqualFold, no special, but includes non-letters (including _)
-// 4) simpleLetterEqualFold, no specials, no non-letters.
-//
-// The letters S and K are special because they map to 3 runes, not just 2:
-// * S maps to s and to U+017F 'ſ' Latin small letter long s
-// * k maps to K and to U+212A 'K' Kelvin sign
-// See http://play.golang.org/p/tTxjOc0OGo
-//
-// The returned function is specialized for matching against s and
-// should only be given s. It's not curried for performance reasons.
-func foldFunc(s []byte) func(s, t []byte) bool {
- nonLetter := false
- special := false // special letter
- for _, b := range s {
- if b >= utf8.RuneSelf {
- return bytes.EqualFold
- }
- upper := b & caseMask
- if upper < 'A' || upper > 'Z' {
- nonLetter = true
- } else if upper == 'K' || upper == 'S' {
- // See above for why these letters are special.
- special = true
- }
- }
- if special {
- return equalFoldRight
- }
- if nonLetter {
- return asciiEqualFold
- }
- return simpleLetterEqualFold
-}
-
-// equalFoldRight is a specialization of bytes.EqualFold when s is
-// known to be all ASCII (including punctuation), but contains an 's',
-// 'S', 'k', or 'K', requiring a Unicode fold on the bytes in t.
-// See comments on foldFunc.
-func equalFoldRight(s, t []byte) bool {
- for _, sb := range s {
- if len(t) == 0 {
- return false
- }
- tb := t[0]
- if tb < utf8.RuneSelf {
- if sb != tb {
- sbUpper := sb & caseMask
- if 'A' <= sbUpper && sbUpper <= 'Z' {
- if sbUpper != tb&caseMask {
- return false
- }
- } else {
- return false
- }
- }
- t = t[1:]
- continue
- }
- // sb is ASCII and t is not. t must be either kelvin
- // sign or long s; sb must be s, S, k, or K.
- tr, size := utf8.DecodeRune(t)
- switch sb {
- case 's', 'S':
- if tr != smallLongEss {
- return false
- }
- case 'k', 'K':
- if tr != kelvin {
- return false
- }
- default:
- return false
- }
- t = t[size:]
-
- }
- if len(t) > 0 {
- return false
- }
- return true
-}
-
-// asciiEqualFold is a specialization of bytes.EqualFold for use when
-// s is all ASCII (but may contain non-letters) and contains no
-// special-folding letters.
-// See comments on foldFunc.
-func asciiEqualFold(s, t []byte) bool {
- if len(s) != len(t) {
- return false
- }
- for i, sb := range s {
- tb := t[i]
- if sb == tb {
- continue
- }
- if ('a' <= sb && sb <= 'z') || ('A' <= sb && sb <= 'Z') {
- if sb&caseMask != tb&caseMask {
- return false
- }
- } else {
- return false
- }
- }
- return true
-}
-
-// simpleLetterEqualFold is a specialization of bytes.EqualFold for
-// use when s is all ASCII letters (no underscores, etc) and also
-// doesn't contain 'k', 'K', 's', or 'S'.
-// See comments on foldFunc.
-func simpleLetterEqualFold(s, t []byte) bool {
- if len(s) != len(t) {
- return false
- }
- for i, b := range s {
- if b&caseMask != t[i]&caseMask {
- return false
- }
- }
- return true
-}
-
-// tagOptions is the string following a comma in a struct field's "json"
-// tag, or the empty string. It does not include the leading comma.
-type tagOptions string
-
-// parseTag splits a struct field's json tag into its name and
-// comma-separated options.
-func parseTag(tag string) (string, tagOptions) {
- if idx := strings.Index(tag, ","); idx != -1 {
- return tag[:idx], tagOptions(tag[idx+1:])
- }
- return tag, tagOptions("")
-}
-
-// Contains reports whether a comma-separated list of options
-// contains a particular substr flag. substr must be surrounded by a
-// string boundary or commas.
-func (o tagOptions) Contains(optionName string) bool {
- if len(o) == 0 {
- return false
- }
- s := string(o)
- for s != "" {
- var next string
- i := strings.Index(s, ",")
- if i >= 0 {
- s, next = s[:i], s[i+1:]
- }
- if s == optionName {
- return true
- }
- s = next
- }
- return false
-}
diff --git a/vendor/github.com/ghodss/yaml/yaml.go b/vendor/github.com/ghodss/yaml/yaml.go
deleted file mode 100644
index 4fb4054a8b74..000000000000
--- a/vendor/github.com/ghodss/yaml/yaml.go
+++ /dev/null
@@ -1,277 +0,0 @@
-package yaml
-
-import (
- "bytes"
- "encoding/json"
- "fmt"
- "reflect"
- "strconv"
-
- "gopkg.in/yaml.v2"
-)
-
-// Marshals the object into JSON then converts JSON to YAML and returns the
-// YAML.
-func Marshal(o interface{}) ([]byte, error) {
- j, err := json.Marshal(o)
- if err != nil {
- return nil, fmt.Errorf("error marshaling into JSON: %v", err)
- }
-
- y, err := JSONToYAML(j)
- if err != nil {
- return nil, fmt.Errorf("error converting JSON to YAML: %v", err)
- }
-
- return y, nil
-}
-
-// Converts YAML to JSON then uses JSON to unmarshal into an object.
-func Unmarshal(y []byte, o interface{}) error {
- vo := reflect.ValueOf(o)
- j, err := yamlToJSON(y, &vo)
- if err != nil {
- return fmt.Errorf("error converting YAML to JSON: %v", err)
- }
-
- err = json.Unmarshal(j, o)
- if err != nil {
- return fmt.Errorf("error unmarshaling JSON: %v", err)
- }
-
- return nil
-}
-
-// Convert JSON to YAML.
-func JSONToYAML(j []byte) ([]byte, error) {
- // Convert the JSON to an object.
- var jsonObj interface{}
- // We are using yaml.Unmarshal here (instead of json.Unmarshal) because the
- // Go JSON library doesn't try to pick the right number type (int, float,
- // etc.) when unmarshalling to interface{}, it just picks float64
- // universally. go-yaml does go through the effort of picking the right
- // number type, so we can preserve number type throughout this process.
- err := yaml.Unmarshal(j, &jsonObj)
- if err != nil {
- return nil, err
- }
-
- // Marshal this object into YAML.
- return yaml.Marshal(jsonObj)
-}
-
-// Convert YAML to JSON. Since JSON is a subset of YAML, passing JSON through
-// this method should be a no-op.
-//
-// Things YAML can do that are not supported by JSON:
-// * In YAML you can have binary and null keys in your maps. These are invalid
-// in JSON. (int and float keys are converted to strings.)
-// * Binary data in YAML with the !!binary tag is not supported. If you want to
-// use binary data with this library, encode the data as base64 as usual but do
-// not use the !!binary tag in your YAML. This will ensure the original base64
-// encoded data makes it all the way through to the JSON.
-func YAMLToJSON(y []byte) ([]byte, error) {
- return yamlToJSON(y, nil)
-}
-
-func yamlToJSON(y []byte, jsonTarget *reflect.Value) ([]byte, error) {
- // Convert the YAML to an object.
- var yamlObj interface{}
- err := yaml.Unmarshal(y, &yamlObj)
- if err != nil {
- return nil, err
- }
-
- // YAML objects are not completely compatible with JSON objects (e.g. you
- // can have non-string keys in YAML). So, convert the YAML-compatible object
- // to a JSON-compatible object, failing with an error if irrecoverable
- // incompatibilties happen along the way.
- jsonObj, err := convertToJSONableObject(yamlObj, jsonTarget)
- if err != nil {
- return nil, err
- }
-
- // Convert this object to JSON and return the data.
- return json.Marshal(jsonObj)
-}
-
-func convertToJSONableObject(yamlObj interface{}, jsonTarget *reflect.Value) (interface{}, error) {
- var err error
-
- // Resolve jsonTarget to a concrete value (i.e. not a pointer or an
- // interface). We pass decodingNull as false because we're not actually
- // decoding into the value, we're just checking if the ultimate target is a
- // string.
- if jsonTarget != nil {
- ju, tu, pv := indirect(*jsonTarget, false)
- // We have a JSON or Text Umarshaler at this level, so we can't be trying
- // to decode into a string.
- if ju != nil || tu != nil {
- jsonTarget = nil
- } else {
- jsonTarget = &pv
- }
- }
-
- // If yamlObj is a number or a boolean, check if jsonTarget is a string -
- // if so, coerce. Else return normal.
- // If yamlObj is a map or array, find the field that each key is
- // unmarshaling to, and when you recurse pass the reflect.Value for that
- // field back into this function.
- switch typedYAMLObj := yamlObj.(type) {
- case map[interface{}]interface{}:
- // JSON does not support arbitrary keys in a map, so we must convert
- // these keys to strings.
- //
- // From my reading of go-yaml v2 (specifically the resolve function),
- // keys can only have the types string, int, int64, float64, binary
- // (unsupported), or null (unsupported).
- strMap := make(map[string]interface{})
- for k, v := range typedYAMLObj {
- // Resolve the key to a string first.
- var keyString string
- switch typedKey := k.(type) {
- case string:
- keyString = typedKey
- case int:
- keyString = strconv.Itoa(typedKey)
- case int64:
- // go-yaml will only return an int64 as a key if the system
- // architecture is 32-bit and the key's value is between 32-bit
- // and 64-bit. Otherwise the key type will simply be int.
- keyString = strconv.FormatInt(typedKey, 10)
- case float64:
- // Stolen from go-yaml to use the same conversion to string as
- // the go-yaml library uses to convert float to string when
- // Marshaling.
- s := strconv.FormatFloat(typedKey, 'g', -1, 32)
- switch s {
- case "+Inf":
- s = ".inf"
- case "-Inf":
- s = "-.inf"
- case "NaN":
- s = ".nan"
- }
- keyString = s
- case bool:
- if typedKey {
- keyString = "true"
- } else {
- keyString = "false"
- }
- default:
- return nil, fmt.Errorf("Unsupported map key of type: %s, key: %+#v, value: %+#v",
- reflect.TypeOf(k), k, v)
- }
-
- // jsonTarget should be a struct or a map. If it's a struct, find
- // the field it's going to map to and pass its reflect.Value. If
- // it's a map, find the element type of the map and pass the
- // reflect.Value created from that type. If it's neither, just pass
- // nil - JSON conversion will error for us if it's a real issue.
- if jsonTarget != nil {
- t := *jsonTarget
- if t.Kind() == reflect.Struct {
- keyBytes := []byte(keyString)
- // Find the field that the JSON library would use.
- var f *field
- fields := cachedTypeFields(t.Type())
- for i := range fields {
- ff := &fields[i]
- if bytes.Equal(ff.nameBytes, keyBytes) {
- f = ff
- break
- }
- // Do case-insensitive comparison.
- if f == nil && ff.equalFold(ff.nameBytes, keyBytes) {
- f = ff
- }
- }
- if f != nil {
- // Find the reflect.Value of the most preferential
- // struct field.
- jtf := t.Field(f.index[0])
- strMap[keyString], err = convertToJSONableObject(v, &jtf)
- if err != nil {
- return nil, err
- }
- continue
- }
- } else if t.Kind() == reflect.Map {
- // Create a zero value of the map's element type to use as
- // the JSON target.
- jtv := reflect.Zero(t.Type().Elem())
- strMap[keyString], err = convertToJSONableObject(v, &jtv)
- if err != nil {
- return nil, err
- }
- continue
- }
- }
- strMap[keyString], err = convertToJSONableObject(v, nil)
- if err != nil {
- return nil, err
- }
- }
- return strMap, nil
- case []interface{}:
- // We need to recurse into arrays in case there are any
- // map[interface{}]interface{}'s inside and to convert any
- // numbers to strings.
-
- // If jsonTarget is a slice (which it really should be), find the
- // thing it's going to map to. If it's not a slice, just pass nil
- // - JSON conversion will error for us if it's a real issue.
- var jsonSliceElemValue *reflect.Value
- if jsonTarget != nil {
- t := *jsonTarget
- if t.Kind() == reflect.Slice {
- // By default slices point to nil, but we need a reflect.Value
- // pointing to a value of the slice type, so we create one here.
- ev := reflect.Indirect(reflect.New(t.Type().Elem()))
- jsonSliceElemValue = &ev
- }
- }
-
- // Make and use a new array.
- arr := make([]interface{}, len(typedYAMLObj))
- for i, v := range typedYAMLObj {
- arr[i], err = convertToJSONableObject(v, jsonSliceElemValue)
- if err != nil {
- return nil, err
- }
- }
- return arr, nil
- default:
- // If the target type is a string and the YAML type is a number,
- // convert the YAML type to a string.
- if jsonTarget != nil && (*jsonTarget).Kind() == reflect.String {
- // Based on my reading of go-yaml, it may return int, int64,
- // float64, or uint64.
- var s string
- switch typedVal := typedYAMLObj.(type) {
- case int:
- s = strconv.FormatInt(int64(typedVal), 10)
- case int64:
- s = strconv.FormatInt(typedVal, 10)
- case float64:
- s = strconv.FormatFloat(typedVal, 'g', -1, 32)
- case uint64:
- s = strconv.FormatUint(typedVal, 10)
- case bool:
- if typedVal {
- s = "true"
- } else {
- s = "false"
- }
- }
- if len(s) > 0 {
- yamlObj = interface{}(s)
- }
- }
- return yamlObj, nil
- }
-
- return nil, nil
-}
diff --git a/vendor/github.com/go-errors/errors/.travis.yml b/vendor/github.com/go-errors/errors/.travis.yml
index 77a6bccf77e9..1dc296026a78 100644
--- a/vendor/github.com/go-errors/errors/.travis.yml
+++ b/vendor/github.com/go-errors/errors/.travis.yml
@@ -2,7 +2,6 @@ language: go
go:
- "1.8.x"
- - "1.10.x"
- - "1.13.x"
- - "1.14.x"
+ - "1.11.x"
- "1.16.x"
+ - "1.21.x"
diff --git a/vendor/github.com/go-errors/errors/README.md b/vendor/github.com/go-errors/errors/README.md
index 3d78525940ae..558bc883ef9b 100644
--- a/vendor/github.com/go-errors/errors/README.md
+++ b/vendor/github.com/go-errors/errors/README.md
@@ -9,7 +9,7 @@ This is particularly useful when you want to understand the state of execution
when an error was returned unexpectedly.
It provides the type \*Error which implements the standard golang error
-interface, so you can use this library interchangably with code that is
+interface, so you can use this library interchangeably with code that is
expecting a normal error return.
Usage
@@ -80,3 +80,5 @@ This package is licensed under the MIT license, see LICENSE.MIT for details.
* v1.4.0 *BREAKING* v1.4.0 reverted all changes from v1.3.0 and is identical to v1.2.0
* v1.4.1 no code change, but now without an unnecessary cover.out file.
* v1.4.2 performance improvement to ErrorStack() to avoid unnecessary work https://github.com/go-errors/errors/pull/40
+* v1.5.0 add errors.Join() and errors.Unwrap() copying the stdlib https://github.com/go-errors/errors/pull/40
+* v1.5.1 fix build on go1.13..go1.19 (broken by adding Join and Unwrap with wrong build constraints)
diff --git a/vendor/github.com/go-errors/errors/error_1_13.go b/vendor/github.com/go-errors/errors/error_1_13.go
index 0af2fc806594..34ab3e00eb53 100644
--- a/vendor/github.com/go-errors/errors/error_1_13.go
+++ b/vendor/github.com/go-errors/errors/error_1_13.go
@@ -1,3 +1,4 @@
+//go:build go1.13
// +build go1.13
package errors
@@ -6,14 +7,17 @@ import (
baseErrors "errors"
)
-// find error in any wrapped error
+// As finds the first error in err's tree that matches target, and if one is found, sets
+// target to that error value and returns true. Otherwise, it returns false.
+//
+// For more information see stdlib errors.As.
func As(err error, target interface{}) bool {
return baseErrors.As(err, target)
}
// Is detects whether the error is equal to a given error. Errors
// are considered equal by this function if they are matched by errors.Is
-// or if their contained errors are matched through errors.Is
+// or if their contained errors are matched through errors.Is.
func Is(e error, original error) bool {
if baseErrors.Is(e, original) {
return true
diff --git a/vendor/github.com/go-errors/errors/error_backward.go b/vendor/github.com/go-errors/errors/error_backward.go
index 80b0695e7e8c..ff14c4bfa27f 100644
--- a/vendor/github.com/go-errors/errors/error_backward.go
+++ b/vendor/github.com/go-errors/errors/error_backward.go
@@ -1,3 +1,4 @@
+//go:build !go1.13
// +build !go1.13
package errors
@@ -55,3 +56,70 @@ func Is(e error, original error) bool {
return false
}
+
+// Disclaimer: functions Join and Unwrap are copied from the stdlib errors
+// package v1.21.0.
+
+// Join returns an error that wraps the given errors.
+// Any nil error values are discarded.
+// Join returns nil if every value in errs is nil.
+// The error formats as the concatenation of the strings obtained
+// by calling the Error method of each element of errs, with a newline
+// between each string.
+//
+// A non-nil error returned by Join implements the Unwrap() []error method.
+func Join(errs ...error) error {
+ n := 0
+ for _, err := range errs {
+ if err != nil {
+ n++
+ }
+ }
+ if n == 0 {
+ return nil
+ }
+ e := &joinError{
+ errs: make([]error, 0, n),
+ }
+ for _, err := range errs {
+ if err != nil {
+ e.errs = append(e.errs, err)
+ }
+ }
+ return e
+}
+
+type joinError struct {
+ errs []error
+}
+
+func (e *joinError) Error() string {
+ var b []byte
+ for i, err := range e.errs {
+ if i > 0 {
+ b = append(b, '\n')
+ }
+ b = append(b, err.Error()...)
+ }
+ return string(b)
+}
+
+func (e *joinError) Unwrap() []error {
+ return e.errs
+}
+
+// Unwrap returns the result of calling the Unwrap method on err, if err's
+// type contains an Unwrap method returning error.
+// Otherwise, Unwrap returns nil.
+//
+// Unwrap only calls a method of the form "Unwrap() error".
+// In particular Unwrap does not unwrap errors returned by [Join].
+func Unwrap(err error) error {
+ u, ok := err.(interface {
+ Unwrap() error
+ })
+ if !ok {
+ return nil
+ }
+ return u.Unwrap()
+}
diff --git a/vendor/github.com/go-errors/errors/join_unwrap_1_20.go b/vendor/github.com/go-errors/errors/join_unwrap_1_20.go
new file mode 100644
index 000000000000..44df35ece924
--- /dev/null
+++ b/vendor/github.com/go-errors/errors/join_unwrap_1_20.go
@@ -0,0 +1,32 @@
+//go:build go1.20
+// +build go1.20
+
+package errors
+
+import baseErrors "errors"
+
+// Join returns an error that wraps the given errors.
+// Any nil error values are discarded.
+// Join returns nil if every value in errs is nil.
+// The error formats as the concatenation of the strings obtained
+// by calling the Error method of each element of errs, with a newline
+// between each string.
+//
+// A non-nil error returned by Join implements the Unwrap() []error method.
+//
+// For more information see stdlib errors.Join.
+func Join(errs ...error) error {
+ return baseErrors.Join(errs...)
+}
+
+// Unwrap returns the result of calling the Unwrap method on err, if err's
+// type contains an Unwrap method returning error.
+// Otherwise, Unwrap returns nil.
+//
+// Unwrap only calls a method of the form "Unwrap() error".
+// In particular Unwrap does not unwrap errors returned by [Join].
+//
+// For more information see stdlib errors.Unwrap.
+func Unwrap(err error) error {
+ return baseErrors.Unwrap(err)
+}
diff --git a/vendor/github.com/go-errors/errors/join_unwrap_backward.go b/vendor/github.com/go-errors/errors/join_unwrap_backward.go
new file mode 100644
index 000000000000..50c766976c8e
--- /dev/null
+++ b/vendor/github.com/go-errors/errors/join_unwrap_backward.go
@@ -0,0 +1,71 @@
+//go:build !go1.20
+// +build !go1.20
+
+package errors
+
+// Disclaimer: functions Join and Unwrap are copied from the stdlib errors
+// package v1.21.0.
+
+// Join returns an error that wraps the given errors.
+// Any nil error values are discarded.
+// Join returns nil if every value in errs is nil.
+// The error formats as the concatenation of the strings obtained
+// by calling the Error method of each element of errs, with a newline
+// between each string.
+//
+// A non-nil error returned by Join implements the Unwrap() []error method.
+func Join(errs ...error) error {
+ n := 0
+ for _, err := range errs {
+ if err != nil {
+ n++
+ }
+ }
+ if n == 0 {
+ return nil
+ }
+ e := &joinError{
+ errs: make([]error, 0, n),
+ }
+ for _, err := range errs {
+ if err != nil {
+ e.errs = append(e.errs, err)
+ }
+ }
+ return e
+}
+
+type joinError struct {
+ errs []error
+}
+
+func (e *joinError) Error() string {
+ var b []byte
+ for i, err := range e.errs {
+ if i > 0 {
+ b = append(b, '\n')
+ }
+ b = append(b, err.Error()...)
+ }
+ return string(b)
+}
+
+func (e *joinError) Unwrap() []error {
+ return e.errs
+}
+
+// Unwrap returns the result of calling the Unwrap method on err, if err's
+// type contains an Unwrap method returning error.
+// Otherwise, Unwrap returns nil.
+//
+// Unwrap only calls a method of the form "Unwrap() error".
+// In particular Unwrap does not unwrap errors returned by [Join].
+func Unwrap(err error) error {
+ u, ok := err.(interface {
+ Unwrap() error
+ })
+ if !ok {
+ return nil
+ }
+ return u.Unwrap()
+}
diff --git a/vendor/github.com/go-openapi/errors/.golangci.yml b/vendor/github.com/go-openapi/errors/.golangci.yml
index cf88ead324d9..ee8b9bd1f141 100644
--- a/vendor/github.com/go-openapi/errors/.golangci.yml
+++ b/vendor/github.com/go-openapi/errors/.golangci.yml
@@ -1,12 +1,6 @@
linters-settings:
- govet:
- check-shadowing: true
- golint:
- min-confidence: 0
gocyclo:
min-complexity: 45
- maligned:
- suggest-new: true
dupl:
threshold: 200
goconst:
@@ -16,8 +10,6 @@ linters-settings:
linters:
enable-all: true
disable:
- - errname # this repo doesn't follow the convention advised by this linter
- - maligned
- unparam
- lll
- gochecknoinits
@@ -30,9 +22,6 @@ linters:
- wrapcheck
- testpackage
- nlreturn
- - gomnd
- - exhaustivestruct
- - goerr113
- errorlint
- nestif
- godot
@@ -40,7 +29,6 @@ linters:
- paralleltest
- tparallel
- thelper
- - ifshort
- exhaustruct
- varnamelen
- gci
@@ -53,10 +41,15 @@ linters:
- forcetypeassert
- cyclop
# deprecated linters
- - deadcode
- - interfacer
- - scopelint
- - varcheck
- - structcheck
- - golint
- - nosnakecase
+ #- deadcode
+ #- interfacer
+ #- scopelint
+ #- varcheck
+ #- structcheck
+ #- golint
+ #- nosnakecase
+ #- maligned
+ #- goerr113
+ #- ifshort
+ #- gomnd
+ #- exhaustivestruct
diff --git a/vendor/github.com/go-openapi/errors/api.go b/vendor/github.com/go-openapi/errors/api.go
index 5320cb963044..d6f507f42de2 100644
--- a/vendor/github.com/go-openapi/errors/api.go
+++ b/vendor/github.com/go-openapi/errors/api.go
@@ -185,7 +185,7 @@ func ServeError(rw http.ResponseWriter, r *http.Request, err error) {
}
func asHTTPCode(input int) int {
- if input >= 600 {
+ if input >= maximumValidHTTPCode {
return DefaultHTTPCode
}
return input
diff --git a/vendor/github.com/go-openapi/errors/headers.go b/vendor/github.com/go-openapi/errors/headers.go
index dfebe8f95f08..6ea1151f4155 100644
--- a/vendor/github.com/go-openapi/errors/headers.go
+++ b/vendor/github.com/go-openapi/errors/headers.go
@@ -21,7 +21,7 @@ import (
)
// Validation represents a failure of a precondition
-type Validation struct {
+type Validation struct { //nolint: errname
code int32
Name string
In string
diff --git a/vendor/github.com/go-openapi/errors/middleware.go b/vendor/github.com/go-openapi/errors/middleware.go
index 963472d1f34b..67f80386a2ec 100644
--- a/vendor/github.com/go-openapi/errors/middleware.go
+++ b/vendor/github.com/go-openapi/errors/middleware.go
@@ -22,7 +22,7 @@ import (
// APIVerificationFailed is an error that contains all the missing info for a mismatched section
// between the api registrations and the api spec
-type APIVerificationFailed struct {
+type APIVerificationFailed struct { //nolint: errname
Section string `json:"section,omitempty"`
MissingSpecification []string `json:"missingSpecification,omitempty"`
MissingRegistration []string `json:"missingRegistration,omitempty"`
diff --git a/vendor/github.com/go-openapi/errors/parsing.go b/vendor/github.com/go-openapi/errors/parsing.go
index 5096e1ea7be5..ce1ef9cb675d 100644
--- a/vendor/github.com/go-openapi/errors/parsing.go
+++ b/vendor/github.com/go-openapi/errors/parsing.go
@@ -17,6 +17,7 @@ package errors
import (
"encoding/json"
"fmt"
+ "net/http"
)
// ParseError represents a parsing error
@@ -68,7 +69,7 @@ func NewParseError(name, in, value string, reason error) *ParseError {
msg = fmt.Sprintf(parseErrorTemplContent, name, in, value, reason)
}
return &ParseError{
- code: 400,
+ code: http.StatusBadRequest,
Name: name,
In: in,
Value: value,
diff --git a/vendor/github.com/go-openapi/errors/schema.go b/vendor/github.com/go-openapi/errors/schema.go
index cf7ac2ed4da5..8f3239dfd9bd 100644
--- a/vendor/github.com/go-openapi/errors/schema.go
+++ b/vendor/github.com/go-openapi/errors/schema.go
@@ -17,6 +17,7 @@ package errors
import (
"encoding/json"
"fmt"
+ "net/http"
"strings"
)
@@ -32,12 +33,12 @@ const (
patternFail = "%s in %s should match '%s'"
enumFail = "%s in %s should be one of %v"
multipleOfFail = "%s in %s should be a multiple of %v"
- maxIncFail = "%s in %s should be less than or equal to %v"
- maxExcFail = "%s in %s should be less than %v"
+ maximumIncFail = "%s in %s should be less than or equal to %v"
+ maximumExcFail = "%s in %s should be less than %v"
minIncFail = "%s in %s should be greater than or equal to %v"
minExcFail = "%s in %s should be greater than %v"
uniqueFail = "%s in %s shouldn't contain duplicates"
- maxItemsFail = "%s in %s should have at most %d items"
+ maximumItemsFail = "%s in %s should have at most %d items"
minItemsFail = "%s in %s should have at least %d items"
typeFailNoIn = "%s must be of type %s"
typeFailWithDataNoIn = "%s must be of type %s: %q"
@@ -49,12 +50,12 @@ const (
patternFailNoIn = "%s should match '%s'"
enumFailNoIn = "%s should be one of %v"
multipleOfFailNoIn = "%s should be a multiple of %v"
- maxIncFailNoIn = "%s should be less than or equal to %v"
- maxExcFailNoIn = "%s should be less than %v"
+ maximumIncFailNoIn = "%s should be less than or equal to %v"
+ maximumExcFailNoIn = "%s should be less than %v"
minIncFailNoIn = "%s should be greater than or equal to %v"
minExcFailNoIn = "%s should be greater than %v"
uniqueFailNoIn = "%s shouldn't contain duplicates"
- maxItemsFailNoIn = "%s should have at most %d items"
+ maximumItemsFailNoIn = "%s should have at most %d items"
minItemsFailNoIn = "%s should have at least %d items"
noAdditionalItems = "%s in %s can't have additional items"
noAdditionalItemsNoIn = "%s can't have additional items"
@@ -69,14 +70,17 @@ const (
multipleOfMustBePositive = "factor MultipleOf declared for %s must be positive: %v"
)
+const maximumValidHTTPCode = 600
+
// All code responses can be used to differentiate errors for different handling
// by the consuming program
const (
// CompositeErrorCode remains 422 for backwards-compatibility
// and to separate it from validation errors with cause
- CompositeErrorCode = 422
+ CompositeErrorCode = http.StatusUnprocessableEntity
+
// InvalidTypeCode is used for any subclass of invalid types
- InvalidTypeCode = 600 + iota
+ InvalidTypeCode = maximumValidHTTPCode + iota
RequiredFailCode
TooLongFailCode
TooShortFailCode
@@ -298,10 +302,10 @@ func DuplicateItems(name, in string) *Validation {
}
// TooManyItems error for when an array contains too many items
-func TooManyItems(name, in string, max int64, value interface{}) *Validation {
- msg := fmt.Sprintf(maxItemsFail, name, in, max)
+func TooManyItems(name, in string, maximum int64, value interface{}) *Validation {
+ msg := fmt.Sprintf(maximumItemsFail, name, in, maximum)
if in == "" {
- msg = fmt.Sprintf(maxItemsFailNoIn, name, max)
+ msg = fmt.Sprintf(maximumItemsFailNoIn, name, maximum)
}
return &Validation{
@@ -314,10 +318,10 @@ func TooManyItems(name, in string, max int64, value interface{}) *Validation {
}
// TooFewItems error for when an array contains too few items
-func TooFewItems(name, in string, min int64, value interface{}) *Validation {
- msg := fmt.Sprintf(minItemsFail, name, in, min)
+func TooFewItems(name, in string, minimum int64, value interface{}) *Validation {
+ msg := fmt.Sprintf(minItemsFail, name, in, minimum)
if in == "" {
- msg = fmt.Sprintf(minItemsFailNoIn, name, min)
+ msg = fmt.Sprintf(minItemsFailNoIn, name, minimum)
}
return &Validation{
code: MinItemsFailCode,
@@ -328,21 +332,21 @@ func TooFewItems(name, in string, min int64, value interface{}) *Validation {
}
}
-// ExceedsMaximumInt error for when maximum validation fails
-func ExceedsMaximumInt(name, in string, max int64, exclusive bool, value interface{}) *Validation {
+// ExceedsMaximumInt error for when maximumimum validation fails
+func ExceedsMaximumInt(name, in string, maximum int64, exclusive bool, value interface{}) *Validation {
var message string
if in == "" {
- m := maxIncFailNoIn
+ m := maximumIncFailNoIn
if exclusive {
- m = maxExcFailNoIn
+ m = maximumExcFailNoIn
}
- message = fmt.Sprintf(m, name, max)
+ message = fmt.Sprintf(m, name, maximum)
} else {
- m := maxIncFail
+ m := maximumIncFail
if exclusive {
- m = maxExcFail
+ m = maximumExcFail
}
- message = fmt.Sprintf(m, name, in, max)
+ message = fmt.Sprintf(m, name, in, maximum)
}
return &Validation{
code: MaxFailCode,
@@ -353,21 +357,21 @@ func ExceedsMaximumInt(name, in string, max int64, exclusive bool, value interfa
}
}
-// ExceedsMaximumUint error for when maximum validation fails
-func ExceedsMaximumUint(name, in string, max uint64, exclusive bool, value interface{}) *Validation {
+// ExceedsMaximumUint error for when maximumimum validation fails
+func ExceedsMaximumUint(name, in string, maximum uint64, exclusive bool, value interface{}) *Validation {
var message string
if in == "" {
- m := maxIncFailNoIn
+ m := maximumIncFailNoIn
if exclusive {
- m = maxExcFailNoIn
+ m = maximumExcFailNoIn
}
- message = fmt.Sprintf(m, name, max)
+ message = fmt.Sprintf(m, name, maximum)
} else {
- m := maxIncFail
+ m := maximumIncFail
if exclusive {
- m = maxExcFail
+ m = maximumExcFail
}
- message = fmt.Sprintf(m, name, in, max)
+ message = fmt.Sprintf(m, name, in, maximum)
}
return &Validation{
code: MaxFailCode,
@@ -378,21 +382,21 @@ func ExceedsMaximumUint(name, in string, max uint64, exclusive bool, value inter
}
}
-// ExceedsMaximum error for when maximum validation fails
-func ExceedsMaximum(name, in string, max float64, exclusive bool, value interface{}) *Validation {
+// ExceedsMaximum error for when maximumimum validation fails
+func ExceedsMaximum(name, in string, maximum float64, exclusive bool, value interface{}) *Validation {
var message string
if in == "" {
- m := maxIncFailNoIn
+ m := maximumIncFailNoIn
if exclusive {
- m = maxExcFailNoIn
+ m = maximumExcFailNoIn
}
- message = fmt.Sprintf(m, name, max)
+ message = fmt.Sprintf(m, name, maximum)
} else {
- m := maxIncFail
+ m := maximumIncFail
if exclusive {
- m = maxExcFail
+ m = maximumExcFail
}
- message = fmt.Sprintf(m, name, in, max)
+ message = fmt.Sprintf(m, name, in, maximum)
}
return &Validation{
code: MaxFailCode,
@@ -404,20 +408,20 @@ func ExceedsMaximum(name, in string, max float64, exclusive bool, value interfac
}
// ExceedsMinimumInt error for when minimum validation fails
-func ExceedsMinimumInt(name, in string, min int64, exclusive bool, value interface{}) *Validation {
+func ExceedsMinimumInt(name, in string, minimum int64, exclusive bool, value interface{}) *Validation {
var message string
if in == "" {
m := minIncFailNoIn
if exclusive {
m = minExcFailNoIn
}
- message = fmt.Sprintf(m, name, min)
+ message = fmt.Sprintf(m, name, minimum)
} else {
m := minIncFail
if exclusive {
m = minExcFail
}
- message = fmt.Sprintf(m, name, in, min)
+ message = fmt.Sprintf(m, name, in, minimum)
}
return &Validation{
code: MinFailCode,
@@ -429,20 +433,20 @@ func ExceedsMinimumInt(name, in string, min int64, exclusive bool, value interfa
}
// ExceedsMinimumUint error for when minimum validation fails
-func ExceedsMinimumUint(name, in string, min uint64, exclusive bool, value interface{}) *Validation {
+func ExceedsMinimumUint(name, in string, minimum uint64, exclusive bool, value interface{}) *Validation {
var message string
if in == "" {
m := minIncFailNoIn
if exclusive {
m = minExcFailNoIn
}
- message = fmt.Sprintf(m, name, min)
+ message = fmt.Sprintf(m, name, minimum)
} else {
m := minIncFail
if exclusive {
m = minExcFail
}
- message = fmt.Sprintf(m, name, in, min)
+ message = fmt.Sprintf(m, name, in, minimum)
}
return &Validation{
code: MinFailCode,
@@ -454,20 +458,20 @@ func ExceedsMinimumUint(name, in string, min uint64, exclusive bool, value inter
}
// ExceedsMinimum error for when minimum validation fails
-func ExceedsMinimum(name, in string, min float64, exclusive bool, value interface{}) *Validation {
+func ExceedsMinimum(name, in string, minimum float64, exclusive bool, value interface{}) *Validation {
var message string
if in == "" {
m := minIncFailNoIn
if exclusive {
m = minExcFailNoIn
}
- message = fmt.Sprintf(m, name, min)
+ message = fmt.Sprintf(m, name, minimum)
} else {
m := minIncFail
if exclusive {
m = minExcFail
}
- message = fmt.Sprintf(m, name, in, min)
+ message = fmt.Sprintf(m, name, in, minimum)
}
return &Validation{
code: MinFailCode,
@@ -549,12 +553,12 @@ func ReadOnly(name, in string, value interface{}) *Validation {
}
// TooLong error for when a string is too long
-func TooLong(name, in string, max int64, value interface{}) *Validation {
+func TooLong(name, in string, maximum int64, value interface{}) *Validation {
var msg string
if in == "" {
- msg = fmt.Sprintf(tooLongMessageNoIn, name, max)
+ msg = fmt.Sprintf(tooLongMessageNoIn, name, maximum)
} else {
- msg = fmt.Sprintf(tooLongMessage, name, in, max)
+ msg = fmt.Sprintf(tooLongMessage, name, in, maximum)
}
return &Validation{
code: TooLongFailCode,
@@ -566,12 +570,12 @@ func TooLong(name, in string, max int64, value interface{}) *Validation {
}
// TooShort error for when a string is too short
-func TooShort(name, in string, min int64, value interface{}) *Validation {
+func TooShort(name, in string, minimum int64, value interface{}) *Validation {
var msg string
if in == "" {
- msg = fmt.Sprintf(tooShortMessageNoIn, name, min)
+ msg = fmt.Sprintf(tooShortMessageNoIn, name, minimum)
} else {
- msg = fmt.Sprintf(tooShortMessage, name, in, min)
+ msg = fmt.Sprintf(tooShortMessage, name, in, minimum)
}
return &Validation{
diff --git a/vendor/github.com/go-openapi/jsonpointer/.golangci.yml b/vendor/github.com/go-openapi/jsonpointer/.golangci.yml
index 22f8d21cca19..d2fafb8a2bb0 100644
--- a/vendor/github.com/go-openapi/jsonpointer/.golangci.yml
+++ b/vendor/github.com/go-openapi/jsonpointer/.golangci.yml
@@ -1,12 +1,6 @@
linters-settings:
- govet:
- check-shadowing: true
- golint:
- min-confidence: 0
gocyclo:
min-complexity: 45
- maligned:
- suggest-new: true
dupl:
threshold: 200
goconst:
@@ -16,7 +10,7 @@ linters-settings:
linters:
enable-all: true
disable:
- - maligned
+ - recvcheck
- unparam
- lll
- gochecknoinits
@@ -29,9 +23,6 @@ linters:
- wrapcheck
- testpackage
- nlreturn
- - gomnd
- - exhaustivestruct
- - goerr113
- errorlint
- nestif
- godot
@@ -39,7 +30,6 @@ linters:
- paralleltest
- tparallel
- thelper
- - ifshort
- exhaustruct
- varnamelen
- gci
@@ -52,10 +42,15 @@ linters:
- forcetypeassert
- cyclop
# deprecated linters
- - deadcode
- - interfacer
- - scopelint
- - varcheck
- - structcheck
- - golint
- - nosnakecase
+ #- deadcode
+ #- interfacer
+ #- scopelint
+ #- varcheck
+ #- structcheck
+ #- golint
+ #- nosnakecase
+ #- maligned
+ #- goerr113
+ #- ifshort
+ #- gomnd
+ #- exhaustivestruct
diff --git a/vendor/github.com/go-openapi/jsonpointer/errors.go b/vendor/github.com/go-openapi/jsonpointer/errors.go
new file mode 100644
index 000000000000..b84343d9d74e
--- /dev/null
+++ b/vendor/github.com/go-openapi/jsonpointer/errors.go
@@ -0,0 +1,18 @@
+package jsonpointer
+
+type pointerError string
+
+func (e pointerError) Error() string {
+ return string(e)
+}
+
+const (
+ // ErrPointer is an error raised by the jsonpointer package
+ ErrPointer pointerError = "JSON pointer error"
+
+ // ErrInvalidStart states that a JSON pointer must start with a separator ("/")
+ ErrInvalidStart pointerError = `JSON pointer must be empty or start with a "` + pointerSeparator
+
+ // ErrUnsupportedValueType indicates that a value of the wrong type is being set
+ ErrUnsupportedValueType pointerError = "only structs, pointers, maps and slices are supported for setting values"
+)
diff --git a/vendor/github.com/go-openapi/jsonpointer/pointer.go b/vendor/github.com/go-openapi/jsonpointer/pointer.go
index d970c7cf448e..a08cd68ac04e 100644
--- a/vendor/github.com/go-openapi/jsonpointer/pointer.go
+++ b/vendor/github.com/go-openapi/jsonpointer/pointer.go
@@ -39,9 +39,6 @@ import (
const (
emptyPointer = ``
pointerSeparator = `/`
-
- invalidStart = `JSON pointer must be empty or start with a "` + pointerSeparator
- notFound = `Can't find the pointer in the document`
)
var jsonPointableType = reflect.TypeOf(new(JSONPointable)).Elem()
@@ -80,7 +77,7 @@ func (p *Pointer) parse(jsonPointerString string) error {
if jsonPointerString != emptyPointer {
if !strings.HasPrefix(jsonPointerString, pointerSeparator) {
- err = errors.New(invalidStart)
+ err = errors.Join(ErrInvalidStart, ErrPointer)
} else {
referenceTokens := strings.Split(jsonPointerString, pointerSeparator)
p.referenceTokens = append(p.referenceTokens, referenceTokens[1:]...)
@@ -128,7 +125,7 @@ func getSingleImpl(node any, decodedToken string, nameProvider *swag.NameProvide
rValue := reflect.Indirect(reflect.ValueOf(node))
kind := rValue.Kind()
if isNil(node) {
- return nil, kind, fmt.Errorf("nil value has not field %q", decodedToken)
+ return nil, kind, fmt.Errorf("nil value has no field %q: %w", decodedToken, ErrPointer)
}
switch typed := node.(type) {
@@ -146,7 +143,7 @@ func getSingleImpl(node any, decodedToken string, nameProvider *swag.NameProvide
case reflect.Struct:
nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
if !ok {
- return nil, kind, fmt.Errorf("object has no field %q", decodedToken)
+ return nil, kind, fmt.Errorf("object has no field %q: %w", decodedToken, ErrPointer)
}
fld := rValue.FieldByName(nm)
return fld.Interface(), kind, nil
@@ -158,7 +155,7 @@ func getSingleImpl(node any, decodedToken string, nameProvider *swag.NameProvide
if mv.IsValid() {
return mv.Interface(), kind, nil
}
- return nil, kind, fmt.Errorf("object has no key %q", decodedToken)
+ return nil, kind, fmt.Errorf("object has no key %q: %w", decodedToken, ErrPointer)
case reflect.Slice:
tokenIndex, err := strconv.Atoi(decodedToken)
@@ -167,14 +164,14 @@ func getSingleImpl(node any, decodedToken string, nameProvider *swag.NameProvide
}
sLength := rValue.Len()
if tokenIndex < 0 || tokenIndex >= sLength {
- return nil, kind, fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength-1, tokenIndex)
+ return nil, kind, fmt.Errorf("index out of bounds array[0,%d] index '%d': %w", sLength-1, tokenIndex, ErrPointer)
}
elem := rValue.Index(tokenIndex)
return elem.Interface(), kind, nil
default:
- return nil, kind, fmt.Errorf("invalid token reference %q", decodedToken)
+ return nil, kind, fmt.Errorf("invalid token reference %q: %w", decodedToken, ErrPointer)
}
}
@@ -194,7 +191,7 @@ func setSingleImpl(node, data any, decodedToken string, nameProvider *swag.NameP
case reflect.Struct:
nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
if !ok {
- return fmt.Errorf("object has no field %q", decodedToken)
+ return fmt.Errorf("object has no field %q: %w", decodedToken, ErrPointer)
}
fld := rValue.FieldByName(nm)
if fld.IsValid() {
@@ -214,18 +211,18 @@ func setSingleImpl(node, data any, decodedToken string, nameProvider *swag.NameP
}
sLength := rValue.Len()
if tokenIndex < 0 || tokenIndex >= sLength {
- return fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength, tokenIndex)
+ return fmt.Errorf("index out of bounds array[0,%d] index '%d': %w", sLength, tokenIndex, ErrPointer)
}
elem := rValue.Index(tokenIndex)
if !elem.CanSet() {
- return fmt.Errorf("can't set slice index %s to %v", decodedToken, data)
+ return fmt.Errorf("can't set slice index %s to %v: %w", decodedToken, data, ErrPointer)
}
elem.Set(reflect.ValueOf(data))
return nil
default:
- return fmt.Errorf("invalid token reference %q", decodedToken)
+ return fmt.Errorf("invalid token reference %q: %w", decodedToken, ErrPointer)
}
}
@@ -244,7 +241,6 @@ func (p *Pointer) get(node any, nameProvider *swag.NameProvider) (any, reflect.K
}
for _, token := range p.referenceTokens {
-
decodedToken := Unescape(token)
r, knd, err := getSingleImpl(node, decodedToken, nameProvider)
@@ -264,7 +260,10 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
knd := reflect.ValueOf(node).Kind()
if knd != reflect.Ptr && knd != reflect.Struct && knd != reflect.Map && knd != reflect.Slice && knd != reflect.Array {
- return errors.New("only structs, pointers, maps and slices are supported for setting values")
+ return errors.Join(
+ ErrUnsupportedValueType,
+ ErrPointer,
+ )
}
if nameProvider == nil {
@@ -307,7 +306,7 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
case reflect.Struct:
nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
if !ok {
- return fmt.Errorf("object has no field %q", decodedToken)
+ return fmt.Errorf("object has no field %q: %w", decodedToken, ErrPointer)
}
fld := rValue.FieldByName(nm)
if fld.CanAddr() && fld.Kind() != reflect.Interface && fld.Kind() != reflect.Map && fld.Kind() != reflect.Slice && fld.Kind() != reflect.Ptr {
@@ -321,7 +320,7 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
mv := rValue.MapIndex(kv)
if !mv.IsValid() {
- return fmt.Errorf("object has no key %q", decodedToken)
+ return fmt.Errorf("object has no key %q: %w", decodedToken, ErrPointer)
}
if mv.CanAddr() && mv.Kind() != reflect.Interface && mv.Kind() != reflect.Map && mv.Kind() != reflect.Slice && mv.Kind() != reflect.Ptr {
node = mv.Addr().Interface()
@@ -336,7 +335,7 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
}
sLength := rValue.Len()
if tokenIndex < 0 || tokenIndex >= sLength {
- return fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength, tokenIndex)
+ return fmt.Errorf("index out of bounds array[0,%d] index '%d': %w", sLength, tokenIndex, ErrPointer)
}
elem := rValue.Index(tokenIndex)
@@ -347,7 +346,7 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
node = elem.Interface()
default:
- return fmt.Errorf("invalid token reference %q", decodedToken)
+ return fmt.Errorf("invalid token reference %q: %w", decodedToken, ErrPointer)
}
}
@@ -404,10 +403,10 @@ func (p *Pointer) Offset(document string) (int64, error) {
return 0, err
}
default:
- return 0, fmt.Errorf("invalid token %#v", tk)
+ return 0, fmt.Errorf("invalid token %#v: %w", tk, ErrPointer)
}
default:
- return 0, fmt.Errorf("invalid token %#v", tk)
+ return 0, fmt.Errorf("invalid token %#v: %w", tk, ErrPointer)
}
}
return offset, nil
@@ -437,16 +436,16 @@ func offsetSingleObject(dec *json.Decoder, decodedToken string) (int64, error) {
return offset, nil
}
default:
- return 0, fmt.Errorf("invalid token %#v", tk)
+ return 0, fmt.Errorf("invalid token %#v: %w", tk, ErrPointer)
}
}
- return 0, fmt.Errorf("token reference %q not found", decodedToken)
+ return 0, fmt.Errorf("token reference %q not found: %w", decodedToken, ErrPointer)
}
func offsetSingleArray(dec *json.Decoder, decodedToken string) (int64, error) {
idx, err := strconv.Atoi(decodedToken)
if err != nil {
- return 0, fmt.Errorf("token reference %q is not a number: %v", decodedToken, err)
+ return 0, fmt.Errorf("token reference %q is not a number: %v: %w", decodedToken, err, ErrPointer)
}
var i int
for i = 0; i < idx && dec.More(); i++ {
@@ -470,7 +469,7 @@ func offsetSingleArray(dec *json.Decoder, decodedToken string) (int64, error) {
}
if !dec.More() {
- return 0, fmt.Errorf("token reference %q not found", decodedToken)
+ return 0, fmt.Errorf("token reference %q not found: %w", decodedToken, ErrPointer)
}
return dec.InputOffset(), nil
}
diff --git a/vendor/github.com/go-openapi/runtime/.gitattributes b/vendor/github.com/go-openapi/runtime/.gitattributes
new file mode 100644
index 000000000000..d207b1802b20
--- /dev/null
+++ b/vendor/github.com/go-openapi/runtime/.gitattributes
@@ -0,0 +1 @@
+*.go text eol=lf
diff --git a/vendor/github.com/go-openapi/runtime/.golangci.yml b/vendor/github.com/go-openapi/runtime/.golangci.yml
new file mode 100644
index 000000000000..1c75557bac57
--- /dev/null
+++ b/vendor/github.com/go-openapi/runtime/.golangci.yml
@@ -0,0 +1,62 @@
+linters-settings:
+ govet:
+ check-shadowing: true
+ golint:
+ min-confidence: 0
+ gocyclo:
+ min-complexity: 45
+ maligned:
+ suggest-new: true
+ dupl:
+ threshold: 200
+ goconst:
+ min-len: 2
+ min-occurrences: 3
+
+linters:
+ enable-all: true
+ disable:
+ - nilerr # nilerr crashes on this repo
+ - maligned
+ - unparam
+ - lll
+ - gochecknoinits
+ - gochecknoglobals
+ - funlen
+ - godox
+ - gocognit
+ - whitespace
+ - wsl
+ - wrapcheck
+ - testpackage
+ - nlreturn
+ - gomnd
+ - exhaustivestruct
+ - goerr113
+ - errorlint
+ - nestif
+ - godot
+ - gofumpt
+ - paralleltest
+ - tparallel
+ - thelper
+ - ifshort
+ - exhaustruct
+ - varnamelen
+ - gci
+ - depguard
+ - errchkjson
+ - inamedparam
+ - nonamedreturns
+ - musttag
+ - ireturn
+ - forcetypeassert
+ - cyclop
+ # deprecated linters
+ - deadcode
+ - interfacer
+ - scopelint
+ - varcheck
+ - structcheck
+ - golint
+ - nosnakecase
diff --git a/vendor/github.com/go-openapi/runtime/.travis.yml b/vendor/github.com/go-openapi/runtime/.travis.yml
deleted file mode 100644
index e36276ab3fa7..000000000000
--- a/vendor/github.com/go-openapi/runtime/.travis.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-after_success:
-- bash <(curl -s https://codecov.io/bash)
-go:
-- 1.13.x
-- 1.14.x
-install:
-- GO111MODULE=off go get -u gotest.tools/gotestsum
-language: go
-notifications:
- slack:
- secure: EmObnQuM9Mw8J9vpFaKKHqSMN4Wsr/A9+v7ewAD5cEhA0T1P4m7MbJMiJOhxUhj/X+BFh2DamW+P2lT8mybj5wg8wnkQ2BteKA8Tawi6f9PRw2NRheO8tAi8o/npLnlmet0kc93mn+oLuqHw36w4+j5mkOl2FghkfGiUVhwrhkCP7KXQN+3TU87e+/HzQumlJ3nsE+6terVxkH3PmaUTsS5ONaODZfuxFpfb7RsoEl3skHf6d+tr+1nViLxxly7558Nc33C+W1mr0qiEvMLZ+kJ/CpGWBJ6CUJM3jm6hNe2eMuIPwEK2hxZob8c7n22VPap4K6a0bBRoydoDXaba+2sD7Ym6ivDO/DVyL44VeBBLyIiIBylDGQdZH+6SoWm90Qe/i7tnY/T5Ao5igT8f3cfQY1c3EsTfqmlDfrhmACBmwSlgkdVBLTprHL63JMY24LWmh4jhxsmMRZhCL4dze8su1w6pLN/pD1pGHtKYCEVbdTmaM3PblNRFf12XB7qosmQsgUndH4Vq3bTbU0s1pKjeDhRyLvFzvR0TBbo0pDLEoF1A/i5GVFWa7yLZNUDudQERRh7qv/xBl2excIaQ1sV4DSVm7bAE9l6Kp+yeHQJW2uN6Y3X8wu9gB9nv9l5HBze7wh8KE6PyWAOLYYqZg9/sAtsv/2GcQqXcKFF1zcA=
-script:
-- gotestsum -f short-verbose -- -race -timeout=20m -coverprofile=coverage.txt -covermode=atomic ./...
diff --git a/vendor/github.com/go-openapi/runtime/README.md b/vendor/github.com/go-openapi/runtime/README.md
index 5b1ec6494541..b07e0ad9d623 100644
--- a/vendor/github.com/go-openapi/runtime/README.md
+++ b/vendor/github.com/go-openapi/runtime/README.md
@@ -1,7 +1,10 @@
-# runtime [](https://travis-ci.org/go-openapi/runtime) [](https://codecov.io/gh/go-openapi/runtime) [](https://slackin.goswagger.io)
+# runtime [](https://github.com/go-openapi/runtime/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/runtime)
-[](https://raw.githubusercontent.com/go-openapi/runtime/master/LICENSE) [](http://godoc.org/github.com/go-openapi/runtime)
+[](https://slackin.goswagger.io)
+[](https://raw.githubusercontent.com/go-openapi/runtime/master/LICENSE)
+[](https://pkg.go.dev/github.com/go-openapi/runtime)
+[](https://goreportcard.com/report/github.com/go-openapi/runtime)
-# golang Open-API toolkit - runtime
+# go OpenAPI toolkit runtime
-The runtime component for use in codegeneration or as untyped usage.
+The runtime component for use in code generation or as untyped usage.
diff --git a/vendor/github.com/go-openapi/runtime/bytestream.go b/vendor/github.com/go-openapi/runtime/bytestream.go
index 4459025b9279..f8fb482232b4 100644
--- a/vendor/github.com/go-openapi/runtime/bytestream.go
+++ b/vendor/github.com/go-openapi/runtime/bytestream.go
@@ -38,9 +38,16 @@ type byteStreamOpts struct {
Close bool
}
-// ByteStreamConsumer creates a consmer for byte streams,
-// takes a Writer/BinaryUnmarshaler interface or binary slice by reference,
-// and reads from the provided reader
+// ByteStreamConsumer creates a consumer for byte streams.
+//
+// The consumer consumes from a provided reader into the data passed by reference.
+//
+// Supported output underlying types and interfaces, prioritized in this order:
+// - io.ReaderFrom (for maximum control)
+// - io.Writer (performs io.Copy)
+// - encoding.BinaryUnmarshaler
+// - *string
+// - *[]byte
func ByteStreamConsumer(opts ...byteStreamOpt) Consumer {
var vals byteStreamOpts
for _, opt := range opts {
@@ -51,36 +58,70 @@ func ByteStreamConsumer(opts ...byteStreamOpt) Consumer {
if reader == nil {
return errors.New("ByteStreamConsumer requires a reader") // early exit
}
+ if data == nil {
+ return errors.New("nil destination for ByteStreamConsumer")
+ }
- close := defaultCloser
+ closer := defaultCloser
if vals.Close {
- if cl, ok := reader.(io.Closer); ok {
- close = cl.Close
+ if cl, isReaderCloser := reader.(io.Closer); isReaderCloser {
+ closer = cl.Close
}
}
- defer close()
+ defer func() {
+ _ = closer()
+ }()
- if wrtr, ok := data.(io.Writer); ok {
- _, err := io.Copy(wrtr, reader)
+ if readerFrom, isReaderFrom := data.(io.ReaderFrom); isReaderFrom {
+ _, err := readerFrom.ReadFrom(reader)
return err
}
- buf := new(bytes.Buffer)
+ if writer, isDataWriter := data.(io.Writer); isDataWriter {
+ _, err := io.Copy(writer, reader)
+ return err
+ }
+
+ // buffers input before writing to data
+ var buf bytes.Buffer
_, err := buf.ReadFrom(reader)
if err != nil {
return err
}
b := buf.Bytes()
- if bu, ok := data.(encoding.BinaryUnmarshaler); ok {
- return bu.UnmarshalBinary(b)
- }
+ switch destinationPointer := data.(type) {
+ case encoding.BinaryUnmarshaler:
+ return destinationPointer.UnmarshalBinary(b)
+ case *any:
+ switch (*destinationPointer).(type) {
+ case string:
+ *destinationPointer = string(b)
+
+ return nil
+
+ case []byte:
+ *destinationPointer = b
+
+ return nil
+ }
+ default:
+ // check for the underlying type to be pointer to []byte or string,
+ if ptr := reflect.TypeOf(data); ptr.Kind() != reflect.Ptr {
+ return errors.New("destination must be a pointer")
+ }
- if t := reflect.TypeOf(data); data != nil && t.Kind() == reflect.Ptr {
v := reflect.Indirect(reflect.ValueOf(data))
- if t = v.Type(); t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Uint8 {
+ t := v.Type()
+
+ switch {
+ case t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Uint8:
v.SetBytes(b)
return nil
+
+ case t.Kind() == reflect.String:
+ v.SetString(string(b))
+ return nil
}
}
@@ -89,61 +130,87 @@ func ByteStreamConsumer(opts ...byteStreamOpt) Consumer {
})
}
-// ByteStreamProducer creates a producer for byte streams,
-// takes a Reader/BinaryMarshaler interface or binary slice,
-// and writes to a writer (essentially a pipe)
+// ByteStreamProducer creates a producer for byte streams.
+//
+// The producer takes input data then writes to an output writer (essentially as a pipe).
+//
+// Supported input underlying types and interfaces, prioritized in this order:
+// - io.WriterTo (for maximum control)
+// - io.Reader (performs io.Copy). A ReadCloser is closed before exiting.
+// - encoding.BinaryMarshaler
+// - error (writes as a string)
+// - []byte
+// - string
+// - struct, other slices: writes as JSON
func ByteStreamProducer(opts ...byteStreamOpt) Producer {
var vals byteStreamOpts
for _, opt := range opts {
opt(&vals)
}
+
return ProducerFunc(func(writer io.Writer, data interface{}) error {
if writer == nil {
return errors.New("ByteStreamProducer requires a writer") // early exit
}
- close := defaultCloser
+ if data == nil {
+ return errors.New("nil data for ByteStreamProducer")
+ }
+
+ closer := defaultCloser
if vals.Close {
- if cl, ok := writer.(io.Closer); ok {
- close = cl.Close
+ if cl, isWriterCloser := writer.(io.Closer); isWriterCloser {
+ closer = cl.Close
}
}
- defer close()
+ defer func() {
+ _ = closer()
+ }()
- if rc, ok := data.(io.ReadCloser); ok {
+ if rc, isDataCloser := data.(io.ReadCloser); isDataCloser {
defer rc.Close()
}
- if rdr, ok := data.(io.Reader); ok {
- _, err := io.Copy(writer, rdr)
+ switch origin := data.(type) {
+ case io.WriterTo:
+ _, err := origin.WriteTo(writer)
return err
- }
- if bm, ok := data.(encoding.BinaryMarshaler); ok {
- bytes, err := bm.MarshalBinary()
+ case io.Reader:
+ _, err := io.Copy(writer, origin)
+ return err
+
+ case encoding.BinaryMarshaler:
+ bytes, err := origin.MarshalBinary()
if err != nil {
return err
}
_, err = writer.Write(bytes)
return err
- }
- if data != nil {
- if e, ok := data.(error); ok {
- _, err := writer.Write([]byte(e.Error()))
- return err
- }
+ case error:
+ _, err := writer.Write([]byte(origin.Error()))
+ return err
+ default:
v := reflect.Indirect(reflect.ValueOf(data))
- if t := v.Type(); t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Uint8 {
+ t := v.Type()
+
+ switch {
+ case t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Uint8:
_, err := writer.Write(v.Bytes())
return err
- }
- if t := v.Type(); t.Kind() == reflect.Struct || t.Kind() == reflect.Slice {
+
+ case t.Kind() == reflect.String:
+ _, err := writer.Write([]byte(v.String()))
+ return err
+
+ case t.Kind() == reflect.Struct || t.Kind() == reflect.Slice:
b, err := swag.WriteJSON(data)
if err != nil {
return err
}
+
_, err = writer.Write(b)
return err
}
diff --git a/vendor/github.com/go-openapi/runtime/client/auth_info.go b/vendor/github.com/go-openapi/runtime/client/auth_info.go
index bbe1479c35d2..4f26e92347a8 100644
--- a/vendor/github.com/go-openapi/runtime/client/auth_info.go
+++ b/vendor/github.com/go-openapi/runtime/client/auth_info.go
@@ -33,7 +33,7 @@ func init() {
func BasicAuth(username, password string) runtime.ClientAuthInfoWriter {
return runtime.ClientAuthInfoWriterFunc(func(r runtime.ClientRequest, _ strfmt.Registry) error {
encoded := base64.StdEncoding.EncodeToString([]byte(username + ":" + password))
- return r.SetHeaderParam("Authorization", "Basic "+encoded)
+ return r.SetHeaderParam(runtime.HeaderAuthorization, "Basic "+encoded)
})
}
@@ -56,6 +56,22 @@ func APIKeyAuth(name, in, value string) runtime.ClientAuthInfoWriter {
// BearerToken provides a header based oauth2 bearer access token auth info writer
func BearerToken(token string) runtime.ClientAuthInfoWriter {
return runtime.ClientAuthInfoWriterFunc(func(r runtime.ClientRequest, _ strfmt.Registry) error {
- return r.SetHeaderParam("Authorization", "Bearer "+token)
+ return r.SetHeaderParam(runtime.HeaderAuthorization, "Bearer "+token)
+ })
+}
+
+// Compose combines multiple ClientAuthInfoWriters into a single one.
+// Useful when multiple auth headers are needed.
+func Compose(auths ...runtime.ClientAuthInfoWriter) runtime.ClientAuthInfoWriter {
+ return runtime.ClientAuthInfoWriterFunc(func(r runtime.ClientRequest, _ strfmt.Registry) error {
+ for _, auth := range auths {
+ if auth == nil {
+ continue
+ }
+ if err := auth.AuthenticateRequest(r, nil); err != nil {
+ return err
+ }
+ }
+ return nil
})
}
diff --git a/vendor/github.com/go-openapi/runtime/client/keepalive.go b/vendor/github.com/go-openapi/runtime/client/keepalive.go
index f83254515ba9..7dd6b51c4df0 100644
--- a/vendor/github.com/go-openapi/runtime/client/keepalive.go
+++ b/vendor/github.com/go-openapi/runtime/client/keepalive.go
@@ -2,7 +2,6 @@ package client
import (
"io"
- "io/ioutil"
"net/http"
"sync/atomic"
)
@@ -46,8 +45,10 @@ func (d *drainingReadCloser) Read(p []byte) (n int, err error) {
func (d *drainingReadCloser) Close() error {
// drain buffer
if atomic.LoadUint32(&d.seenEOF) != 1 {
- //#nosec
- io.Copy(ioutil.Discard, d.rdr)
+ // If the reader side (a HTTP server) is misbehaving, it still may send
+ // some bytes, but the closer ignores them to keep the underling
+ // connection open.
+ _, _ = io.Copy(io.Discard, d.rdr)
}
return d.rdr.Close()
}
diff --git a/vendor/github.com/go-openapi/runtime/client/opentelemetry.go b/vendor/github.com/go-openapi/runtime/client/opentelemetry.go
new file mode 100644
index 000000000000..256cd1b4fd86
--- /dev/null
+++ b/vendor/github.com/go-openapi/runtime/client/opentelemetry.go
@@ -0,0 +1,211 @@
+package client
+
+import (
+ "fmt"
+ "net/http"
+ "strings"
+
+ "github.com/go-openapi/runtime"
+ "github.com/go-openapi/strfmt"
+ "go.opentelemetry.io/otel"
+ "go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/codes"
+ "go.opentelemetry.io/otel/propagation"
+ semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
+ "go.opentelemetry.io/otel/semconv/v1.17.0/httpconv"
+ "go.opentelemetry.io/otel/trace"
+)
+
+const (
+ instrumentationVersion = "1.0.0"
+ tracerName = "go-openapi"
+)
+
+type config struct {
+ Tracer trace.Tracer
+ Propagator propagation.TextMapPropagator
+ SpanStartOptions []trace.SpanStartOption
+ SpanNameFormatter func(*runtime.ClientOperation) string
+ TracerProvider trace.TracerProvider
+}
+
+type OpenTelemetryOpt interface {
+ apply(*config)
+}
+
+type optionFunc func(*config)
+
+func (o optionFunc) apply(c *config) {
+ o(c)
+}
+
+// WithTracerProvider specifies a tracer provider to use for creating a tracer.
+// If none is specified, the global provider is used.
+func WithTracerProvider(provider trace.TracerProvider) OpenTelemetryOpt {
+ return optionFunc(func(c *config) {
+ if provider != nil {
+ c.TracerProvider = provider
+ }
+ })
+}
+
+// WithPropagators configures specific propagators. If this
+// option isn't specified, then the global TextMapPropagator is used.
+func WithPropagators(ps propagation.TextMapPropagator) OpenTelemetryOpt {
+ return optionFunc(func(c *config) {
+ if ps != nil {
+ c.Propagator = ps
+ }
+ })
+}
+
+// WithSpanOptions configures an additional set of
+// trace.SpanOptions, which are applied to each new span.
+func WithSpanOptions(opts ...trace.SpanStartOption) OpenTelemetryOpt {
+ return optionFunc(func(c *config) {
+ c.SpanStartOptions = append(c.SpanStartOptions, opts...)
+ })
+}
+
+// WithSpanNameFormatter takes a function that will be called on every
+// request and the returned string will become the Span Name.
+func WithSpanNameFormatter(f func(op *runtime.ClientOperation) string) OpenTelemetryOpt {
+ return optionFunc(func(c *config) {
+ c.SpanNameFormatter = f
+ })
+}
+
+func defaultTransportFormatter(op *runtime.ClientOperation) string {
+ if op.ID != "" {
+ return op.ID
+ }
+
+ return fmt.Sprintf("%s_%s", strings.ToLower(op.Method), op.PathPattern)
+}
+
+type openTelemetryTransport struct {
+ transport runtime.ClientTransport
+ host string
+ tracer trace.Tracer
+ config *config
+}
+
+func newOpenTelemetryTransport(transport runtime.ClientTransport, host string, opts []OpenTelemetryOpt) *openTelemetryTransport {
+ tr := &openTelemetryTransport{
+ transport: transport,
+ host: host,
+ }
+
+ defaultOpts := []OpenTelemetryOpt{
+ WithSpanOptions(trace.WithSpanKind(trace.SpanKindClient)),
+ WithSpanNameFormatter(defaultTransportFormatter),
+ WithPropagators(otel.GetTextMapPropagator()),
+ WithTracerProvider(otel.GetTracerProvider()),
+ }
+
+ c := newConfig(append(defaultOpts, opts...)...)
+ tr.config = c
+
+ return tr
+}
+
+func (t *openTelemetryTransport) Submit(op *runtime.ClientOperation) (interface{}, error) {
+ if op.Context == nil {
+ return t.transport.Submit(op)
+ }
+
+ params := op.Params
+ reader := op.Reader
+
+ var span trace.Span
+ defer func() {
+ if span != nil {
+ span.End()
+ }
+ }()
+
+ op.Params = runtime.ClientRequestWriterFunc(func(req runtime.ClientRequest, reg strfmt.Registry) error {
+ span = t.newOpenTelemetrySpan(op, req.GetHeaderParams())
+ return params.WriteToRequest(req, reg)
+ })
+
+ op.Reader = runtime.ClientResponseReaderFunc(func(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
+ if span != nil {
+ statusCode := response.Code()
+ // NOTE: this is replaced by semconv.HTTPResponseStatusCode in semconv v1.21
+ span.SetAttributes(semconv.HTTPStatusCode(statusCode))
+ // NOTE: the conversion from HTTP status code to trace code is no longer available with
+ // semconv v1.21
+ span.SetStatus(httpconv.ServerStatus(statusCode))
+ }
+
+ return reader.ReadResponse(response, consumer)
+ })
+
+ submit, err := t.transport.Submit(op)
+ if err != nil && span != nil {
+ span.RecordError(err)
+ span.SetStatus(codes.Error, err.Error())
+ }
+
+ return submit, err
+}
+
+func (t *openTelemetryTransport) newOpenTelemetrySpan(op *runtime.ClientOperation, header http.Header) trace.Span {
+ ctx := op.Context
+
+ tracer := t.tracer
+ if tracer == nil {
+ if span := trace.SpanFromContext(ctx); span.SpanContext().IsValid() {
+ tracer = newTracer(span.TracerProvider())
+ } else {
+ tracer = newTracer(otel.GetTracerProvider())
+ }
+ }
+
+ ctx, span := tracer.Start(ctx, t.config.SpanNameFormatter(op), t.config.SpanStartOptions...)
+
+ var scheme string
+ if len(op.Schemes) > 0 {
+ scheme = op.Schemes[0]
+ }
+
+ span.SetAttributes(
+ attribute.String("net.peer.name", t.host),
+ attribute.String(string(semconv.HTTPRouteKey), op.PathPattern),
+ attribute.String(string(semconv.HTTPMethodKey), op.Method),
+ attribute.String("span.kind", trace.SpanKindClient.String()),
+ attribute.String("http.scheme", scheme),
+ )
+
+ carrier := propagation.HeaderCarrier(header)
+ t.config.Propagator.Inject(ctx, carrier)
+
+ return span
+}
+
+func newTracer(tp trace.TracerProvider) trace.Tracer {
+ return tp.Tracer(tracerName, trace.WithInstrumentationVersion(version()))
+}
+
+func newConfig(opts ...OpenTelemetryOpt) *config {
+ c := &config{
+ Propagator: otel.GetTextMapPropagator(),
+ }
+
+ for _, opt := range opts {
+ opt.apply(c)
+ }
+
+ // Tracer is only initialized if manually specified. Otherwise, can be passed with the tracing context.
+ if c.TracerProvider != nil {
+ c.Tracer = newTracer(c.TracerProvider)
+ }
+
+ return c
+}
+
+// Version is the current release version of the go-runtime instrumentation.
+func version() string {
+ return instrumentationVersion
+}
diff --git a/vendor/github.com/go-openapi/runtime/client/opentracing.go b/vendor/github.com/go-openapi/runtime/client/opentracing.go
new file mode 100644
index 000000000000..627286d12fa3
--- /dev/null
+++ b/vendor/github.com/go-openapi/runtime/client/opentracing.go
@@ -0,0 +1,99 @@
+package client
+
+import (
+ "fmt"
+ "net/http"
+
+ "github.com/go-openapi/strfmt"
+ "github.com/opentracing/opentracing-go"
+ "github.com/opentracing/opentracing-go/ext"
+ "github.com/opentracing/opentracing-go/log"
+
+ "github.com/go-openapi/runtime"
+)
+
+type tracingTransport struct {
+ transport runtime.ClientTransport
+ host string
+ opts []opentracing.StartSpanOption
+}
+
+func newOpenTracingTransport(transport runtime.ClientTransport, host string, opts []opentracing.StartSpanOption,
+) runtime.ClientTransport {
+ return &tracingTransport{
+ transport: transport,
+ host: host,
+ opts: opts,
+ }
+}
+
+func (t *tracingTransport) Submit(op *runtime.ClientOperation) (interface{}, error) {
+ if op.Context == nil {
+ return t.transport.Submit(op)
+ }
+
+ params := op.Params
+ reader := op.Reader
+
+ var span opentracing.Span
+ defer func() {
+ if span != nil {
+ span.Finish()
+ }
+ }()
+
+ op.Params = runtime.ClientRequestWriterFunc(func(req runtime.ClientRequest, reg strfmt.Registry) error {
+ span = createClientSpan(op, req.GetHeaderParams(), t.host, t.opts)
+ return params.WriteToRequest(req, reg)
+ })
+
+ op.Reader = runtime.ClientResponseReaderFunc(func(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
+ if span != nil {
+ code := response.Code()
+ ext.HTTPStatusCode.Set(span, uint16(code))
+ if code >= 400 {
+ ext.Error.Set(span, true)
+ }
+ }
+ return reader.ReadResponse(response, consumer)
+ })
+
+ submit, err := t.transport.Submit(op)
+ if err != nil && span != nil {
+ ext.Error.Set(span, true)
+ span.LogFields(log.Error(err))
+ }
+ return submit, err
+}
+
+func createClientSpan(op *runtime.ClientOperation, header http.Header, host string,
+ opts []opentracing.StartSpanOption) opentracing.Span {
+ ctx := op.Context
+ span := opentracing.SpanFromContext(ctx)
+
+ if span != nil {
+ opts = append(opts, ext.SpanKindRPCClient)
+ span, _ = opentracing.StartSpanFromContextWithTracer(
+ ctx, span.Tracer(), operationName(op), opts...)
+
+ ext.Component.Set(span, "go-openapi")
+ ext.PeerHostname.Set(span, host)
+ span.SetTag("http.path", op.PathPattern)
+ ext.HTTPMethod.Set(span, op.Method)
+
+ _ = span.Tracer().Inject(
+ span.Context(),
+ opentracing.HTTPHeaders,
+ opentracing.HTTPHeadersCarrier(header))
+
+ return span
+ }
+ return nil
+}
+
+func operationName(op *runtime.ClientOperation) string {
+ if op.ID != "" {
+ return op.ID
+ }
+ return fmt.Sprintf("%s_%s", op.Method, op.PathPattern)
+}
diff --git a/vendor/github.com/go-openapi/runtime/client/request.go b/vendor/github.com/go-openapi/runtime/client/request.go
index b7ea8b811b5b..c4a891d0bc59 100644
--- a/vendor/github.com/go-openapi/runtime/client/request.go
+++ b/vendor/github.com/go-openapi/runtime/client/request.go
@@ -16,6 +16,7 @@ package client
import (
"bytes"
+ "context"
"fmt"
"io"
"log"
@@ -35,7 +36,7 @@ import (
)
// NewRequest creates a new swagger http client request
-func newRequest(method, pathPattern string, writer runtime.ClientRequestWriter) (*request, error) {
+func newRequest(method, pathPattern string, writer runtime.ClientRequestWriter) *request {
return &request{
pathPattern: pathPattern,
method: method,
@@ -44,7 +45,7 @@ func newRequest(method, pathPattern string, writer runtime.ClientRequestWriter)
query: make(url.Values),
timeout: DefaultTimeout,
getBody: getRequestBuffer,
- }, nil
+ }
}
// Request represents a swagger client request.
@@ -93,7 +94,16 @@ func (r *request) BuildHTTP(mediaType, basePath string, producers map[string]run
func escapeQuotes(s string) string {
return strings.NewReplacer("\\", "\\\\", `"`, "\\\"").Replace(s)
}
-func (r *request) buildHTTP(mediaType, basePath string, producers map[string]runtime.Producer, registry strfmt.Registry, auth runtime.ClientAuthInfoWriter) (*http.Request, error) {
+
+func logClose(err error, pw *io.PipeWriter) {
+ log.Println(err)
+ closeErr := pw.CloseWithError(err)
+ if closeErr != nil {
+ log.Println(closeErr)
+ }
+}
+
+func (r *request) buildHTTP(mediaType, basePath string, producers map[string]runtime.Producer, registry strfmt.Registry, auth runtime.ClientAuthInfoWriter) (*http.Request, error) { //nolint:gocyclo,maintidx
// build the data
if err := r.writer.WriteToRequest(r, registry); err != nil {
return nil, err
@@ -137,8 +147,8 @@ func (r *request) buildHTTP(mediaType, basePath string, producers map[string]run
for fn, v := range r.formFields {
for _, vi := range v {
if err := mp.WriteField(fn, vi); err != nil {
- pw.CloseWithError(err)
- log.Println(err)
+ logClose(err, pw)
+ return
}
}
}
@@ -152,18 +162,22 @@ func (r *request) buildHTTP(mediaType, basePath string, producers map[string]run
}()
for fn, f := range r.fileFields {
for _, fi := range f {
- buf := bytes.NewBuffer([]byte{})
-
- // Need to read the data so that we can detect the content type
- _, err := io.Copy(buf, fi)
- if err != nil {
- _ = pw.CloseWithError(err)
- log.Println(err)
+ var fileContentType string
+ if p, ok := fi.(interface {
+ ContentType() string
+ }); ok {
+ fileContentType = p.ContentType()
+ } else {
+ // Need to read the data so that we can detect the content type
+ buf := make([]byte, 512)
+ size, err := fi.Read(buf)
+ if err != nil && err != io.EOF {
+ logClose(err, pw)
+ return
+ }
+ fileContentType = http.DetectContentType(buf)
+ fi = runtime.NamedReader(fi.Name(), io.MultiReader(bytes.NewReader(buf[:size]), fi))
}
- fileBytes := buf.Bytes()
- fileContentType := http.DetectContentType(fileBytes)
-
- newFi := runtime.NamedReader(fi.Name(), buf)
// Create the MIME headers for the new part
h := make(textproto.MIMEHeader)
@@ -174,11 +188,11 @@ func (r *request) buildHTTP(mediaType, basePath string, producers map[string]run
wrtr, err := mp.CreatePart(h)
if err != nil {
- pw.CloseWithError(err)
- log.Println(err)
- } else if _, err := io.Copy(wrtr, newFi); err != nil {
- pw.CloseWithError(err)
- log.Println(err)
+ logClose(err, pw)
+ return
+ }
+ if _, err := io.Copy(wrtr, fi); err != nil {
+ logClose(err, pw)
}
}
}
@@ -211,7 +225,7 @@ func (r *request) buildHTTP(mediaType, basePath string, producers map[string]run
DoneChoosingBodySource:
- if runtime.CanHaveBody(r.method) && body == nil && r.header.Get(runtime.HeaderContentType) == "" {
+ if runtime.CanHaveBody(r.method) && body != nil && r.header.Get(runtime.HeaderContentType) == "" {
r.header.Set(runtime.HeaderContentType, mediaType)
}
@@ -273,24 +287,61 @@ DoneChoosingBodySource:
}
}
+ // In case the basePath or the request pathPattern include static query parameters,
+ // parse those out before constructing the final path. The parameters themselves
+ // will be merged with the ones set by the client, with the priority given first to
+ // the ones set by the client, then the path pattern, and lastly the base path.
+ basePathURL, err := url.Parse(basePath)
+ if err != nil {
+ return nil, err
+ }
+ staticQueryParams := basePathURL.Query()
+
+ pathPatternURL, err := url.Parse(r.pathPattern)
+ if err != nil {
+ return nil, err
+ }
+ for name, values := range pathPatternURL.Query() {
+ if _, present := staticQueryParams[name]; present {
+ staticQueryParams.Del(name)
+ }
+ for _, value := range values {
+ staticQueryParams.Add(name, value)
+ }
+ }
+
// create http request
var reinstateSlash bool
- if r.pathPattern != "" && r.pathPattern != "/" && r.pathPattern[len(r.pathPattern)-1] == '/' {
+ if pathPatternURL.Path != "" && pathPatternURL.Path != "/" && pathPatternURL.Path[len(pathPatternURL.Path)-1] == '/' {
reinstateSlash = true
}
- urlPath := path.Join(basePath, r.pathPattern)
+
+ urlPath := path.Join(basePathURL.Path, pathPatternURL.Path)
for k, v := range r.pathParams {
- urlPath = strings.Replace(urlPath, "{"+k+"}", url.PathEscape(v), -1)
+ urlPath = strings.ReplaceAll(urlPath, "{"+k+"}", url.PathEscape(v))
}
if reinstateSlash {
- urlPath = urlPath + "/"
+ urlPath += "/"
}
- req, err := http.NewRequest(r.method, urlPath, body)
+ req, err := http.NewRequestWithContext(context.Background(), r.method, urlPath, body)
if err != nil {
return nil, err
}
+ originalParams := r.GetQueryParams()
+
+ // Merge the query parameters extracted from the basePath with the ones set by
+ // the client in this struct. In case of conflict, the client wins.
+ for k, v := range staticQueryParams {
+ _, present := originalParams[k]
+ if !present {
+ if err = r.SetQueryParam(k, v...); err != nil {
+ return nil, err
+ }
+ }
+ }
+
req.URL.RawQuery = r.query.Encode()
req.Header = r.header
@@ -311,7 +362,7 @@ func (r *request) GetMethod() string {
func (r *request) GetPath() string {
path := r.pathPattern
for k, v := range r.pathParams {
- path = strings.Replace(path, "{"+k+"}", v, -1)
+ path = strings.ReplaceAll(path, "{"+k+"}", v)
}
return path
}
diff --git a/vendor/github.com/go-openapi/runtime/client/response.go b/vendor/github.com/go-openapi/runtime/client/response.go
index bd238588b7d0..0bbd388bc8bd 100644
--- a/vendor/github.com/go-openapi/runtime/client/response.go
+++ b/vendor/github.com/go-openapi/runtime/client/response.go
@@ -23,6 +23,8 @@ import (
var _ runtime.ClientResponse = response{}
+func newResponse(resp *http.Response) runtime.ClientResponse { return response{resp: resp} }
+
type response struct {
resp *http.Response
}
@@ -39,6 +41,10 @@ func (r response) GetHeader(name string) string {
return r.resp.Header.Get(name)
}
+func (r response) GetHeaders(name string) []string {
+ return r.resp.Header.Values(name)
+}
+
func (r response) Body() io.ReadCloser {
return r.resp.Body
}
diff --git a/vendor/github.com/go-openapi/runtime/client/runtime.go b/vendor/github.com/go-openapi/runtime/client/runtime.go
index 083d751e3cae..5bd4d75d9062 100644
--- a/vendor/github.com/go-openapi/runtime/client/runtime.go
+++ b/vendor/github.com/go-openapi/runtime/client/runtime.go
@@ -22,16 +22,18 @@ import (
"crypto/tls"
"crypto/x509"
"encoding/pem"
+ "errors"
"fmt"
- "io/ioutil"
"mime"
"net/http"
"net/http/httputil"
+ "os"
"strings"
"sync"
"time"
"github.com/go-openapi/strfmt"
+ "github.com/opentracing/opentracing-go"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/logger"
@@ -39,6 +41,11 @@ import (
"github.com/go-openapi/runtime/yamlpc"
)
+const (
+ schemeHTTP = "http"
+ schemeHTTPS = "https"
+)
+
// TLSClientOptions to configure client authentication with mutual TLS
type TLSClientOptions struct {
// Certificate is the path to a PEM-encoded certificate to be used for
@@ -69,7 +76,7 @@ type TLSClientOptions struct {
LoadedCA *x509.Certificate
// LoadedCAPool specifies a pool of RootCAs to use when validating the server's TLS certificate.
- // If set, it will be combined with the the other loaded certificates (see LoadedCA and CA).
+ // If set, it will be combined with the other loaded certificates (see LoadedCA and CA).
// If neither LoadedCA or CA is set, the provided pool with override the system
// certificate pool.
// The caller must not use the supplied pool after calling TLSClientAuth.
@@ -81,7 +88,7 @@ type TLSClientOptions struct {
ServerName string
// InsecureSkipVerify controls whether the certificate chain and hostname presented
- // by the server are validated. If false, any certificate is accepted.
+ // by the server are validated. If true, any certificate is accepted.
InsecureSkipVerify bool
// VerifyPeerCertificate, if not nil, is called after normal
@@ -111,7 +118,9 @@ type TLSClientOptions struct {
// TLSClientAuth creates a tls.Config for mutual auth
func TLSClientAuth(opts TLSClientOptions) (*tls.Config, error) {
// create client tls config
- cfg := &tls.Config{}
+ cfg := &tls.Config{
+ MinVersion: tls.VersionTLS12,
+ }
// load client cert if specified
if opts.Certificate != "" {
@@ -135,7 +144,7 @@ func TLSClientAuth(opts TLSClientOptions) (*tls.Config, error) {
return nil, fmt.Errorf("tls client priv key: %v", err)
}
default:
- return nil, fmt.Errorf("tls client priv key: unsupported key type")
+ return nil, errors.New("tls client priv key: unsupported key type")
}
block = pem.Block{Type: "PRIVATE KEY", Bytes: keyBytes}
@@ -157,20 +166,21 @@ func TLSClientAuth(opts TLSClientOptions) (*tls.Config, error) {
// When no CA certificate is provided, default to the system cert pool
// that way when a request is made to a server known by the system trust store,
// the name is still verified
- if opts.LoadedCA != nil {
+ switch {
+ case opts.LoadedCA != nil:
caCertPool := basePool(opts.LoadedCAPool)
caCertPool.AddCert(opts.LoadedCA)
cfg.RootCAs = caCertPool
- } else if opts.CA != "" {
+ case opts.CA != "":
// load ca cert
- caCert, err := ioutil.ReadFile(opts.CA)
+ caCert, err := os.ReadFile(opts.CA)
if err != nil {
return nil, fmt.Errorf("tls client ca: %v", err)
}
caCertPool := basePool(opts.LoadedCAPool)
caCertPool.AppendCertsFromPEM(caCert)
cfg.RootCAs = caCertPool
- } else if opts.LoadedCAPool != nil {
+ case opts.LoadedCAPool != nil:
cfg.RootCAs = opts.LoadedCAPool
}
@@ -180,8 +190,6 @@ func TLSClientAuth(opts TLSClientOptions) (*tls.Config, error) {
cfg.ServerName = opts.ServerName
}
- cfg.BuildNameToCertificate()
-
return cfg, nil
}
@@ -224,11 +232,11 @@ type Runtime struct {
Transport http.RoundTripper
Jar http.CookieJar
- //Spec *spec.Document
+ // Spec *spec.Document
Host string
BasePath string
Formats strfmt.Registry
- Context context.Context
+ Context context.Context //nolint:containedctx // we precisely want this type to contain the request context
Debug bool
logger logger.Logger
@@ -236,6 +244,7 @@ type Runtime struct {
clientOnce *sync.Once
client *http.Client
schemes []string
+ response ClientResponseFunc
}
// New creates a new default runtime for a swagger api runtime.Client
@@ -274,6 +283,7 @@ func New(host, basePath string, schemes []string) *Runtime {
rt.Debug = logger.DebugEnabled()
rt.logger = logger.StandardLogger{}
+ rt.response = newResponse
if len(schemes) > 0 {
rt.schemes = schemes
@@ -292,6 +302,22 @@ func NewWithClient(host, basePath string, schemes []string, client *http.Client)
return rt
}
+// WithOpenTracing adds opentracing support to the provided runtime.
+// A new client span is created for each request.
+// If the context of the client operation does not contain an active span, no span is created.
+// The provided opts are applied to each spans - for example to add global tags.
+func (r *Runtime) WithOpenTracing(opts ...opentracing.StartSpanOption) runtime.ClientTransport {
+ return newOpenTracingTransport(r, r.Host, opts)
+}
+
+// WithOpenTelemetry adds opentelemetry support to the provided runtime.
+// A new client span is created for each request.
+// If the context of the client operation does not contain an active span, no span is created.
+// The provided opts are applied to each spans - for example to add global tags.
+func (r *Runtime) WithOpenTelemetry(opts ...OpenTelemetryOpt) runtime.ClientTransport {
+ return newOpenTelemetryTransport(r, r.Host, opts)
+}
+
func (r *Runtime) pickScheme(schemes []string) string {
if v := r.selectScheme(r.schemes); v != "" {
return v
@@ -299,7 +325,7 @@ func (r *Runtime) pickScheme(schemes []string) string {
if v := r.selectScheme(schemes); v != "" {
return v
}
- return "http"
+ return schemeHTTP
}
func (r *Runtime) selectScheme(schemes []string) string {
@@ -310,9 +336,9 @@ func (r *Runtime) selectScheme(schemes []string) string {
scheme := schemes[0]
// prefer https, but skip when not possible
- if scheme != "https" && schLen > 1 {
+ if scheme != schemeHTTPS && schLen > 1 {
for _, sch := range schemes {
- if sch == "https" {
+ if sch == schemeHTTPS {
scheme = sch
break
}
@@ -320,6 +346,7 @@ func (r *Runtime) selectScheme(schemes []string) string {
}
return scheme
}
+
func transportOrDefault(left, right http.RoundTripper) http.RoundTripper {
if left == nil {
return right
@@ -349,26 +376,27 @@ func (r *Runtime) EnableConnectionReuse() {
)
}
-// Submit a request and when there is a body on success it will turn that into the result
-// all other things are turned into an api error for swagger which retains the status code
-func (r *Runtime) Submit(operation *runtime.ClientOperation) (interface{}, error) {
- params, readResponse, auth := operation.Params, operation.Reader, operation.AuthInfo
+// takes a client operation and creates equivalent http.Request
+func (r *Runtime) createHttpRequest(operation *runtime.ClientOperation) (*request, *http.Request, error) { //nolint:revive,stylecheck
+ params, _, auth := operation.Params, operation.Reader, operation.AuthInfo
- request, err := newRequest(operation.Method, operation.PathPattern, params)
- if err != nil {
- return nil, err
- }
+ request := newRequest(operation.Method, operation.PathPattern, params)
var accept []string
accept = append(accept, operation.ProducesMediaTypes...)
- if err = request.SetHeaderParam(runtime.HeaderAccept, accept...); err != nil {
- return nil, err
+ if err := request.SetHeaderParam(runtime.HeaderAccept, accept...); err != nil {
+ return nil, nil, err
}
if auth == nil && r.DefaultAuthentication != nil {
- auth = r.DefaultAuthentication
+ auth = runtime.ClientAuthInfoWriterFunc(func(req runtime.ClientRequest, reg strfmt.Registry) error {
+ if req.GetHeaderParams().Get(runtime.HeaderAuthorization) != "" {
+ return nil
+ }
+ return r.DefaultAuthentication.AuthenticateRequest(req, reg)
+ })
}
- //if auth != nil {
+ // if auth != nil {
// if err := auth.AuthenticateRequest(request, r.Formats); err != nil {
// return nil, err
// }
@@ -385,16 +413,33 @@ func (r *Runtime) Submit(operation *runtime.ClientOperation) (interface{}, error
}
if _, ok := r.Producers[cmt]; !ok && cmt != runtime.MultipartFormMime && cmt != runtime.URLencodedFormMime {
- return nil, fmt.Errorf("none of producers: %v registered. try %s", r.Producers, cmt)
+ return nil, nil, fmt.Errorf("none of producers: %v registered. try %s", r.Producers, cmt)
}
req, err := request.buildHTTP(cmt, r.BasePath, r.Producers, r.Formats, auth)
if err != nil {
- return nil, err
+ return nil, nil, err
}
req.URL.Scheme = r.pickScheme(operation.Schemes)
req.URL.Host = r.Host
req.Host = r.Host
+ return request, req, nil
+}
+
+func (r *Runtime) CreateHttpRequest(operation *runtime.ClientOperation) (req *http.Request, err error) { //nolint:revive,stylecheck
+ _, req, err = r.createHttpRequest(operation)
+ return
+}
+
+// Submit a request and when there is a body on success it will turn that into the result
+// all other things are turned into an api error for swagger which retains the status code
+func (r *Runtime) Submit(operation *runtime.ClientOperation) (interface{}, error) {
+ _, readResponse, _ := operation.Params, operation.Reader, operation.AuthInfo
+
+ request, req, err := r.createHttpRequest(operation)
+ if err != nil {
+ return nil, err
+ }
r.clientOnce.Do(func() {
r.client = &http.Client{
@@ -411,27 +456,36 @@ func (r *Runtime) Submit(operation *runtime.ClientOperation) (interface{}, error
r.logger.Debugf("%s\n", string(b))
}
- var hasTimeout bool
- pctx := operation.Context
- if pctx == nil {
- pctx = r.Context
- } else {
- hasTimeout = true
+ var parentCtx context.Context
+ switch {
+ case operation.Context != nil:
+ parentCtx = operation.Context
+ case r.Context != nil:
+ parentCtx = r.Context
+ default:
+ parentCtx = context.Background()
}
- if pctx == nil {
- pctx = context.Background()
- }
- var ctx context.Context
- var cancel context.CancelFunc
- if hasTimeout {
- ctx, cancel = context.WithCancel(pctx)
+
+ var (
+ ctx context.Context
+ cancel context.CancelFunc
+ )
+ if request.timeout == 0 {
+ // There may be a deadline in the context passed to the operation.
+ // Otherwise, there is no timeout set.
+ ctx, cancel = context.WithCancel(parentCtx)
} else {
- ctx, cancel = context.WithTimeout(pctx, request.timeout)
+ // Sets the timeout passed from request params (by default runtime.DefaultTimeout).
+ // If there is already a deadline in the parent context, the shortest will
+ // apply.
+ ctx, cancel = context.WithTimeout(parentCtx, request.timeout)
}
defer cancel()
- client := operation.Client
- if client == nil {
+ var client *http.Client
+ if operation.Client != nil {
+ client = operation.Client
+ } else {
client = r.client
}
req = req.WithContext(ctx)
@@ -441,19 +495,23 @@ func (r *Runtime) Submit(operation *runtime.ClientOperation) (interface{}, error
}
defer res.Body.Close()
+ ct := res.Header.Get(runtime.HeaderContentType)
+ if ct == "" { // this should really never occur
+ ct = r.DefaultMediaType
+ }
+
if r.Debug {
- b, err2 := httputil.DumpResponse(res, true)
+ printBody := true
+ if ct == runtime.DefaultMime {
+ printBody = false // Spare the terminal from a binary blob.
+ }
+ b, err2 := httputil.DumpResponse(res, printBody)
if err2 != nil {
return nil, err2
}
r.logger.Debugf("%s\n", string(b))
}
- ct := res.Header.Get(runtime.HeaderContentType)
- if ct == "" { // this should really really never occur
- ct = r.DefaultMediaType
- }
-
mt, _, err := mime.ParseMediaType(ct)
if err != nil {
return nil, fmt.Errorf("parse content type: %s", err)
@@ -466,7 +524,7 @@ func (r *Runtime) Submit(operation *runtime.ClientOperation) (interface{}, error
return nil, fmt.Errorf("no consumer: %q", ct)
}
}
- return readResponse.ReadResponse(response{res}, cons)
+ return readResponse.ReadResponse(r.response(res), cons)
}
// SetDebug changes the debug flag.
@@ -482,3 +540,13 @@ func (r *Runtime) SetLogger(logger logger.Logger) {
r.logger = logger
middleware.Logger = logger
}
+
+type ClientResponseFunc = func(*http.Response) runtime.ClientResponse //nolint:revive
+
+// SetResponseReader changes the response reader implementation.
+func (r *Runtime) SetResponseReader(f ClientResponseFunc) {
+ if f == nil {
+ return
+ }
+ r.response = f
+}
diff --git a/vendor/github.com/go-openapi/runtime/client_operation.go b/vendor/github.com/go-openapi/runtime/client_operation.go
index fa21eacf3301..5a5d63563adf 100644
--- a/vendor/github.com/go-openapi/runtime/client_operation.go
+++ b/vendor/github.com/go-openapi/runtime/client_operation.go
@@ -30,12 +30,12 @@ type ClientOperation struct {
AuthInfo ClientAuthInfoWriter
Params ClientRequestWriter
Reader ClientResponseReader
- Context context.Context
+ Context context.Context //nolint:containedctx // we precisely want this type to contain the request context
Client *http.Client
}
// A ClientTransport implementor knows how to submit Request objects to some destination
type ClientTransport interface {
- //Submit(string, RequestWriter, ResponseReader, AuthInfoWriter) (interface{}, error)
+ // Submit(string, RequestWriter, ResponseReader, AuthInfoWriter) (interface{}, error)
Submit(*ClientOperation) (interface{}, error)
}
diff --git a/vendor/github.com/go-openapi/runtime/client_request.go b/vendor/github.com/go-openapi/runtime/client_request.go
index 6215e0a1c1fc..4ebb2deabe95 100644
--- a/vendor/github.com/go-openapi/runtime/client_request.go
+++ b/vendor/github.com/go-openapi/runtime/client_request.go
@@ -16,7 +16,6 @@ package runtime
import (
"io"
- "io/ioutil"
"net/http"
"net/url"
"time"
@@ -38,8 +37,8 @@ type ClientRequestWriter interface {
}
// ClientRequest is an interface for things that know how to
-// add information to a swagger client request
-type ClientRequest interface {
+// add information to a swagger client request.
+type ClientRequest interface { //nolint:interfacebloat // a swagger-capable request is quite rich, hence the many getter/setters
SetHeaderParam(string, ...string) error
GetHeaderParams() http.Header
@@ -79,7 +78,7 @@ type NamedReadCloser interface {
func NamedReader(name string, rdr io.Reader) NamedReadCloser {
rc, ok := rdr.(io.ReadCloser)
if !ok {
- rc = ioutil.NopCloser(rdr)
+ rc = io.NopCloser(rdr)
}
return &namedReadCloser{
name: name,
@@ -101,3 +100,53 @@ func (n *namedReadCloser) Read(p []byte) (int, error) {
func (n *namedReadCloser) Name() string {
return n.name
}
+
+type TestClientRequest struct {
+ Headers http.Header
+ Body interface{}
+}
+
+func (t *TestClientRequest) SetHeaderParam(name string, values ...string) error {
+ if t.Headers == nil {
+ t.Headers = make(http.Header)
+ }
+ t.Headers.Set(name, values[0])
+ return nil
+}
+
+func (t *TestClientRequest) SetQueryParam(_ string, _ ...string) error { return nil }
+
+func (t *TestClientRequest) SetFormParam(_ string, _ ...string) error { return nil }
+
+func (t *TestClientRequest) SetPathParam(_ string, _ string) error { return nil }
+
+func (t *TestClientRequest) SetFileParam(_ string, _ ...NamedReadCloser) error { return nil }
+
+func (t *TestClientRequest) SetBodyParam(body interface{}) error {
+ t.Body = body
+ return nil
+}
+
+func (t *TestClientRequest) SetTimeout(time.Duration) error {
+ return nil
+}
+
+func (t *TestClientRequest) GetQueryParams() url.Values { return nil }
+
+func (t *TestClientRequest) GetMethod() string { return "" }
+
+func (t *TestClientRequest) GetPath() string { return "" }
+
+func (t *TestClientRequest) GetBody() []byte { return nil }
+
+func (t *TestClientRequest) GetBodyParam() interface{} {
+ return t.Body
+}
+
+func (t *TestClientRequest) GetFileParam() map[string][]NamedReadCloser {
+ return nil
+}
+
+func (t *TestClientRequest) GetHeaderParams() http.Header {
+ return t.Headers
+}
diff --git a/vendor/github.com/go-openapi/runtime/client_response.go b/vendor/github.com/go-openapi/runtime/client_response.go
index d97e0ac64fce..0d1691149d42 100644
--- a/vendor/github.com/go-openapi/runtime/client_response.go
+++ b/vendor/github.com/go-openapi/runtime/client_response.go
@@ -15,10 +15,9 @@
package runtime
import (
+ "encoding/json"
"fmt"
"io"
-
- "encoding/json"
)
// A ClientResponse represents a client response
@@ -27,6 +26,7 @@ type ClientResponse interface {
Code() int
Message() string
GetHeader(string) string
+ GetHeaders(string) []string
Body() io.ReadCloser
}
@@ -60,11 +60,51 @@ type APIError struct {
Code int
}
-func (a *APIError) Error() string {
- resp, _ := json.Marshal(a.Response)
- return fmt.Sprintf("%s (status %d): %s", a.OperationName, a.Code, resp)
+func (o *APIError) Error() string {
+ var resp []byte
+ if err, ok := o.Response.(error); ok {
+ resp = []byte("'" + err.Error() + "'")
+ } else {
+ resp, _ = json.Marshal(o.Response)
+ }
+ return fmt.Sprintf("%s (status %d): %s", o.OperationName, o.Code, resp)
+}
+
+func (o *APIError) String() string {
+ return o.Error()
+}
+
+// IsSuccess returns true when this elapse o k response returns a 2xx status code
+func (o *APIError) IsSuccess() bool {
+ return o.Code/100 == 2
+}
+
+// IsRedirect returns true when this elapse o k response returns a 3xx status code
+func (o *APIError) IsRedirect() bool {
+ return o.Code/100 == 3
+}
+
+// IsClientError returns true when this elapse o k response returns a 4xx status code
+func (o *APIError) IsClientError() bool {
+ return o.Code/100 == 4
+}
+
+// IsServerError returns true when this elapse o k response returns a 5xx status code
+func (o *APIError) IsServerError() bool {
+ return o.Code/100 == 5
+}
+
+// IsCode returns true when this elapse o k response returns a 4xx status code
+func (o *APIError) IsCode(code int) bool {
+ return o.Code == code
}
-func (a *APIError) String() string {
- return a.Error()
+// A ClientResponseStatus is a common interface implemented by all responses on the generated code
+// You can use this to treat any client response based on status code
+type ClientResponseStatus interface {
+ IsSuccess() bool
+ IsRedirect() bool
+ IsClientError() bool
+ IsServerError() bool
+ IsCode(int) bool
}
diff --git a/vendor/github.com/go-openapi/runtime/constants.go b/vendor/github.com/go-openapi/runtime/constants.go
index a4de897adcdf..515969242ca1 100644
--- a/vendor/github.com/go-openapi/runtime/constants.go
+++ b/vendor/github.com/go-openapi/runtime/constants.go
@@ -23,6 +23,8 @@ const (
// HeaderAccept the Accept header
HeaderAccept = "Accept"
+ // HeaderAuthorization the Authorization header
+ HeaderAuthorization = "Authorization"
charsetKey = "charset"
diff --git a/vendor/github.com/go-openapi/runtime/csv.go b/vendor/github.com/go-openapi/runtime/csv.go
index d807bd915b44..c9597bcd6e0e 100644
--- a/vendor/github.com/go-openapi/runtime/csv.go
+++ b/vendor/github.com/go-openapi/runtime/csv.go
@@ -16,62 +16,335 @@ package runtime
import (
"bytes"
+ "context"
+ "encoding"
"encoding/csv"
"errors"
+ "fmt"
"io"
+ "reflect"
+
+ "golang.org/x/sync/errgroup"
)
-// CSVConsumer creates a new CSV consumer
-func CSVConsumer() Consumer {
+// CSVConsumer creates a new CSV consumer.
+//
+// The consumer consumes CSV records from a provided reader into the data passed by reference.
+//
+// CSVOpts options may be specified to alter the default CSV behavior on the reader and the writer side (e.g. separator, skip header, ...).
+// The defaults are those of the standard library's csv.Reader and csv.Writer.
+//
+// Supported output underlying types and interfaces, prioritized in this order:
+// - *csv.Writer
+// - CSVWriter (writer options are ignored)
+// - io.Writer (as raw bytes)
+// - io.ReaderFrom (as raw bytes)
+// - encoding.BinaryUnmarshaler (as raw bytes)
+// - *[][]string (as a collection of records)
+// - *[]byte (as raw bytes)
+// - *string (a raw bytes)
+//
+// The consumer prioritizes situations where buffering the input is not required.
+func CSVConsumer(opts ...CSVOpt) Consumer {
+ o := csvOptsWithDefaults(opts)
+
return ConsumerFunc(func(reader io.Reader, data interface{}) error {
if reader == nil {
return errors.New("CSVConsumer requires a reader")
}
+ if data == nil {
+ return errors.New("nil destination for CSVConsumer")
+ }
csvReader := csv.NewReader(reader)
- writer, ok := data.(io.Writer)
- if !ok {
- return errors.New("data type must be io.Writer")
+ o.applyToReader(csvReader)
+ closer := defaultCloser
+ if o.closeStream {
+ if cl, isReaderCloser := reader.(io.Closer); isReaderCloser {
+ closer = cl.Close
+ }
}
- csvWriter := csv.NewWriter(writer)
- records, err := csvReader.ReadAll()
- if err != nil {
+ defer func() {
+ _ = closer()
+ }()
+
+ switch destination := data.(type) {
+ case *csv.Writer:
+ csvWriter := destination
+ o.applyToWriter(csvWriter)
+
+ return pipeCSV(csvWriter, csvReader, o)
+
+ case CSVWriter:
+ csvWriter := destination
+ // no writer options available
+
+ return pipeCSV(csvWriter, csvReader, o)
+
+ case io.Writer:
+ csvWriter := csv.NewWriter(destination)
+ o.applyToWriter(csvWriter)
+
+ return pipeCSV(csvWriter, csvReader, o)
+
+ case io.ReaderFrom:
+ var buf bytes.Buffer
+ csvWriter := csv.NewWriter(&buf)
+ o.applyToWriter(csvWriter)
+ if err := bufferedCSV(csvWriter, csvReader, o); err != nil {
+ return err
+ }
+ _, err := destination.ReadFrom(&buf)
+
return err
- }
- for _, r := range records {
- if err := csvWriter.Write(r); err != nil {
+
+ case encoding.BinaryUnmarshaler:
+ var buf bytes.Buffer
+ csvWriter := csv.NewWriter(&buf)
+ o.applyToWriter(csvWriter)
+ if err := bufferedCSV(csvWriter, csvReader, o); err != nil {
return err
}
+
+ return destination.UnmarshalBinary(buf.Bytes())
+
+ default:
+ // support *[][]string, *[]byte, *string
+ if ptr := reflect.TypeOf(data); ptr.Kind() != reflect.Ptr {
+ return errors.New("destination must be a pointer")
+ }
+
+ v := reflect.Indirect(reflect.ValueOf(data))
+ t := v.Type()
+
+ switch {
+ case t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Slice && t.Elem().Elem().Kind() == reflect.String:
+ csvWriter := &csvRecordsWriter{}
+ // writer options are ignored
+ if err := pipeCSV(csvWriter, csvReader, o); err != nil {
+ return err
+ }
+
+ v.Grow(len(csvWriter.records))
+ v.SetCap(len(csvWriter.records)) // in case Grow was unnessary, trim down the capacity
+ v.SetLen(len(csvWriter.records))
+ reflect.Copy(v, reflect.ValueOf(csvWriter.records))
+
+ return nil
+
+ case t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Uint8:
+ var buf bytes.Buffer
+ csvWriter := csv.NewWriter(&buf)
+ o.applyToWriter(csvWriter)
+ if err := bufferedCSV(csvWriter, csvReader, o); err != nil {
+ return err
+ }
+ v.SetBytes(buf.Bytes())
+
+ return nil
+
+ case t.Kind() == reflect.String:
+ var buf bytes.Buffer
+ csvWriter := csv.NewWriter(&buf)
+ o.applyToWriter(csvWriter)
+ if err := bufferedCSV(csvWriter, csvReader, o); err != nil {
+ return err
+ }
+ v.SetString(buf.String())
+
+ return nil
+
+ default:
+ return fmt.Errorf("%v (%T) is not supported by the CSVConsumer, %s",
+ data, data, "can be resolved by supporting CSVWriter/Writer/BinaryUnmarshaler interface",
+ )
+ }
}
- csvWriter.Flush()
- return nil
})
}
-// CSVProducer creates a new CSV producer
-func CSVProducer() Producer {
+// CSVProducer creates a new CSV producer.
+//
+// The producer takes input data then writes as CSV to an output writer (essentially as a pipe).
+//
+// Supported input underlying types and interfaces, prioritized in this order:
+// - *csv.Reader
+// - CSVReader (reader options are ignored)
+// - io.Reader
+// - io.WriterTo
+// - encoding.BinaryMarshaler
+// - [][]string
+// - []byte
+// - string
+//
+// The producer prioritizes situations where buffering the input is not required.
+func CSVProducer(opts ...CSVOpt) Producer {
+ o := csvOptsWithDefaults(opts)
+
return ProducerFunc(func(writer io.Writer, data interface{}) error {
if writer == nil {
return errors.New("CSVProducer requires a writer")
}
+ if data == nil {
+ return errors.New("nil data for CSVProducer")
+ }
- dataBytes, ok := data.([]byte)
- if !ok {
- return errors.New("data type must be byte array")
+ csvWriter := csv.NewWriter(writer)
+ o.applyToWriter(csvWriter)
+ closer := defaultCloser
+ if o.closeStream {
+ if cl, isWriterCloser := writer.(io.Closer); isWriterCloser {
+ closer = cl.Close
+ }
}
+ defer func() {
+ _ = closer()
+ }()
- csvReader := csv.NewReader(bytes.NewBuffer(dataBytes))
- records, err := csvReader.ReadAll()
- if err != nil {
- return err
+ if rc, isDataCloser := data.(io.ReadCloser); isDataCloser {
+ defer rc.Close()
}
- csvWriter := csv.NewWriter(writer)
- for _, r := range records {
- if err := csvWriter.Write(r); err != nil {
+
+ switch origin := data.(type) {
+ case *csv.Reader:
+ csvReader := origin
+ o.applyToReader(csvReader)
+
+ return pipeCSV(csvWriter, csvReader, o)
+
+ case CSVReader:
+ csvReader := origin
+ // no reader options available
+
+ return pipeCSV(csvWriter, csvReader, o)
+
+ case io.Reader:
+ csvReader := csv.NewReader(origin)
+ o.applyToReader(csvReader)
+
+ return pipeCSV(csvWriter, csvReader, o)
+
+ case io.WriterTo:
+ // async piping of the writes performed by WriteTo
+ r, w := io.Pipe()
+ csvReader := csv.NewReader(r)
+ o.applyToReader(csvReader)
+
+ pipe, _ := errgroup.WithContext(context.Background())
+ pipe.Go(func() error {
+ _, err := origin.WriteTo(w)
+ _ = w.Close()
+ return err
+ })
+
+ pipe.Go(func() error {
+ defer func() {
+ _ = r.Close()
+ }()
+
+ return pipeCSV(csvWriter, csvReader, o)
+ })
+
+ return pipe.Wait()
+
+ case encoding.BinaryMarshaler:
+ buf, err := origin.MarshalBinary()
+ if err != nil {
return err
}
+ rdr := bytes.NewBuffer(buf)
+ csvReader := csv.NewReader(rdr)
+
+ return bufferedCSV(csvWriter, csvReader, o)
+
+ default:
+ // support [][]string, []byte, string (or pointers to those)
+ v := reflect.Indirect(reflect.ValueOf(data))
+ t := v.Type()
+
+ switch {
+ case t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Slice && t.Elem().Elem().Kind() == reflect.String:
+ csvReader := &csvRecordsWriter{
+ records: make([][]string, v.Len()),
+ }
+ reflect.Copy(reflect.ValueOf(csvReader.records), v)
+
+ return pipeCSV(csvWriter, csvReader, o)
+
+ case t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Uint8:
+ buf := bytes.NewBuffer(v.Bytes())
+ csvReader := csv.NewReader(buf)
+ o.applyToReader(csvReader)
+
+ return bufferedCSV(csvWriter, csvReader, o)
+
+ case t.Kind() == reflect.String:
+ buf := bytes.NewBufferString(v.String())
+ csvReader := csv.NewReader(buf)
+ o.applyToReader(csvReader)
+
+ return bufferedCSV(csvWriter, csvReader, o)
+
+ default:
+ return fmt.Errorf("%v (%T) is not supported by the CSVProducer, %s",
+ data, data, "can be resolved by supporting CSVReader/Reader/BinaryMarshaler interface",
+ )
+ }
}
- csvWriter.Flush()
- return nil
})
}
+
+// pipeCSV copies CSV records from a CSV reader to a CSV writer
+func pipeCSV(csvWriter CSVWriter, csvReader CSVReader, opts csvOpts) error {
+ for ; opts.skippedLines > 0; opts.skippedLines-- {
+ _, err := csvReader.Read()
+ if err != nil {
+ if errors.Is(err, io.EOF) {
+ return nil
+ }
+
+ return err
+ }
+ }
+
+ for {
+ record, err := csvReader.Read()
+ if err != nil {
+ if errors.Is(err, io.EOF) {
+ break
+ }
+
+ return err
+ }
+
+ if err := csvWriter.Write(record); err != nil {
+ return err
+ }
+ }
+
+ csvWriter.Flush()
+
+ return csvWriter.Error()
+}
+
+// bufferedCSV copies CSV records from a CSV reader to a CSV writer,
+// by first reading all records then writing them at once.
+func bufferedCSV(csvWriter *csv.Writer, csvReader *csv.Reader, opts csvOpts) error {
+ for ; opts.skippedLines > 0; opts.skippedLines-- {
+ _, err := csvReader.Read()
+ if err != nil {
+ if errors.Is(err, io.EOF) {
+ return nil
+ }
+
+ return err
+ }
+ }
+
+ records, err := csvReader.ReadAll()
+ if err != nil {
+ return err
+ }
+
+ return csvWriter.WriteAll(records)
+}
diff --git a/vendor/github.com/go-openapi/runtime/csv_options.go b/vendor/github.com/go-openapi/runtime/csv_options.go
new file mode 100644
index 000000000000..c16464c57842
--- /dev/null
+++ b/vendor/github.com/go-openapi/runtime/csv_options.go
@@ -0,0 +1,121 @@
+package runtime
+
+import (
+ "encoding/csv"
+ "io"
+)
+
+// CSVOpts alter the behavior of the CSV consumer or producer.
+type CSVOpt func(*csvOpts)
+
+type csvOpts struct {
+ csvReader csv.Reader
+ csvWriter csv.Writer
+ skippedLines int
+ closeStream bool
+}
+
+// WithCSVReaderOpts specifies the options to csv.Reader
+// when reading CSV.
+func WithCSVReaderOpts(reader csv.Reader) CSVOpt {
+ return func(o *csvOpts) {
+ o.csvReader = reader
+ }
+}
+
+// WithCSVWriterOpts specifies the options to csv.Writer
+// when writing CSV.
+func WithCSVWriterOpts(writer csv.Writer) CSVOpt {
+ return func(o *csvOpts) {
+ o.csvWriter = writer
+ }
+}
+
+// WithCSVSkipLines will skip header lines.
+func WithCSVSkipLines(skipped int) CSVOpt {
+ return func(o *csvOpts) {
+ o.skippedLines = skipped
+ }
+}
+
+func WithCSVClosesStream() CSVOpt {
+ return func(o *csvOpts) {
+ o.closeStream = true
+ }
+}
+
+func (o csvOpts) applyToReader(in *csv.Reader) {
+ if o.csvReader.Comma != 0 {
+ in.Comma = o.csvReader.Comma
+ }
+ if o.csvReader.Comment != 0 {
+ in.Comment = o.csvReader.Comment
+ }
+ if o.csvReader.FieldsPerRecord != 0 {
+ in.FieldsPerRecord = o.csvReader.FieldsPerRecord
+ }
+
+ in.LazyQuotes = o.csvReader.LazyQuotes
+ in.TrimLeadingSpace = o.csvReader.TrimLeadingSpace
+ in.ReuseRecord = o.csvReader.ReuseRecord
+}
+
+func (o csvOpts) applyToWriter(in *csv.Writer) {
+ if o.csvWriter.Comma != 0 {
+ in.Comma = o.csvWriter.Comma
+ }
+ in.UseCRLF = o.csvWriter.UseCRLF
+}
+
+func csvOptsWithDefaults(opts []CSVOpt) csvOpts {
+ var o csvOpts
+ for _, apply := range opts {
+ apply(&o)
+ }
+
+ return o
+}
+
+type CSVWriter interface {
+ Write([]string) error
+ Flush()
+ Error() error
+}
+
+type CSVReader interface {
+ Read() ([]string, error)
+}
+
+var (
+ _ CSVWriter = &csvRecordsWriter{}
+ _ CSVReader = &csvRecordsWriter{}
+)
+
+// csvRecordsWriter is an internal container to move CSV records back and forth
+type csvRecordsWriter struct {
+ i int
+ records [][]string
+}
+
+func (w *csvRecordsWriter) Write(record []string) error {
+ w.records = append(w.records, record)
+
+ return nil
+}
+
+func (w *csvRecordsWriter) Read() ([]string, error) {
+ if w.i >= len(w.records) {
+ return nil, io.EOF
+ }
+ defer func() {
+ w.i++
+ }()
+
+ return w.records[w.i], nil
+}
+
+func (w *csvRecordsWriter) Flush() {}
+
+func (w *csvRecordsWriter) Error() error {
+ return nil
+}
diff --git a/vendor/github.com/go-openapi/runtime/file.go b/vendor/github.com/go-openapi/runtime/file.go
index 85971c18c4b5..397d8a45933f 100644
--- a/vendor/github.com/go-openapi/runtime/file.go
+++ b/vendor/github.com/go-openapi/runtime/file.go
@@ -14,20 +14,6 @@
package runtime
-import "mime/multipart"
+import "github.com/go-openapi/swag"
-// File represents an uploaded file.
-type File struct {
- Data multipart.File
- Header *multipart.FileHeader
-}
-
-// Read bytes from the file
-func (f *File) Read(p []byte) (n int, err error) {
- return f.Data.Read(p)
-}
-
-// Close the file
-func (f *File) Close() error {
- return f.Data.Close()
-}
+type File = swag.File
diff --git a/vendor/github.com/go-openapi/runtime/logger/standard.go b/vendor/github.com/go-openapi/runtime/logger/standard.go
index f7e67ebb9e75..30035a777707 100644
--- a/vendor/github.com/go-openapi/runtime/logger/standard.go
+++ b/vendor/github.com/go-openapi/runtime/logger/standard.go
@@ -5,6 +5,8 @@ import (
"os"
)
+var _ Logger = StandardLogger{}
+
type StandardLogger struct{}
func (StandardLogger) Printf(format string, args ...interface{}) {
diff --git a/vendor/github.com/go-openapi/runtime/middleware/context.go b/vendor/github.com/go-openapi/runtime/middleware/context.go
index 250e35fb0e14..44cecf1181e4 100644
--- a/vendor/github.com/go-openapi/runtime/middleware/context.go
+++ b/vendor/github.com/go-openapi/runtime/middleware/context.go
@@ -18,6 +18,8 @@ import (
stdContext "context"
"fmt"
"net/http"
+ "net/url"
+ "path"
"strings"
"sync"
@@ -35,12 +37,21 @@ import (
// Debug when true turns on verbose logging
var Debug = logger.DebugEnabled()
+
+// Logger is the standard libray logger used for printing debug messages
var Logger logger.Logger = logger.StandardLogger{}
-func debugLog(format string, args ...interface{}) {
- if Debug {
- Logger.Printf(format, args...)
+func debugLogfFunc(lg logger.Logger) func(string, ...any) {
+ if logger.DebugEnabled() {
+ if lg == nil {
+ return Logger.Debugf
+ }
+
+ return lg.Debugf
}
+
+ // muted logger
+ return func(_ string, _ ...any) {}
}
// A Builder can create middlewares
@@ -73,10 +84,11 @@ func (fn ResponderFunc) WriteResponse(rw http.ResponseWriter, pr runtime.Produce
// used throughout to store request context with the standard context attached
// to the http.Request
type Context struct {
- spec *loads.Document
- analyzer *analysis.Spec
- api RoutableAPI
- router Router
+ spec *loads.Document
+ analyzer *analysis.Spec
+ api RoutableAPI
+ router Router
+ debugLogf func(string, ...any) // a logging function to debug context and all components using it
}
type routableUntypedAPI struct {
@@ -162,7 +174,7 @@ func (r *routableUntypedAPI) HandlerFor(method, path string) (http.Handler, bool
r.hlock.Unlock()
return handler, ok
}
-func (r *routableUntypedAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) {
+func (r *routableUntypedAPI) ServeErrorFor(_ string) func(http.ResponseWriter, *http.Request, error) {
return r.api.ServeError
}
func (r *routableUntypedAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer {
@@ -189,25 +201,52 @@ func (r *routableUntypedAPI) DefaultConsumes() string {
return r.defaultConsumes
}
-// NewRoutableContext creates a new context for a routable API
+// NewRoutableContext creates a new context for a routable API.
+//
+// If a nil Router is provided, the DefaultRouter (denco-based) will be used.
func NewRoutableContext(spec *loads.Document, routableAPI RoutableAPI, routes Router) *Context {
var an *analysis.Spec
if spec != nil {
an = analysis.New(spec.Spec())
}
- ctx := &Context{spec: spec, api: routableAPI, analyzer: an, router: routes}
- return ctx
+
+ return NewRoutableContextWithAnalyzedSpec(spec, an, routableAPI, routes)
}
-// NewContext creates a new context wrapper
+// NewRoutableContextWithAnalyzedSpec is like NewRoutableContext but takes as input an already analysed spec.
+//
+// If a nil Router is provided, the DefaultRouter (denco-based) will be used.
+func NewRoutableContextWithAnalyzedSpec(spec *loads.Document, an *analysis.Spec, routableAPI RoutableAPI, routes Router) *Context {
+ // Either there are no spec doc and analysis, or both of them.
+ if !((spec == nil && an == nil) || (spec != nil && an != nil)) {
+ panic(errors.New(http.StatusInternalServerError, "routable context requires either both spec doc and analysis, or none of them"))
+ }
+
+ return &Context{
+ spec: spec,
+ api: routableAPI,
+ analyzer: an,
+ router: routes,
+ debugLogf: debugLogfFunc(nil),
+ }
+}
+
+// NewContext creates a new context wrapper.
+//
+// If a nil Router is provided, the DefaultRouter (denco-based) will be used.
func NewContext(spec *loads.Document, api *untyped.API, routes Router) *Context {
var an *analysis.Spec
if spec != nil {
an = analysis.New(spec.Spec())
}
- ctx := &Context{spec: spec, analyzer: an}
+ ctx := &Context{
+ spec: spec,
+ analyzer: an,
+ router: routes,
+ debugLogf: debugLogfFunc(nil),
+ }
ctx.api = newRoutableUntypedAPI(spec, api, ctx)
- ctx.router = routes
+
return ctx
}
@@ -271,6 +310,13 @@ func (c *Context) BasePath() string {
return c.spec.BasePath()
}
+// SetLogger allows for injecting a logger to catch debug entries.
+//
+// The logger is enabled in DEBUG mode only.
+func (c *Context) SetLogger(lg logger.Logger) {
+ c.debugLogf = debugLogfFunc(lg)
+}
+
// RequiredProduces returns the accepted content types for responses
func (c *Context) RequiredProduces() []string {
return c.analyzer.RequiredProduces()
@@ -288,6 +334,7 @@ func (c *Context) BindValidRequest(request *http.Request, route *MatchedRoute, b
if err != nil {
res = append(res, err)
} else {
+ c.debugLogf("validating content type for %q against [%s]", ct, strings.Join(route.Consumes, ", "))
if err := validateContentType(route.Consumes, ct); err != nil {
res = append(res, err)
}
@@ -386,16 +433,16 @@ func (c *Context) ResponseFormat(r *http.Request, offers []string) (string, *htt
var rCtx = r.Context()
if v, ok := rCtx.Value(ctxResponseFormat).(string); ok {
- debugLog("[%s %s] found response format %q in context", r.Method, r.URL.Path, v)
+ c.debugLogf("[%s %s] found response format %q in context", r.Method, r.URL.Path, v)
return v, r
}
format := NegotiateContentType(r, offers, "")
if format != "" {
- debugLog("[%s %s] set response format %q in context", r.Method, r.URL.Path, format)
+ c.debugLogf("[%s %s] set response format %q in context", r.Method, r.URL.Path, format)
r = r.WithContext(stdContext.WithValue(rCtx, ctxResponseFormat, format))
}
- debugLog("[%s %s] negotiated response format %q", r.Method, r.URL.Path, format)
+ c.debugLogf("[%s %s] negotiated response format %q", r.Method, r.URL.Path, format)
return format, r
}
@@ -458,7 +505,7 @@ func (c *Context) BindAndValidate(request *http.Request, matched *MatchedRoute)
var rCtx = request.Context()
if v, ok := rCtx.Value(ctxBoundParams).(*validation); ok {
- debugLog("got cached validation (valid: %t)", len(v.result) == 0)
+ c.debugLogf("got cached validation (valid: %t)", len(v.result) == 0)
if len(v.result) > 0 {
return v.bound, request, errors.CompositeValidationError(v.result...)
}
@@ -470,7 +517,7 @@ func (c *Context) BindAndValidate(request *http.Request, matched *MatchedRoute)
if len(result.result) > 0 {
return result.bound, request, errors.CompositeValidationError(result.result...)
}
- debugLog("no validation errors found")
+ c.debugLogf("no validation errors found")
return result.bound, request, nil
}
@@ -481,7 +528,7 @@ func (c *Context) NotFound(rw http.ResponseWriter, r *http.Request) {
// Respond renders the response after doing some content negotiation
func (c *Context) Respond(rw http.ResponseWriter, r *http.Request, produces []string, route *MatchedRoute, data interface{}) {
- debugLog("responding to %s %s with produces: %v", r.Method, r.URL.Path, produces)
+ c.debugLogf("responding to %s %s with produces: %v", r.Method, r.URL.Path, produces)
offers := []string{}
for _, mt := range produces {
if mt != c.api.DefaultProduces() {
@@ -490,7 +537,7 @@ func (c *Context) Respond(rw http.ResponseWriter, r *http.Request, produces []st
}
// the default producer is last so more specific producers take precedence
offers = append(offers, c.api.DefaultProduces())
- debugLog("offers: %v", offers)
+ c.debugLogf("offers: %v", offers)
var format string
format, r = c.ResponseFormat(r, offers)
@@ -498,12 +545,14 @@ func (c *Context) Respond(rw http.ResponseWriter, r *http.Request, produces []st
if resp, ok := data.(Responder); ok {
producers := route.Producers
- prod, ok := producers[format]
+ // producers contains keys with normalized format, if a format has MIME type parameter such as `text/plain; charset=utf-8`
+ // then you must provide `text/plain` to get the correct producer. HOWEVER, format here is not normalized.
+ prod, ok := producers[normalizeOffer(format)]
if !ok {
prods := c.api.ProducersFor(normalizeOffers([]string{c.api.DefaultProduces()}))
pr, ok := prods[c.api.DefaultProduces()]
if !ok {
- panic(errors.New(http.StatusInternalServerError, "can't find a producer for "+format))
+ panic(errors.New(http.StatusInternalServerError, cantFindProducer(format)))
}
prod = pr
}
@@ -529,14 +578,14 @@ func (c *Context) Respond(rw http.ResponseWriter, r *http.Request, produces []st
}
if route == nil || route.Operation == nil {
- rw.WriteHeader(200)
- if r.Method == "HEAD" {
+ rw.WriteHeader(http.StatusOK)
+ if r.Method == http.MethodHead {
return
}
producers := c.api.ProducersFor(normalizeOffers(offers))
prod, ok := producers[format]
if !ok {
- panic(errors.New(http.StatusInternalServerError, "can't find a producer for "+format))
+ panic(errors.New(http.StatusInternalServerError, cantFindProducer(format)))
}
if err := prod.Produce(rw, data); err != nil {
panic(err) // let the recovery middleware deal with this
@@ -546,7 +595,7 @@ func (c *Context) Respond(rw http.ResponseWriter, r *http.Request, produces []st
if _, code, ok := route.Operation.SuccessResponse(); ok {
rw.WriteHeader(code)
- if code == 204 || r.Method == "HEAD" {
+ if code == http.StatusNoContent || r.Method == http.MethodHead {
return
}
@@ -557,7 +606,7 @@ func (c *Context) Respond(rw http.ResponseWriter, r *http.Request, produces []st
prods := c.api.ProducersFor(normalizeOffers([]string{c.api.DefaultProduces()}))
pr, ok := prods[c.api.DefaultProduces()]
if !ok {
- panic(errors.New(http.StatusInternalServerError, "can't find a producer for "+format))
+ panic(errors.New(http.StatusInternalServerError, cantFindProducer(format)))
}
prod = pr
}
@@ -571,45 +620,92 @@ func (c *Context) Respond(rw http.ResponseWriter, r *http.Request, produces []st
c.api.ServeErrorFor(route.Operation.ID)(rw, r, errors.New(http.StatusInternalServerError, "can't produce response"))
}
-func (c *Context) APIHandlerSwaggerUI(builder Builder) http.Handler {
+// APIHandlerSwaggerUI returns a handler to serve the API.
+//
+// This handler includes a swagger spec, router and the contract defined in the swagger spec.
+//
+// A spec UI (SwaggerUI) is served at {API base path}/docs and the spec document at /swagger.json
+// (these can be modified with uiOptions).
+func (c *Context) APIHandlerSwaggerUI(builder Builder, opts ...UIOption) http.Handler {
b := builder
if b == nil {
b = PassthroughBuilder
}
- var title string
- sp := c.spec.Spec()
- if sp != nil && sp.Info != nil && sp.Info.Title != "" {
- title = sp.Info.Title
- }
+ specPath, uiOpts, specOpts := c.uiOptionsForHandler(opts)
+ var swaggerUIOpts SwaggerUIOpts
+ fromCommonToAnyOptions(uiOpts, &swaggerUIOpts)
+
+ return Spec(specPath, c.spec.Raw(), SwaggerUI(swaggerUIOpts, c.RoutesHandler(b)), specOpts...)
+}
- swaggerUIOpts := SwaggerUIOpts{
- BasePath: c.BasePath(),
- Title: title,
+// APIHandlerRapiDoc returns a handler to serve the API.
+//
+// This handler includes a swagger spec, router and the contract defined in the swagger spec.
+//
+// A spec UI (RapiDoc) is served at {API base path}/docs and the spec document at /swagger.json
+// (these can be modified with uiOptions).
+func (c *Context) APIHandlerRapiDoc(builder Builder, opts ...UIOption) http.Handler {
+ b := builder
+ if b == nil {
+ b = PassthroughBuilder
}
- return Spec("", c.spec.Raw(), SwaggerUI(swaggerUIOpts, c.RoutesHandler(b)))
+ specPath, uiOpts, specOpts := c.uiOptionsForHandler(opts)
+ var rapidocUIOpts RapiDocOpts
+ fromCommonToAnyOptions(uiOpts, &rapidocUIOpts)
+
+ return Spec(specPath, c.spec.Raw(), RapiDoc(rapidocUIOpts, c.RoutesHandler(b)), specOpts...)
}
-// APIHandler returns a handler to serve the API, this includes a swagger spec, router and the contract defined in the swagger spec
-func (c *Context) APIHandler(builder Builder) http.Handler {
+// APIHandler returns a handler to serve the API.
+//
+// This handler includes a swagger spec, router and the contract defined in the swagger spec.
+//
+// A spec UI (Redoc) is served at {API base path}/docs and the spec document at /swagger.json
+// (these can be modified with uiOptions).
+func (c *Context) APIHandler(builder Builder, opts ...UIOption) http.Handler {
b := builder
if b == nil {
b = PassthroughBuilder
}
+ specPath, uiOpts, specOpts := c.uiOptionsForHandler(opts)
+ var redocOpts RedocOpts
+ fromCommonToAnyOptions(uiOpts, &redocOpts)
+
+ return Spec(specPath, c.spec.Raw(), Redoc(redocOpts, c.RoutesHandler(b)), specOpts...)
+}
+
+func (c Context) uiOptionsForHandler(opts []UIOption) (string, uiOptions, []SpecOption) {
var title string
sp := c.spec.Spec()
if sp != nil && sp.Info != nil && sp.Info.Title != "" {
title = sp.Info.Title
}
- redocOpts := RedocOpts{
- BasePath: c.BasePath(),
- Title: title,
+ // default options (may be overridden)
+ optsForContext := []UIOption{
+ WithUIBasePath(c.BasePath()),
+ WithUITitle(title),
}
+ optsForContext = append(optsForContext, opts...)
+ uiOpts := uiOptionsWithDefaults(optsForContext)
- return Spec("", c.spec.Raw(), Redoc(redocOpts, c.RoutesHandler(b)))
+ // If spec URL is provided, there is a non-default path to serve the spec.
+ // This makes sure that the UI middleware is aligned with the Spec middleware.
+ u, _ := url.Parse(uiOpts.SpecURL)
+ var specPath string
+ if u != nil {
+ specPath = u.Path
+ }
+
+ pth, doc := path.Split(specPath)
+ if pth == "." {
+ pth = ""
+ }
+
+ return pth, uiOpts, []SpecOption{WithSpecDocument(doc)}
}
// RoutesHandler returns a handler to serve the API, just the routes and the contract defined in the swagger spec
@@ -620,3 +716,7 @@ func (c *Context) RoutesHandler(builder Builder) http.Handler {
}
return NewRouter(c, b(NewOperationExecutor(c)))
}
+
+func cantFindProducer(format string) string {
+ return "can't find a producer for " + format
+}
diff --git a/vendor/github.com/go-openapi/runtime/middleware/denco/router.go b/vendor/github.com/go-openapi/runtime/middleware/denco/router.go
index 5d2691ec3698..4377f77a466f 100644
--- a/vendor/github.com/go-openapi/runtime/middleware/denco/router.go
+++ b/vendor/github.com/go-openapi/runtime/middleware/denco/router.go
@@ -2,6 +2,7 @@
package denco
import (
+ "errors"
"fmt"
"sort"
"strings"
@@ -29,13 +30,13 @@ const (
// Router represents a URL router.
type Router struct {
+ param *doubleArray
// SizeHint expects the maximum number of path parameters in records to Build.
// SizeHint will be used to determine the capacity of the memory to allocate.
// By default, SizeHint will be determined from given records to Build.
SizeHint int
static map[string]interface{}
- param *doubleArray
}
// New returns a new Router.
@@ -51,7 +52,7 @@ func New() *Router {
// params is a slice of the Param that arranged in the order in which parameters appeared.
// e.g. when built routing path is "/path/to/:id/:name" and given path is "/path/to/1/alice". params order is [{"id": "1"}, {"name": "alice"}], not [{"name": "alice"}, {"id": "1"}].
func (rt *Router) Lookup(path string) (data interface{}, params Params, found bool) {
- if data, found := rt.static[path]; found {
+ if data, found = rt.static[path]; found {
return data, nil, true
}
if len(rt.param.node) == 1 {
@@ -71,7 +72,7 @@ func (rt *Router) Lookup(path string) (data interface{}, params Params, found bo
func (rt *Router) Build(records []Record) error {
statics, params := makeRecords(records)
if len(params) > MaxSize {
- return fmt.Errorf("denco: too many records")
+ return errors.New("denco: too many records")
}
if rt.SizeHint < 0 {
rt.SizeHint = 0
@@ -131,7 +132,8 @@ func newDoubleArray() *doubleArray {
// baseCheck contains BASE, CHECK and Extra flags.
// From the top, 22bits of BASE, 2bits of Extra flags and 8bits of CHECK.
//
-// BASE (22bit) | Extra flags (2bit) | CHECK (8bit)
+// BASE (22bit) | Extra flags (2bit) | CHECK (8bit)
+//
// |----------------------|--|--------|
// 32 10 8 0
type baseCheck uint32
@@ -196,24 +198,29 @@ func (da *doubleArray) lookup(path string, params []Param, idx int) (*node, []Pa
if next := nextIndex(da.bc[idx].Base(), TerminationCharacter); next < len(da.bc) && da.bc[next].Check() == TerminationCharacter {
return da.node[da.bc[next].Base()], params, true
}
+
BACKTRACKING:
for j := len(indices) - 1; j >= 0; j-- {
i, idx := int(indices[j]>>32), int(indices[j]&0xffffffff)
if da.bc[idx].IsSingleParam() {
- idx := nextIndex(da.bc[idx].Base(), ParamCharacter)
- if idx >= len(da.bc) {
+ nextIdx := nextIndex(da.bc[idx].Base(), ParamCharacter)
+ if nextIdx >= len(da.bc) {
break
}
+
next := NextSeparator(path, i)
- params := append(params, Param{Value: path[i:next]})
- if nd, params, found := da.lookup(path[next:], params, idx); found {
- return nd, params, true
+ nextParams := params
+ nextParams = append(nextParams, Param{Value: path[i:next]})
+ if nd, nextNextParams, found := da.lookup(path[next:], nextParams, nextIdx); found {
+ return nd, nextNextParams, true
}
}
+
if da.bc[idx].IsWildcardParam() {
- idx := nextIndex(da.bc[idx].Base(), WildcardCharacter)
- params := append(params, Param{Value: path[i:]})
- return da.node[da.bc[idx].Base()], params, true
+ nextIdx := nextIndex(da.bc[idx].Base(), WildcardCharacter)
+ nextParams := params
+ nextParams = append(nextParams, Param{Value: path[i:]})
+ return da.node[da.bc[nextIdx].Base()], nextParams, true
}
}
return nil, nil, false
@@ -325,7 +332,7 @@ func (da *doubleArray) arrange(records []*record, idx, depth int, usedBase map[i
}
base = da.findBase(siblings, idx, usedBase)
if base > MaxSize {
- return -1, nil, nil, fmt.Errorf("denco: too many elements of internal slice")
+ return -1, nil, nil, errors.New("denco: too many elements of internal slice")
}
da.setBase(idx, base)
return base, siblings, leaf, err
@@ -386,7 +393,7 @@ func makeSiblings(records []*record, depth int) (sib []sibling, leaf *record, er
case pc == c:
continue
default:
- return nil, nil, fmt.Errorf("denco: BUG: routing table hasn't been sorted")
+ return nil, nil, errors.New("denco: BUG: routing table hasn't been sorted")
}
if n > 0 {
sib[n-1].end = i
@@ -431,7 +438,7 @@ func makeRecords(srcs []Record) (statics, params []*record) {
wildcardPrefix := string(SeparatorCharacter) + string(WildcardCharacter)
restconfPrefix := string(PathParamCharacter) + string(ParamCharacter)
for _, r := range srcs {
- if strings.Contains(r.Key, paramPrefix) || strings.Contains(r.Key, wildcardPrefix) ||strings.Contains(r.Key, restconfPrefix){
+ if strings.Contains(r.Key, paramPrefix) || strings.Contains(r.Key, wildcardPrefix) || strings.Contains(r.Key, restconfPrefix) {
r.Key += termChar
params = append(params, &record{Record: r})
} else {
diff --git a/vendor/github.com/go-openapi/runtime/middleware/doc.go b/vendor/github.com/go-openapi/runtime/middleware/doc.go
index eaf90606ac32..836a98850d76 100644
--- a/vendor/github.com/go-openapi/runtime/middleware/doc.go
+++ b/vendor/github.com/go-openapi/runtime/middleware/doc.go
@@ -12,51 +12,52 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-/*Package middleware provides the library with helper functions for serving swagger APIs.
+/*
+Package middleware provides the library with helper functions for serving swagger APIs.
Pseudo middleware handler
- import (
- "net/http"
-
- "github.com/go-openapi/errors"
- )
-
- func newCompleteMiddleware(ctx *Context) http.Handler {
- return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
- // use context to lookup routes
- if matched, ok := ctx.RouteInfo(r); ok {
-
- if matched.NeedsAuth() {
- if _, err := ctx.Authorize(r, matched); err != nil {
- ctx.Respond(rw, r, matched.Produces, matched, err)
- return
- }
- }
-
- bound, validation := ctx.BindAndValidate(r, matched)
- if validation != nil {
- ctx.Respond(rw, r, matched.Produces, matched, validation)
- return
- }
-
- result, err := matched.Handler.Handle(bound)
- if err != nil {
- ctx.Respond(rw, r, matched.Produces, matched, err)
- return
- }
-
- ctx.Respond(rw, r, matched.Produces, matched, result)
- return
- }
-
- // Not found, check if it exists in the other methods first
- if others := ctx.AllowedMethods(r); len(others) > 0 {
- ctx.Respond(rw, r, ctx.spec.RequiredProduces(), nil, errors.MethodNotAllowed(r.Method, others))
- return
- }
- ctx.Respond(rw, r, ctx.spec.RequiredProduces(), nil, errors.NotFound("path %s was not found", r.URL.Path))
- })
- }
+ import (
+ "net/http"
+
+ "github.com/go-openapi/errors"
+ )
+
+ func newCompleteMiddleware(ctx *Context) http.Handler {
+ return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
+ // use context to lookup routes
+ if matched, ok := ctx.RouteInfo(r); ok {
+
+ if matched.NeedsAuth() {
+ if _, err := ctx.Authorize(r, matched); err != nil {
+ ctx.Respond(rw, r, matched.Produces, matched, err)
+ return
+ }
+ }
+
+ bound, validation := ctx.BindAndValidate(r, matched)
+ if validation != nil {
+ ctx.Respond(rw, r, matched.Produces, matched, validation)
+ return
+ }
+
+ result, err := matched.Handler.Handle(bound)
+ if err != nil {
+ ctx.Respond(rw, r, matched.Produces, matched, err)
+ return
+ }
+
+ ctx.Respond(rw, r, matched.Produces, matched, result)
+ return
+ }
+
+ // Not found, check if it exists in the other methods first
+ if others := ctx.AllowedMethods(r); len(others) > 0 {
+ ctx.Respond(rw, r, ctx.spec.RequiredProduces(), nil, errors.MethodNotAllowed(r.Method, others))
+ return
+ }
+ ctx.Respond(rw, r, ctx.spec.RequiredProduces(), nil, errors.NotFound("path %s was not found", r.URL.Path))
+ })
+ }
*/
package middleware
diff --git a/vendor/github.com/go-openapi/runtime/middleware/go18.go b/vendor/github.com/go-openapi/runtime/middleware/go18.go
deleted file mode 100644
index 75c762c09486..000000000000
--- a/vendor/github.com/go-openapi/runtime/middleware/go18.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// +build go1.8
-
-package middleware
-
-import "net/url"
-
-func pathUnescape(path string) (string, error) {
- return url.PathUnescape(path)
-}
diff --git a/vendor/github.com/go-openapi/runtime/middleware/header/header.go b/vendor/github.com/go-openapi/runtime/middleware/header/header.go
index 3e342258bca6..df073c87d98d 100644
--- a/vendor/github.com/go-openapi/runtime/middleware/header/header.go
+++ b/vendor/github.com/go-openapi/runtime/middleware/header/header.go
@@ -195,7 +195,8 @@ func ParseAccept2(header http.Header, key string) (specs []AcceptSpec) {
}
// ParseAccept parses Accept* headers.
-func ParseAccept(header http.Header, key string) (specs []AcceptSpec) {
+func ParseAccept(header http.Header, key string) []AcceptSpec {
+ var specs []AcceptSpec
loop:
for _, s := range header[key] {
for {
@@ -218,6 +219,7 @@ loop:
}
}
}
+
specs = append(specs, spec)
s = skipSpace(s)
if !strings.HasPrefix(s, ",") {
@@ -226,7 +228,8 @@ loop:
s = skipSpace(s[1:])
}
}
- return
+
+ return specs
}
func skipSpace(s string) (rest string) {
@@ -265,13 +268,16 @@ func expectQuality(s string) (q float64, rest string) {
case len(s) == 0:
return -1, ""
case s[0] == '0':
- q = 0
+ // q is already 0
+ s = s[1:]
case s[0] == '1':
+ s = s[1:]
q = 1
+ case s[0] == '.':
+ // q is already 0
default:
return -1, ""
}
- s = s[1:]
if !strings.HasPrefix(s, ".") {
return q, s
}
@@ -303,7 +309,7 @@ func expectTokenOrQuoted(s string) (value string, rest string) {
p := make([]byte, len(s)-1)
j := copy(p, s[:i])
escape := true
- for i = i + 1; i < len(s); i++ {
+ for i++; i < len(s); i++ {
b := s[i]
switch {
case escape:
diff --git a/vendor/github.com/go-openapi/runtime/middleware/parameter.go b/vendor/github.com/go-openapi/runtime/middleware/parameter.go
index 8fa0cf4e464d..9c3353a95c9b 100644
--- a/vendor/github.com/go-openapi/runtime/middleware/parameter.go
+++ b/vendor/github.com/go-openapi/runtime/middleware/parameter.go
@@ -34,6 +34,11 @@ import (
const defaultMaxMemory = 32 << 20
+const (
+ typeString = "string"
+ typeArray = "array"
+)
+
var textUnmarshalType = reflect.TypeOf(new(encoding.TextUnmarshaler)).Elem()
func newUntypedParamBinder(param spec.Parameter, spec *spec.Swagger, formats strfmt.Registry) *untypedParamBinder {
@@ -66,7 +71,7 @@ func (p *untypedParamBinder) typeForSchema(tpe, format string, items *spec.Items
case "boolean":
return reflect.TypeOf(true)
- case "string":
+ case typeString:
if tt, ok := p.formats.GetType(format); ok {
return tt
}
@@ -94,7 +99,7 @@ func (p *untypedParamBinder) typeForSchema(tpe, format string, items *spec.Items
return reflect.TypeOf(float64(0))
}
- case "array":
+ case typeArray:
if items == nil {
return nil
}
@@ -119,7 +124,7 @@ func (p *untypedParamBinder) allowsMulti() bool {
func (p *untypedParamBinder) readValue(values runtime.Gettable, target reflect.Value) ([]string, bool, bool, error) {
name, in, cf, tpe := p.parameter.Name, p.parameter.In, p.parameter.CollectionFormat, p.parameter.Type
- if tpe == "array" {
+ if tpe == typeArray {
if cf == "multi" {
if !p.allowsMulti() {
return nil, false, false, errors.InvalidCollectionFormat(name, in, cf)
@@ -206,8 +211,13 @@ func (p *untypedParamBinder) Bind(request *http.Request, routeParams RouteParams
if p.parameter.Type == "file" {
file, header, ffErr := request.FormFile(p.parameter.Name)
if ffErr != nil {
- return errors.NewParseError(p.Name, p.parameter.In, "", ffErr)
+ if p.parameter.Required {
+ return errors.NewParseError(p.Name, p.parameter.In, "", ffErr)
+ }
+
+ return nil
}
+
target.Set(reflect.ValueOf(runtime.File{Data: file, Header: header}))
return nil
}
@@ -259,7 +269,7 @@ func (p *untypedParamBinder) Bind(request *http.Request, routeParams RouteParams
}
func (p *untypedParamBinder) bindValue(data []string, hasKey bool, target reflect.Value) error {
- if p.parameter.Type == "array" {
+ if p.parameter.Type == typeArray {
return p.setSliceFieldValue(target, p.parameter.Default, data, hasKey)
}
var d string
@@ -269,7 +279,7 @@ func (p *untypedParamBinder) bindValue(data []string, hasKey bool, target reflec
return p.setFieldValue(target, p.parameter.Default, d, hasKey)
}
-func (p *untypedParamBinder) setFieldValue(target reflect.Value, defaultValue interface{}, data string, hasKey bool) error {
+func (p *untypedParamBinder) setFieldValue(target reflect.Value, defaultValue interface{}, data string, hasKey bool) error { //nolint:gocyclo
tpe := p.parameter.Type
if p.parameter.Format != "" {
tpe = p.parameter.Format
@@ -313,7 +323,7 @@ func (p *untypedParamBinder) setFieldValue(target reflect.Value, defaultValue in
return nil
}
- switch target.Kind() {
+ switch target.Kind() { //nolint:exhaustive // we want to check only types that map from a swagger parameter
case reflect.Bool:
if data == "" {
if target.CanSet() {
diff --git a/vendor/github.com/go-openapi/runtime/middleware/pre_go18.go b/vendor/github.com/go-openapi/runtime/middleware/pre_go18.go
deleted file mode 100644
index 03385251e195..000000000000
--- a/vendor/github.com/go-openapi/runtime/middleware/pre_go18.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// +build !go1.8
-
-package middleware
-
-import "net/url"
-
-func pathUnescape(path string) (string, error) {
- return url.QueryUnescape(path)
-}
diff --git a/vendor/github.com/go-openapi/runtime/middleware/rapidoc.go b/vendor/github.com/go-openapi/runtime/middleware/rapidoc.go
index 4be330d6dc34..ef75e7441fc9 100644
--- a/vendor/github.com/go-openapi/runtime/middleware/rapidoc.go
+++ b/vendor/github.com/go-openapi/runtime/middleware/rapidoc.go
@@ -10,67 +10,57 @@ import (
// RapiDocOpts configures the RapiDoc middlewares
type RapiDocOpts struct {
- // BasePath for the UI path, defaults to: /
+ // BasePath for the UI, defaults to: /
BasePath string
- // Path combines with BasePath for the full UI path, defaults to: docs
+
+ // Path combines with BasePath to construct the path to the UI, defaults to: "docs".
Path string
- // SpecURL the url to find the spec for
+
+ // SpecURL is the URL of the spec document.
+ //
+ // Defaults to: /swagger.json
SpecURL string
- // RapiDocURL for the js that generates the rapidoc site, defaults to: https://cdn.jsdelivr.net/npm/rapidoc/bundles/rapidoc.standalone.js
- RapiDocURL string
+
// Title for the documentation site, default to: API documentation
Title string
+
+ // Template specifies a custom template to serve the UI
+ Template string
+
+ // RapiDocURL points to the js asset that generates the rapidoc site.
+ //
+ // Defaults to https://unpkg.com/rapidoc/dist/rapidoc-min.js
+ RapiDocURL string
}
-// EnsureDefaults in case some options are missing
func (r *RapiDocOpts) EnsureDefaults() {
- if r.BasePath == "" {
- r.BasePath = "/"
- }
- if r.Path == "" {
- r.Path = "docs"
- }
- if r.SpecURL == "" {
- r.SpecURL = "/swagger.json"
- }
+ common := toCommonUIOptions(r)
+ common.EnsureDefaults()
+ fromCommonToAnyOptions(common, r)
+
+ // rapidoc-specifics
if r.RapiDocURL == "" {
r.RapiDocURL = rapidocLatest
}
- if r.Title == "" {
- r.Title = "API documentation"
+ if r.Template == "" {
+ r.Template = rapidocTemplate
}
}
// RapiDoc creates a middleware to serve a documentation site for a swagger spec.
-// This allows for altering the spec before starting the http listener.
//
+// This allows for altering the spec before starting the http listener.
func RapiDoc(opts RapiDocOpts, next http.Handler) http.Handler {
opts.EnsureDefaults()
pth := path.Join(opts.BasePath, opts.Path)
- tmpl := template.Must(template.New("rapidoc").Parse(rapidocTemplate))
-
- buf := bytes.NewBuffer(nil)
- _ = tmpl.Execute(buf, opts)
- b := buf.Bytes()
-
- return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
- if r.URL.Path == pth {
- rw.Header().Set("Content-Type", "text/html; charset=utf-8")
- rw.WriteHeader(http.StatusOK)
-
- _, _ = rw.Write(b)
- return
- }
+ tmpl := template.Must(template.New("rapidoc").Parse(opts.Template))
+ assets := bytes.NewBuffer(nil)
+ if err := tmpl.Execute(assets, opts); err != nil {
+ panic(fmt.Errorf("cannot execute template: %w", err))
+ }
- if next == nil {
- rw.Header().Set("Content-Type", "text/plain")
- rw.WriteHeader(http.StatusNotFound)
- _, _ = rw.Write([]byte(fmt.Sprintf("%q not found", pth)))
- return
- }
- next.ServeHTTP(rw, r)
- })
+ return serveUI(pth, assets.Bytes(), next)
}
const (
@@ -79,7 +69,7 @@ const (
{{ .Title }}
-
+
diff --git a/vendor/github.com/go-openapi/runtime/middleware/redoc.go b/vendor/github.com/go-openapi/runtime/middleware/redoc.go
index 019c854295be..b96b01e7f3fe 100644
--- a/vendor/github.com/go-openapi/runtime/middleware/redoc.go
+++ b/vendor/github.com/go-openapi/runtime/middleware/redoc.go
@@ -10,67 +10,58 @@ import (
// RedocOpts configures the Redoc middlewares
type RedocOpts struct {
- // BasePath for the UI path, defaults to: /
+ // BasePath for the UI, defaults to: /
BasePath string
- // Path combines with BasePath for the full UI path, defaults to: docs
+
+ // Path combines with BasePath to construct the path to the UI, defaults to: "docs".
Path string
- // SpecURL the url to find the spec for
+
+ // SpecURL is the URL of the spec document.
+ //
+ // Defaults to: /swagger.json
SpecURL string
- // RedocURL for the js that generates the redoc site, defaults to: https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js
- RedocURL string
+
// Title for the documentation site, default to: API documentation
Title string
+
+ // Template specifies a custom template to serve the UI
+ Template string
+
+ // RedocURL points to the js that generates the redoc site.
+ //
+ // Defaults to: https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js
+ RedocURL string
}
// EnsureDefaults in case some options are missing
func (r *RedocOpts) EnsureDefaults() {
- if r.BasePath == "" {
- r.BasePath = "/"
- }
- if r.Path == "" {
- r.Path = "docs"
- }
- if r.SpecURL == "" {
- r.SpecURL = "/swagger.json"
- }
+ common := toCommonUIOptions(r)
+ common.EnsureDefaults()
+ fromCommonToAnyOptions(common, r)
+
+ // redoc-specifics
if r.RedocURL == "" {
r.RedocURL = redocLatest
}
- if r.Title == "" {
- r.Title = "API documentation"
+ if r.Template == "" {
+ r.Template = redocTemplate
}
}
// Redoc creates a middleware to serve a documentation site for a swagger spec.
-// This allows for altering the spec before starting the http listener.
//
+// This allows for altering the spec before starting the http listener.
func Redoc(opts RedocOpts, next http.Handler) http.Handler {
opts.EnsureDefaults()
pth := path.Join(opts.BasePath, opts.Path)
- tmpl := template.Must(template.New("redoc").Parse(redocTemplate))
-
- buf := bytes.NewBuffer(nil)
- _ = tmpl.Execute(buf, opts)
- b := buf.Bytes()
-
- return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
- if r.URL.Path == pth {
- rw.Header().Set("Content-Type", "text/html; charset=utf-8")
- rw.WriteHeader(http.StatusOK)
-
- _, _ = rw.Write(b)
- return
- }
+ tmpl := template.Must(template.New("redoc").Parse(opts.Template))
+ assets := bytes.NewBuffer(nil)
+ if err := tmpl.Execute(assets, opts); err != nil {
+ panic(fmt.Errorf("cannot execute template: %w", err))
+ }
- if next == nil {
- rw.Header().Set("Content-Type", "text/plain")
- rw.WriteHeader(http.StatusNotFound)
- _, _ = rw.Write([]byte(fmt.Sprintf("%q not found", pth)))
- return
- }
- next.ServeHTTP(rw, r)
- })
+ return serveUI(pth, assets.Bytes(), next)
}
const (
diff --git a/vendor/github.com/go-openapi/runtime/middleware/request.go b/vendor/github.com/go-openapi/runtime/middleware/request.go
index 760c37861d0f..82e14366523f 100644
--- a/vendor/github.com/go-openapi/runtime/middleware/request.go
+++ b/vendor/github.com/go-openapi/runtime/middleware/request.go
@@ -19,10 +19,10 @@ import (
"reflect"
"github.com/go-openapi/errors"
+ "github.com/go-openapi/runtime"
+ "github.com/go-openapi/runtime/logger"
"github.com/go-openapi/spec"
"github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/runtime"
)
// UntypedRequestBinder binds and validates the data from a http request
@@ -31,6 +31,7 @@ type UntypedRequestBinder struct {
Parameters map[string]spec.Parameter
Formats strfmt.Registry
paramBinders map[string]*untypedParamBinder
+ debugLogf func(string, ...any) // a logging function to debug context and all components using it
}
// NewUntypedRequestBinder creates a new binder for reading a request.
@@ -44,6 +45,7 @@ func NewUntypedRequestBinder(parameters map[string]spec.Parameter, spec *spec.Sw
paramBinders: binders,
Spec: spec,
Formats: formats,
+ debugLogf: debugLogfFunc(nil),
}
}
@@ -52,10 +54,10 @@ func (o *UntypedRequestBinder) Bind(request *http.Request, routeParams RoutePara
val := reflect.Indirect(reflect.ValueOf(data))
isMap := val.Kind() == reflect.Map
var result []error
- debugLog("binding %d parameters for %s %s", len(o.Parameters), request.Method, request.URL.EscapedPath())
+ o.debugLogf("binding %d parameters for %s %s", len(o.Parameters), request.Method, request.URL.EscapedPath())
for fieldName, param := range o.Parameters {
binder := o.paramBinders[fieldName]
- debugLog("binding parameter %s for %s %s", fieldName, request.Method, request.URL.EscapedPath())
+ o.debugLogf("binding parameter %s for %s %s", fieldName, request.Method, request.URL.EscapedPath())
var target reflect.Value
if !isMap {
binder.Name = fieldName
@@ -65,7 +67,7 @@ func (o *UntypedRequestBinder) Bind(request *http.Request, routeParams RoutePara
if isMap {
tpe := binder.Type()
if tpe == nil {
- if param.Schema.Type.Contains("array") {
+ if param.Schema.Type.Contains(typeArray) {
tpe = reflect.TypeOf([]interface{}{})
} else {
tpe = reflect.TypeOf(map[string]interface{}{})
@@ -102,3 +104,14 @@ func (o *UntypedRequestBinder) Bind(request *http.Request, routeParams RoutePara
return nil
}
+
+// SetLogger allows for injecting a logger to catch debug entries.
+//
+// The logger is enabled in DEBUG mode only.
+func (o *UntypedRequestBinder) SetLogger(lg logger.Logger) {
+ o.debugLogf = debugLogfFunc(lg)
+}
+
+func (o *UntypedRequestBinder) setDebugLogf(fn func(string, ...any)) {
+ o.debugLogf = fn
+}
diff --git a/vendor/github.com/go-openapi/runtime/middleware/router.go b/vendor/github.com/go-openapi/runtime/middleware/router.go
index 02768bade28d..3a6aee90e50d 100644
--- a/vendor/github.com/go-openapi/runtime/middleware/router.go
+++ b/vendor/github.com/go-openapi/runtime/middleware/router.go
@@ -17,11 +17,14 @@ package middleware
import (
"fmt"
"net/http"
+ "net/url"
fpath "path"
"regexp"
"strings"
+ "github.com/go-openapi/runtime/logger"
"github.com/go-openapi/runtime/security"
+ "github.com/go-openapi/swag"
"github.com/go-openapi/analysis"
"github.com/go-openapi/errors"
@@ -66,10 +69,10 @@ func (r RouteParams) GetOK(name string) ([]string, bool, bool) {
return nil, false, false
}
-// NewRouter creates a new context aware router middleware
+// NewRouter creates a new context-aware router middleware
func NewRouter(ctx *Context, next http.Handler) http.Handler {
if ctx.router == nil {
- ctx.router = DefaultRouter(ctx.spec, ctx.api)
+ ctx.router = DefaultRouter(ctx.spec, ctx.api, WithDefaultRouterLoggerFunc(ctx.debugLogf))
}
return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
@@ -102,41 +105,75 @@ type RoutableAPI interface {
DefaultConsumes() string
}
-// Router represents a swagger aware router
+// Router represents a swagger-aware router
type Router interface {
Lookup(method, path string) (*MatchedRoute, bool)
OtherMethods(method, path string) []string
}
type defaultRouteBuilder struct {
- spec *loads.Document
- analyzer *analysis.Spec
- api RoutableAPI
- records map[string][]denco.Record
+ spec *loads.Document
+ analyzer *analysis.Spec
+ api RoutableAPI
+ records map[string][]denco.Record
+ debugLogf func(string, ...any) // a logging function to debug context and all components using it
}
type defaultRouter struct {
- spec *loads.Document
- routers map[string]*denco.Router
+ spec *loads.Document
+ routers map[string]*denco.Router
+ debugLogf func(string, ...any) // a logging function to debug context and all components using it
}
-func newDefaultRouteBuilder(spec *loads.Document, api RoutableAPI) *defaultRouteBuilder {
+func newDefaultRouteBuilder(spec *loads.Document, api RoutableAPI, opts ...DefaultRouterOpt) *defaultRouteBuilder {
+ var o defaultRouterOpts
+ for _, apply := range opts {
+ apply(&o)
+ }
+ if o.debugLogf == nil {
+ o.debugLogf = debugLogfFunc(nil) // defaults to standard logger
+ }
+
return &defaultRouteBuilder{
- spec: spec,
- analyzer: analysis.New(spec.Spec()),
- api: api,
- records: make(map[string][]denco.Record),
+ spec: spec,
+ analyzer: analysis.New(spec.Spec()),
+ api: api,
+ records: make(map[string][]denco.Record),
+ debugLogf: o.debugLogf,
+ }
+}
+
+// DefaultRouterOpt allows to inject optional behavior to the default router.
+type DefaultRouterOpt func(*defaultRouterOpts)
+
+type defaultRouterOpts struct {
+ debugLogf func(string, ...any)
+}
+
+// WithDefaultRouterLogger sets the debug logger for the default router.
+//
+// This is enabled only in DEBUG mode.
+func WithDefaultRouterLogger(lg logger.Logger) DefaultRouterOpt {
+ return func(o *defaultRouterOpts) {
+ o.debugLogf = debugLogfFunc(lg)
}
}
-// DefaultRouter creates a default implemenation of the router
-func DefaultRouter(spec *loads.Document, api RoutableAPI) Router {
- builder := newDefaultRouteBuilder(spec, api)
+// WithDefaultRouterLoggerFunc sets a logging debug method for the default router.
+func WithDefaultRouterLoggerFunc(fn func(string, ...any)) DefaultRouterOpt {
+ return func(o *defaultRouterOpts) {
+ o.debugLogf = fn
+ }
+}
+
+// DefaultRouter creates a default implementation of the router
+func DefaultRouter(spec *loads.Document, api RoutableAPI, opts ...DefaultRouterOpt) Router {
+ builder := newDefaultRouteBuilder(spec, api, opts...)
if spec != nil {
for method, paths := range builder.analyzer.Operations() {
for path, operation := range paths {
fp := fpath.Join(spec.BasePath(), path)
- debugLog("adding route %s %s %q", method, fp, operation.ID)
+ builder.debugLogf("adding route %s %s %q", method, fp, operation.ID)
builder.AddRoute(method, fp, operation)
}
}
@@ -318,24 +355,24 @@ func (m *MatchedRoute) NeedsAuth() bool {
func (d *defaultRouter) Lookup(method, path string) (*MatchedRoute, bool) {
mth := strings.ToUpper(method)
- debugLog("looking up route for %s %s", method, path)
+ d.debugLogf("looking up route for %s %s", method, path)
if Debug {
if len(d.routers) == 0 {
- debugLog("there are no known routers")
+ d.debugLogf("there are no known routers")
}
for meth := range d.routers {
- debugLog("got a router for %s", meth)
+ d.debugLogf("got a router for %s", meth)
}
}
if router, ok := d.routers[mth]; ok {
if m, rp, ok := router.Lookup(fpath.Clean(path)); ok && m != nil {
if entry, ok := m.(*routeEntry); ok {
- debugLog("found a route for %s %s with %d parameters", method, path, len(entry.Parameters))
+ d.debugLogf("found a route for %s %s with %d parameters", method, path, len(entry.Parameters))
var params RouteParams
for _, p := range rp {
- v, err := pathUnescape(p.Value)
+ v, err := url.PathUnescape(p.Value)
if err != nil {
- debugLog("failed to escape %q: %v", p.Value, err)
+ d.debugLogf("failed to escape %q: %v", p.Value, err)
v = p.Value
}
// a workaround to handle fragment/composing parameters until they are supported in denco router
@@ -355,10 +392,10 @@ func (d *defaultRouter) Lookup(method, path string) (*MatchedRoute, bool) {
return &MatchedRoute{routeEntry: *entry, Params: params}, true
}
} else {
- debugLog("couldn't find a route by path for %s %s", method, path)
+ d.debugLogf("couldn't find a route by path for %s %s", method, path)
}
} else {
- debugLog("couldn't find a route by method for %s %s", method, path)
+ d.debugLogf("couldn't find a route by method for %s %s", method, path)
}
return nil, false
}
@@ -377,6 +414,10 @@ func (d *defaultRouter) OtherMethods(method, path string) []string {
return methods
}
+func (d *defaultRouter) SetLogger(lg logger.Logger) {
+ d.debugLogf = debugLogfFunc(lg)
+}
+
// convert swagger parameters per path segment into a denco parameter as multiple parameters per segment are not supported in denco
var pathConverter = regexp.MustCompile(`{(.+?)}([^/]*)`)
@@ -412,12 +453,23 @@ func (d *defaultRouteBuilder) AddRoute(method, path string, operation *spec.Oper
bp = bp[:len(bp)-1]
}
- debugLog("operation: %#v", *operation)
+ d.debugLogf("operation: %#v", *operation)
if handler, ok := d.api.HandlerFor(method, strings.TrimPrefix(path, bp)); ok {
consumes := d.analyzer.ConsumesFor(operation)
produces := d.analyzer.ProducesFor(operation)
parameters := d.analyzer.ParamsFor(method, strings.TrimPrefix(path, bp))
+ // add API defaults if not part of the spec
+ if defConsumes := d.api.DefaultConsumes(); defConsumes != "" && !swag.ContainsStringsCI(consumes, defConsumes) {
+ consumes = append(consumes, defConsumes)
+ }
+
+ if defProduces := d.api.DefaultProduces(); defProduces != "" && !swag.ContainsStringsCI(produces, defProduces) {
+ produces = append(produces, defProduces)
+ }
+
+ requestBinder := NewUntypedRequestBinder(parameters, d.spec.Spec(), d.api.Formats())
+ requestBinder.setDebugLogf(d.debugLogf)
record := denco.NewRecord(pathConverter.ReplaceAllString(path, ":$1"), &routeEntry{
BasePath: bp,
PathPattern: path,
@@ -429,7 +481,7 @@ func (d *defaultRouteBuilder) AddRoute(method, path string, operation *spec.Oper
Producers: d.api.ProducersFor(normalizeOffers(produces)),
Parameters: parameters,
Formats: d.api.Formats(),
- Binder: NewUntypedRequestBinder(parameters, d.spec.Spec(), d.api.Formats()),
+ Binder: requestBinder,
Authenticators: d.buildAuthenticators(operation),
Authorizer: d.api.Authorizer(),
})
@@ -439,11 +491,11 @@ func (d *defaultRouteBuilder) AddRoute(method, path string, operation *spec.Oper
func (d *defaultRouteBuilder) buildAuthenticators(operation *spec.Operation) RouteAuthenticators {
requirements := d.analyzer.SecurityRequirementsFor(operation)
- var auths []RouteAuthenticator
+ auths := make([]RouteAuthenticator, 0, len(requirements))
for _, reqs := range requirements {
- var schemes []string
+ schemes := make([]string, 0, len(reqs))
scopes := make(map[string][]string, len(reqs))
- var scopeSlices [][]string
+ scopeSlices := make([][]string, 0, len(reqs))
for _, req := range reqs {
schemes = append(schemes, req.Name)
scopes[req.Name] = req.Scopes
@@ -472,7 +524,8 @@ func (d *defaultRouteBuilder) Build() *defaultRouter {
routers[method] = router
}
return &defaultRouter{
- spec: d.spec,
- routers: routers,
+ spec: d.spec,
+ routers: routers,
+ debugLogf: d.debugLogf,
}
}
diff --git a/vendor/github.com/go-openapi/runtime/middleware/spec.go b/vendor/github.com/go-openapi/runtime/middleware/spec.go
index f02914298060..87e17e342491 100644
--- a/vendor/github.com/go-openapi/runtime/middleware/spec.go
+++ b/vendor/github.com/go-openapi/runtime/middleware/spec.go
@@ -19,30 +19,84 @@ import (
"path"
)
-// Spec creates a middleware to serve a swagger spec.
+const (
+ contentTypeHeader = "Content-Type"
+ applicationJSON = "application/json"
+)
+
+// SpecOption can be applied to the Spec serving middleware
+type SpecOption func(*specOptions)
+
+var defaultSpecOptions = specOptions{
+ Path: "",
+ Document: "swagger.json",
+}
+
+type specOptions struct {
+ Path string
+ Document string
+}
+
+func specOptionsWithDefaults(opts []SpecOption) specOptions {
+ o := defaultSpecOptions
+ for _, apply := range opts {
+ apply(&o)
+ }
+
+ return o
+}
+
+// Spec creates a middleware to serve a swagger spec as a JSON document.
+//
// This allows for altering the spec before starting the http listener.
-// This can be useful if you want to serve the swagger spec from another path than /swagger.json
//
-func Spec(basePath string, b []byte, next http.Handler) http.Handler {
+// The basePath argument indicates the path of the spec document (defaults to "/").
+// Additional SpecOption can be used to change the name of the document (defaults to "swagger.json").
+func Spec(basePath string, b []byte, next http.Handler, opts ...SpecOption) http.Handler {
if basePath == "" {
basePath = "/"
}
- pth := path.Join(basePath, "swagger.json")
+ o := specOptionsWithDefaults(opts)
+ pth := path.Join(basePath, o.Path, o.Document)
return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
- if r.URL.Path == pth {
- rw.Header().Set("Content-Type", "application/json")
+ if path.Clean(r.URL.Path) == pth {
+ rw.Header().Set(contentTypeHeader, applicationJSON)
rw.WriteHeader(http.StatusOK)
- //#nosec
_, _ = rw.Write(b)
+
return
}
- if next == nil {
- rw.Header().Set("Content-Type", "application/json")
- rw.WriteHeader(http.StatusNotFound)
+ if next != nil {
+ next.ServeHTTP(rw, r)
+
return
}
- next.ServeHTTP(rw, r)
+
+ rw.Header().Set(contentTypeHeader, applicationJSON)
+ rw.WriteHeader(http.StatusNotFound)
})
}
+
+// WithSpecPath sets the path to be joined to the base path of the Spec middleware.
+//
+// This is empty by default.
+func WithSpecPath(pth string) SpecOption {
+ return func(o *specOptions) {
+ o.Path = pth
+ }
+}
+
+// WithSpecDocument sets the name of the JSON document served as a spec.
+//
+// By default, this is "swagger.json"
+func WithSpecDocument(doc string) SpecOption {
+ return func(o *specOptions) {
+ if doc == "" {
+ return
+ }
+
+ o.Document = doc
+ }
+}
diff --git a/vendor/github.com/go-openapi/runtime/middleware/swaggerui.go b/vendor/github.com/go-openapi/runtime/middleware/swaggerui.go
index 2c92f5c91f3a..ec3c10cbafaa 100644
--- a/vendor/github.com/go-openapi/runtime/middleware/swaggerui.go
+++ b/vendor/github.com/go-openapi/runtime/middleware/swaggerui.go
@@ -8,37 +8,67 @@ import (
"path"
)
-// SwaggerUIOpts configures the Swaggerui middlewares
+// SwaggerUIOpts configures the SwaggerUI middleware
type SwaggerUIOpts struct {
- // BasePath for the UI path, defaults to: /
+ // BasePath for the API, defaults to: /
BasePath string
- // Path combines with BasePath for the full UI path, defaults to: docs
+
+ // Path combines with BasePath to construct the path to the UI, defaults to: "docs".
Path string
- // SpecURL the url to find the spec for
+
+ // SpecURL is the URL of the spec document.
+ //
+ // Defaults to: /swagger.json
SpecURL string
+ // Title for the documentation site, default to: API documentation
+ Title string
+
+ // Template specifies a custom template to serve the UI
+ Template string
+
+ // OAuthCallbackURL the url called after OAuth2 login
+ OAuthCallbackURL string
+
// The three components needed to embed swagger-ui
- SwaggerURL string
+
+ // SwaggerURL points to the js that generates the SwaggerUI site.
+ //
+ // Defaults to: https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js
+ SwaggerURL string
+
SwaggerPresetURL string
SwaggerStylesURL string
Favicon32 string
Favicon16 string
-
- // Title for the documentation site, default to: API documentation
- Title string
}
// EnsureDefaults in case some options are missing
func (r *SwaggerUIOpts) EnsureDefaults() {
- if r.BasePath == "" {
- r.BasePath = "/"
+ r.ensureDefaults()
+
+ if r.Template == "" {
+ r.Template = swaggeruiTemplate
}
- if r.Path == "" {
- r.Path = "docs"
+}
+
+func (r *SwaggerUIOpts) EnsureDefaultsOauth2() {
+ r.ensureDefaults()
+
+ if r.Template == "" {
+ r.Template = swaggerOAuthTemplate
}
- if r.SpecURL == "" {
- r.SpecURL = "/swagger.json"
+}
+
+func (r *SwaggerUIOpts) ensureDefaults() {
+ common := toCommonUIOptions(r)
+ common.EnsureDefaults()
+ fromCommonToAnyOptions(common, r)
+
+ // swaggerui-specifics
+ if r.OAuthCallbackURL == "" {
+ r.OAuthCallbackURL = path.Join(r.BasePath, r.Path, "oauth2-callback")
}
if r.SwaggerURL == "" {
r.SwaggerURL = swaggerLatest
@@ -55,40 +85,22 @@ func (r *SwaggerUIOpts) EnsureDefaults() {
if r.Favicon32 == "" {
r.Favicon32 = swaggerFavicon32Latest
}
- if r.Title == "" {
- r.Title = "API documentation"
- }
}
// SwaggerUI creates a middleware to serve a documentation site for a swagger spec.
+//
// This allows for altering the spec before starting the http listener.
func SwaggerUI(opts SwaggerUIOpts, next http.Handler) http.Handler {
opts.EnsureDefaults()
pth := path.Join(opts.BasePath, opts.Path)
- tmpl := template.Must(template.New("swaggerui").Parse(swaggeruiTemplate))
-
- buf := bytes.NewBuffer(nil)
- _ = tmpl.Execute(buf, &opts)
- b := buf.Bytes()
-
- return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
- if r.URL.Path == pth {
- rw.Header().Set("Content-Type", "text/html; charset=utf-8")
- rw.WriteHeader(http.StatusOK)
-
- _, _ = rw.Write(b)
- return
- }
-
- if next == nil {
- rw.Header().Set("Content-Type", "text/plain")
- rw.WriteHeader(http.StatusNotFound)
- _, _ = rw.Write([]byte(fmt.Sprintf("%q not found", pth)))
- return
- }
- next.ServeHTTP(rw, r)
- })
+ tmpl := template.Must(template.New("swaggerui").Parse(opts.Template))
+ assets := bytes.NewBuffer(nil)
+ if err := tmpl.Execute(assets, opts); err != nil {
+ panic(fmt.Errorf("cannot execute template: %w", err))
+ }
+
+ return serveUI(pth, assets.Bytes(), next)
}
const (
@@ -149,7 +161,8 @@ const (
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
- layout: "StandaloneLayout"
+ layout: "StandaloneLayout",
+ oauth2RedirectUrl: '{{ .OAuthCallbackURL }}'
})
// End Swagger UI call region
diff --git a/vendor/github.com/go-openapi/runtime/middleware/swaggerui_oauth2.go b/vendor/github.com/go-openapi/runtime/middleware/swaggerui_oauth2.go
new file mode 100644
index 000000000000..e81212f71c80
--- /dev/null
+++ b/vendor/github.com/go-openapi/runtime/middleware/swaggerui_oauth2.go
@@ -0,0 +1,105 @@
+package middleware
+
+import (
+ "bytes"
+ "fmt"
+ "net/http"
+ "text/template"
+)
+
+func SwaggerUIOAuth2Callback(opts SwaggerUIOpts, next http.Handler) http.Handler {
+ opts.EnsureDefaultsOauth2()
+
+ pth := opts.OAuthCallbackURL
+ tmpl := template.Must(template.New("swaggeroauth").Parse(opts.Template))
+ assets := bytes.NewBuffer(nil)
+ if err := tmpl.Execute(assets, opts); err != nil {
+ panic(fmt.Errorf("cannot execute template: %w", err))
+ }
+
+ return serveUI(pth, assets.Bytes(), next)
+}
+
+const (
+ swaggerOAuthTemplate = `
+
+
+
+ {{ .Title }}
+
+
+
+
+
+`
+)
diff --git a/vendor/github.com/go-openapi/runtime/middleware/ui_options.go b/vendor/github.com/go-openapi/runtime/middleware/ui_options.go
new file mode 100644
index 000000000000..b86efa0089ee
--- /dev/null
+++ b/vendor/github.com/go-openapi/runtime/middleware/ui_options.go
@@ -0,0 +1,173 @@
+package middleware
+
+import (
+ "bytes"
+ "encoding/gob"
+ "fmt"
+ "net/http"
+ "path"
+ "strings"
+)
+
+const (
+ // constants that are common to all UI-serving middlewares
+ defaultDocsPath = "docs"
+ defaultDocsURL = "/swagger.json"
+ defaultDocsTitle = "API Documentation"
+)
+
+// uiOptions defines common options for UI serving middlewares.
+type uiOptions struct {
+ // BasePath for the UI, defaults to: /
+ BasePath string
+
+ // Path combines with BasePath to construct the path to the UI, defaults to: "docs".
+ Path string
+
+ // SpecURL is the URL of the spec document.
+ //
+ // Defaults to: /swagger.json
+ SpecURL string
+
+ // Title for the documentation site, default to: API documentation
+ Title string
+
+ // Template specifies a custom template to serve the UI
+ Template string
+}
+
+// toCommonUIOptions converts any UI option type to retain the common options.
+//
+// This uses gob encoding/decoding to convert common fields from one struct to another.
+func toCommonUIOptions(opts interface{}) uiOptions {
+ var buf bytes.Buffer
+ enc := gob.NewEncoder(&buf)
+ dec := gob.NewDecoder(&buf)
+ var o uiOptions
+ err := enc.Encode(opts)
+ if err != nil {
+ panic(err)
+ }
+
+ err = dec.Decode(&o)
+ if err != nil {
+ panic(err)
+ }
+
+ return o
+}
+
+func fromCommonToAnyOptions[T any](source uiOptions, target *T) {
+ var buf bytes.Buffer
+ enc := gob.NewEncoder(&buf)
+ dec := gob.NewDecoder(&buf)
+ err := enc.Encode(source)
+ if err != nil {
+ panic(err)
+ }
+
+ err = dec.Decode(target)
+ if err != nil {
+ panic(err)
+ }
+}
+
+// UIOption can be applied to UI serving middleware, such as Context.APIHandler or
+// Context.APIHandlerSwaggerUI to alter the defaut behavior.
+type UIOption func(*uiOptions)
+
+func uiOptionsWithDefaults(opts []UIOption) uiOptions {
+ var o uiOptions
+ for _, apply := range opts {
+ apply(&o)
+ }
+
+ return o
+}
+
+// WithUIBasePath sets the base path from where to serve the UI assets.
+//
+// By default, Context middleware sets this value to the API base path.
+func WithUIBasePath(base string) UIOption {
+ return func(o *uiOptions) {
+ if !strings.HasPrefix(base, "/") {
+ base = "/" + base
+ }
+ o.BasePath = base
+ }
+}
+
+// WithUIPath sets the path from where to serve the UI assets (i.e. /{basepath}/{path}.
+func WithUIPath(pth string) UIOption {
+ return func(o *uiOptions) {
+ o.Path = pth
+ }
+}
+
+// WithUISpecURL sets the path from where to serve swagger spec document.
+//
+// This may be specified as a full URL or a path.
+//
+// By default, this is "/swagger.json"
+func WithUISpecURL(specURL string) UIOption {
+ return func(o *uiOptions) {
+ o.SpecURL = specURL
+ }
+}
+
+// WithUITitle sets the title of the UI.
+//
+// By default, Context middleware sets this value to the title found in the API spec.
+func WithUITitle(title string) UIOption {
+ return func(o *uiOptions) {
+ o.Title = title
+ }
+}
+
+// WithTemplate allows to set a custom template for the UI.
+//
+// UI middleware will panic if the template does not parse or execute properly.
+func WithTemplate(tpl string) UIOption {
+ return func(o *uiOptions) {
+ o.Template = tpl
+ }
+}
+
+// EnsureDefaults in case some options are missing
+func (r *uiOptions) EnsureDefaults() {
+ if r.BasePath == "" {
+ r.BasePath = "/"
+ }
+ if r.Path == "" {
+ r.Path = defaultDocsPath
+ }
+ if r.SpecURL == "" {
+ r.SpecURL = defaultDocsURL
+ }
+ if r.Title == "" {
+ r.Title = defaultDocsTitle
+ }
+}
+
+// serveUI creates a middleware that serves a templated asset as text/html.
+func serveUI(pth string, assets []byte, next http.Handler) http.Handler {
+ return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
+ if path.Clean(r.URL.Path) == pth {
+ rw.Header().Set(contentTypeHeader, "text/html; charset=utf-8")
+ rw.WriteHeader(http.StatusOK)
+ _, _ = rw.Write(assets)
+
+ return
+ }
+
+ if next != nil {
+ next.ServeHTTP(rw, r)
+
+ return
+ }
+
+ rw.Header().Set(contentTypeHeader, "text/plain")
+ rw.WriteHeader(http.StatusNotFound)
+ _, _ = rw.Write([]byte(fmt.Sprintf("%q not found", pth)))
+ })
+}
diff --git a/vendor/github.com/go-openapi/runtime/middleware/untyped/api.go b/vendor/github.com/go-openapi/runtime/middleware/untyped/api.go
index 39a85f7d9e89..7b7269bd195f 100644
--- a/vendor/github.com/go-openapi/runtime/middleware/untyped/api.go
+++ b/vendor/github.com/go-openapi/runtime/middleware/untyped/api.go
@@ -197,30 +197,31 @@ func (d *API) Validate() error {
// validateWith validates the registrations in this API against the provided spec analyzer
func (d *API) validate() error {
- var consumes []string
+ consumes := make([]string, 0, len(d.consumers))
for k := range d.consumers {
consumes = append(consumes, k)
}
- var produces []string
+ produces := make([]string, 0, len(d.producers))
for k := range d.producers {
produces = append(produces, k)
}
- var authenticators []string
+ authenticators := make([]string, 0, len(d.authenticators))
for k := range d.authenticators {
authenticators = append(authenticators, k)
}
- var operations []string
+ operations := make([]string, 0, len(d.operations))
for m, v := range d.operations {
for p := range v {
operations = append(operations, fmt.Sprintf("%s %s", strings.ToUpper(m), p))
}
}
- var definedAuths []string
- for k := range d.spec.Spec().SecurityDefinitions {
+ secDefinitions := d.spec.Spec().SecurityDefinitions
+ definedAuths := make([]string, 0, len(secDefinitions))
+ for k := range secDefinitions {
definedAuths = append(definedAuths, k)
}
@@ -267,7 +268,7 @@ func (d *API) verify(name string, registrations []string, expectations []string)
delete(expected, k)
}
- var unregistered []string
+ unregistered := make([]string, 0, len(expected))
for k := range expected {
unregistered = append(unregistered, k)
}
diff --git a/vendor/github.com/go-openapi/runtime/middleware/validation.go b/vendor/github.com/go-openapi/runtime/middleware/validation.go
index 1f0135b5788d..0a5356c6075e 100644
--- a/vendor/github.com/go-openapi/runtime/middleware/validation.go
+++ b/vendor/github.com/go-openapi/runtime/middleware/validation.go
@@ -35,7 +35,6 @@ type validation struct {
// ContentType validates the content type of a request
func validateContentType(allowed []string, actual string) error {
- debugLog("validating content type for %q against [%s]", actual, strings.Join(allowed, ", "))
if len(allowed) == 0 {
return nil
}
@@ -57,13 +56,13 @@ func validateContentType(allowed []string, actual string) error {
}
func validateRequest(ctx *Context, request *http.Request, route *MatchedRoute) *validation {
- debugLog("validating request %s %s", request.Method, request.URL.EscapedPath())
validate := &validation{
context: ctx,
request: request,
route: route,
bound: make(map[string]interface{}),
}
+ validate.debugLogf("validating request %s %s", request.Method, request.URL.EscapedPath())
validate.contentType()
if len(validate.result) == 0 {
@@ -76,8 +75,12 @@ func validateRequest(ctx *Context, request *http.Request, route *MatchedRoute) *
return validate
}
+func (v *validation) debugLogf(format string, args ...any) {
+ v.context.debugLogf(format, args...)
+}
+
func (v *validation) parameters() {
- debugLog("validating request parameters for %s %s", v.request.Method, v.request.URL.EscapedPath())
+ v.debugLogf("validating request parameters for %s %s", v.request.Method, v.request.URL.EscapedPath())
if result := v.route.Binder.Bind(v.request, v.route.Params, v.route.Consumer, v.bound); result != nil {
if result.Error() == "validation failure list" {
for _, e := range result.(*errors.Validation).Value.([]interface{}) {
@@ -91,7 +94,7 @@ func (v *validation) parameters() {
func (v *validation) contentType() {
if len(v.result) == 0 && runtime.HasBody(v.request) {
- debugLog("validating body content type for %s %s", v.request.Method, v.request.URL.EscapedPath())
+ v.debugLogf("validating body content type for %s %s", v.request.Method, v.request.URL.EscapedPath())
ct, _, req, err := v.context.ContentType(v.request)
if err != nil {
v.result = append(v.result, err)
@@ -100,6 +103,7 @@ func (v *validation) contentType() {
}
if len(v.result) == 0 {
+ v.debugLogf("validating content type for %q against [%s]", ct, strings.Join(v.route.Consumes, ", "))
if err := validateContentType(v.route.Consumes, ct); err != nil {
v.result = append(v.result, err)
}
diff --git a/vendor/github.com/go-openapi/runtime/request.go b/vendor/github.com/go-openapi/runtime/request.go
index 9e51b42b59d0..9e3e1ecb1480 100644
--- a/vendor/github.com/go-openapi/runtime/request.go
+++ b/vendor/github.com/go-openapi/runtime/request.go
@@ -16,6 +16,8 @@ package runtime
import (
"bufio"
+ "context"
+ "errors"
"io"
"net/http"
"strings"
@@ -48,7 +50,7 @@ func HasBody(r *http.Request) bool {
return true
}
- if r.Header.Get(http.CanonicalHeaderKey("content-length")) != "" {
+ if r.Header.Get("content-length") != "" {
// in this case, no Transfer-Encoding should be present
// we have a header set but it was explicitly set to 0, so we assume no body
return false
@@ -96,10 +98,16 @@ func (p *peekingReader) Read(d []byte) (int, error) {
if p == nil {
return 0, io.EOF
}
+ if p.underlying == nil {
+ return 0, io.ErrUnexpectedEOF
+ }
return p.underlying.Read(d)
}
func (p *peekingReader) Close() error {
+ if p.underlying == nil {
+ return errors.New("reader already closed")
+ }
p.underlying = nil
if p.orig != nil {
return p.orig.Close()
@@ -107,9 +115,11 @@ func (p *peekingReader) Close() error {
return nil
}
-// JSONRequest creates a new http request with json headers set
+// JSONRequest creates a new http request with json headers set.
+//
+// It uses context.Background.
func JSONRequest(method, urlStr string, body io.Reader) (*http.Request, error) {
- req, err := http.NewRequest(method, urlStr, body)
+ req, err := http.NewRequestWithContext(context.Background(), method, urlStr, body)
if err != nil {
return nil, err
}
diff --git a/vendor/github.com/go-openapi/runtime/security/authenticator.go b/vendor/github.com/go-openapi/runtime/security/authenticator.go
index 476d26c3e77b..bb30472bbeea 100644
--- a/vendor/github.com/go-openapi/runtime/security/authenticator.go
+++ b/vendor/github.com/go-openapi/runtime/security/authenticator.go
@@ -25,12 +25,13 @@ import (
)
const (
- query = "query"
- header = "header"
+ query = "query"
+ header = "header"
+ accessTokenParam = "access_token"
)
// HttpAuthenticator is a function that authenticates a HTTP request
-func HttpAuthenticator(handler func(*http.Request) (bool, interface{}, error)) runtime.Authenticator {
+func HttpAuthenticator(handler func(*http.Request) (bool, interface{}, error)) runtime.Authenticator { //nolint:revive,stylecheck
return runtime.AuthenticatorFunc(func(params interface{}) (bool, interface{}, error) {
if request, ok := params.(*http.Request); ok {
return handler(request)
@@ -158,7 +159,7 @@ func APIKeyAuth(name, in string, authenticate TokenAuthentication) runtime.Authe
inl := strings.ToLower(in)
if inl != query && inl != header {
// panic because this is most likely a typo
- panic(errors.New(500, "api key auth: in value needs to be either \"query\" or \"header\"."))
+ panic(errors.New(500, "api key auth: in value needs to be either \"query\" or \"header\""))
}
var getToken func(*http.Request) string
@@ -186,7 +187,7 @@ func APIKeyAuthCtx(name, in string, authenticate TokenAuthenticationCtx) runtime
inl := strings.ToLower(in)
if inl != query && inl != header {
// panic because this is most likely a typo
- panic(errors.New(500, "api key auth: in value needs to be either \"query\" or \"header\"."))
+ panic(errors.New(500, "api key auth: in value needs to be either \"query\" or \"header\""))
}
var getToken func(*http.Request) string
@@ -220,18 +221,18 @@ func BearerAuth(name string, authenticate ScopedTokenAuthentication) runtime.Aut
const prefix = "Bearer "
return ScopedAuthenticator(func(r *ScopedAuthRequest) (bool, interface{}, error) {
var token string
- hdr := r.Request.Header.Get("Authorization")
+ hdr := r.Request.Header.Get(runtime.HeaderAuthorization)
if strings.HasPrefix(hdr, prefix) {
token = strings.TrimPrefix(hdr, prefix)
}
if token == "" {
qs := r.Request.URL.Query()
- token = qs.Get("access_token")
+ token = qs.Get(accessTokenParam)
}
//#nosec
ct, _, _ := runtime.ContentType(r.Request.Header)
if token == "" && (ct == "application/x-www-form-urlencoded" || ct == "multipart/form-data") {
- token = r.Request.FormValue("access_token")
+ token = r.Request.FormValue(accessTokenParam)
}
if token == "" {
@@ -250,18 +251,18 @@ func BearerAuthCtx(name string, authenticate ScopedTokenAuthenticationCtx) runti
const prefix = "Bearer "
return ScopedAuthenticator(func(r *ScopedAuthRequest) (bool, interface{}, error) {
var token string
- hdr := r.Request.Header.Get("Authorization")
+ hdr := r.Request.Header.Get(runtime.HeaderAuthorization)
if strings.HasPrefix(hdr, prefix) {
token = strings.TrimPrefix(hdr, prefix)
}
if token == "" {
qs := r.Request.URL.Query()
- token = qs.Get("access_token")
+ token = qs.Get(accessTokenParam)
}
//#nosec
ct, _, _ := runtime.ContentType(r.Request.Header)
if token == "" && (ct == "application/x-www-form-urlencoded" || ct == "multipart/form-data") {
- token = r.Request.FormValue("access_token")
+ token = r.Request.FormValue(accessTokenParam)
}
if token == "" {
diff --git a/vendor/github.com/go-openapi/runtime/text.go b/vendor/github.com/go-openapi/runtime/text.go
index c7fd04c3c5c1..f33320b7dd53 100644
--- a/vendor/github.com/go-openapi/runtime/text.go
+++ b/vendor/github.com/go-openapi/runtime/text.go
@@ -41,7 +41,6 @@ func TextConsumer() Consumer {
// If the buffer is empty, no need to unmarshal it, which causes a panic.
if len(b) == 0 {
- data = ""
return nil
}
diff --git a/vendor/github.com/go-openapi/runtime/yamlpc/yaml.go b/vendor/github.com/go-openapi/runtime/yamlpc/yaml.go
index b30d37712633..a1a0a589dfa9 100644
--- a/vendor/github.com/go-openapi/runtime/yamlpc/yaml.go
+++ b/vendor/github.com/go-openapi/runtime/yamlpc/yaml.go
@@ -18,8 +18,7 @@ import (
"io"
"github.com/go-openapi/runtime"
-
- "gopkg.in/yaml.v2"
+ "gopkg.in/yaml.v3"
)
// YAMLConsumer creates a consumer for yaml data
diff --git a/vendor/github.com/go-openapi/swag/.codecov.yml b/vendor/github.com/go-openapi/swag/.codecov.yml
new file mode 100644
index 000000000000..3354f44b28e9
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/.codecov.yml
@@ -0,0 +1,4 @@
+ignore:
+ - jsonutils/fixtures_test
+ - jsonutils/adapters/ifaces/mocks
+ - jsonutils/adapters/testintegration/benchmarks
diff --git a/vendor/github.com/go-openapi/swag/.golangci.yml b/vendor/github.com/go-openapi/swag/.golangci.yml
index 80e2be0042f1..126264a6b898 100644
--- a/vendor/github.com/go-openapi/swag/.golangci.yml
+++ b/vendor/github.com/go-openapi/swag/.golangci.yml
@@ -1,60 +1,78 @@
-linters-settings:
- govet:
- check-shadowing: true
- golint:
- min-confidence: 0
- gocyclo:
- min-complexity: 45
- maligned:
- suggest-new: true
- dupl:
- threshold: 200
- goconst:
- min-len: 3
- min-occurrences: 3
-
+version: "2"
linters:
- enable-all: true
+ default: all
disable:
- - maligned
- - lll
- - gochecknoinits
- - gochecknoglobals
+ - cyclop
+ - depguard
+ - errchkjson
+ - errorlint
+ - exhaustruct
+ - forcetypeassert
- funlen
- - godox
+ - gochecknoglobals
+ - gochecknoinits
- gocognit
- - whitespace
- - wsl
- - wrapcheck
- - testpackage
- - nlreturn
- - gomnd
- - exhaustivestruct
- - goerr113
- - errorlint
- - nestif
- godot
- - gofumpt
+ - godox
+ - gomoddirectives
+ - gosmopolitan
+ - inamedparam
+ - intrange
+ - ireturn
+ - lll
+ - musttag
+ - modernize
+ - nestif
+ - nlreturn
+ - nonamedreturns
+ - noinlineerr
- paralleltest
- - tparallel
+ - recvcheck
+ - testpackage
- thelper
- - ifshort
- - exhaustruct
+ - tagliatelle
+ - tparallel
+ - unparam
- varnamelen
- - gci
- - depguard
- - errchkjson
- - inamedparam
- - nonamedreturns
- - musttag
- - ireturn
- - forcetypeassert
- - cyclop
- # deprecated linters
- - deadcode
- - interfacer
- - scopelint
- - varcheck
- - structcheck
- - golint
- - nosnakecase
+ - whitespace
+ - wrapcheck
+ - wsl
+ - wsl_v5
+ settings:
+ dupl:
+ threshold: 200
+ goconst:
+ min-len: 2
+ min-occurrences: 3
+ gocyclo:
+ min-complexity: 45
+ exclusions:
+ generated: lax
+ presets:
+ - comments
+ - common-false-positives
+ - legacy
+ - std-error-handling
+ paths:
+ - third_party$
+ - builtin$
+ - examples$
+formatters:
+ enable:
+ - gofmt
+ - goimports
+ exclusions:
+ generated: lax
+ paths:
+ - third_party$
+ - builtin$
+ - examples$
+issues:
+ # Maximum issues count per one linter.
+ # Set to 0 to disable.
+ # Default: 50
+ max-issues-per-linter: 0
+ # Maximum count of issues with the same text.
+ # Set to 0 to disable.
+ # Default: 3
+ max-same-issues: 0
diff --git a/vendor/github.com/go-openapi/swag/.mockery.yml b/vendor/github.com/go-openapi/swag/.mockery.yml
new file mode 100644
index 000000000000..8557cb58d331
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/.mockery.yml
@@ -0,0 +1,30 @@
+all: false
+dir: '{{.InterfaceDir}}'
+filename: mocks_test.go
+force-file-write: true
+formatter: goimports
+include-auto-generated: false
+log-level: info
+structname: '{{.Mock}}{{.InterfaceName}}'
+pkgname: '{{.SrcPackageName}}'
+recursive: false
+require-template-schema-exists: true
+template: matryer
+template-schema: '{{.Template}}.schema.json'
+packages:
+ github.com/go-openapi/swag/jsonutils/adapters/ifaces:
+ config:
+ dir: jsonutils/adapters/ifaces/mocks
+ filename: mocks.go
+ pkgname: 'mocks'
+ force-file-write: true
+ all: true
+ github.com/go-openapi/swag/jsonutils/adapters/testintegration:
+ config:
+ inpackage: true
+ dir: jsonutils/adapters/testintegration
+ force-file-write: true
+ all: true
+ interfaces:
+ EJMarshaler:
+ EJUnmarshaler:
diff --git a/vendor/github.com/go-openapi/swag/README.md b/vendor/github.com/go-openapi/swag/README.md
index a7292229980f..371fd55fdc36 100644
--- a/vendor/github.com/go-openapi/swag/README.md
+++ b/vendor/github.com/go-openapi/swag/README.md
@@ -1,23 +1,239 @@
# Swag [](https://github.com/go-openapi/swag/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/swag)
[](https://slackin.goswagger.io)
-[](https://raw.githubusercontent.com/go-openapi/swag/master/LICENSE)
+[](https://raw.githubusercontent.com/go-openapi/swag/master/LICENSE)
[](https://pkg.go.dev/github.com/go-openapi/swag)
[](https://goreportcard.com/report/github.com/go-openapi/swag)
-Contains a bunch of helper functions for go-openapi and go-swagger projects.
+Package `swag` contains a bunch of helper functions for go-openapi and go-swagger projects.
You may also use it standalone for your projects.
-* convert between value and pointers for builtin types
-* convert from string to builtin types (wraps strconv)
-* fast json concatenation
-* search in path
-* load from file or http
-* name mangling
+> **NOTE**
+> `swag` is one of the foundational building blocks of the go-openapi initiative.
+> Most repositories in `github.com/go-openapi/...` depend on it in some way.
+> And so does our CLI tool `github.com/go-swagger/go-swagger`,
+> as well as the code generated by this tool.
+* [Contents](#contents)
+* [Dependencies](#dependencies)
+* [Release Notes](#release-notes)
+* [Licensing](#licensing)
+* [Note to contributors](#note-to-contributors)
+* [TODOs, suggestions and plans](#todos-suggestions-and-plans)
-This repo has only few dependencies outside of the standard library:
+## Contents
-* YAML utilities depend on `gopkg.in/yaml.v3`
-* `github.com/mailru/easyjson v0.7.7`
+`go-openapi/swag` exposes a collection of relatively independent modules.
+
+Moving forward, no additional feature will be added to the `swag` API directly at the root package level,
+which remains there for backward-compatibility purposes. All exported top-level features are now deprecated.
+
+Child modules will continue to evolve and some new ones may be added in the future.
+
+| Module | Content | Main features |
+|---------------|---------|---------------|
+| `cmdutils` | utilities to work with CLIs ||
+| `conv` | type conversion utilities | convert between values and pointers for any types
convert from string to builtin types (wraps `strconv`)
require `./typeutils` (test dependency)
|
+| `fileutils` | file utilities | |
+| `jsonname` | JSON utilities | infer JSON names from `go` properties
|
+| `jsonutils` | JSON utilities | fast json concatenation
read and write JSON from and to dynamic `go` data structures
~require `github.com/mailru/easyjson`~
|
+| `loading` | file loading | load from file or http
require `./yamlutils`
|
+| `mangling` | safe name generation | name mangling for `go`
|
+| `netutils` | networking utilities | host, port from address
|
+| `stringutils` | `string` utilities | search in slice (with case-insensitive)
split/join query parameters as arrays
|
+| `typeutils` | `go` types utilities | check the zero value for any type
safe check for a nil value
|
+| `yamlutils` | YAML utilities | converting YAML to JSON
loading YAML into a dynamic YAML document
maintaining the original order of keys in YAML objects
require `./jsonutils`
~require `github.com/mailru/easyjson`~
require `go.yaml.in/yaml/v3`
|
+
+---
+
+## Dependencies
+
+The root module `github.com/go-openapi/swag` at the repo level maintains a few
+dependencies outside of the standard library.
+
+* YAML utilities depend on `go.yaml.in/yaml/v3`
+* JSON utilities depend on their registered adapter module:
+ * by default, only the standard library is used
+ * `github.com/mailru/easyjson` is now only a dependency for module
+ `github.com/go-openapi/swag/jsonutils/adapters/easyjson/json`,
+ for users willing to import that module.
+ * integration tests and benchmarks use all the dependencies are published as their own module
+* other dependencies are test dependencies drawn from `github.com/stretchr/testify`
+
+## Release notes
+
+### v0.25.4
+
+** mangling**
+
+Bug fix
+
+* [x] mangler may panic with pluralized overlapping initialisms
+
+Tests
+
+* [x] introduced fuzz tests
+
+### v0.25.3
+
+** mangling**
+
+Bug fix
+
+* [x] mangler may panic with pluralized initialisms
+
+### v0.25.2
+
+Minor changes due to internal maintenance that don't affect the behavior of the library.
+
+* [x] removed indirect test dependencies by switching all tests to `go-openapi/testify`,
+ a fork of `stretch/testify` with zero-dependencies.
+* [x] improvements to CI to catch test reports.
+* [x] modernized licensing annotations in source code, using the more compact SPDX annotations
+ rather than the full license terms.
+* [x] simplified a bit JSON & YAML testing by using newly available assertions
+* started the journey to an OpenSSF score card badge:
+ * [x] explicited permissions in CI workflows
+ * [x] published security policy
+ * pinned dependencies to github actions
+ * introduced fuzzing in tests
+
+### v0.25.1
+
+* fixes a data race that could occur when using the standard library implementation of a JSON ordered map
+
+### v0.25.0
+
+**New with this release**:
+
+* requires `go1.24`, as iterators are being introduced
+* removes the dependency to `mailru/easyjson` by default (#68)
+ * functionality remains the same, but performance may somewhat degrade for applications
+ that relied on `easyjson`
+ * users of the JSON or YAML utilities who want to use `easyjson` as their preferred JSON serializer library
+ will be able to do so by registering this the corresponding JSON adapter at runtime. See below.
+ * ordered keys in JSON and YAML objects: this feature used to rely solely on `easyjson`.
+ With this release, an implementation relying on the standard `encoding/json` is provided.
+ * an independent [benchmark](./jsonutils/adapters/testintegration/benchmarks/README.md) to compare the different adapters
+* improves the "float is integer" check (`conv.IsFloat64AJSONInteger`) (#59)
+* removes the _direct_ dependency to `gopkg.in/yaml.v3` (indirect dependency is still incurred through `stretchr/testify`) (#127)
+* exposed `conv.IsNil()` (previously kept private): a safe nil check (accounting for the "non-nil interface with nil value" nonsensical go trick)
+
+**What coming next?**
+
+Moving forward, we want to :
+* provide an implementation of the JSON adapter based on `encoding/json/v2`, for `go1.25` builds.
+* provide similar implementations for `goccy/go-json` and `jsoniterator/go`, and perhaps some other
+ similar libraries may be interesting too.
+
+
+**How to explicitly register a dependency at runtime**?
+
+The following would maintain how JSON utilities proposed by `swag` used work, up to `v0.24.1`.
+
+ ```go
+ import (
+ "github.com/go-openapi/swag/jsonutils/adapters"
+ easyjson "github.com/go-openapi/swag/jsonutils/adapters/easyjson/json"
+ )
+
+ func init() {
+ easyjson.Register(adapters.Registry)
+ }
+ ```
+
+Subsequent calls to `jsonutils.ReadJSON()` or `jsonutils.WriteJSON()` will switch to `easyjson`
+whenever the passed data structures implement the `easyjson.Unmarshaler` or `easyjson.Marshaler` respectively,
+or fallback to the standard library.
+
+For more details, you may also look at our
+[integration tests](jsonutils/adapters/testintegration/integration_suite_test.go#29).
+
+### v0.24.0
+
+With this release, we have largely modernized the API of `swag`:
+
+* The traditional `swag` API is still supported: code that imports `swag` will still
+ compile and work the same.
+* A deprecation notice is published to encourage consumers of this library to adopt
+ the newer API
+* **Deprecation notice**
+ * configuration through global variables is now deprecated, in favor of options passed as parameters
+ * all helper functions are moved to more specialized packages, which are exposed as
+ go modules. Importing such a module would reduce the footprint of dependencies.
+ * _all_ functions, variables, constants exposed by the deprecated API have now moved, so
+ that consumers of the new API no longer need to import github.com/go-openapi/swag, but
+ should import the desired sub-module(s).
+
+**New with this release**:
+
+* [x] type converters and pointer to value helpers now support generic types
+* [x] name mangling now support pluralized initialisms (issue #46)
+ Strings like "contact IDs" are now recognized as such a plural form and mangled as a linter would expect.
+* [x] performance: small improvements to reduce the overhead of convert/format wrappers (see issues #110, or PR #108)
+* [x] performance: name mangling utilities run ~ 10% faster (PR #115)
+
+---
+
+## Licensing
+
+This library ships under the [SPDX-License-Identifier: Apache-2.0](./LICENSE).
+
+## Note to contributors
+
+A mono-repo structure comes with some unavoidable extra pains...
+
+* Testing
+
+> The usual `go test ./...` command, run from the root of this repo won't work any longer to test all submodules.
+>
+> Each module constitutes an independant unit of test. So you have to run `go test` inside each module.
+> Or you may take a look at how this is achieved by CI
+> [here] https://github.com/go-openapi/swag/blob/master/.github/workflows/go-test.yml).
+>
+> There are also some alternative tricks using `go work`, for local development, if you feel comfortable with
+> go workspaces. Perhaps some day, we'll have a `go work test` to run all tests without any hack.
+
+* Releasing
+
+> Each module follows its own independant module versioning.
+>
+> So you have tags like `mangling/v0.24.0`, `fileutils/v0.24.0` etc that are used by `go mod` and `go get`
+> to refer to the tagged version of each module specifically.
+>
+> This means we may release patches etc to each module independently.
+>
+> We'd like to adopt the rule that modules in this repo would only differ by a patch version
+> (e.g. `v0.24.5` vs `v0.24.3`), and we'll level all modules whenever a minor version is introduced.
+>
+> A script in `./hack` is provided to tag all modules with the same version in one go.
+
+* Continuous integration
+
+> At this moment, all tests in all modules are systematically run over the full test matrix (3 platform x 2 go releases).
+> This generates quite a lot of jobs.
+>
+> We ought to reduce the number of jobs required to test a PR focused on only a few modules.
+
+## Todos, suggestions and plans
+
+All kinds of contributions are welcome.
+
+A few ideas:
+
+* [x] Complete the split of dependencies to isolate easyjson from the rest
+* [x] Improve CI to reduce needed tests
+* [x] Replace dependency to `gopkg.in/yaml.v3` (`yamlutil`)
+* [ ] Improve mangling utilities (improve readability, support for capitalized words,
+ better word substitution for non-letter symbols...)
+* [ ] Move back to this common shared pot a few of the technical features introduced by go-swagger independently
+ (e.g. mangle go package names, search package with go modules support, ...)
+* [ ] Apply a similar mono-repo approach to go-openapi/strfmt which suffer from similar woes: bloated API,
+ imposed dependency to some database driver.
+* [ ] Adapt `go-swagger` (incl. generated code) to the new `swag` API.
+* [ ] Factorize some tests, as there is a lot of redundant testing code in `jsonutils`
+* [ ] Benchmark & profiling: publish independently the tool built to analyze and chart benchmarks (e.g. similar to `benchvisual`)
+* [ ] more thorough testing for nil / null case
+* [ ] ci pipeline to manage releases
+* [ ] cleaner mockery generation (doesn't work out of the box for all sub-modules)
diff --git a/vendor/github.com/go-openapi/swag/SECURITY.md b/vendor/github.com/go-openapi/swag/SECURITY.md
new file mode 100644
index 000000000000..72296a83135d
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/SECURITY.md
@@ -0,0 +1,19 @@
+# Security Policy
+
+This policy outlines the commitment and practices of the go-openapi maintainers regarding security.
+
+## Supported Versions
+
+| Version | Supported |
+| ------- | ------------------ |
+| 0.25.x | :white_check_mark: |
+
+## Reporting a vulnerability
+
+If you become aware of a security vulnerability that affects the current repository,
+please report it privately to the maintainers.
+
+Please follow the instructions provided by github to
+[Privately report a security vulnerability](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability).
+
+TL;DR: on Github, navigate to the project's "Security" tab then click on "Report a vulnerability".
diff --git a/vendor/github.com/google/shlex/COPYING b/vendor/github.com/go-openapi/swag/cmdutils/LICENSE
similarity index 100%
rename from vendor/github.com/google/shlex/COPYING
rename to vendor/github.com/go-openapi/swag/cmdutils/LICENSE
diff --git a/vendor/github.com/go-openapi/swag/cmdutils/cmd_utils.go b/vendor/github.com/go-openapi/swag/cmdutils/cmd_utils.go
new file mode 100644
index 000000000000..6c7bbb26f03d
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/cmdutils/cmd_utils.go
@@ -0,0 +1,13 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package cmdutils
+
+// CommandLineOptionsGroup represents a group of user-defined command line options.
+//
+// This is for instance used to configure command line arguments in API servers generated by go-swagger.
+type CommandLineOptionsGroup struct {
+ ShortDescription string
+ LongDescription string
+ Options any
+}
diff --git a/vendor/github.com/go-openapi/swag/cmdutils/doc.go b/vendor/github.com/go-openapi/swag/cmdutils/doc.go
new file mode 100644
index 000000000000..31f2c37538a0
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/cmdutils/doc.go
@@ -0,0 +1,5 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+// Package cmdutils brings helpers for CLIs produced by go-openapi
+package cmdutils
diff --git a/vendor/github.com/go-openapi/swag/cmdutils_iface.go b/vendor/github.com/go-openapi/swag/cmdutils_iface.go
new file mode 100644
index 000000000000..bd0c1fc12802
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/cmdutils_iface.go
@@ -0,0 +1,11 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package swag
+
+import "github.com/go-openapi/swag/cmdutils"
+
+// CommandLineOptionsGroup represents a group of user-defined command line options.
+//
+// Deprecated: use [cmdutils.CommandLineOptionsGroup] instead.
+type CommandLineOptionsGroup = cmdutils.CommandLineOptionsGroup
diff --git a/vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/LICENSE b/vendor/github.com/go-openapi/swag/conv/LICENSE
similarity index 99%
rename from vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/LICENSE
rename to vendor/github.com/go-openapi/swag/conv/LICENSE
index 261eeb9e9f8b..d64569567334 100644
--- a/vendor/github.com/metal3-io/baremetal-operator/pkg/hardwareutils/LICENSE
+++ b/vendor/github.com/go-openapi/swag/conv/LICENSE
@@ -1,3 +1,4 @@
+
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
diff --git a/vendor/github.com/go-openapi/swag/conv/convert.go b/vendor/github.com/go-openapi/swag/conv/convert.go
new file mode 100644
index 000000000000..f205c3913457
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/conv/convert.go
@@ -0,0 +1,161 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package conv
+
+import (
+ "math"
+ "strconv"
+ "strings"
+)
+
+// same as ECMA Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER
+const (
+ maxJSONFloat = float64(1<<53 - 1) // 9007199254740991.0 2^53 - 1
+ minJSONFloat = -float64(1<<53 - 1) //-9007199254740991.0 -2^53 - 1
+ epsilon float64 = 1e-9
+)
+
+// IsFloat64AJSONInteger allows for integers [-2^53, 2^53-1] inclusive.
+func IsFloat64AJSONInteger(f float64) bool {
+ if math.IsNaN(f) || math.IsInf(f, 0) || f < minJSONFloat || f > maxJSONFloat {
+ return false
+ }
+ rounded := math.Round(f)
+ if f == rounded {
+ return true
+ }
+ if rounded == 0 { // f = 0.0 exited above
+ return false
+ }
+
+ diff := math.Abs(f - rounded)
+ if diff == 0 {
+ return true
+ }
+
+ // relative error Abs{f - Round(f)) / Round(f)} < ε ; Round(f)
+ return diff < epsilon*math.Abs(rounded)
+}
+
+// ConvertFloat turns a string into a float numerical value.
+func ConvertFloat[T Float](str string) (T, error) {
+ var v T
+ f, err := strconv.ParseFloat(str, bitsize(v))
+ if err != nil {
+ return 0, err
+ }
+
+ return T(f), nil
+}
+
+// ConvertInteger turns a string into a signed integer.
+func ConvertInteger[T Signed](str string) (T, error) {
+ var v T
+ f, err := strconv.ParseInt(str, 10, bitsize(v))
+ if err != nil {
+ return 0, err
+ }
+
+ return T(f), nil
+}
+
+// ConvertUinteger turns a string into an unsigned integer.
+func ConvertUinteger[T Unsigned](str string) (T, error) {
+ var v T
+ f, err := strconv.ParseUint(str, 10, bitsize(v))
+ if err != nil {
+ return 0, err
+ }
+
+ return T(f), nil
+}
+
+// ConvertBool turns a string into a boolean.
+//
+// It supports a few more "true" strings than [strconv.ParseBool]:
+//
+// - it is not case sensitive ("trUe" or "FalsE" work)
+// - "ok", "yes", "y", "on", "selected", "checked", "enabled" are all true
+// - everything that is not true is false: there is never an actual error returned
+func ConvertBool(str string) (bool, error) {
+ switch strings.ToLower(str) {
+ case "true",
+ "1",
+ "yes",
+ "ok",
+ "y",
+ "on",
+ "selected",
+ "checked",
+ "t",
+ "enabled":
+ return true, nil
+ default:
+ return false, nil
+ }
+}
+
+// ConvertFloat32 turns a string into a float32.
+func ConvertFloat32(str string) (float32, error) { return ConvertFloat[float32](str) }
+
+// ConvertFloat64 turns a string into a float64
+func ConvertFloat64(str string) (float64, error) { return ConvertFloat[float64](str) }
+
+// ConvertInt8 turns a string into an int8
+func ConvertInt8(str string) (int8, error) { return ConvertInteger[int8](str) }
+
+// ConvertInt16 turns a string into an int16
+func ConvertInt16(str string) (int16, error) {
+ i, err := strconv.ParseInt(str, 10, 16)
+ if err != nil {
+ return 0, err
+ }
+ return int16(i), nil
+}
+
+// ConvertInt32 turns a string into an int32
+func ConvertInt32(str string) (int32, error) {
+ i, err := strconv.ParseInt(str, 10, 32)
+ if err != nil {
+ return 0, err
+ }
+ return int32(i), nil
+}
+
+// ConvertInt64 turns a string into an int64
+func ConvertInt64(str string) (int64, error) {
+ return strconv.ParseInt(str, 10, 64)
+}
+
+// ConvertUint8 turns a string into an uint8
+func ConvertUint8(str string) (uint8, error) {
+ i, err := strconv.ParseUint(str, 10, 8)
+ if err != nil {
+ return 0, err
+ }
+ return uint8(i), nil
+}
+
+// ConvertUint16 turns a string into an uint16
+func ConvertUint16(str string) (uint16, error) {
+ i, err := strconv.ParseUint(str, 10, 16)
+ if err != nil {
+ return 0, err
+ }
+ return uint16(i), nil
+}
+
+// ConvertUint32 turns a string into an uint32
+func ConvertUint32(str string) (uint32, error) {
+ i, err := strconv.ParseUint(str, 10, 32)
+ if err != nil {
+ return 0, err
+ }
+ return uint32(i), nil
+}
+
+// ConvertUint64 turns a string into an uint64
+func ConvertUint64(str string) (uint64, error) {
+ return strconv.ParseUint(str, 10, 64)
+}
diff --git a/vendor/github.com/go-openapi/swag/conv/convert_types.go b/vendor/github.com/go-openapi/swag/conv/convert_types.go
new file mode 100644
index 000000000000..cf4c6495ebc9
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/conv/convert_types.go
@@ -0,0 +1,72 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package conv
+
+// Unlicensed credits (idea, concept)
+//
+// The idea to convert values to pointers and the other way around, was inspired, eons ago, by the aws go sdk.
+//
+// Nowadays, all sensible API sdk's expose a similar functionality.
+
+// Pointer returns a pointer to the value passed in.
+func Pointer[T any](v T) *T {
+ return &v
+}
+
+// Value returns a shallow copy of the value of the pointer passed in.
+//
+// If the pointer is nil, the returned value is the zero value.
+func Value[T any](v *T) T {
+ if v != nil {
+ return *v
+ }
+
+ var zero T
+ return zero
+}
+
+// PointerSlice converts a slice of values into a slice of pointers.
+func PointerSlice[T any](src []T) []*T {
+ dst := make([]*T, len(src))
+ for i := 0; i < len(src); i++ {
+ dst[i] = &(src[i])
+ }
+ return dst
+}
+
+// ValueSlice converts a slice of pointers into a slice of values.
+//
+// nil elements are zero values.
+func ValueSlice[T any](src []*T) []T {
+ dst := make([]T, len(src))
+ for i := 0; i < len(src); i++ {
+ if src[i] != nil {
+ dst[i] = *(src[i])
+ }
+ }
+ return dst
+}
+
+// PointerMap converts a map of values into a map of pointers.
+func PointerMap[K comparable, T any](src map[K]T) map[K]*T {
+ dst := make(map[K]*T)
+ for k, val := range src {
+ v := val
+ dst[k] = &v
+ }
+ return dst
+}
+
+// ValueMap converts a map of pointers into a map of values.
+//
+// nil elements are skipped.
+func ValueMap[K comparable, T any](src map[K]*T) map[K]T {
+ dst := make(map[K]T)
+ for k, val := range src {
+ if val != nil {
+ dst[k] = *val
+ }
+ }
+ return dst
+}
diff --git a/vendor/github.com/go-openapi/swag/conv/doc.go b/vendor/github.com/go-openapi/swag/conv/doc.go
new file mode 100644
index 000000000000..1bd6ead6e2d1
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/conv/doc.go
@@ -0,0 +1,15 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+// Package conv exposes utilities to convert types.
+//
+// The Convert and Format families of functions are essentially a shorthand to [strconv] functions,
+// using the decimal representation of numbers.
+//
+// Features:
+//
+// - from string representation to value ("Convert*") and reciprocally ("Format*")
+// - from pointer to value ([Value]) and reciprocally ([Pointer])
+// - from slice of values to slice of pointers ([PointerSlice]) and reciprocally ([ValueSlice])
+// - from map of values to map of pointers ([PointerMap]) and reciprocally ([ValueMap])
+package conv
diff --git a/vendor/github.com/go-openapi/swag/conv/format.go b/vendor/github.com/go-openapi/swag/conv/format.go
new file mode 100644
index 000000000000..5b87b8e146bb
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/conv/format.go
@@ -0,0 +1,28 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package conv
+
+import (
+ "strconv"
+)
+
+// FormatInteger turns an integer type into a string.
+func FormatInteger[T Signed](value T) string {
+ return strconv.FormatInt(int64(value), 10)
+}
+
+// FormatUinteger turns an unsigned integer type into a string.
+func FormatUinteger[T Unsigned](value T) string {
+ return strconv.FormatUint(uint64(value), 10)
+}
+
+// FormatFloat turns a floating point numerical value into a string.
+func FormatFloat[T Float](value T) string {
+ return strconv.FormatFloat(float64(value), 'f', -1, bitsize(value))
+}
+
+// FormatBool turns a boolean into a string.
+func FormatBool(value bool) string {
+ return strconv.FormatBool(value)
+}
diff --git a/vendor/github.com/go-openapi/swag/conv/sizeof.go b/vendor/github.com/go-openapi/swag/conv/sizeof.go
new file mode 100644
index 000000000000..494346557381
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/conv/sizeof.go
@@ -0,0 +1,20 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package conv
+
+import "unsafe"
+
+// bitsize returns the size in bits of a type.
+//
+// NOTE: [unsafe.SizeOf] simply returns the size in bytes of the value.
+// For primitive types T, the generic stencil is precompiled and this value
+// is resolved at compile time, resulting in an immediate call to [strconv.ParseFloat].
+//
+// We may leave up to the go compiler to simplify this function into a
+// constant value, which happens in practice at least for primitive types
+// (e.g. numerical types).
+func bitsize[T Numerical](value T) int {
+ const bitsPerByte = 8
+ return int(unsafe.Sizeof(value)) * bitsPerByte
+}
diff --git a/vendor/github.com/go-openapi/swag/conv/type_constraints.go b/vendor/github.com/go-openapi/swag/conv/type_constraints.go
new file mode 100644
index 000000000000..81135e827e52
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/conv/type_constraints.go
@@ -0,0 +1,29 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package conv
+
+type (
+ // these type constraints are redefined after golang.org/x/exp/constraints,
+ // because importing that package causes an undesired go upgrade.
+
+ // Signed integer types, cf. [golang.org/x/exp/constraints.Signed]
+ Signed interface {
+ ~int | ~int8 | ~int16 | ~int32 | ~int64
+ }
+
+ // Unsigned integer types, cf. [golang.org/x/exp/constraints.Unsigned]
+ Unsigned interface {
+ ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
+ }
+
+ // Float numerical types, cf. [golang.org/x/exp/constraints.Float]
+ Float interface {
+ ~float32 | ~float64
+ }
+
+ // Numerical types
+ Numerical interface {
+ Signed | Unsigned | Float
+ }
+)
diff --git a/vendor/github.com/go-openapi/swag/conv_iface.go b/vendor/github.com/go-openapi/swag/conv_iface.go
new file mode 100644
index 000000000000..eea7b2e56e33
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/conv_iface.go
@@ -0,0 +1,486 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package swag
+
+import (
+ "time"
+
+ "github.com/go-openapi/swag/conv"
+)
+
+// IsFloat64AJSONInteger allows for integers [-2^53, 2^53-1] inclusive.
+//
+// Deprecated: use [conv.IsFloat64AJSONInteger] instead.
+func IsFloat64AJSONInteger(f float64) bool { return conv.IsFloat64AJSONInteger(f) }
+
+// ConvertBool turns a string into a boolean.
+//
+// Deprecated: use [conv.ConvertBool] instead.
+func ConvertBool(str string) (bool, error) { return conv.ConvertBool(str) }
+
+// ConvertFloat32 turns a string into a float32.
+//
+// Deprecated: use [conv.ConvertFloat32] instead. Alternatively, you may use the generic version [conv.ConvertFloat].
+func ConvertFloat32(str string) (float32, error) { return conv.ConvertFloat[float32](str) }
+
+// ConvertFloat64 turns a string into a float64.
+//
+// Deprecated: use [conv.ConvertFloat64] instead. Alternatively, you may use the generic version [conv.ConvertFloat].
+func ConvertFloat64(str string) (float64, error) { return conv.ConvertFloat[float64](str) }
+
+// ConvertInt8 turns a string into an int8.
+//
+// Deprecated: use [conv.ConvertInt8] instead. Alternatively, you may use the generic version [conv.ConvertInteger].
+func ConvertInt8(str string) (int8, error) { return conv.ConvertInteger[int8](str) }
+
+// ConvertInt16 turns a string into an int16.
+//
+// Deprecated: use [conv.ConvertInt16] instead. Alternatively, you may use the generic version [conv.ConvertInteger].
+func ConvertInt16(str string) (int16, error) { return conv.ConvertInteger[int16](str) }
+
+// ConvertInt32 turns a string into an int32.
+//
+// Deprecated: use [conv.ConvertInt32] instead. Alternatively, you may use the generic version [conv.ConvertInteger].
+func ConvertInt32(str string) (int32, error) { return conv.ConvertInteger[int32](str) }
+
+// ConvertInt64 turns a string into an int64.
+//
+// Deprecated: use [conv.ConvertInt64] instead. Alternatively, you may use the generic version [conv.ConvertInteger].
+func ConvertInt64(str string) (int64, error) { return conv.ConvertInteger[int64](str) }
+
+// ConvertUint8 turns a string into an uint8.
+//
+// Deprecated: use [conv.ConvertUint8] instead. Alternatively, you may use the generic version [conv.ConvertUinteger].
+func ConvertUint8(str string) (uint8, error) { return conv.ConvertUinteger[uint8](str) }
+
+// ConvertUint16 turns a string into an uint16.
+//
+// Deprecated: use [conv.ConvertUint16] instead. Alternatively, you may use the generic version [conv.ConvertUinteger].
+func ConvertUint16(str string) (uint16, error) { return conv.ConvertUinteger[uint16](str) }
+
+// ConvertUint32 turns a string into an uint32.
+//
+// Deprecated: use [conv.ConvertUint32] instead. Alternatively, you may use the generic version [conv.ConvertUinteger].
+func ConvertUint32(str string) (uint32, error) { return conv.ConvertUinteger[uint32](str) }
+
+// ConvertUint64 turns a string into an uint64.
+//
+// Deprecated: use [conv.ConvertUint64] instead. Alternatively, you may use the generic version [conv.ConvertUinteger].
+func ConvertUint64(str string) (uint64, error) { return conv.ConvertUinteger[uint64](str) }
+
+// FormatBool turns a boolean into a string.
+//
+// Deprecated: use [conv.FormatBool] instead.
+func FormatBool(value bool) string { return conv.FormatBool(value) }
+
+// FormatFloat32 turns a float32 into a string.
+//
+// Deprecated: use [conv.FormatFloat] instead.
+func FormatFloat32(value float32) string { return conv.FormatFloat(value) }
+
+// FormatFloat64 turns a float64 into a string.
+//
+// Deprecated: use [conv.FormatFloat] instead.
+func FormatFloat64(value float64) string { return conv.FormatFloat(value) }
+
+// FormatInt8 turns an int8 into a string.
+//
+// Deprecated: use [conv.FormatInteger] instead.
+func FormatInt8(value int8) string { return conv.FormatInteger(value) }
+
+// FormatInt16 turns an int16 into a string.
+//
+// Deprecated: use [conv.FormatInteger] instead.
+func FormatInt16(value int16) string { return conv.FormatInteger(value) }
+
+// FormatInt32 turns an int32 into a string
+//
+// Deprecated: use [conv.FormatInteger] instead.
+func FormatInt32(value int32) string { return conv.FormatInteger(value) }
+
+// FormatInt64 turns an int64 into a string.
+//
+// Deprecated: use [conv.FormatInteger] instead.
+func FormatInt64(value int64) string { return conv.FormatInteger(value) }
+
+// FormatUint8 turns an uint8 into a string.
+//
+// Deprecated: use [conv.FormatUinteger] instead.
+func FormatUint8(value uint8) string { return conv.FormatUinteger(value) }
+
+// FormatUint16 turns an uint16 into a string.
+//
+// Deprecated: use [conv.FormatUinteger] instead.
+func FormatUint16(value uint16) string { return conv.FormatUinteger(value) }
+
+// FormatUint32 turns an uint32 into a string.
+//
+// Deprecated: use [conv.FormatUinteger] instead.
+func FormatUint32(value uint32) string { return conv.FormatUinteger(value) }
+
+// FormatUint64 turns an uint64 into a string.
+//
+// Deprecated: use [conv.FormatUinteger] instead.
+func FormatUint64(value uint64) string { return conv.FormatUinteger(value) }
+
+// String turn a pointer to of the string value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func String(v string) *string { return conv.Pointer(v) }
+
+// StringValue turn the value of the string pointer passed in or
+// "" if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func StringValue(v *string) string { return conv.Value(v) }
+
+// StringSlice converts a slice of string values into a slice of string pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func StringSlice(src []string) []*string { return conv.PointerSlice(src) }
+
+// StringValueSlice converts a slice of string pointers into a slice of string values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func StringValueSlice(src []*string) []string { return conv.ValueSlice(src) }
+
+// StringMap converts a string map of string values into a string map of string pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func StringMap(src map[string]string) map[string]*string { return conv.PointerMap(src) }
+
+// StringValueMap converts a string map of string pointers into a string map of string values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func StringValueMap(src map[string]*string) map[string]string { return conv.ValueMap(src) }
+
+// Bool turn a pointer to of the bool value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Bool(v bool) *bool { return conv.Pointer(v) }
+
+// BoolValue turn the value of the bool pointer passed in or false if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func BoolValue(v *bool) bool { return conv.Value(v) }
+
+// BoolSlice converts a slice of bool values into a slice of bool pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func BoolSlice(src []bool) []*bool { return conv.PointerSlice(src) }
+
+// BoolValueSlice converts a slice of bool pointers into a slice of bool values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func BoolValueSlice(src []*bool) []bool { return conv.ValueSlice(src) }
+
+// BoolMap converts a string map of bool values into a string map of bool pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func BoolMap(src map[string]bool) map[string]*bool { return conv.PointerMap(src) }
+
+// BoolValueMap converts a string map of bool pointers into a string map of bool values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func BoolValueMap(src map[string]*bool) map[string]bool { return conv.ValueMap(src) }
+
+// Int turn a pointer to of the int value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Int(v int) *int { return conv.Pointer(v) }
+
+// IntValue turn the value of the int pointer passed in or 0 if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func IntValue(v *int) int { return conv.Value(v) }
+
+// IntSlice converts a slice of int values into a slice of int pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func IntSlice(src []int) []*int { return conv.PointerSlice(src) }
+
+// IntValueSlice converts a slice of int pointers into a slice of int values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func IntValueSlice(src []*int) []int { return conv.ValueSlice(src) }
+
+// IntMap converts a string map of int values into a string map of int pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func IntMap(src map[string]int) map[string]*int { return conv.PointerMap(src) }
+
+// IntValueMap converts a string map of int pointers into a string map of int values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func IntValueMap(src map[string]*int) map[string]int { return conv.ValueMap(src) }
+
+// Int32 turn a pointer to of the int32 value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Int32(v int32) *int32 { return conv.Pointer(v) }
+
+// Int32Value turn the value of the int32 pointer passed in or 0 if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func Int32Value(v *int32) int32 { return conv.Value(v) }
+
+// Int32Slice converts a slice of int32 values into a slice of int32 pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func Int32Slice(src []int32) []*int32 { return conv.PointerSlice(src) }
+
+// Int32ValueSlice converts a slice of int32 pointers into a slice of int32 values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func Int32ValueSlice(src []*int32) []int32 { return conv.ValueSlice(src) }
+
+// Int32Map converts a string map of int32 values into a string map of int32 pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func Int32Map(src map[string]int32) map[string]*int32 { return conv.PointerMap(src) }
+
+// Int32ValueMap converts a string map of int32 pointers into a string map of int32 values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func Int32ValueMap(src map[string]*int32) map[string]int32 { return conv.ValueMap(src) }
+
+// Int64 turn a pointer to of the int64 value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Int64(v int64) *int64 { return conv.Pointer(v) }
+
+// Int64Value turn the value of the int64 pointer passed in or 0 if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func Int64Value(v *int64) int64 { return conv.Value(v) }
+
+// Int64Slice converts a slice of int64 values into a slice of int64 pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func Int64Slice(src []int64) []*int64 { return conv.PointerSlice(src) }
+
+// Int64ValueSlice converts a slice of int64 pointers into a slice of int64 values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func Int64ValueSlice(src []*int64) []int64 { return conv.ValueSlice(src) }
+
+// Int64Map converts a string map of int64 values into a string map of int64 pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func Int64Map(src map[string]int64) map[string]*int64 { return conv.PointerMap(src) }
+
+// Int64ValueMap converts a string map of int64 pointers into a string map of int64 values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func Int64ValueMap(src map[string]*int64) map[string]int64 { return conv.ValueMap(src) }
+
+// Uint16 turn a pointer to of the uint16 value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Uint16(v uint16) *uint16 { return conv.Pointer(v) }
+
+// Uint16Value turn the value of the uint16 pointer passed in or 0 if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func Uint16Value(v *uint16) uint16 { return conv.Value(v) }
+
+// Uint16Slice converts a slice of uint16 values into a slice of uint16 pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func Uint16Slice(src []uint16) []*uint16 { return conv.PointerSlice(src) }
+
+// Uint16ValueSlice converts a slice of uint16 pointers into a slice of uint16 values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func Uint16ValueSlice(src []*uint16) []uint16 { return conv.ValueSlice(src) }
+
+// Uint16Map converts a string map of uint16 values into a string map of uint16 pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func Uint16Map(src map[string]uint16) map[string]*uint16 { return conv.PointerMap(src) }
+
+// Uint16ValueMap converts a string map of uint16 pointers into a string map of uint16 values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func Uint16ValueMap(src map[string]*uint16) map[string]uint16 { return conv.ValueMap(src) }
+
+// Uint turn a pointer to of the uint value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Uint(v uint) *uint { return conv.Pointer(v) }
+
+// UintValue turn the value of the uint pointer passed in or 0 if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func UintValue(v *uint) uint { return conv.Value(v) }
+
+// UintSlice converts a slice of uint values into a slice of uint pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func UintSlice(src []uint) []*uint { return conv.PointerSlice(src) }
+
+// UintValueSlice converts a slice of uint pointers into a slice of uint values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func UintValueSlice(src []*uint) []uint { return conv.ValueSlice(src) }
+
+// UintMap converts a string map of uint values into a string map of uint pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func UintMap(src map[string]uint) map[string]*uint { return conv.PointerMap(src) }
+
+// UintValueMap converts a string map of uint pointers into a string map of uint values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func UintValueMap(src map[string]*uint) map[string]uint { return conv.ValueMap(src) }
+
+// Uint32 turn a pointer to of the uint32 value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Uint32(v uint32) *uint32 { return conv.Pointer(v) }
+
+// Uint32Value turn the value of the uint32 pointer passed in or 0 if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func Uint32Value(v *uint32) uint32 { return conv.Value(v) }
+
+// Uint32Slice converts a slice of uint32 values into a slice of uint32 pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func Uint32Slice(src []uint32) []*uint32 { return conv.PointerSlice(src) }
+
+// Uint32ValueSlice converts a slice of uint32 pointers into a slice of uint32 values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func Uint32ValueSlice(src []*uint32) []uint32 { return conv.ValueSlice(src) }
+
+// Uint32Map converts a string map of uint32 values into a string map of uint32 pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func Uint32Map(src map[string]uint32) map[string]*uint32 { return conv.PointerMap(src) }
+
+// Uint32ValueMap converts a string map of uint32 pointers into a string map of uint32 values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func Uint32ValueMap(src map[string]*uint32) map[string]uint32 { return conv.ValueMap(src) }
+
+// Uint64 turn a pointer to of the uint64 value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Uint64(v uint64) *uint64 { return conv.Pointer(v) }
+
+// Uint64Value turn the value of the uint64 pointer passed in or 0 if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func Uint64Value(v *uint64) uint64 { return conv.Value(v) }
+
+// Uint64Slice converts a slice of uint64 values into a slice of uint64 pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func Uint64Slice(src []uint64) []*uint64 { return conv.PointerSlice(src) }
+
+// Uint64ValueSlice converts a slice of uint64 pointers into a slice of uint64 values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func Uint64ValueSlice(src []*uint64) []uint64 { return conv.ValueSlice(src) }
+
+// Uint64Map converts a string map of uint64 values into a string map of uint64 pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func Uint64Map(src map[string]uint64) map[string]*uint64 { return conv.PointerMap(src) }
+
+// Uint64ValueMap converts a string map of uint64 pointers into a string map of uint64 values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func Uint64ValueMap(src map[string]*uint64) map[string]uint64 { return conv.ValueMap(src) }
+
+// Float32 turn a pointer to of the float32 value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Float32(v float32) *float32 { return conv.Pointer(v) }
+
+// Float32Value turn the value of the float32 pointer passed in or 0 if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func Float32Value(v *float32) float32 { return conv.Value(v) }
+
+// Float32Slice converts a slice of float32 values into a slice of float32 pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func Float32Slice(src []float32) []*float32 { return conv.PointerSlice(src) }
+
+// Float32ValueSlice converts a slice of float32 pointers into a slice of float32 values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func Float32ValueSlice(src []*float32) []float32 { return conv.ValueSlice(src) }
+
+// Float32Map converts a string map of float32 values into a string map of float32 pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func Float32Map(src map[string]float32) map[string]*float32 { return conv.PointerMap(src) }
+
+// Float32ValueMap converts a string map of float32 pointers into a string map of float32 values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func Float32ValueMap(src map[string]*float32) map[string]float32 { return conv.ValueMap(src) }
+
+// Float64 turn a pointer to of the float64 value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Float64(v float64) *float64 { return conv.Pointer(v) }
+
+// Float64Value turn the value of the float64 pointer passed in or 0 if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func Float64Value(v *float64) float64 { return conv.Value(v) }
+
+// Float64Slice converts a slice of float64 values into a slice of float64 pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func Float64Slice(src []float64) []*float64 { return conv.PointerSlice(src) }
+
+// Float64ValueSlice converts a slice of float64 pointers into a slice of float64 values.
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func Float64ValueSlice(src []*float64) []float64 { return conv.ValueSlice(src) }
+
+// Float64Map converts a string map of float64 values into a string map of float64 pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func Float64Map(src map[string]float64) map[string]*float64 { return conv.PointerMap(src) }
+
+// Float64ValueMap converts a string map of float64 pointers into a string map of float64 values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func Float64ValueMap(src map[string]*float64) map[string]float64 { return conv.ValueMap(src) }
+
+// Time turn a pointer to of the time.Time value passed in.
+//
+// Deprecated: use [conv.Pointer] instead.
+func Time(v time.Time) *time.Time { return conv.Pointer(v) }
+
+// TimeValue turn the value of the time.Time pointer passed in or time.Time{} if the pointer is nil.
+//
+// Deprecated: use [conv.Value] instead.
+func TimeValue(v *time.Time) time.Time { return conv.Value(v) }
+
+// TimeSlice converts a slice of time.Time values into a slice of time.Time pointers.
+//
+// Deprecated: use [conv.PointerSlice] instead.
+func TimeSlice(src []time.Time) []*time.Time { return conv.PointerSlice(src) }
+
+// TimeValueSlice converts a slice of time.Time pointers into a slice of time.Time values
+//
+// Deprecated: use [conv.ValueSlice] instead.
+func TimeValueSlice(src []*time.Time) []time.Time { return conv.ValueSlice(src) }
+
+// TimeMap converts a string map of time.Time values into a string map of time.Time pointers.
+//
+// Deprecated: use [conv.PointerMap] instead.
+func TimeMap(src map[string]time.Time) map[string]*time.Time { return conv.PointerMap(src) }
+
+// TimeValueMap converts a string map of time.Time pointers into a string map of time.Time values.
+//
+// Deprecated: use [conv.ValueMap] instead.
+func TimeValueMap(src map[string]*time.Time) map[string]time.Time { return conv.ValueMap(src) }
diff --git a/vendor/github.com/go-openapi/swag/convert.go b/vendor/github.com/go-openapi/swag/convert.go
deleted file mode 100644
index fc085aeb8ea5..000000000000
--- a/vendor/github.com/go-openapi/swag/convert.go
+++ /dev/null
@@ -1,208 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 swag
-
-import (
- "math"
- "strconv"
- "strings"
-)
-
-// same as ECMA Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER
-const (
- maxJSONFloat = float64(1<<53 - 1) // 9007199254740991.0 2^53 - 1
- minJSONFloat = -float64(1<<53 - 1) //-9007199254740991.0 -2^53 - 1
- epsilon float64 = 1e-9
-)
-
-// IsFloat64AJSONInteger allow for integers [-2^53, 2^53-1] inclusive
-func IsFloat64AJSONInteger(f float64) bool {
- if math.IsNaN(f) || math.IsInf(f, 0) || f < minJSONFloat || f > maxJSONFloat {
- return false
- }
- fa := math.Abs(f)
- g := float64(uint64(f))
- ga := math.Abs(g)
-
- diff := math.Abs(f - g)
-
- // more info: https://floating-point-gui.de/errors/comparison/#look-out-for-edge-cases
- switch {
- case f == g: // best case
- return true
- case f == float64(int64(f)) || f == float64(uint64(f)): // optimistic case
- return true
- case f == 0 || g == 0 || diff < math.SmallestNonzeroFloat64: // very close to 0 values
- return diff < (epsilon * math.SmallestNonzeroFloat64)
- }
- // check the relative error
- return diff/math.Min(fa+ga, math.MaxFloat64) < epsilon
-}
-
-var evaluatesAsTrue map[string]struct{}
-
-func init() {
- evaluatesAsTrue = map[string]struct{}{
- "true": {},
- "1": {},
- "yes": {},
- "ok": {},
- "y": {},
- "on": {},
- "selected": {},
- "checked": {},
- "t": {},
- "enabled": {},
- }
-}
-
-// ConvertBool turn a string into a boolean
-func ConvertBool(str string) (bool, error) {
- _, ok := evaluatesAsTrue[strings.ToLower(str)]
- return ok, nil
-}
-
-// ConvertFloat32 turn a string into a float32
-func ConvertFloat32(str string) (float32, error) {
- f, err := strconv.ParseFloat(str, 32)
- if err != nil {
- return 0, err
- }
- return float32(f), nil
-}
-
-// ConvertFloat64 turn a string into a float64
-func ConvertFloat64(str string) (float64, error) {
- return strconv.ParseFloat(str, 64)
-}
-
-// ConvertInt8 turn a string into an int8
-func ConvertInt8(str string) (int8, error) {
- i, err := strconv.ParseInt(str, 10, 8)
- if err != nil {
- return 0, err
- }
- return int8(i), nil
-}
-
-// ConvertInt16 turn a string into an int16
-func ConvertInt16(str string) (int16, error) {
- i, err := strconv.ParseInt(str, 10, 16)
- if err != nil {
- return 0, err
- }
- return int16(i), nil
-}
-
-// ConvertInt32 turn a string into an int32
-func ConvertInt32(str string) (int32, error) {
- i, err := strconv.ParseInt(str, 10, 32)
- if err != nil {
- return 0, err
- }
- return int32(i), nil
-}
-
-// ConvertInt64 turn a string into an int64
-func ConvertInt64(str string) (int64, error) {
- return strconv.ParseInt(str, 10, 64)
-}
-
-// ConvertUint8 turn a string into an uint8
-func ConvertUint8(str string) (uint8, error) {
- i, err := strconv.ParseUint(str, 10, 8)
- if err != nil {
- return 0, err
- }
- return uint8(i), nil
-}
-
-// ConvertUint16 turn a string into an uint16
-func ConvertUint16(str string) (uint16, error) {
- i, err := strconv.ParseUint(str, 10, 16)
- if err != nil {
- return 0, err
- }
- return uint16(i), nil
-}
-
-// ConvertUint32 turn a string into an uint32
-func ConvertUint32(str string) (uint32, error) {
- i, err := strconv.ParseUint(str, 10, 32)
- if err != nil {
- return 0, err
- }
- return uint32(i), nil
-}
-
-// ConvertUint64 turn a string into an uint64
-func ConvertUint64(str string) (uint64, error) {
- return strconv.ParseUint(str, 10, 64)
-}
-
-// FormatBool turns a boolean into a string
-func FormatBool(value bool) string {
- return strconv.FormatBool(value)
-}
-
-// FormatFloat32 turns a float32 into a string
-func FormatFloat32(value float32) string {
- return strconv.FormatFloat(float64(value), 'f', -1, 32)
-}
-
-// FormatFloat64 turns a float64 into a string
-func FormatFloat64(value float64) string {
- return strconv.FormatFloat(value, 'f', -1, 64)
-}
-
-// FormatInt8 turns an int8 into a string
-func FormatInt8(value int8) string {
- return strconv.FormatInt(int64(value), 10)
-}
-
-// FormatInt16 turns an int16 into a string
-func FormatInt16(value int16) string {
- return strconv.FormatInt(int64(value), 10)
-}
-
-// FormatInt32 turns an int32 into a string
-func FormatInt32(value int32) string {
- return strconv.Itoa(int(value))
-}
-
-// FormatInt64 turns an int64 into a string
-func FormatInt64(value int64) string {
- return strconv.FormatInt(value, 10)
-}
-
-// FormatUint8 turns an uint8 into a string
-func FormatUint8(value uint8) string {
- return strconv.FormatUint(uint64(value), 10)
-}
-
-// FormatUint16 turns an uint16 into a string
-func FormatUint16(value uint16) string {
- return strconv.FormatUint(uint64(value), 10)
-}
-
-// FormatUint32 turns an uint32 into a string
-func FormatUint32(value uint32) string {
- return strconv.FormatUint(uint64(value), 10)
-}
-
-// FormatUint64 turns an uint64 into a string
-func FormatUint64(value uint64) string {
- return strconv.FormatUint(value, 10)
-}
diff --git a/vendor/github.com/go-openapi/swag/convert_types.go b/vendor/github.com/go-openapi/swag/convert_types.go
deleted file mode 100644
index c49cc473a8c2..000000000000
--- a/vendor/github.com/go-openapi/swag/convert_types.go
+++ /dev/null
@@ -1,730 +0,0 @@
-package swag
-
-import "time"
-
-// This file was taken from the aws go sdk
-
-// String returns a pointer to of the string value passed in.
-func String(v string) *string {
- return &v
-}
-
-// StringValue returns the value of the string pointer passed in or
-// "" if the pointer is nil.
-func StringValue(v *string) string {
- if v != nil {
- return *v
- }
- return ""
-}
-
-// StringSlice converts a slice of string values into a slice of
-// string pointers
-func StringSlice(src []string) []*string {
- dst := make([]*string, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// StringValueSlice converts a slice of string pointers into a slice of
-// string values
-func StringValueSlice(src []*string) []string {
- dst := make([]string, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// StringMap converts a string map of string values into a string
-// map of string pointers
-func StringMap(src map[string]string) map[string]*string {
- dst := make(map[string]*string)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// StringValueMap converts a string map of string pointers into a string
-// map of string values
-func StringValueMap(src map[string]*string) map[string]string {
- dst := make(map[string]string)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
-
-// Bool returns a pointer to of the bool value passed in.
-func Bool(v bool) *bool {
- return &v
-}
-
-// BoolValue returns the value of the bool pointer passed in or
-// false if the pointer is nil.
-func BoolValue(v *bool) bool {
- if v != nil {
- return *v
- }
- return false
-}
-
-// BoolSlice converts a slice of bool values into a slice of
-// bool pointers
-func BoolSlice(src []bool) []*bool {
- dst := make([]*bool, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// BoolValueSlice converts a slice of bool pointers into a slice of
-// bool values
-func BoolValueSlice(src []*bool) []bool {
- dst := make([]bool, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// BoolMap converts a string map of bool values into a string
-// map of bool pointers
-func BoolMap(src map[string]bool) map[string]*bool {
- dst := make(map[string]*bool)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// BoolValueMap converts a string map of bool pointers into a string
-// map of bool values
-func BoolValueMap(src map[string]*bool) map[string]bool {
- dst := make(map[string]bool)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
-
-// Int returns a pointer to of the int value passed in.
-func Int(v int) *int {
- return &v
-}
-
-// IntValue returns the value of the int pointer passed in or
-// 0 if the pointer is nil.
-func IntValue(v *int) int {
- if v != nil {
- return *v
- }
- return 0
-}
-
-// IntSlice converts a slice of int values into a slice of
-// int pointers
-func IntSlice(src []int) []*int {
- dst := make([]*int, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// IntValueSlice converts a slice of int pointers into a slice of
-// int values
-func IntValueSlice(src []*int) []int {
- dst := make([]int, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// IntMap converts a string map of int values into a string
-// map of int pointers
-func IntMap(src map[string]int) map[string]*int {
- dst := make(map[string]*int)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// IntValueMap converts a string map of int pointers into a string
-// map of int values
-func IntValueMap(src map[string]*int) map[string]int {
- dst := make(map[string]int)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
-
-// Int32 returns a pointer to of the int32 value passed in.
-func Int32(v int32) *int32 {
- return &v
-}
-
-// Int32Value returns the value of the int32 pointer passed in or
-// 0 if the pointer is nil.
-func Int32Value(v *int32) int32 {
- if v != nil {
- return *v
- }
- return 0
-}
-
-// Int32Slice converts a slice of int32 values into a slice of
-// int32 pointers
-func Int32Slice(src []int32) []*int32 {
- dst := make([]*int32, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// Int32ValueSlice converts a slice of int32 pointers into a slice of
-// int32 values
-func Int32ValueSlice(src []*int32) []int32 {
- dst := make([]int32, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// Int32Map converts a string map of int32 values into a string
-// map of int32 pointers
-func Int32Map(src map[string]int32) map[string]*int32 {
- dst := make(map[string]*int32)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// Int32ValueMap converts a string map of int32 pointers into a string
-// map of int32 values
-func Int32ValueMap(src map[string]*int32) map[string]int32 {
- dst := make(map[string]int32)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
-
-// Int64 returns a pointer to of the int64 value passed in.
-func Int64(v int64) *int64 {
- return &v
-}
-
-// Int64Value returns the value of the int64 pointer passed in or
-// 0 if the pointer is nil.
-func Int64Value(v *int64) int64 {
- if v != nil {
- return *v
- }
- return 0
-}
-
-// Int64Slice converts a slice of int64 values into a slice of
-// int64 pointers
-func Int64Slice(src []int64) []*int64 {
- dst := make([]*int64, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// Int64ValueSlice converts a slice of int64 pointers into a slice of
-// int64 values
-func Int64ValueSlice(src []*int64) []int64 {
- dst := make([]int64, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// Int64Map converts a string map of int64 values into a string
-// map of int64 pointers
-func Int64Map(src map[string]int64) map[string]*int64 {
- dst := make(map[string]*int64)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// Int64ValueMap converts a string map of int64 pointers into a string
-// map of int64 values
-func Int64ValueMap(src map[string]*int64) map[string]int64 {
- dst := make(map[string]int64)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
-
-// Uint16 returns a pointer to of the uint16 value passed in.
-func Uint16(v uint16) *uint16 {
- return &v
-}
-
-// Uint16Value returns the value of the uint16 pointer passed in or
-// 0 if the pointer is nil.
-func Uint16Value(v *uint16) uint16 {
- if v != nil {
- return *v
- }
-
- return 0
-}
-
-// Uint16Slice converts a slice of uint16 values into a slice of
-// uint16 pointers
-func Uint16Slice(src []uint16) []*uint16 {
- dst := make([]*uint16, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
-
- return dst
-}
-
-// Uint16ValueSlice converts a slice of uint16 pointers into a slice of
-// uint16 values
-func Uint16ValueSlice(src []*uint16) []uint16 {
- dst := make([]uint16, len(src))
-
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
-
- return dst
-}
-
-// Uint16Map converts a string map of uint16 values into a string
-// map of uint16 pointers
-func Uint16Map(src map[string]uint16) map[string]*uint16 {
- dst := make(map[string]*uint16)
-
- for k, val := range src {
- v := val
- dst[k] = &v
- }
-
- return dst
-}
-
-// Uint16ValueMap converts a string map of uint16 pointers into a string
-// map of uint16 values
-func Uint16ValueMap(src map[string]*uint16) map[string]uint16 {
- dst := make(map[string]uint16)
-
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
-
- return dst
-}
-
-// Uint returns a pointer to of the uint value passed in.
-func Uint(v uint) *uint {
- return &v
-}
-
-// UintValue returns the value of the uint pointer passed in or
-// 0 if the pointer is nil.
-func UintValue(v *uint) uint {
- if v != nil {
- return *v
- }
- return 0
-}
-
-// UintSlice converts a slice of uint values into a slice of
-// uint pointers
-func UintSlice(src []uint) []*uint {
- dst := make([]*uint, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// UintValueSlice converts a slice of uint pointers into a slice of
-// uint values
-func UintValueSlice(src []*uint) []uint {
- dst := make([]uint, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// UintMap converts a string map of uint values into a string
-// map of uint pointers
-func UintMap(src map[string]uint) map[string]*uint {
- dst := make(map[string]*uint)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// UintValueMap converts a string map of uint pointers into a string
-// map of uint values
-func UintValueMap(src map[string]*uint) map[string]uint {
- dst := make(map[string]uint)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
-
-// Uint32 returns a pointer to of the uint32 value passed in.
-func Uint32(v uint32) *uint32 {
- return &v
-}
-
-// Uint32Value returns the value of the uint32 pointer passed in or
-// 0 if the pointer is nil.
-func Uint32Value(v *uint32) uint32 {
- if v != nil {
- return *v
- }
- return 0
-}
-
-// Uint32Slice converts a slice of uint32 values into a slice of
-// uint32 pointers
-func Uint32Slice(src []uint32) []*uint32 {
- dst := make([]*uint32, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// Uint32ValueSlice converts a slice of uint32 pointers into a slice of
-// uint32 values
-func Uint32ValueSlice(src []*uint32) []uint32 {
- dst := make([]uint32, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// Uint32Map converts a string map of uint32 values into a string
-// map of uint32 pointers
-func Uint32Map(src map[string]uint32) map[string]*uint32 {
- dst := make(map[string]*uint32)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// Uint32ValueMap converts a string map of uint32 pointers into a string
-// map of uint32 values
-func Uint32ValueMap(src map[string]*uint32) map[string]uint32 {
- dst := make(map[string]uint32)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
-
-// Uint64 returns a pointer to of the uint64 value passed in.
-func Uint64(v uint64) *uint64 {
- return &v
-}
-
-// Uint64Value returns the value of the uint64 pointer passed in or
-// 0 if the pointer is nil.
-func Uint64Value(v *uint64) uint64 {
- if v != nil {
- return *v
- }
- return 0
-}
-
-// Uint64Slice converts a slice of uint64 values into a slice of
-// uint64 pointers
-func Uint64Slice(src []uint64) []*uint64 {
- dst := make([]*uint64, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// Uint64ValueSlice converts a slice of uint64 pointers into a slice of
-// uint64 values
-func Uint64ValueSlice(src []*uint64) []uint64 {
- dst := make([]uint64, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// Uint64Map converts a string map of uint64 values into a string
-// map of uint64 pointers
-func Uint64Map(src map[string]uint64) map[string]*uint64 {
- dst := make(map[string]*uint64)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// Uint64ValueMap converts a string map of uint64 pointers into a string
-// map of uint64 values
-func Uint64ValueMap(src map[string]*uint64) map[string]uint64 {
- dst := make(map[string]uint64)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
-
-// Float32 returns a pointer to of the float32 value passed in.
-func Float32(v float32) *float32 {
- return &v
-}
-
-// Float32Value returns the value of the float32 pointer passed in or
-// 0 if the pointer is nil.
-func Float32Value(v *float32) float32 {
- if v != nil {
- return *v
- }
-
- return 0
-}
-
-// Float32Slice converts a slice of float32 values into a slice of
-// float32 pointers
-func Float32Slice(src []float32) []*float32 {
- dst := make([]*float32, len(src))
-
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
-
- return dst
-}
-
-// Float32ValueSlice converts a slice of float32 pointers into a slice of
-// float32 values
-func Float32ValueSlice(src []*float32) []float32 {
- dst := make([]float32, len(src))
-
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
-
- return dst
-}
-
-// Float32Map converts a string map of float32 values into a string
-// map of float32 pointers
-func Float32Map(src map[string]float32) map[string]*float32 {
- dst := make(map[string]*float32)
-
- for k, val := range src {
- v := val
- dst[k] = &v
- }
-
- return dst
-}
-
-// Float32ValueMap converts a string map of float32 pointers into a string
-// map of float32 values
-func Float32ValueMap(src map[string]*float32) map[string]float32 {
- dst := make(map[string]float32)
-
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
-
- return dst
-}
-
-// Float64 returns a pointer to of the float64 value passed in.
-func Float64(v float64) *float64 {
- return &v
-}
-
-// Float64Value returns the value of the float64 pointer passed in or
-// 0 if the pointer is nil.
-func Float64Value(v *float64) float64 {
- if v != nil {
- return *v
- }
- return 0
-}
-
-// Float64Slice converts a slice of float64 values into a slice of
-// float64 pointers
-func Float64Slice(src []float64) []*float64 {
- dst := make([]*float64, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// Float64ValueSlice converts a slice of float64 pointers into a slice of
-// float64 values
-func Float64ValueSlice(src []*float64) []float64 {
- dst := make([]float64, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// Float64Map converts a string map of float64 values into a string
-// map of float64 pointers
-func Float64Map(src map[string]float64) map[string]*float64 {
- dst := make(map[string]*float64)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// Float64ValueMap converts a string map of float64 pointers into a string
-// map of float64 values
-func Float64ValueMap(src map[string]*float64) map[string]float64 {
- dst := make(map[string]float64)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
-
-// Time returns a pointer to of the time.Time value passed in.
-func Time(v time.Time) *time.Time {
- return &v
-}
-
-// TimeValue returns the value of the time.Time pointer passed in or
-// time.Time{} if the pointer is nil.
-func TimeValue(v *time.Time) time.Time {
- if v != nil {
- return *v
- }
- return time.Time{}
-}
-
-// TimeSlice converts a slice of time.Time values into a slice of
-// time.Time pointers
-func TimeSlice(src []time.Time) []*time.Time {
- dst := make([]*time.Time, len(src))
- for i := 0; i < len(src); i++ {
- dst[i] = &(src[i])
- }
- return dst
-}
-
-// TimeValueSlice converts a slice of time.Time pointers into a slice of
-// time.Time values
-func TimeValueSlice(src []*time.Time) []time.Time {
- dst := make([]time.Time, len(src))
- for i := 0; i < len(src); i++ {
- if src[i] != nil {
- dst[i] = *(src[i])
- }
- }
- return dst
-}
-
-// TimeMap converts a string map of time.Time values into a string
-// map of time.Time pointers
-func TimeMap(src map[string]time.Time) map[string]*time.Time {
- dst := make(map[string]*time.Time)
- for k, val := range src {
- v := val
- dst[k] = &v
- }
- return dst
-}
-
-// TimeValueMap converts a string map of time.Time pointers into a string
-// map of time.Time values
-func TimeValueMap(src map[string]*time.Time) map[string]time.Time {
- dst := make(map[string]time.Time)
- for k, val := range src {
- if val != nil {
- dst[k] = *val
- }
- }
- return dst
-}
diff --git a/vendor/github.com/go-openapi/swag/doc.go b/vendor/github.com/go-openapi/swag/doc.go
index 55094cb74c4d..b54b57478af6 100644
--- a/vendor/github.com/go-openapi/swag/doc.go
+++ b/vendor/github.com/go-openapi/swag/doc.go
@@ -1,31 +1,47 @@
-// Copyright 2015 go-swagger maintainers
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+// Package swag contains a bunch of helper functions for go-openapi and go-swagger projects.
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
+// You may also use it standalone for your projects.
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// NOTE: all features that used to be exposed as package-level members (constants, variables,
+// functions and types) are now deprecated and are superseded by equivalent features in
+// more specialized sub-packages.
+// Moving forward, no additional feature will be added to the [swag] API directly at the root package level,
+// which remains there for backward-compatibility purposes.
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 swag contains a bunch of helper functions for go-openapi and go-swagger projects.
-
-You may also use it standalone for your projects.
-
- - convert between value and pointers for builtin types
- - convert from string to builtin types (wraps strconv)
- - fast json concatenation
- - search in path
- - load from file or http
- - name mangling
-
-This repo has only few dependencies outside of the standard library:
-
- - YAML utilities depend on gopkg.in/yaml.v2
-*/
+// Child modules will continue to evolve or some new ones may be added in the future.
+//
+// # Modules
+//
+// - [cmdutils] utilities to work with CLIs
+//
+// - [conv] type conversion utilities
+//
+// - [fileutils] file utilities
+//
+// - [jsonname] JSON utilities
+//
+// - [jsonutils] JSON utilities
+//
+// - [loading] file loading
+//
+// - [mangling] safe name generation
+//
+// - [netutils] networking utilities
+//
+// - [stringutils] `string` utilities
+//
+// - [typeutils] `go` types utilities
+//
+// - [yamlutils] YAML utilities
+//
+// # Dependencies
+//
+// This repo has a few dependencies outside of the standard library:
+//
+// - YAML utilities depend on [go.yaml.in/yaml/v3]
package swag
+
+//go:generate mockery
diff --git a/vendor/github.com/go-openapi/swag/fileutils/LICENSE b/vendor/github.com/go-openapi/swag/fileutils/LICENSE
new file mode 100644
index 000000000000..d64569567334
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/fileutils/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/vendor/github.com/go-openapi/swag/fileutils/doc.go b/vendor/github.com/go-openapi/swag/fileutils/doc.go
new file mode 100644
index 000000000000..859a200d8413
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/fileutils/doc.go
@@ -0,0 +1,10 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+// Package fileutils exposes utilities to deal with files and paths.
+//
+// Currently, there is:
+// - [File] to represent an abstraction of an uploaded file.
+// For instance, this is used by [github.com/go-openapi/runtime.File].
+// - path search utilities (e.g. finding packages in the GO search path)
+package fileutils
diff --git a/vendor/github.com/go-openapi/swag/fileutils/file.go b/vendor/github.com/go-openapi/swag/fileutils/file.go
new file mode 100644
index 000000000000..5ad4cfaeafa4
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/fileutils/file.go
@@ -0,0 +1,22 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package fileutils
+
+import "mime/multipart"
+
+// File represents an uploaded file.
+type File struct {
+ Data multipart.File
+ Header *multipart.FileHeader
+}
+
+// Read bytes from the file
+func (f *File) Read(p []byte) (n int, err error) {
+ return f.Data.Read(p)
+}
+
+// Close the file
+func (f *File) Close() error {
+ return f.Data.Close()
+}
diff --git a/vendor/github.com/go-openapi/swag/path.go b/vendor/github.com/go-openapi/swag/fileutils/path.go
similarity index 58%
rename from vendor/github.com/go-openapi/swag/path.go
rename to vendor/github.com/go-openapi/swag/fileutils/path.go
index 941bd0176b05..dd09f690bf81 100644
--- a/vendor/github.com/go-openapi/swag/path.go
+++ b/vendor/github.com/go-openapi/swag/fileutils/path.go
@@ -1,18 +1,7 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
-package swag
+package fileutils
import (
"os"
@@ -21,10 +10,8 @@ import (
"strings"
)
-const (
- // GOPATHKey represents the env key for gopath
- GOPATHKey = "GOPATH"
-)
+// GOPATHKey represents the env key for gopath
+const GOPATHKey = "GOPATH"
// FindInSearchPath finds a package in a provided lists of paths
func FindInSearchPath(searchPath, pkg string) string {
@@ -40,11 +27,17 @@ func FindInSearchPath(searchPath, pkg string) string {
}
// FindInGoSearchPath finds a package in the $GOPATH:$GOROOT
+//
+// Deprecated: this function is no longer relevant with modern go.
+// It uses [runtime.GOROOT] under the hood, which is deprecated as of go1.24.
func FindInGoSearchPath(pkg string) string {
return FindInSearchPath(FullGoSearchPath(), pkg)
}
// FullGoSearchPath gets the search paths for finding packages
+//
+// Deprecated: this function is no longer relevant with modern go.
+// It uses [runtime.GOROOT] under the hood, which is deprecated as of go1.24.
func FullGoSearchPath() string {
allPaths := os.Getenv(GOPATHKey)
if allPaths == "" {
diff --git a/vendor/github.com/go-openapi/swag/fileutils_iface.go b/vendor/github.com/go-openapi/swag/fileutils_iface.go
new file mode 100644
index 000000000000..f3e79a0e4bce
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/fileutils_iface.go
@@ -0,0 +1,33 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package swag
+
+import "github.com/go-openapi/swag/fileutils"
+
+// GOPATHKey represents the env key for gopath
+//
+// Deprecated: use [fileutils.GOPATHKey] instead.
+const GOPATHKey = fileutils.GOPATHKey
+
+// File represents an uploaded file.
+//
+// Deprecated: use [fileutils.File] instead.
+type File = fileutils.File
+
+// FindInSearchPath finds a package in a provided lists of paths.
+//
+// Deprecated: use [fileutils.FindInSearchPath] instead.
+func FindInSearchPath(searchPath, pkg string) string {
+ return fileutils.FindInSearchPath(searchPath, pkg)
+}
+
+// FindInGoSearchPath finds a package in the $GOPATH:$GOROOT
+//
+// Deprecated: use [fileutils.FindInGoSearchPath] instead.
+func FindInGoSearchPath(pkg string) string { return fileutils.FindInGoSearchPath(pkg) }
+
+// FullGoSearchPath gets the search paths for finding packages
+//
+// Deprecated: use [fileutils.FullGoSearchPath] instead.
+func FullGoSearchPath() string { return fileutils.FullGoSearchPath() }
diff --git a/vendor/github.com/go-openapi/swag/initialism_index.go b/vendor/github.com/go-openapi/swag/initialism_index.go
deleted file mode 100644
index 20a359bb60a2..000000000000
--- a/vendor/github.com/go-openapi/swag/initialism_index.go
+++ /dev/null
@@ -1,202 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 swag
-
-import (
- "sort"
- "strings"
- "sync"
-)
-
-var (
- // commonInitialisms are common acronyms that are kept as whole uppercased words.
- commonInitialisms *indexOfInitialisms
-
- // initialisms is a slice of sorted initialisms
- initialisms []string
-
- // a copy of initialisms pre-baked as []rune
- initialismsRunes [][]rune
- initialismsUpperCased [][]rune
-
- isInitialism func(string) bool
-
- maxAllocMatches int
-)
-
-func init() {
- // Taken from https://github.com/golang/lint/blob/3390df4df2787994aea98de825b964ac7944b817/lint.go#L732-L769
- configuredInitialisms := map[string]bool{
- "ACL": true,
- "API": true,
- "ASCII": true,
- "CPU": true,
- "CSS": true,
- "DNS": true,
- "EOF": true,
- "GUID": true,
- "HTML": true,
- "HTTPS": true,
- "HTTP": true,
- "ID": true,
- "IP": true,
- "IPv4": true,
- "IPv6": true,
- "JSON": true,
- "LHS": true,
- "OAI": true,
- "QPS": true,
- "RAM": true,
- "RHS": true,
- "RPC": true,
- "SLA": true,
- "SMTP": true,
- "SQL": true,
- "SSH": true,
- "TCP": true,
- "TLS": true,
- "TTL": true,
- "UDP": true,
- "UI": true,
- "UID": true,
- "UUID": true,
- "URI": true,
- "URL": true,
- "UTF8": true,
- "VM": true,
- "XML": true,
- "XMPP": true,
- "XSRF": true,
- "XSS": true,
- }
-
- // a thread-safe index of initialisms
- commonInitialisms = newIndexOfInitialisms().load(configuredInitialisms)
- initialisms = commonInitialisms.sorted()
- initialismsRunes = asRunes(initialisms)
- initialismsUpperCased = asUpperCased(initialisms)
- maxAllocMatches = maxAllocHeuristic(initialismsRunes)
-
- // a test function
- isInitialism = commonInitialisms.isInitialism
-}
-
-func asRunes(in []string) [][]rune {
- out := make([][]rune, len(in))
- for i, initialism := range in {
- out[i] = []rune(initialism)
- }
-
- return out
-}
-
-func asUpperCased(in []string) [][]rune {
- out := make([][]rune, len(in))
-
- for i, initialism := range in {
- out[i] = []rune(upper(trim(initialism)))
- }
-
- return out
-}
-
-func maxAllocHeuristic(in [][]rune) int {
- heuristic := make(map[rune]int)
- for _, initialism := range in {
- heuristic[initialism[0]]++
- }
-
- var maxAlloc int
- for _, val := range heuristic {
- if val > maxAlloc {
- maxAlloc = val
- }
- }
-
- return maxAlloc
-}
-
-// AddInitialisms add additional initialisms
-func AddInitialisms(words ...string) {
- for _, word := range words {
- // commonInitialisms[upper(word)] = true
- commonInitialisms.add(upper(word))
- }
- // sort again
- initialisms = commonInitialisms.sorted()
- initialismsRunes = asRunes(initialisms)
- initialismsUpperCased = asUpperCased(initialisms)
-}
-
-// indexOfInitialisms is a thread-safe implementation of the sorted index of initialisms.
-// Since go1.9, this may be implemented with sync.Map.
-type indexOfInitialisms struct {
- sortMutex *sync.Mutex
- index *sync.Map
-}
-
-func newIndexOfInitialisms() *indexOfInitialisms {
- return &indexOfInitialisms{
- sortMutex: new(sync.Mutex),
- index: new(sync.Map),
- }
-}
-
-func (m *indexOfInitialisms) load(initial map[string]bool) *indexOfInitialisms {
- m.sortMutex.Lock()
- defer m.sortMutex.Unlock()
- for k, v := range initial {
- m.index.Store(k, v)
- }
- return m
-}
-
-func (m *indexOfInitialisms) isInitialism(key string) bool {
- _, ok := m.index.Load(key)
- return ok
-}
-
-func (m *indexOfInitialisms) add(key string) *indexOfInitialisms {
- m.index.Store(key, true)
- return m
-}
-
-func (m *indexOfInitialisms) sorted() (result []string) {
- m.sortMutex.Lock()
- defer m.sortMutex.Unlock()
- m.index.Range(func(key, _ interface{}) bool {
- k := key.(string)
- result = append(result, k)
- return true
- })
- sort.Sort(sort.Reverse(byInitialism(result)))
- return
-}
-
-type byInitialism []string
-
-func (s byInitialism) Len() int {
- return len(s)
-}
-func (s byInitialism) Swap(i, j int) {
- s[i], s[j] = s[j], s[i]
-}
-func (s byInitialism) Less(i, j int) bool {
- if len(s[i]) != len(s[j]) {
- return len(s[i]) < len(s[j])
- }
-
- return strings.Compare(s[i], s[j]) > 0
-}
diff --git a/vendor/github.com/go-openapi/swag/json.go b/vendor/github.com/go-openapi/swag/json.go
deleted file mode 100644
index 7e9902ca314b..000000000000
--- a/vendor/github.com/go-openapi/swag/json.go
+++ /dev/null
@@ -1,312 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 swag
-
-import (
- "bytes"
- "encoding/json"
- "log"
- "reflect"
- "strings"
- "sync"
-
- "github.com/mailru/easyjson/jlexer"
- "github.com/mailru/easyjson/jwriter"
-)
-
-// nullJSON represents a JSON object with null type
-var nullJSON = []byte("null")
-
-// DefaultJSONNameProvider the default cache for types
-var DefaultJSONNameProvider = NewNameProvider()
-
-const comma = byte(',')
-
-var closers map[byte]byte
-
-func init() {
- closers = map[byte]byte{
- '{': '}',
- '[': ']',
- }
-}
-
-type ejMarshaler interface {
- MarshalEasyJSON(w *jwriter.Writer)
-}
-
-type ejUnmarshaler interface {
- UnmarshalEasyJSON(w *jlexer.Lexer)
-}
-
-// WriteJSON writes json data, prefers finding an appropriate interface to short-circuit the marshaler
-// so it takes the fastest option available.
-func WriteJSON(data interface{}) ([]byte, error) {
- if d, ok := data.(ejMarshaler); ok {
- jw := new(jwriter.Writer)
- d.MarshalEasyJSON(jw)
- return jw.BuildBytes()
- }
- if d, ok := data.(json.Marshaler); ok {
- return d.MarshalJSON()
- }
- return json.Marshal(data)
-}
-
-// ReadJSON reads json data, prefers finding an appropriate interface to short-circuit the unmarshaler
-// so it takes the fastest option available
-func ReadJSON(data []byte, value interface{}) error {
- trimmedData := bytes.Trim(data, "\x00")
- if d, ok := value.(ejUnmarshaler); ok {
- jl := &jlexer.Lexer{Data: trimmedData}
- d.UnmarshalEasyJSON(jl)
- return jl.Error()
- }
- if d, ok := value.(json.Unmarshaler); ok {
- return d.UnmarshalJSON(trimmedData)
- }
- return json.Unmarshal(trimmedData, value)
-}
-
-// DynamicJSONToStruct converts an untyped json structure into a struct
-func DynamicJSONToStruct(data interface{}, target interface{}) error {
- // TODO: convert straight to a json typed map (mergo + iterate?)
- b, err := WriteJSON(data)
- if err != nil {
- return err
- }
- return ReadJSON(b, target)
-}
-
-// ConcatJSON concatenates multiple json objects efficiently
-func ConcatJSON(blobs ...[]byte) []byte {
- if len(blobs) == 0 {
- return nil
- }
-
- last := len(blobs) - 1
- for blobs[last] == nil || bytes.Equal(blobs[last], nullJSON) {
- // strips trailing null objects
- last--
- if last < 0 {
- // there was nothing but "null"s or nil...
- return nil
- }
- }
- if last == 0 {
- return blobs[0]
- }
-
- var opening, closing byte
- var idx, a int
- buf := bytes.NewBuffer(nil)
-
- for i, b := range blobs[:last+1] {
- if b == nil || bytes.Equal(b, nullJSON) {
- // a null object is in the list: skip it
- continue
- }
- if len(b) > 0 && opening == 0 { // is this an array or an object?
- opening, closing = b[0], closers[b[0]]
- }
-
- if opening != '{' && opening != '[' {
- continue // don't know how to concatenate non container objects
- }
-
- if len(b) < 3 { // yep empty but also the last one, so closing this thing
- if i == last && a > 0 {
- if err := buf.WriteByte(closing); err != nil {
- log.Println(err)
- }
- }
- continue
- }
-
- idx = 0
- if a > 0 { // we need to join with a comma for everything beyond the first non-empty item
- if err := buf.WriteByte(comma); err != nil {
- log.Println(err)
- }
- idx = 1 // this is not the first or the last so we want to drop the leading bracket
- }
-
- if i != last { // not the last one, strip brackets
- if _, err := buf.Write(b[idx : len(b)-1]); err != nil {
- log.Println(err)
- }
- } else { // last one, strip only the leading bracket
- if _, err := buf.Write(b[idx:]); err != nil {
- log.Println(err)
- }
- }
- a++
- }
- // somehow it ended up being empty, so provide a default value
- if buf.Len() == 0 {
- if err := buf.WriteByte(opening); err != nil {
- log.Println(err)
- }
- if err := buf.WriteByte(closing); err != nil {
- log.Println(err)
- }
- }
- return buf.Bytes()
-}
-
-// ToDynamicJSON turns an object into a properly JSON typed structure
-func ToDynamicJSON(data interface{}) interface{} {
- // TODO: convert straight to a json typed map (mergo + iterate?)
- b, err := json.Marshal(data)
- if err != nil {
- log.Println(err)
- }
- var res interface{}
- if err := json.Unmarshal(b, &res); err != nil {
- log.Println(err)
- }
- return res
-}
-
-// FromDynamicJSON turns an object into a properly JSON typed structure
-func FromDynamicJSON(data, target interface{}) error {
- b, err := json.Marshal(data)
- if err != nil {
- log.Println(err)
- }
- return json.Unmarshal(b, target)
-}
-
-// NameProvider represents an object capable of translating from go property names
-// to json property names
-// This type is thread-safe.
-type NameProvider struct {
- lock *sync.Mutex
- index map[reflect.Type]nameIndex
-}
-
-type nameIndex struct {
- jsonNames map[string]string
- goNames map[string]string
-}
-
-// NewNameProvider creates a new name provider
-func NewNameProvider() *NameProvider {
- return &NameProvider{
- lock: &sync.Mutex{},
- index: make(map[reflect.Type]nameIndex),
- }
-}
-
-func buildnameIndex(tpe reflect.Type, idx, reverseIdx map[string]string) {
- for i := 0; i < tpe.NumField(); i++ {
- targetDes := tpe.Field(i)
-
- if targetDes.PkgPath != "" { // unexported
- continue
- }
-
- if targetDes.Anonymous { // walk embedded structures tree down first
- buildnameIndex(targetDes.Type, idx, reverseIdx)
- continue
- }
-
- if tag := targetDes.Tag.Get("json"); tag != "" {
-
- parts := strings.Split(tag, ",")
- if len(parts) == 0 {
- continue
- }
-
- nm := parts[0]
- if nm == "-" {
- continue
- }
- if nm == "" { // empty string means we want to use the Go name
- nm = targetDes.Name
- }
-
- idx[nm] = targetDes.Name
- reverseIdx[targetDes.Name] = nm
- }
- }
-}
-
-func newNameIndex(tpe reflect.Type) nameIndex {
- var idx = make(map[string]string, tpe.NumField())
- var reverseIdx = make(map[string]string, tpe.NumField())
-
- buildnameIndex(tpe, idx, reverseIdx)
- return nameIndex{jsonNames: idx, goNames: reverseIdx}
-}
-
-// GetJSONNames gets all the json property names for a type
-func (n *NameProvider) GetJSONNames(subject interface{}) []string {
- n.lock.Lock()
- defer n.lock.Unlock()
- tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
- names, ok := n.index[tpe]
- if !ok {
- names = n.makeNameIndex(tpe)
- }
-
- res := make([]string, 0, len(names.jsonNames))
- for k := range names.jsonNames {
- res = append(res, k)
- }
- return res
-}
-
-// GetJSONName gets the json name for a go property name
-func (n *NameProvider) GetJSONName(subject interface{}, name string) (string, bool) {
- tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
- return n.GetJSONNameForType(tpe, name)
-}
-
-// GetJSONNameForType gets the json name for a go property name on a given type
-func (n *NameProvider) GetJSONNameForType(tpe reflect.Type, name string) (string, bool) {
- n.lock.Lock()
- defer n.lock.Unlock()
- names, ok := n.index[tpe]
- if !ok {
- names = n.makeNameIndex(tpe)
- }
- nme, ok := names.goNames[name]
- return nme, ok
-}
-
-func (n *NameProvider) makeNameIndex(tpe reflect.Type) nameIndex {
- names := newNameIndex(tpe)
- n.index[tpe] = names
- return names
-}
-
-// GetGoName gets the go name for a json property name
-func (n *NameProvider) GetGoName(subject interface{}, name string) (string, bool) {
- tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
- return n.GetGoNameForType(tpe, name)
-}
-
-// GetGoNameForType gets the go name for a given type for a json property name
-func (n *NameProvider) GetGoNameForType(tpe reflect.Type, name string) (string, bool) {
- n.lock.Lock()
- defer n.lock.Unlock()
- names, ok := n.index[tpe]
- if !ok {
- names = n.makeNameIndex(tpe)
- }
- nme, ok := names.jsonNames[name]
- return nme, ok
-}
diff --git a/vendor/github.com/go-openapi/swag/jsonname/LICENSE b/vendor/github.com/go-openapi/swag/jsonname/LICENSE
new file mode 100644
index 000000000000..d64569567334
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonname/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/vendor/github.com/go-openapi/swag/jsonname/doc.go b/vendor/github.com/go-openapi/swag/jsonname/doc.go
new file mode 100644
index 000000000000..79232eaca476
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonname/doc.go
@@ -0,0 +1,5 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+// Package jsonname is a provider of json property names from go properties.
+package jsonname
diff --git a/vendor/github.com/go-openapi/swag/jsonname/name_provider.go b/vendor/github.com/go-openapi/swag/jsonname/name_provider.go
new file mode 100644
index 000000000000..8eaf1bece8d6
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonname/name_provider.go
@@ -0,0 +1,138 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package jsonname
+
+import (
+ "reflect"
+ "strings"
+ "sync"
+)
+
+// DefaultJSONNameProvider is the default cache for types.
+var DefaultJSONNameProvider = NewNameProvider()
+
+// NameProvider represents an object capable of translating from go property names
+// to json property names.
+//
+// This type is thread-safe.
+//
+// See [github.com/go-openapi/jsonpointer.Pointer] for an example.
+type NameProvider struct {
+ lock *sync.Mutex
+ index map[reflect.Type]nameIndex
+}
+
+type nameIndex struct {
+ jsonNames map[string]string
+ goNames map[string]string
+}
+
+// NewNameProvider creates a new name provider
+func NewNameProvider() *NameProvider {
+ return &NameProvider{
+ lock: &sync.Mutex{},
+ index: make(map[reflect.Type]nameIndex),
+ }
+}
+
+func buildnameIndex(tpe reflect.Type, idx, reverseIdx map[string]string) {
+ for i := 0; i < tpe.NumField(); i++ {
+ targetDes := tpe.Field(i)
+
+ if targetDes.PkgPath != "" { // unexported
+ continue
+ }
+
+ if targetDes.Anonymous { // walk embedded structures tree down first
+ buildnameIndex(targetDes.Type, idx, reverseIdx)
+ continue
+ }
+
+ if tag := targetDes.Tag.Get("json"); tag != "" {
+
+ parts := strings.Split(tag, ",")
+ if len(parts) == 0 {
+ continue
+ }
+
+ nm := parts[0]
+ if nm == "-" {
+ continue
+ }
+ if nm == "" { // empty string means we want to use the Go name
+ nm = targetDes.Name
+ }
+
+ idx[nm] = targetDes.Name
+ reverseIdx[targetDes.Name] = nm
+ }
+ }
+}
+
+func newNameIndex(tpe reflect.Type) nameIndex {
+ var idx = make(map[string]string, tpe.NumField())
+ var reverseIdx = make(map[string]string, tpe.NumField())
+
+ buildnameIndex(tpe, idx, reverseIdx)
+ return nameIndex{jsonNames: idx, goNames: reverseIdx}
+}
+
+// GetJSONNames gets all the json property names for a type
+func (n *NameProvider) GetJSONNames(subject any) []string {
+ n.lock.Lock()
+ defer n.lock.Unlock()
+ tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
+ names, ok := n.index[tpe]
+ if !ok {
+ names = n.makeNameIndex(tpe)
+ }
+
+ res := make([]string, 0, len(names.jsonNames))
+ for k := range names.jsonNames {
+ res = append(res, k)
+ }
+ return res
+}
+
+// GetJSONName gets the json name for a go property name
+func (n *NameProvider) GetJSONName(subject any, name string) (string, bool) {
+ tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
+ return n.GetJSONNameForType(tpe, name)
+}
+
+// GetJSONNameForType gets the json name for a go property name on a given type
+func (n *NameProvider) GetJSONNameForType(tpe reflect.Type, name string) (string, bool) {
+ n.lock.Lock()
+ defer n.lock.Unlock()
+ names, ok := n.index[tpe]
+ if !ok {
+ names = n.makeNameIndex(tpe)
+ }
+ nme, ok := names.goNames[name]
+ return nme, ok
+}
+
+// GetGoName gets the go name for a json property name
+func (n *NameProvider) GetGoName(subject any, name string) (string, bool) {
+ tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
+ return n.GetGoNameForType(tpe, name)
+}
+
+// GetGoNameForType gets the go name for a given type for a json property name
+func (n *NameProvider) GetGoNameForType(tpe reflect.Type, name string) (string, bool) {
+ n.lock.Lock()
+ defer n.lock.Unlock()
+ names, ok := n.index[tpe]
+ if !ok {
+ names = n.makeNameIndex(tpe)
+ }
+ nme, ok := names.jsonNames[name]
+ return nme, ok
+}
+
+func (n *NameProvider) makeNameIndex(tpe reflect.Type) nameIndex {
+ names := newNameIndex(tpe)
+ n.index[tpe] = names
+ return names
+}
diff --git a/vendor/github.com/go-openapi/swag/jsonname_iface.go b/vendor/github.com/go-openapi/swag/jsonname_iface.go
new file mode 100644
index 000000000000..303a007f6f4c
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonname_iface.go
@@ -0,0 +1,24 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package swag
+
+import (
+ "github.com/go-openapi/swag/jsonname"
+)
+
+// DefaultJSONNameProvider is the default cache for types
+//
+// Deprecated: use [jsonname.DefaultJSONNameProvider] instead.
+var DefaultJSONNameProvider = jsonname.DefaultJSONNameProvider
+
+// NameProvider represents an object capable of translating from go property names
+// to json property names.
+//
+// Deprecated: use [jsonname.NameProvider] instead.
+type NameProvider = jsonname.NameProvider
+
+// NewNameProvider creates a new name provider
+//
+// Deprecated: use [jsonname.NewNameProvider] instead.
+func NewNameProvider() *NameProvider { return jsonname.NewNameProvider() }
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/LICENSE b/vendor/github.com/go-openapi/swag/jsonutils/LICENSE
new file mode 100644
index 000000000000..d64569567334
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/README.md b/vendor/github.com/go-openapi/swag/jsonutils/README.md
new file mode 100644
index 000000000000..d745cdb466e2
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/README.md
@@ -0,0 +1,108 @@
+ # jsonutils
+
+`jsonutils` exposes a few tools to work with JSON:
+
+- a fast, simple `Concat` to concatenate (not merge) JSON objects and arrays
+- `FromDynamicJSON` to convert a data structure into a "dynamic JSON" data structure
+- `ReadJSON` and `WriteJSON` behave like `json.Unmarshal` and `json.Marshal`,
+ with the ability to use another underlying serialization library through an `Adapter`
+ configured at runtime
+- a `JSONMapSlice` structure that may be used to store JSON objects with the order of keys maintained
+
+## Dynamic JSON
+
+We call "dynamic JSON" the go data structure that results from unmarshaling JSON like this:
+
+```go
+ var value any
+ jsonBytes := `{"a": 1, ... }`
+ _ = json.Unmarshal(jsonBytes, &value)
+```
+
+In this configuration, the standard library mappings are as follows:
+
+| JSON | go |
+|-----------|------------------|
+| `number` | `float64` |
+| `string` | `string` |
+| `boolean` | `bool` |
+| `null` | `nil` |
+| `object` | `map[string]any` |
+| `array` | `[]any` |
+
+## Map slices
+
+When using `JSONMapSlice`, the ordering of keys is ensured by replacing
+mappings to `map[string]any` by a `JSONMapSlice` which is an (ordered)
+slice of `JSONMapItem`s.
+
+Notice that a similar feature is available for YAML (see [`yamlutils`](../yamlutils)),
+with a `YAMLMapSlice` type based on the `JSONMapSlice`.
+
+`JSONMapSlice` is similar to an ordered map, but the keys are not retrieved
+in constant time.
+
+Another difference with the the above standard mappings is that numbers don't always map
+to a `float64`: if the value is a JSON integer, it unmarshals to `int64`.
+
+See also [some examples](https://pkg.go.dev/github.com/go-openapi/swag/jsonutils#pkg-examples)
+
+## Adapters
+
+`ReadJSON`, `WriteJSON` and `FromDynamicJSON` (which is a combination of the latter two)
+are wrappers on top of `json.Unmarshal` and `json.Marshal`.
+
+By default, the adapter merely wraps the standard library.
+
+The adapter may be used to register other JSON serialization libraries,
+possibly several ones at the same time.
+
+If the value passed is identified as an "ordered map" (i.e. implements `ifaces.Ordered`
+or `ifaces.SetOrdered`, the adapter favors the "ordered" JSON behavior and tries to
+find a registered implementation that support ordered keys in objects.
+
+Our standard library implementation supports this.
+
+As of `v0.25.0`, we support through such an adapter the popular `mailru/easyjson`
+library, which kicks in when the passed values support the `easyjson.Unmarshaler`
+or `easyjson.Marshaler` interfaces.
+
+In the future, we plan to add more similar libraries that compete on the go JSON
+serializers scene.
+
+## Registering an adapter
+
+In package `github.com/go-openapi/swag/easyjson/adapters`, several adapters are available.
+
+Each adapter is an independent go module. Hence you'll pick its dependencies only if you import it.
+
+At this moment we provide:
+* `stdlib`: JSON adapter based on the standard library
+* `easyjson`: JSON adapter based on the `github.com/mailru/easyjson`
+
+The adapters provide the basic `Marshal` and `Unmarshal` capabilities, plus an implementation
+of the `MapSlice` pattern.
+
+You may also build your own adapter based on your specific use-case. An adapter is not required to implement
+all capabilities.
+
+Every adapter comes with a `Register` function, possibly with some options, to register the adapter
+to a global registry.
+
+For example, to enable `easyjson` to be used in `ReadJSON` and `WriteJSON`, you would write something like:
+
+```go
+ import (
+ "github.com/go-openapi/swag/jsonutils/adapters"
+ easyjson "github.com/go-openapi/swag/jsonutils/adapters/easyjson/json"
+ )
+
+ func init() {
+ easyjson.Register(adapters.Registry)
+ }
+```
+
+You may register several adapters. In this case, capability matching is evaluated from the last registered
+adapters (LIFO).
+
+## [Benchmarks](./adapters/testintegration/benchmarks/README.md)
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/doc.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/doc.go
new file mode 100644
index 000000000000..76d3898fca5e
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/doc.go
@@ -0,0 +1,8 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+// Package adapters exposes a registry of adapters to multiple
+// JSON serialization libraries.
+//
+// All interfaces are defined in package [ifaces.Adapter].
+package adapters
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/doc.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/doc.go
new file mode 100644
index 000000000000..1fd43a1fad51
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/doc.go
@@ -0,0 +1,5 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+// Package ifaces exposes all interfaces to work with adapters.
+package ifaces
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/ifaces.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/ifaces.go
new file mode 100644
index 000000000000..7805e5e5e398
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/ifaces.go
@@ -0,0 +1,84 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package ifaces
+
+import (
+ _ "encoding/json" // for documentation purpose
+ "iter"
+)
+
+// Ordered knows how to iterate over the (key,value) pairs of a JSON object.
+type Ordered interface {
+ OrderedItems() iter.Seq2[string, any]
+}
+
+// SetOrdered knows how to append or update the keys of a JSON object,
+// given an iterator over (key,value) pairs.
+//
+// If the provided iterator is nil then the receiver should be set to nil.
+type SetOrdered interface {
+ SetOrderedItems(iter.Seq2[string, any])
+}
+
+// OrderedMap represent a JSON object (i.e. like a map[string,any]),
+// and knows how to serialize and deserialize JSON with the order of keys maintained.
+type OrderedMap interface {
+ Ordered
+ SetOrdered
+
+ OrderedMarshalJSON() ([]byte, error)
+ OrderedUnmarshalJSON([]byte) error
+}
+
+// MarshalAdapter behaves likes the standard library [json.Marshal].
+type MarshalAdapter interface {
+ Poolable
+
+ Marshal(any) ([]byte, error)
+}
+
+// OrderedMarshalAdapter behaves likes the standard library [json.Marshal], preserving the order of keys in objects.
+type OrderedMarshalAdapter interface {
+ Poolable
+
+ OrderedMarshal(Ordered) ([]byte, error)
+}
+
+// UnmarshalAdapter behaves likes the standard library [json.Unmarshal].
+type UnmarshalAdapter interface {
+ Poolable
+
+ Unmarshal([]byte, any) error
+}
+
+// OrderedUnmarshalAdapter behaves likes the standard library [json.Unmarshal], preserving the order of keys in objects.
+type OrderedUnmarshalAdapter interface {
+ Poolable
+
+ OrderedUnmarshal([]byte, SetOrdered) error
+}
+
+// Adapter exposes an interface like the standard [json] library.
+type Adapter interface {
+ MarshalAdapter
+ UnmarshalAdapter
+
+ OrderedAdapter
+}
+
+// OrderedAdapter exposes interfaces to process JSON and keep the order of object keys.
+type OrderedAdapter interface {
+ OrderedMarshalAdapter
+ OrderedUnmarshalAdapter
+ NewOrderedMap(capacity int) OrderedMap
+}
+
+type Poolable interface {
+ // Self-redeem: for [Adapter] s that are allocated from a pool.
+ // The [Adapter] must not be used after calling [Redeem].
+ Redeem()
+
+ // Reset the state of the [Adapter], if any.
+ Reset()
+}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/registry_iface.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/registry_iface.go
new file mode 100644
index 000000000000..2d6c69f4e602
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/registry_iface.go
@@ -0,0 +1,91 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package ifaces
+
+import (
+ "strings"
+)
+
+// Capability indicates what a JSON adapter is capable of.
+type Capability uint8
+
+const (
+ CapabilityMarshalJSON Capability = 1 << iota
+ CapabilityUnmarshalJSON
+ CapabilityOrderedMarshalJSON
+ CapabilityOrderedUnmarshalJSON
+ CapabilityOrderedMap
+)
+
+func (c Capability) String() string {
+ switch c {
+ case CapabilityMarshalJSON:
+ return "MarshalJSON"
+ case CapabilityUnmarshalJSON:
+ return "UnmarshalJSON"
+ case CapabilityOrderedMarshalJSON:
+ return "OrderedMarshalJSON"
+ case CapabilityOrderedUnmarshalJSON:
+ return "OrderedUnmarshalJSON"
+ case CapabilityOrderedMap:
+ return "OrderedMap"
+ default:
+ return ""
+ }
+}
+
+// Capabilities holds several unitary capability flags
+type Capabilities uint8
+
+// Has some capability flag enabled.
+func (c Capabilities) Has(capability Capability) bool {
+ return Capability(c)&capability > 0
+}
+
+func (c Capabilities) String() string {
+ var w strings.Builder
+
+ first := true
+ for _, capability := range []Capability{
+ CapabilityMarshalJSON,
+ CapabilityUnmarshalJSON,
+ CapabilityOrderedMarshalJSON,
+ CapabilityOrderedUnmarshalJSON,
+ CapabilityOrderedMap,
+ } {
+ if c.Has(capability) {
+ if !first {
+ w.WriteByte('|')
+ } else {
+ first = false
+ }
+ w.WriteString(capability.String())
+ }
+ }
+
+ return w.String()
+}
+
+const (
+ AllCapabilities Capabilities = Capabilities(uint8(CapabilityMarshalJSON) |
+ uint8(CapabilityUnmarshalJSON) |
+ uint8(CapabilityOrderedMarshalJSON) |
+ uint8(CapabilityOrderedUnmarshalJSON) |
+ uint8(CapabilityOrderedMap))
+
+ AllUnorderedCapabilities Capabilities = Capabilities(uint8(CapabilityMarshalJSON) | uint8(CapabilityUnmarshalJSON))
+)
+
+// RegistryEntry describes how any given adapter registers its capabilities to the [Registrar].
+type RegistryEntry struct {
+ Who string
+ What Capabilities
+ Constructor func() Adapter
+ Support func(what Capability, value any) bool
+}
+
+// Registrar is a type that knows how to keep registration calls from adapters.
+type Registrar interface {
+ RegisterFor(RegistryEntry)
+}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/registry.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/registry.go
new file mode 100644
index 000000000000..3062acaff261
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/registry.go
@@ -0,0 +1,229 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package adapters
+
+import (
+ "fmt"
+ "reflect"
+ "slices"
+ "sync"
+
+ "github.com/go-openapi/swag/jsonutils/adapters/ifaces"
+ stdlib "github.com/go-openapi/swag/jsonutils/adapters/stdlib/json"
+)
+
+// Registry holds the global registry for registered adapters.
+var Registry = NewRegistrar()
+
+var (
+ defaultRegistered = stdlib.Register
+
+ _ ifaces.Registrar = &Registrar{}
+)
+
+type registryError string
+
+func (e registryError) Error() string {
+ return string(e)
+}
+
+// ErrRegistry indicates an error returned by the [Registrar].
+var ErrRegistry registryError = "JSON adapters registry error"
+
+type registry []*ifaces.RegistryEntry
+
+// Registrar holds registered [ifaces.Adapters] for different serialization capabilities.
+//
+// Internally, it maintains a cache for data types that favor a given adapter.
+type Registrar struct {
+ marshalerRegistry registry
+ unmarshalerRegistry registry
+ orderedMarshalerRegistry registry
+ orderedUnmarshalerRegistry registry
+ orderedMapRegistry registry
+
+ gmx sync.RWMutex
+
+ // cache indexed by value type, so we don't have to lookup
+ marshalerCache map[reflect.Type]*ifaces.RegistryEntry
+ unmarshalerCache map[reflect.Type]*ifaces.RegistryEntry
+ orderedMarshalerCache map[reflect.Type]*ifaces.RegistryEntry
+ orderedUnmarshalerCache map[reflect.Type]*ifaces.RegistryEntry
+ orderedMapCache map[reflect.Type]*ifaces.RegistryEntry
+}
+
+func NewRegistrar() *Registrar {
+ r := &Registrar{}
+
+ r.marshalerRegistry = make(registry, 0, 1)
+ r.unmarshalerRegistry = make(registry, 0, 1)
+ r.orderedMarshalerRegistry = make(registry, 0, 1)
+ r.orderedUnmarshalerRegistry = make(registry, 0, 1)
+ r.orderedMapRegistry = make(registry, 0, 1)
+
+ r.marshalerCache = make(map[reflect.Type]*ifaces.RegistryEntry)
+ r.unmarshalerCache = make(map[reflect.Type]*ifaces.RegistryEntry)
+ r.orderedMarshalerCache = make(map[reflect.Type]*ifaces.RegistryEntry)
+ r.orderedUnmarshalerCache = make(map[reflect.Type]*ifaces.RegistryEntry)
+ r.orderedMapCache = make(map[reflect.Type]*ifaces.RegistryEntry)
+
+ defaultRegistered(r)
+
+ return r
+}
+
+// ClearCache resets the internal type cache.
+func (r *Registrar) ClearCache() {
+ r.gmx.Lock()
+ r.clearCache()
+ r.gmx.Unlock()
+}
+
+// Reset the [Registrar] to its defaults.
+func (r *Registrar) Reset() {
+ r.gmx.Lock()
+ r.clearCache()
+ r.marshalerRegistry = r.marshalerRegistry[:0]
+ r.unmarshalerRegistry = r.unmarshalerRegistry[:0]
+ r.orderedMarshalerRegistry = r.orderedMarshalerRegistry[:0]
+ r.orderedUnmarshalerRegistry = r.orderedUnmarshalerRegistry[:0]
+ r.orderedMapRegistry = r.orderedMapRegistry[:0]
+ r.gmx.Unlock()
+
+ defaultRegistered(r)
+}
+
+// RegisterFor registers an adapter for some JSON capabilities.
+func (r *Registrar) RegisterFor(entry ifaces.RegistryEntry) {
+ r.gmx.Lock()
+ if entry.What.Has(ifaces.CapabilityMarshalJSON) {
+ e := entry
+ e.What &= ifaces.Capabilities(ifaces.CapabilityMarshalJSON)
+ r.marshalerRegistry = slices.Insert(r.marshalerRegistry, 0, &e)
+ }
+ if entry.What.Has(ifaces.CapabilityUnmarshalJSON) {
+ e := entry
+ e.What &= ifaces.Capabilities(ifaces.CapabilityUnmarshalJSON)
+ r.unmarshalerRegistry = slices.Insert(r.unmarshalerRegistry, 0, &e)
+ }
+ if entry.What.Has(ifaces.CapabilityOrderedMarshalJSON) {
+ e := entry
+ e.What &= ifaces.Capabilities(ifaces.CapabilityOrderedMarshalJSON)
+ r.orderedMarshalerRegistry = slices.Insert(r.orderedMarshalerRegistry, 0, &e)
+ }
+ if entry.What.Has(ifaces.CapabilityOrderedUnmarshalJSON) {
+ e := entry
+ e.What &= ifaces.Capabilities(ifaces.CapabilityOrderedUnmarshalJSON)
+ r.orderedUnmarshalerRegistry = slices.Insert(r.orderedUnmarshalerRegistry, 0, &e)
+ }
+ if entry.What.Has(ifaces.CapabilityOrderedMap) {
+ e := entry
+ e.What &= ifaces.Capabilities(ifaces.CapabilityOrderedMap)
+ r.orderedMapRegistry = slices.Insert(r.orderedMapRegistry, 0, &e)
+ }
+ r.gmx.Unlock()
+}
+
+// AdapterFor returns an [ifaces.Adapter] that supports this capability for this type of value.
+//
+// The [ifaces.Adapter] may be redeemed to its pool using its Redeem() method, for adapters that support global
+// pooling. When this is not the case, the redeem function is just a no-operation.
+func (r *Registrar) AdapterFor(capability ifaces.Capability, value any) ifaces.Adapter {
+ entry := r.findFirstFor(capability, value)
+ if entry == nil {
+ return nil
+ }
+
+ return entry.Constructor()
+}
+
+func (r *Registrar) clearCache() {
+ clear(r.marshalerCache)
+ clear(r.unmarshalerCache)
+ clear(r.orderedMarshalerCache)
+ clear(r.orderedUnmarshalerCache)
+ clear(r.orderedMapCache)
+}
+
+func (r *Registrar) findFirstFor(capability ifaces.Capability, value any) *ifaces.RegistryEntry {
+ switch capability {
+ case ifaces.CapabilityMarshalJSON:
+ return r.findFirstInRegistryFor(r.marshalerRegistry, r.marshalerCache, capability, value)
+ case ifaces.CapabilityUnmarshalJSON:
+ return r.findFirstInRegistryFor(r.unmarshalerRegistry, r.unmarshalerCache, capability, value)
+ case ifaces.CapabilityOrderedMarshalJSON:
+ return r.findFirstInRegistryFor(r.orderedMarshalerRegistry, r.orderedMarshalerCache, capability, value)
+ case ifaces.CapabilityOrderedUnmarshalJSON:
+ return r.findFirstInRegistryFor(r.orderedUnmarshalerRegistry, r.orderedUnmarshalerCache, capability, value)
+ case ifaces.CapabilityOrderedMap:
+ return r.findFirstInRegistryFor(r.orderedMapRegistry, r.orderedMapCache, capability, value)
+ default:
+ panic(fmt.Errorf("unsupported capability %d: %w", capability, ErrRegistry))
+ }
+}
+
+func (r *Registrar) findFirstInRegistryFor(reg registry, cache map[reflect.Type]*ifaces.RegistryEntry, capability ifaces.Capability, value any) *ifaces.RegistryEntry {
+ r.gmx.RLock()
+ if len(reg) > 1 {
+ if entry, ok := cache[reflect.TypeOf(value)]; ok {
+ // cache hit
+ r.gmx.RUnlock()
+ return entry
+ }
+ }
+
+ for _, entry := range reg {
+ if !entry.Support(capability, value) {
+ continue
+ }
+
+ r.gmx.RUnlock()
+
+ // update the internal cache
+ r.gmx.Lock()
+ cache[reflect.TypeOf(value)] = entry
+ r.gmx.Unlock()
+
+ return entry
+ }
+
+ // no adapter found
+ r.gmx.RUnlock()
+
+ return nil
+}
+
+// MarshalAdapterFor returns the first adapter that knows how to Marshal this type of value.
+func MarshalAdapterFor(value any) ifaces.MarshalAdapter {
+ return Registry.AdapterFor(ifaces.CapabilityMarshalJSON, value)
+}
+
+// OrderedMarshalAdapterFor returns the first adapter that knows how to OrderedMarshal this type of value.
+func OrderedMarshalAdapterFor(value ifaces.Ordered) ifaces.OrderedMarshalAdapter {
+ return Registry.AdapterFor(ifaces.CapabilityOrderedMarshalJSON, value)
+}
+
+// UnmarshalAdapterFor returns the first adapter that knows how to Unmarshal this type of value.
+func UnmarshalAdapterFor(value any) ifaces.UnmarshalAdapter {
+ return Registry.AdapterFor(ifaces.CapabilityUnmarshalJSON, value)
+}
+
+// OrderedUnmarshalAdapterFor provides the first adapter that knows how to OrderedUnmarshal this type of value.
+func OrderedUnmarshalAdapterFor(value ifaces.SetOrdered) ifaces.OrderedUnmarshalAdapter {
+ return Registry.AdapterFor(ifaces.CapabilityOrderedUnmarshalJSON, value)
+}
+
+// NewOrderedMap provides the "ordered map" implementation provided by the registry.
+func NewOrderedMap(capacity int) ifaces.OrderedMap {
+ var v any
+ adapter := Registry.AdapterFor(ifaces.CapabilityOrderedUnmarshalJSON, v)
+ if adapter == nil {
+ return nil
+ }
+
+ defer adapter.Redeem()
+ return adapter.NewOrderedMap(capacity)
+}
+
+func noopRedeemer() {}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go
new file mode 100644
index 000000000000..0213ff5c29f1
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go
@@ -0,0 +1,115 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package json
+
+import (
+ stdjson "encoding/json"
+
+ "github.com/go-openapi/swag/jsonutils/adapters/ifaces"
+ "github.com/go-openapi/swag/typeutils"
+)
+
+const sensibleBufferSize = 8192
+
+type jsonError string
+
+func (e jsonError) Error() string {
+ return string(e)
+}
+
+// ErrStdlib indicates that an error comes from the stdlib JSON adapter
+var ErrStdlib jsonError = "error from the JSON adapter stdlib"
+
+var _ ifaces.Adapter = &Adapter{}
+
+type Adapter struct {
+}
+
+// NewAdapter yields an [ifaces.Adapter] using the standard library.
+func NewAdapter() *Adapter {
+ return &Adapter{}
+}
+
+func (a *Adapter) Marshal(value any) ([]byte, error) {
+ return stdjson.Marshal(value)
+}
+
+func (a *Adapter) Unmarshal(data []byte, value any) error {
+ return stdjson.Unmarshal(data, value)
+}
+
+func (a *Adapter) OrderedMarshal(value ifaces.Ordered) ([]byte, error) {
+ w := poolOfWriters.Borrow()
+ defer func() {
+ poolOfWriters.Redeem(w)
+ }()
+
+ if typeutils.IsNil(value) {
+ w.RawString("null")
+
+ return w.BuildBytes()
+ }
+
+ w.RawByte('{')
+ first := true
+ for k, v := range value.OrderedItems() {
+ if first {
+ first = false
+ } else {
+ w.RawByte(',')
+ }
+
+ w.String(k)
+ w.RawByte(':')
+
+ switch val := v.(type) {
+ case ifaces.Ordered:
+ w.Raw(a.OrderedMarshal(val))
+ default:
+ w.Raw(stdjson.Marshal(v))
+ }
+ }
+
+ w.RawByte('}')
+
+ return w.BuildBytes()
+}
+
+func (a *Adapter) OrderedUnmarshal(data []byte, value ifaces.SetOrdered) error {
+ var m MapSlice
+ if err := m.OrderedUnmarshalJSON(data); err != nil {
+ return err
+ }
+
+ if typeutils.IsNil(m) {
+ // force input value to nil
+ value.SetOrderedItems(nil)
+
+ return nil
+ }
+
+ value.SetOrderedItems(m.OrderedItems())
+
+ return nil
+}
+
+func (a *Adapter) NewOrderedMap(capacity int) ifaces.OrderedMap {
+ m := make(MapSlice, 0, capacity)
+
+ return &m
+}
+
+// Redeem the [Adapter] when it comes from a pool.
+//
+// The adapter becomes immediately unusable once redeemed.
+func (a *Adapter) Redeem() {
+ if a == nil {
+ return
+ }
+
+ RedeemAdapter(a)
+}
+
+func (a *Adapter) Reset() {
+}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/doc.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/doc.go
new file mode 100644
index 000000000000..5ea1b4404252
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/doc.go
@@ -0,0 +1,5 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+// Package json implements an [ifaces.Adapter] using the standard library.
+package json
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go
new file mode 100644
index 000000000000..b5aa1c7972e7
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go
@@ -0,0 +1,320 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package json
+
+import (
+ stdjson "encoding/json"
+ "errors"
+ "fmt"
+ "io"
+ "math"
+ "strconv"
+
+ "github.com/go-openapi/swag/conv"
+)
+
+type token struct {
+ stdjson.Token
+}
+
+func (t token) String() string {
+ if t == invalidToken {
+ return "invalid token"
+ }
+ if t == eofToken {
+ return "EOF"
+ }
+
+ return fmt.Sprintf("%v", t.Token)
+}
+
+func (t token) Kind() tokenKind {
+ switch t.Token.(type) {
+ case nil:
+ return tokenNull
+ case stdjson.Delim:
+ return tokenDelim
+ case bool:
+ return tokenBool
+ case float64:
+ return tokenFloat
+ case stdjson.Number:
+ return tokenNumber
+ case string:
+ return tokenString
+ default:
+ return tokenUndef
+ }
+}
+
+func (t token) Delim() byte {
+ r, ok := t.Token.(stdjson.Delim)
+ if !ok {
+ return 0
+ }
+
+ return byte(r)
+}
+
+type tokenKind uint8
+
+const (
+ tokenUndef tokenKind = iota
+ tokenString
+ tokenNumber
+ tokenFloat
+ tokenBool
+ tokenNull
+ tokenDelim
+)
+
+var (
+ invalidToken = token{
+ Token: stdjson.Token(struct{}{}),
+ }
+
+ eofToken = token{
+ Token: stdjson.Token(&struct{}{}),
+ }
+
+ undefToken = token{
+ Token: stdjson.Token(uint8(0)),
+ }
+)
+
+// jlexer apes easyjson's jlexer, but uses the standard library decoder under the hood.
+type jlexer struct {
+ buf *bytesReader
+ dec *stdjson.Decoder
+ err error
+ // current token
+ next token
+ // started bool
+}
+
+type bytesReader struct {
+ buf []byte
+ offset int
+}
+
+func (b *bytesReader) Reset() {
+ b.buf = nil
+ b.offset = 0
+}
+
+func (b *bytesReader) Read(p []byte) (int, error) {
+ if b.offset >= len(b.buf) {
+ return 0, io.EOF
+ }
+
+ n := len(p)
+ buf := b.buf[b.offset:]
+ m := len(buf)
+
+ if n >= m {
+ copy(p, buf)
+ b.offset += m
+
+ return m, nil
+ }
+
+ copy(p, buf[:n])
+ b.offset += n
+
+ return n, nil
+}
+
+var _ io.Reader = &bytesReader{}
+
+func newLexer(data []byte) *jlexer {
+ l := &jlexer{
+ // current: undefToken,
+ next: undefToken,
+ }
+ l.buf = &bytesReader{
+ buf: data,
+ }
+ l.dec = stdjson.NewDecoder(l.buf) // unfortunately, cannot pool this
+
+ return l
+}
+
+func (l *jlexer) Reset() {
+ l.err = nil
+ l.next = undefToken
+ // leave l.dec and l.buf alone, since they are replaced at every Borrow
+}
+
+func (l *jlexer) Error() error {
+ return l.err
+}
+
+func (l *jlexer) SetErr(err error) {
+ l.err = err
+}
+
+func (l *jlexer) Ok() bool {
+ return l.err == nil
+}
+
+// NextToken consumes a token
+func (l *jlexer) NextToken() token {
+ if !l.Ok() {
+ return invalidToken
+ }
+
+ if l.next != undefToken {
+ next := l.next
+ l.next = undefToken
+
+ return next
+ }
+
+ return l.fetchToken()
+}
+
+// PeekToken returns the next token without consuming it
+func (l *jlexer) PeekToken() token {
+ if l.next == undefToken {
+ l.next = l.fetchToken()
+ }
+
+ return l.next
+}
+
+func (l *jlexer) Skip() {
+ _ = l.NextToken()
+}
+
+func (l *jlexer) IsDelim(c byte) bool {
+ if !l.Ok() {
+ return false
+ }
+
+ next := l.PeekToken()
+ if next.Kind() != tokenDelim {
+ return false
+ }
+
+ if next.Delim() != c {
+ return false
+ }
+
+ return true
+}
+
+func (l *jlexer) IsNull() bool {
+ if !l.Ok() {
+ return false
+ }
+
+ next := l.PeekToken()
+
+ return next.Kind() == tokenNull
+}
+
+func (l *jlexer) Delim(c byte) {
+ if !l.Ok() {
+ return
+ }
+
+ tok := l.NextToken()
+ if tok.Kind() != tokenDelim {
+ l.err = fmt.Errorf("expected a delimiter token but got '%v': %w", tok, ErrStdlib)
+
+ return
+ }
+
+ if tok.Delim() != c {
+ l.err = fmt.Errorf("expected delimiter '%q' but got '%q': %w", c, tok.Delim(), ErrStdlib)
+ }
+}
+
+func (l *jlexer) Null() {
+ if !l.Ok() {
+ return
+ }
+
+ tok := l.NextToken()
+ if tok.Kind() != tokenNull {
+ l.err = fmt.Errorf("expected a null token but got '%v': %w", tok, ErrStdlib)
+ }
+}
+
+func (l *jlexer) Number() any {
+ if !l.Ok() {
+ return 0
+ }
+
+ tok := l.NextToken()
+
+ switch tok.Kind() { //nolint:exhaustive
+ case tokenNumber:
+ n := tok.Token.(stdjson.Number).String()
+ f, _ := strconv.ParseFloat(n, 64)
+ if conv.IsFloat64AJSONInteger(f) {
+ return int64(math.Trunc(f))
+ }
+
+ return f
+
+ case tokenFloat:
+ f := tok.Token.(float64)
+ if conv.IsFloat64AJSONInteger(f) {
+ return int64(math.Trunc(f))
+ }
+
+ return f
+
+ default:
+ l.err = fmt.Errorf("expected a number token but got '%v': %w", tok, ErrStdlib)
+
+ return 0
+ }
+}
+
+func (l *jlexer) Bool() bool {
+ if !l.Ok() {
+ return false
+ }
+
+ tok := l.NextToken()
+ if tok.Kind() != tokenBool {
+ l.err = fmt.Errorf("expected a bool token but got '%v': %w", tok, ErrStdlib)
+
+ return false
+ }
+
+ return tok.Token.(bool)
+}
+
+func (l *jlexer) String() string {
+ if !l.Ok() {
+ return ""
+ }
+
+ tok := l.NextToken()
+ if tok.Kind() != tokenString {
+ l.err = fmt.Errorf("expected a string token but got '%v': %w", tok, ErrStdlib)
+
+ return ""
+ }
+
+ return tok.Token.(string)
+}
+
+// Commas and colons are elided.
+func (l *jlexer) fetchToken() token {
+ jtok, err := l.dec.Token()
+ if err != nil {
+ if errors.Is(err, io.EOF) {
+ return eofToken
+ }
+
+ l.err = errors.Join(err, ErrStdlib)
+ return invalidToken
+ }
+
+ return token{Token: jtok}
+}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go
new file mode 100644
index 000000000000..54deef406f33
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go
@@ -0,0 +1,266 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package json
+
+import (
+ stdjson "encoding/json"
+ "fmt"
+ "iter"
+
+ "github.com/go-openapi/swag/jsonutils/adapters/ifaces"
+)
+
+var _ ifaces.OrderedMap = &MapSlice{}
+
+// MapSlice represents a JSON object, with the order of keys maintained.
+type MapSlice []MapItem
+
+func (s MapSlice) OrderedItems() iter.Seq2[string, any] {
+ return func(yield func(string, any) bool) {
+ for _, item := range s {
+ if !yield(item.Key, item.Value) {
+ return
+ }
+ }
+ }
+}
+
+func (s *MapSlice) SetOrderedItems(items iter.Seq2[string, any]) {
+ if items == nil {
+ *s = nil
+
+ return
+ }
+
+ m := *s
+ if len(m) > 0 {
+ // update mode
+ idx := make(map[string]int, len(m))
+
+ for i, item := range m {
+ idx[item.Key] = i
+ }
+
+ for k, v := range items {
+ idx, ok := idx[k]
+ if ok {
+ m[idx].Value = v
+
+ continue
+ }
+ m = append(m, MapItem{Key: k, Value: v})
+ }
+
+ *s = m
+
+ return
+ }
+
+ for k, v := range items {
+ m = append(m, MapItem{Key: k, Value: v})
+ }
+
+ *s = m
+}
+
+// MarshalJSON renders a [MapSlice] as JSON bytes, preserving the order of keys.
+func (s MapSlice) MarshalJSON() ([]byte, error) {
+ return s.OrderedMarshalJSON()
+}
+
+func (s MapSlice) OrderedMarshalJSON() ([]byte, error) {
+ w := poolOfWriters.Borrow()
+ defer func() {
+ poolOfWriters.Redeem(w)
+ }()
+
+ s.marshalObject(w)
+
+ return w.BuildBytes() // this clones data, so it's okay to redeem the writer and its buffer
+}
+
+// UnmarshalJSON builds a [MapSlice] from JSON bytes, preserving the order of keys.
+//
+// Inner objects are unmarshaled as [MapSlice] slices and not map[string]any.
+func (s *MapSlice) UnmarshalJSON(data []byte) error {
+ return s.OrderedUnmarshalJSON(data)
+}
+
+func (s *MapSlice) OrderedUnmarshalJSON(data []byte) error {
+ l := poolOfLexers.Borrow(data)
+ defer func() {
+ poolOfLexers.Redeem(l)
+ }()
+
+ s.unmarshalObject(l)
+
+ return l.Error()
+}
+
+func (s MapSlice) marshalObject(w *jwriter) {
+ if s == nil {
+ w.RawString("null")
+
+ return
+ }
+
+ w.RawByte('{')
+
+ if len(s) == 0 {
+ w.RawByte('}')
+
+ return
+ }
+
+ s[0].marshalJSON(w)
+
+ for i := 1; i < len(s); i++ {
+ w.RawByte(',')
+ s[i].marshalJSON(w)
+ }
+
+ w.RawByte('}')
+}
+
+func (s *MapSlice) unmarshalObject(in *jlexer) {
+ if in.IsNull() {
+ in.Skip()
+
+ return
+ }
+
+ in.Delim('{') // consume token
+ if !in.Ok() {
+ return
+ }
+
+ result := make(MapSlice, 0)
+
+ for in.Ok() && !in.IsDelim('}') {
+ var mi MapItem
+
+ mi.unmarshalKeyValue(in)
+ result = append(result, mi)
+ }
+
+ in.Delim('}')
+
+ if !in.Ok() {
+ return
+ }
+
+ *s = result
+}
+
+// MapItem represents the value of a key in a JSON object held by [MapSlice].
+//
+// Notice that [MapItem] should not be marshaled to or unmarshaled from JSON directly,
+// use this type as part of a [MapSlice] when dealing with JSON bytes.
+type MapItem struct {
+ Key string
+ Value any
+}
+
+func (s MapItem) marshalJSON(w *jwriter) {
+ w.String(s.Key)
+ w.RawByte(':')
+ w.Raw(stdjson.Marshal(s.Value))
+}
+
+func (s *MapItem) unmarshalKeyValue(in *jlexer) {
+ key := in.String() // consume string
+ value := s.asInterface(in) // consume any value, including termination tokens '}' or ']'
+
+ if !in.Ok() {
+ return
+ }
+
+ s.Key = key
+ s.Value = value
+}
+
+func (s *MapItem) unmarshalArray(in *jlexer) []any {
+ if in.IsNull() {
+ in.Skip()
+
+ return nil
+ }
+
+ in.Delim('[') // consume token
+ if !in.Ok() {
+ return nil
+ }
+
+ ret := make([]any, 0)
+
+ for in.Ok() && !in.IsDelim(']') {
+ ret = append(ret, s.asInterface(in))
+ }
+
+ in.Delim(']')
+ if !in.Ok() {
+ return nil
+ }
+
+ return ret
+}
+
+// asInterface is very much like [jlexer.Lexer.Interface], but unmarshals an object
+// into a [MapSlice], not a map[string]any.
+//
+// We have to force parsing errors somehow, since [jlexer.Lexer] doesn't let us
+// set a parsing error directly.
+func (s *MapItem) asInterface(in *jlexer) any {
+ if !in.Ok() {
+ return nil
+ }
+
+ tok := in.PeekToken() // look-ahead what the next token looks like
+ kind := tok.Kind()
+
+ switch kind {
+ case tokenString:
+ return in.String() // consume string
+
+ case tokenNumber, tokenFloat:
+ return in.Number()
+
+ case tokenBool:
+ return in.Bool()
+
+ case tokenNull:
+ in.Null()
+
+ return nil
+
+ case tokenDelim:
+ switch tok.Delim() {
+ case '{': // not consumed yet
+ ret := make(MapSlice, 0)
+ ret.unmarshalObject(in) // consumes the terminating '}'
+
+ if in.Ok() {
+ return ret
+ }
+
+ // lexer is in an error state: will exhaust
+ return nil
+
+ case '[': // not consumed yet
+ return s.unmarshalArray(in) // consumes the terminating ']'
+ default:
+ in.SetErr(fmt.Errorf("unexpected delimiter: %v: %w", tok, ErrStdlib)) // force error
+ return nil
+ }
+
+ case tokenUndef:
+ fallthrough
+ default:
+ if in.Ok() {
+ in.SetErr(fmt.Errorf("unexpected token: %v: %w", tok, ErrStdlib)) // force error
+ }
+
+ return nil
+ }
+}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go
new file mode 100644
index 000000000000..709b97c3046b
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go
@@ -0,0 +1,143 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package json
+
+import (
+ "encoding/json"
+ "sync"
+
+ "github.com/go-openapi/swag/jsonutils/adapters/ifaces"
+)
+
+type adaptersPool struct {
+ sync.Pool
+}
+
+func (p *adaptersPool) Borrow() *Adapter {
+ return p.Get().(*Adapter)
+}
+
+func (p *adaptersPool) BorrowIface() ifaces.Adapter {
+ return p.Get().(*Adapter)
+}
+
+func (p *adaptersPool) Redeem(a *Adapter) {
+ p.Put(a)
+}
+
+type writersPool struct {
+ sync.Pool
+}
+
+func (p *writersPool) Borrow() *jwriter {
+ ptr := p.Get()
+
+ jw := ptr.(*jwriter)
+ jw.Reset()
+
+ return jw
+}
+
+func (p *writersPool) Redeem(w *jwriter) {
+ p.Put(w)
+}
+
+type lexersPool struct {
+ sync.Pool
+}
+
+func (p *lexersPool) Borrow(data []byte) *jlexer {
+ ptr := p.Get()
+
+ l := ptr.(*jlexer)
+ l.buf = poolOfReaders.Borrow(data)
+ l.dec = json.NewDecoder(l.buf) // cannot pool, not exposed by the encoding/json API
+ l.Reset()
+
+ return l
+}
+
+func (p *lexersPool) Redeem(l *jlexer) {
+ l.dec = nil
+ discard := l.buf
+ l.buf = nil
+ poolOfReaders.Redeem(discard)
+ p.Put(l)
+}
+
+type readersPool struct {
+ sync.Pool
+}
+
+func (p *readersPool) Borrow(data []byte) *bytesReader {
+ ptr := p.Get()
+
+ b := ptr.(*bytesReader)
+ b.Reset()
+ b.buf = data
+
+ return b
+}
+
+func (p *readersPool) Redeem(b *bytesReader) {
+ p.Put(b)
+}
+
+var (
+ poolOfAdapters = &adaptersPool{
+ Pool: sync.Pool{
+ New: func() any {
+ return NewAdapter()
+ },
+ },
+ }
+
+ poolOfWriters = &writersPool{
+ Pool: sync.Pool{
+ New: func() any {
+ return newJWriter()
+ },
+ },
+ }
+
+ poolOfLexers = &lexersPool{
+ Pool: sync.Pool{
+ New: func() any {
+ return newLexer(nil)
+ },
+ },
+ }
+
+ poolOfReaders = &readersPool{
+ Pool: sync.Pool{
+ New: func() any {
+ return &bytesReader{}
+ },
+ },
+ }
+)
+
+// BorrowAdapter borrows an [Adapter] from the pool, recycling already allocated instances.
+func BorrowAdapter() *Adapter {
+ return poolOfAdapters.Borrow()
+}
+
+// BorrowAdapterIface borrows a stdlib [Adapter] and converts it directly
+// to [ifaces.Adapter]. This is useful to avoid further allocations when
+// translating the concrete type into an interface.
+func BorrowAdapterIface() ifaces.Adapter {
+ return poolOfAdapters.BorrowIface()
+}
+
+// RedeemAdapter redeems an [Adapter] to the pool, so it may be recycled.
+func RedeemAdapter(a *Adapter) {
+ poolOfAdapters.Redeem(a)
+}
+
+func RedeemAdapterIface(a ifaces.Adapter) {
+ concrete, ok := a.(*Adapter)
+ if ok {
+ poolOfAdapters.Redeem(concrete)
+ }
+}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go
new file mode 100644
index 000000000000..fc8818694eae
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go
@@ -0,0 +1,26 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package json
+
+import (
+ "fmt"
+ "reflect"
+
+ "github.com/go-openapi/swag/jsonutils/adapters/ifaces"
+)
+
+func Register(dispatcher ifaces.Registrar) {
+ t := reflect.TypeOf(Adapter{})
+ dispatcher.RegisterFor(
+ ifaces.RegistryEntry{
+ Who: fmt.Sprintf("%s.%s", t.PkgPath(), t.Name()),
+ What: ifaces.AllCapabilities,
+ Constructor: BorrowAdapterIface,
+ Support: support,
+ })
+}
+
+func support(_ ifaces.Capability, _ any) bool {
+ return true
+}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go
new file mode 100644
index 000000000000..dc2325c1a30f
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go
@@ -0,0 +1,75 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package json
+
+import (
+ "bytes"
+ "encoding/json"
+ "strings"
+)
+
+type jwriter struct {
+ buf *bytes.Buffer
+ err error
+}
+
+func newJWriter() *jwriter {
+ buf := make([]byte, 0, sensibleBufferSize)
+
+ return &jwriter{buf: bytes.NewBuffer(buf)}
+}
+
+func (w *jwriter) Reset() {
+ w.buf.Reset()
+ w.err = nil
+}
+
+func (w *jwriter) RawString(s string) {
+ if w.err != nil {
+ return
+ }
+ w.buf.WriteString(s)
+}
+
+func (w *jwriter) Raw(b []byte, err error) {
+ if w.err != nil {
+ return
+ }
+ if err != nil {
+ w.err = err
+ return
+ }
+
+ _, _ = w.buf.Write(b)
+}
+
+func (w *jwriter) RawByte(c byte) {
+ if w.err != nil {
+ return
+ }
+ w.buf.WriteByte(c)
+}
+
+var quoteReplacer = strings.NewReplacer(`"`, `\"`, `\`, `\\`)
+
+func (w *jwriter) String(s string) {
+ if w.err != nil {
+ return
+ }
+ // escape quotes and \
+ s = quoteReplacer.Replace(s)
+
+ _ = w.buf.WriteByte('"')
+ json.HTMLEscape(w.buf, []byte(s))
+ _ = w.buf.WriteByte('"')
+}
+
+// BuildBytes returns a clone of the internal buffer.
+func (w *jwriter) BuildBytes() ([]byte, error) {
+ if w.err != nil {
+ return nil, w.err
+ }
+
+ return bytes.Clone(w.buf.Bytes()), nil
+}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/concat.go b/vendor/github.com/go-openapi/swag/jsonutils/concat.go
new file mode 100644
index 000000000000..2068503af05b
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/concat.go
@@ -0,0 +1,92 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package jsonutils
+
+import (
+ "bytes"
+)
+
+// nullJSON represents a JSON object with null type
+var nullJSON = []byte("null")
+
+const comma = byte(',')
+
+var closers map[byte]byte
+
+func init() {
+ closers = map[byte]byte{
+ '{': '}',
+ '[': ']',
+ }
+}
+
+// ConcatJSON concatenates multiple json objects or arrays efficiently.
+//
+// Note that [ConcatJSON] performs a very simple (and fast) concatenation
+// operation: it does not attempt to merge objects.
+func ConcatJSON(blobs ...[]byte) []byte {
+ if len(blobs) == 0 {
+ return nil
+ }
+
+ last := len(blobs) - 1
+ for blobs[last] == nil || bytes.Equal(blobs[last], nullJSON) {
+ // strips trailing null objects
+ last--
+ if last < 0 {
+ // there was nothing but "null"s or nil...
+ return nil
+ }
+ }
+ if last == 0 {
+ return blobs[0]
+ }
+
+ var opening, closing byte
+ var idx, a int
+ buf := bytes.NewBuffer(nil)
+
+ for i, b := range blobs[:last+1] {
+ if b == nil || bytes.Equal(b, nullJSON) {
+ // a null object is in the list: skip it
+ continue
+ }
+ if len(b) > 0 && opening == 0 { // is this an array or an object?
+ opening, closing = b[0], closers[b[0]]
+ }
+
+ if opening != '{' && opening != '[' {
+ continue // don't know how to concatenate non container objects
+ }
+
+ const minLengthIfNotEmpty = 3
+ if len(b) < minLengthIfNotEmpty { // yep empty but also the last one, so closing this thing
+ if i == last && a > 0 {
+ _ = buf.WriteByte(closing) // never returns err != nil
+ }
+ continue
+ }
+
+ idx = 0
+ if a > 0 { // we need to join with a comma for everything beyond the first non-empty item
+ _ = buf.WriteByte(comma) // never returns err != nil
+ idx = 1 // this is not the first or the last so we want to drop the leading bracket
+ }
+
+ if i != last { // not the last one, strip brackets
+ _, _ = buf.Write(b[idx : len(b)-1]) // never returns err != nil
+ } else { // last one, strip only the leading bracket
+ _, _ = buf.Write(b[idx:])
+ }
+ a++
+ }
+
+ // somehow it ended up being empty, so provide a default value
+ if buf.Len() == 0 && (opening == '{' || opening == '[') {
+ _ = buf.WriteByte(opening) // never returns err != nil
+ _ = buf.WriteByte(closing)
+ }
+
+ return buf.Bytes()
+}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/doc.go b/vendor/github.com/go-openapi/swag/jsonutils/doc.go
new file mode 100644
index 000000000000..3926cc58d1bc
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/doc.go
@@ -0,0 +1,7 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+// Package jsonutils provides helpers to work with JSON.
+//
+// These utilities work with dynamic go structures to and from JSON.
+package jsonutils
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/json.go b/vendor/github.com/go-openapi/swag/jsonutils/json.go
new file mode 100644
index 000000000000..40753ce03fde
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/json.go
@@ -0,0 +1,116 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package jsonutils
+
+import (
+ "bytes"
+ "encoding/json"
+
+ "github.com/go-openapi/swag/jsonutils/adapters"
+ "github.com/go-openapi/swag/jsonutils/adapters/ifaces"
+)
+
+// WriteJSON marshals a data structure as JSON.
+//
+// The difference with [json.Marshal] is that it may check among several alternatives
+// to do so.
+//
+// See [adapters.Registrar] for more details about how to configure
+// multiple serialization alternatives.
+//
+// NOTE: to allow types that are [easyjson.Marshaler] s to use that route to process JSON,
+// you now need to register the adapter for easyjson at runtime.
+func WriteJSON(value any) ([]byte, error) {
+ if orderedMap, isOrdered := value.(ifaces.Ordered); isOrdered {
+ orderedMarshaler := adapters.OrderedMarshalAdapterFor(orderedMap)
+
+ if orderedMarshaler != nil {
+ defer orderedMarshaler.Redeem()
+
+ return orderedMarshaler.OrderedMarshal(orderedMap)
+ }
+
+ // no support found in registered adapters, fallback to the default (unordered) case
+ }
+
+ marshaler := adapters.MarshalAdapterFor(value)
+ if marshaler != nil {
+ defer marshaler.Redeem()
+
+ return marshaler.Marshal(value)
+ }
+
+ // no support found in registered adapters, fallback to the default standard library.
+ //
+ // This only happens when tinkering with the global registry of adapters, since the default handles all the above cases.
+ return json.Marshal(value) // Codecov ignore // this is a safeguard not easily simulated in tests
+}
+
+// ReadJSON unmarshals JSON data into a data structure.
+//
+// The difference with [json.Unmarshal] is that it may check among several alternatives
+// to do so.
+//
+// See [adapters.Registrar] for more details about how to configure
+// multiple serialization alternatives.
+//
+// NOTE: value must be a pointer.
+//
+// If the provided value implements [ifaces.SetOrdered], it is a considered an "ordered map" and [ReadJSON]
+// will favor an adapter that supports the [ifaces.OrderedUnmarshal] feature, or fallback to
+// an unordered behavior if none is found.
+//
+// NOTE: to allow types that are [easyjson.Unmarshaler] s to use that route to process JSON,
+// you now need to register the adapter for easyjson at runtime.
+func ReadJSON(data []byte, value any) error {
+ trimmedData := bytes.Trim(data, "\x00")
+
+ if orderedMap, isOrdered := value.(ifaces.SetOrdered); isOrdered {
+ // if the value is an ordered map, favors support for OrderedUnmarshal.
+
+ orderedUnmarshaler := adapters.OrderedUnmarshalAdapterFor(orderedMap)
+
+ if orderedUnmarshaler != nil {
+ defer orderedUnmarshaler.Redeem()
+
+ return orderedUnmarshaler.OrderedUnmarshal(trimmedData, orderedMap)
+ }
+
+ // no support found in registered adapters, fallback to the default (unordered) case
+ }
+
+ unmarshaler := adapters.UnmarshalAdapterFor(value)
+ if unmarshaler != nil {
+ defer unmarshaler.Redeem()
+
+ return unmarshaler.Unmarshal(trimmedData, value)
+ }
+
+ // no support found in registered adapters, fallback to the default standard library.
+ //
+ // This only happens when tinkering with the global registry of adapters, since the default handles all the above cases.
+ return json.Unmarshal(trimmedData, value) // Codecov ignore // this is a safeguard not easily simulated in tests
+}
+
+// FromDynamicJSON turns a go value into a properly JSON typed structure.
+//
+// "Dynamic JSON" refers to what you get when unmarshaling JSON into an untyped any,
+// i.e. objects are represented by map[string]any, arrays by []any, and
+// all numbers are represented as float64.
+//
+// NOTE: target must be a pointer.
+//
+// # Maintaining the order of keys in objects
+//
+// If source and target implement [ifaces.Ordered] and [ifaces.SetOrdered] respectively,
+// they are considered "ordered maps" and the order of keys is maintained in the
+// "jsonification" process. In that case, map[string]any values are replaced by (ordered) [JSONMapSlice] ones.
+func FromDynamicJSON(source, target any) error {
+ b, err := WriteJSON(source)
+ if err != nil {
+ return err
+ }
+
+ return ReadJSON(b, target)
+}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils/ordered_map.go b/vendor/github.com/go-openapi/swag/jsonutils/ordered_map.go
new file mode 100644
index 000000000000..38dd3e244426
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils/ordered_map.go
@@ -0,0 +1,114 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package jsonutils
+
+import (
+ "iter"
+
+ "github.com/go-openapi/swag/jsonutils/adapters"
+ "github.com/go-openapi/swag/typeutils"
+)
+
+// JSONMapSlice represents a JSON object, with the order of keys maintained.
+//
+// It behaves like an ordered map, but keys can't be accessed in constant time.
+type JSONMapSlice []JSONMapItem
+
+// OrderedItems iterates over all (key,value) pairs with the order of keys maintained.
+//
+// This implements the [ifaces.Ordered] interface, so that [ifaces.Adapter] s know how to marshal
+// keys in the desired order.
+func (s JSONMapSlice) OrderedItems() iter.Seq2[string, any] {
+ return func(yield func(string, any) bool) {
+ for _, item := range s {
+ if !yield(item.Key, item.Value) {
+ return
+ }
+ }
+ }
+}
+
+// SetOrderedItems sets keys in the [JSONMapSlice] objects, as presented by
+// the provided iterator.
+//
+// As a special case, if items is nil, this sets to receiver to a nil slice.
+//
+// This implements the [ifaces.SetOrdered] interface, so that [ifaces.Adapter] s know how to unmarshal
+// keys in the desired order.
+func (s *JSONMapSlice) SetOrderedItems(items iter.Seq2[string, any]) {
+ if items == nil {
+ // force receiver to be a nil slice
+ *s = nil
+
+ return
+ }
+
+ m := *s
+ if len(m) > 0 {
+ // update mode: short-circuited when unmarshaling fresh data structures
+ idx := make(map[string]int, len(m))
+
+ for i, item := range m {
+ idx[item.Key] = i
+ }
+
+ for k, v := range items {
+ idx, ok := idx[k]
+ if ok {
+ m[idx].Value = v
+
+ continue
+ }
+
+ m = append(m, JSONMapItem{Key: k, Value: v})
+ }
+
+ *s = m
+
+ return
+ }
+
+ for k, v := range items {
+ m = append(m, JSONMapItem{Key: k, Value: v})
+ }
+
+ *s = m
+}
+
+// MarshalJSON renders a [JSONMapSlice] as JSON bytes, preserving the order of keys.
+//
+// It will pick the JSON library currently configured by the [adapters.Registry] (defaults to the standard library).
+func (s JSONMapSlice) MarshalJSON() ([]byte, error) {
+ orderedMarshaler := adapters.OrderedMarshalAdapterFor(s)
+ defer orderedMarshaler.Redeem()
+
+ return orderedMarshaler.OrderedMarshal(s)
+}
+
+// UnmarshalJSON builds a [JSONMapSlice] from JSON bytes, preserving the order of keys.
+//
+// Inner objects are unmarshaled as ordered [JSONMapSlice] slices and not map[string]any.
+//
+// It will pick the JSON library currently configured by the [adapters.Registry] (defaults to the standard library).
+func (s *JSONMapSlice) UnmarshalJSON(data []byte) error {
+ if typeutils.IsNil(*s) {
+ // allow to unmarshal with a simple var declaration (nil slice)
+ *s = JSONMapSlice{}
+ }
+
+ orderedUnmarshaler := adapters.OrderedUnmarshalAdapterFor(s)
+ defer orderedUnmarshaler.Redeem()
+
+ return orderedUnmarshaler.OrderedUnmarshal(data, s)
+}
+
+// JSONMapItem represents the value of a key in a JSON object held by [JSONMapSlice].
+//
+// Notice that JSONMapItem should not be marshaled to or unmarshaled from JSON directly.
+//
+// Use this type as part of a [JSONMapSlice] when dealing with JSON bytes.
+type JSONMapItem struct {
+ Key string
+ Value any
+}
diff --git a/vendor/github.com/go-openapi/swag/jsonutils_iface.go b/vendor/github.com/go-openapi/swag/jsonutils_iface.go
new file mode 100644
index 000000000000..7bd4105fa51a
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/jsonutils_iface.go
@@ -0,0 +1,65 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package swag
+
+import (
+ "log"
+
+ "github.com/go-openapi/swag/jsonutils"
+)
+
+// JSONMapSlice represents a JSON object, with the order of keys maintained
+//
+// Deprecated: use [jsonutils.JSONMapSlice] instead, or [yamlutils.YAMLMapSlice] if you marshal YAML.
+type JSONMapSlice = jsonutils.JSONMapSlice
+
+// JSONMapItem represents a JSON object, with the order of keys maintained
+//
+// Deprecated: use [jsonutils.JSONMapItem] instead.
+type JSONMapItem = jsonutils.JSONMapItem
+
+// WriteJSON writes json data.
+//
+// Deprecated: use [jsonutils.WriteJSON] instead.
+func WriteJSON(data any) ([]byte, error) { return jsonutils.WriteJSON(data) }
+
+// ReadJSON reads json data.
+//
+// Deprecated: use [jsonutils.ReadJSON] instead.
+func ReadJSON(data []byte, value any) error { return jsonutils.ReadJSON(data, value) }
+
+// DynamicJSONToStruct converts an untyped JSON structure into a target data type.
+//
+// Deprecated: use [jsonutils.FromDynamicJSON] instead.
+func DynamicJSONToStruct(data any, target any) error {
+ return jsonutils.FromDynamicJSON(data, target)
+}
+
+// ConcatJSON concatenates multiple JSON objects efficiently.
+//
+// Deprecated: use [jsonutils.ConcatJSON] instead.
+func ConcatJSON(blobs ...[]byte) []byte { return jsonutils.ConcatJSON(blobs...) }
+
+// ToDynamicJSON turns a go value into a properly JSON untyped structure.
+//
+// It is the same as [FromDynamicJSON], but doesn't check for errors.
+//
+// Deprecated: this function is a misnomer and is unsafe. Use [jsonutils.FromDynamicJSON] instead.
+func ToDynamicJSON(value any) any {
+ var res any
+ if err := FromDynamicJSON(value, &res); err != nil {
+ log.Println(err)
+ }
+
+ return res
+}
+
+// FromDynamicJSON turns a go value into a properly JSON typed structure.
+//
+// "Dynamic JSON" refers to what you get when unmarshaling JSON into an untyped any,
+// i.e. objects are represented by map[string]any, arrays by []any, and all
+// scalar values are any.
+//
+// Deprecated: use [jsonutils.FromDynamicJSON] instead.
+func FromDynamicJSON(data, target any) error { return jsonutils.FromDynamicJSON(data, target) }
diff --git a/vendor/github.com/go-openapi/swag/loading/LICENSE b/vendor/github.com/go-openapi/swag/loading/LICENSE
new file mode 100644
index 000000000000..d64569567334
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/loading/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/vendor/github.com/go-openapi/swag/loading/doc.go b/vendor/github.com/go-openapi/swag/loading/doc.go
new file mode 100644
index 000000000000..8cf7bcb8b9d4
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/loading/doc.go
@@ -0,0 +1,5 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+// Package loading provides tools to load a file from http or from a local file system.
+package loading
diff --git a/vendor/github.com/go-openapi/swag/loading/errors.go b/vendor/github.com/go-openapi/swag/loading/errors.go
new file mode 100644
index 000000000000..b3964289c742
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/loading/errors.go
@@ -0,0 +1,15 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package loading
+
+type loadingError string
+
+const (
+ // ErrLoader is an error raised by the file loader utility
+ ErrLoader loadingError = "loader error"
+)
+
+func (e loadingError) Error() string {
+ return string(e)
+}
diff --git a/vendor/github.com/go-openapi/swag/loading/json.go b/vendor/github.com/go-openapi/swag/loading/json.go
new file mode 100644
index 000000000000..59db12f5cfdb
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/loading/json.go
@@ -0,0 +1,25 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package loading
+
+import (
+ "encoding/json"
+ "errors"
+ "path/filepath"
+)
+
+// JSONMatcher matches json for a file loader.
+func JSONMatcher(path string) bool {
+ ext := filepath.Ext(path)
+ return ext == ".json" || ext == ".jsn" || ext == ".jso"
+}
+
+// JSONDoc loads a json document from either a file or a remote url.
+func JSONDoc(path string, opts ...Option) (json.RawMessage, error) {
+ data, err := LoadFromFileOrHTTP(path, opts...)
+ if err != nil {
+ return nil, errors.Join(err, ErrLoader)
+ }
+ return json.RawMessage(data), nil
+}
diff --git a/vendor/github.com/go-openapi/swag/loading.go b/vendor/github.com/go-openapi/swag/loading/loading.go
similarity index 59%
rename from vendor/github.com/go-openapi/swag/loading.go
rename to vendor/github.com/go-openapi/swag/loading/loading.go
index 783442fddf63..269fb74d1675 100644
--- a/vendor/github.com/go-openapi/swag/loading.go
+++ b/vendor/github.com/go-openapi/swag/loading/loading.go
@@ -1,54 +1,26 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
-package swag
+package loading
import (
+ "context"
+ "embed"
"fmt"
"io"
"log"
"net/http"
"net/url"
- "os"
"path"
"path/filepath"
"runtime"
"strings"
- "time"
)
-// LoadHTTPTimeout the default timeout for load requests
-var LoadHTTPTimeout = 30 * time.Second
-
-// LoadHTTPBasicAuthUsername the username to use when load requests require basic auth
-var LoadHTTPBasicAuthUsername = ""
-
-// LoadHTTPBasicAuthPassword the password to use when load requests require basic auth
-var LoadHTTPBasicAuthPassword = ""
-
-// LoadHTTPCustomHeaders an optional collection of custom HTTP headers for load requests
-var LoadHTTPCustomHeaders = map[string]string{}
-
// LoadFromFileOrHTTP loads the bytes from a file or a remote http server based on the path passed in
-func LoadFromFileOrHTTP(pth string) ([]byte, error) {
- return LoadStrategy(pth, os.ReadFile, loadHTTPBytes(LoadHTTPTimeout))(pth)
-}
-
-// LoadFromFileOrHTTPWithTimeout loads the bytes from a file or a remote http server based on the path passed in
-// timeout arg allows for per request overriding of the request timeout
-func LoadFromFileOrHTTPWithTimeout(pth string, timeout time.Duration) ([]byte, error) {
- return LoadStrategy(pth, os.ReadFile, loadHTTPBytes(timeout))(pth)
+func LoadFromFileOrHTTP(pth string, opts ...Option) ([]byte, error) {
+ o := optionsWithDefaults(opts)
+ return LoadStrategy(pth, o.ReadFileFunc(), loadHTTPBytes(opts...), opts...)(pth)
}
// LoadStrategy returns a loader function for a given path or URI.
@@ -81,10 +53,12 @@ func LoadFromFileOrHTTPWithTimeout(pth string, timeout time.Duration) ([]byte, e
// - `file://host/folder/file` becomes an UNC path like `\\host\folder\file` (no port specification is supported)
// - `file:///c:/folder/file` becomes `C:\folder\file`
// - `file://c:/folder/file` is tolerated (without leading `/`) and becomes `c:\folder\file`
-func LoadStrategy(pth string, local, remote func(string) ([]byte, error)) func(string) ([]byte, error) {
+func LoadStrategy(pth string, local, remote func(string) ([]byte, error), opts ...Option) func(string) ([]byte, error) {
if strings.HasPrefix(pth, "http") {
return remote
}
+ o := optionsWithDefaults(opts)
+ _, isEmbedFS := o.fs.(embed.FS)
return func(p string) ([]byte, error) {
upth, err := url.PathUnescape(p)
@@ -92,19 +66,19 @@ func LoadStrategy(pth string, local, remote func(string) ([]byte, error)) func(s
return nil, err
}
- if !strings.HasPrefix(p, `file://`) {
+ cpth, hasPrefix := strings.CutPrefix(upth, "file://")
+ if !hasPrefix || isEmbedFS || runtime.GOOS != "windows" {
+ // crude processing: trim the file:// prefix. This leaves full URIs with a host with a (mostly) unexpected result
// regular file path provided: just normalize slashes
- return local(filepath.FromSlash(upth))
- }
-
- if runtime.GOOS != "windows" {
- // crude processing: this leaves full URIs with a host with a (mostly) unexpected result
- upth = strings.TrimPrefix(upth, `file://`)
+ if isEmbedFS {
+ // on windows, we need to slash the path if FS is an embed FS.
+ return local(strings.TrimLeft(filepath.ToSlash(cpth), "./")) // remove invalid leading characters for embed FS
+ }
- return local(filepath.FromSlash(upth))
+ return local(filepath.FromSlash(cpth))
}
- // windows-only pre-processing of file://... URIs
+ // windows-only pre-processing of file://... URIs, excluding embed.FS
// support for canonical file URIs on windows.
u, err := url.Parse(filepath.ToSlash(upth))
@@ -139,19 +113,29 @@ func LoadStrategy(pth string, local, remote func(string) ([]byte, error)) func(s
}
}
-func loadHTTPBytes(timeout time.Duration) func(path string) ([]byte, error) {
+func loadHTTPBytes(opts ...Option) func(path string) ([]byte, error) {
+ o := optionsWithDefaults(opts)
+
return func(path string) ([]byte, error) {
- client := &http.Client{Timeout: timeout}
- req, err := http.NewRequest(http.MethodGet, path, nil) //nolint:noctx
+ client := o.client
+ timeoutCtx := context.Background()
+ var cancel func()
+
+ if o.httpTimeout > 0 {
+ timeoutCtx, cancel = context.WithTimeout(timeoutCtx, o.httpTimeout)
+ defer cancel()
+ }
+
+ req, err := http.NewRequestWithContext(timeoutCtx, http.MethodGet, path, nil)
if err != nil {
return nil, err
}
- if LoadHTTPBasicAuthUsername != "" && LoadHTTPBasicAuthPassword != "" {
- req.SetBasicAuth(LoadHTTPBasicAuthUsername, LoadHTTPBasicAuthPassword)
+ if o.basicAuthUsername != "" && o.basicAuthPassword != "" {
+ req.SetBasicAuth(o.basicAuthUsername, o.basicAuthPassword)
}
- for key, val := range LoadHTTPCustomHeaders {
+ for key, val := range o.customHeaders {
req.Header.Set(key, val)
}
@@ -168,7 +152,7 @@ func loadHTTPBytes(timeout time.Duration) func(path string) ([]byte, error) {
}
if resp.StatusCode != http.StatusOK {
- return nil, fmt.Errorf("could not access document at %q [%s] ", path, resp.Status)
+ return nil, fmt.Errorf("could not access document at %q [%s]: %w", path, resp.Status, ErrLoader)
}
return io.ReadAll(resp.Body)
diff --git a/vendor/github.com/go-openapi/swag/loading/options.go b/vendor/github.com/go-openapi/swag/loading/options.go
new file mode 100644
index 000000000000..6674ac69e628
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/loading/options.go
@@ -0,0 +1,125 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package loading
+
+import (
+ "io/fs"
+ "net/http"
+ "os"
+ "time"
+)
+
+type (
+ // Option provides options for loading a file over HTTP or from a file.
+ Option func(*options)
+
+ httpOptions struct {
+ httpTimeout time.Duration
+ basicAuthUsername string
+ basicAuthPassword string
+ customHeaders map[string]string
+ client *http.Client
+ }
+
+ fileOptions struct {
+ fs fs.ReadFileFS
+ }
+
+ options struct {
+ httpOptions
+ fileOptions
+ }
+)
+
+func (fo fileOptions) ReadFileFunc() func(string) ([]byte, error) {
+ if fo.fs == nil {
+ return os.ReadFile
+ }
+
+ return fo.fs.ReadFile
+}
+
+// WithTimeout sets a timeout for the remote file loader.
+//
+// The default timeout is 30s.
+func WithTimeout(timeout time.Duration) Option {
+ return func(o *options) {
+ o.httpTimeout = timeout
+ }
+}
+
+// WithBasicAuth sets a basic authentication scheme for the remote file loader.
+func WithBasicAuth(username, password string) Option {
+ return func(o *options) {
+ o.basicAuthUsername = username
+ o.basicAuthPassword = password
+ }
+}
+
+// WithCustomHeaders sets custom headers for the remote file loader.
+func WithCustomHeaders(headers map[string]string) Option {
+ return func(o *options) {
+ if o.customHeaders == nil {
+ o.customHeaders = make(map[string]string, len(headers))
+ }
+
+ for header, value := range headers {
+ o.customHeaders[header] = value
+ }
+ }
+}
+
+// WithHTTPClient overrides the default HTTP client used to fetch a remote file.
+//
+// By default, [http.DefaultClient] is used.
+func WithHTTPClient(client *http.Client) Option {
+ return func(o *options) {
+ o.client = client
+ }
+}
+
+// WithFS sets a file system for the local file loader.
+//
+// If the provided file system is a [fs.ReadFileFS], the ReadFile function is used.
+// Otherwise, ReadFile is wrapped using [fs.ReadFile].
+//
+// By default, the file system is the one provided by the os package.
+//
+// For example, this may be set to consume from an embedded file system, or a rooted FS.
+func WithFS(filesystem fs.FS) Option {
+ return func(o *options) {
+ if rfs, ok := filesystem.(fs.ReadFileFS); ok {
+ o.fs = rfs
+
+ return
+ }
+ o.fs = readFileFS{FS: filesystem}
+ }
+}
+
+type readFileFS struct {
+ fs.FS
+}
+
+func (r readFileFS) ReadFile(name string) ([]byte, error) {
+ return fs.ReadFile(r.FS, name)
+}
+
+func optionsWithDefaults(opts []Option) options {
+ const defaultTimeout = 30 * time.Second
+
+ o := options{
+ // package level defaults
+ httpOptions: httpOptions{
+ httpTimeout: defaultTimeout,
+ client: http.DefaultClient,
+ },
+ }
+
+ for _, apply := range opts {
+ apply(&o)
+ }
+
+ return o
+}
diff --git a/vendor/github.com/go-openapi/swag/loading/yaml.go b/vendor/github.com/go-openapi/swag/loading/yaml.go
new file mode 100644
index 000000000000..3ebb53668c47
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/loading/yaml.go
@@ -0,0 +1,37 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package loading
+
+import (
+ "encoding/json"
+ "path/filepath"
+
+ "github.com/go-openapi/swag/yamlutils"
+)
+
+// YAMLMatcher matches yaml for a file loader.
+func YAMLMatcher(path string) bool {
+ ext := filepath.Ext(path)
+ return ext == ".yaml" || ext == ".yml"
+}
+
+// YAMLDoc loads a yaml document from either http or a file and converts it to json.
+func YAMLDoc(path string, opts ...Option) (json.RawMessage, error) {
+ yamlDoc, err := YAMLData(path, opts...)
+ if err != nil {
+ return nil, err
+ }
+
+ return yamlutils.YAMLToJSON(yamlDoc)
+}
+
+// YAMLData loads a yaml document from either http or a file.
+func YAMLData(path string, opts ...Option) (any, error) {
+ data, err := LoadFromFileOrHTTP(path, opts...)
+ if err != nil {
+ return nil, err
+ }
+
+ return yamlutils.BytesToYAMLDoc(data)
+}
diff --git a/vendor/github.com/go-openapi/swag/loading_iface.go b/vendor/github.com/go-openapi/swag/loading_iface.go
new file mode 100644
index 000000000000..27ec3fb8c37a
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/loading_iface.go
@@ -0,0 +1,91 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package swag
+
+import (
+ "encoding/json"
+ "time"
+
+ "github.com/go-openapi/swag/loading"
+)
+
+var (
+ // Package-level defaults for the file loading utilities (deprecated).
+
+ // LoadHTTPTimeout the default timeout for load requests.
+ //
+ // Deprecated: use [loading.WithTimeout] instead.
+ LoadHTTPTimeout = 30 * time.Second
+
+ // LoadHTTPBasicAuthUsername the username to use when load requests require basic auth.
+ //
+ // Deprecated: use [loading.WithBasicAuth] instead.
+ LoadHTTPBasicAuthUsername = ""
+
+ // LoadHTTPBasicAuthPassword the password to use when load requests require basic auth.
+ //
+ // Deprecated: use [loading.WithBasicAuth] instead.
+ LoadHTTPBasicAuthPassword = ""
+
+ // LoadHTTPCustomHeaders an optional collection of custom HTTP headers for load requests.
+ //
+ // Deprecated: use [loading.WithCustomHeaders] instead.
+ LoadHTTPCustomHeaders = map[string]string{}
+)
+
+// LoadFromFileOrHTTP loads the bytes from a file or a remote http server based on the provided path.
+//
+// Deprecated: use [loading.LoadFromFileOrHTTP] instead.
+func LoadFromFileOrHTTP(pth string, opts ...loading.Option) ([]byte, error) {
+ return loading.LoadFromFileOrHTTP(pth, loadingOptionsWithDefaults(opts)...)
+}
+
+// LoadFromFileOrHTTPWithTimeout loads the bytes from a file or a remote http server based on the path passed in
+// timeout arg allows for per request overriding of the request timeout.
+//
+// Deprecated: use [loading.LoadFileOrHTTP] with the [loading.WithTimeout] option instead.
+func LoadFromFileOrHTTPWithTimeout(pth string, timeout time.Duration, opts ...loading.Option) ([]byte, error) {
+ opts = append(opts, loading.WithTimeout(timeout))
+
+ return LoadFromFileOrHTTP(pth, opts...)
+}
+
+// LoadStrategy returns a loader function for a given path or URL.
+//
+// Deprecated: use [loading.LoadStrategy] instead.
+func LoadStrategy(pth string, local, remote func(string) ([]byte, error), opts ...loading.Option) func(string) ([]byte, error) {
+ return loading.LoadStrategy(pth, local, remote, loadingOptionsWithDefaults(opts)...)
+}
+
+// YAMLMatcher matches yaml for a file loader.
+//
+// Deprecated: use [loading.YAMLMatcher] instead.
+func YAMLMatcher(path string) bool { return loading.YAMLMatcher(path) }
+
+// YAMLDoc loads a yaml document from either http or a file and converts it to json.
+//
+// Deprecated: use [loading.YAMLDoc] instead.
+func YAMLDoc(path string) (json.RawMessage, error) {
+ return loading.YAMLDoc(path)
+}
+
+// YAMLData loads a yaml document from either http or a file.
+//
+// Deprecated: use [loading.YAMLData] instead.
+func YAMLData(path string) (any, error) {
+ return loading.YAMLData(path)
+}
+
+// loadingOptionsWithDefaults bridges deprecated default settings that use package-level variables,
+// with the recommended use of loading.Option.
+func loadingOptionsWithDefaults(opts []loading.Option) []loading.Option {
+ o := []loading.Option{
+ loading.WithTimeout(LoadHTTPTimeout),
+ loading.WithBasicAuth(LoadHTTPBasicAuthUsername, LoadHTTPBasicAuthPassword),
+ loading.WithCustomHeaders(LoadHTTPCustomHeaders),
+ }
+ o = append(o, opts...)
+
+ return o
+}
diff --git a/vendor/github.com/go-openapi/swag/BENCHMARK.md b/vendor/github.com/go-openapi/swag/mangling/BENCHMARK.md
similarity index 53%
rename from vendor/github.com/go-openapi/swag/BENCHMARK.md
rename to vendor/github.com/go-openapi/swag/mangling/BENCHMARK.md
index e7f28ed6b789..6674c63b7294 100644
--- a/vendor/github.com/go-openapi/swag/BENCHMARK.md
+++ b/vendor/github.com/go-openapi/swag/mangling/BENCHMARK.md
@@ -1,12 +1,10 @@
-# Benchmarks
-
-## Name mangling utilities
+# Benchmarking name mangling utilities
```bash
go test -bench XXX -run XXX -benchtime 30s
```
-### Benchmarks at b3e7a5386f996177e4808f11acb2aa93a0f660df
+## Benchmarks at b3e7a5386f996177e4808f11acb2aa93a0f660df
```
goos: linux
@@ -21,7 +19,7 @@ BenchmarkToXXXName/ToHumanNameLower-4 895334 40354 ns/op 10472 B/op
BenchmarkToXXXName/ToHumanNameTitle-4 882441 40678 ns/op 10566 B/op 749 allocs/op
```
-### Benchmarks after PR #79
+## Benchmarks after PR #79
~ x10 performance improvement and ~ /100 memory allocations.
@@ -50,3 +48,43 @@ BenchmarkToXXXName/ToCommandName-16 32256634 1137 ns/op 147 B/op
BenchmarkToXXXName/ToHumanNameLower-16 18599661 1946 ns/op 92 B/op 6 allocs/op
BenchmarkToXXXName/ToHumanNameTitle-16 17581353 2054 ns/op 105 B/op 6 allocs/op
```
+
+## Benchmarks at d7d2d1b895f5b6747afaff312dd2a402e69e818b
+
+go1.24
+
+```
+goos: linux
+goarch: amd64
+pkg: github.com/go-openapi/swag
+cpu: AMD Ryzen 7 5800X 8-Core Processor
+BenchmarkToXXXName/ToGoName-16 19757858 1881 ns/op 42 B/op 5 allocs/op
+BenchmarkToXXXName/ToVarName-16 17494111 2094 ns/op 74 B/op 7 allocs/op
+BenchmarkToXXXName/ToFileName-16 28161226 1492 ns/op 158 B/op 7 allocs/op
+BenchmarkToXXXName/ToCommandName-16 23787333 1489 ns/op 158 B/op 7 allocs/op
+BenchmarkToXXXName/ToHumanNameLower-16 17537257 2030 ns/op 103 B/op 6 allocs/op
+BenchmarkToXXXName/ToHumanNameTitle-16 16977453 2156 ns/op 105 B/op 6 allocs/op
+```
+
+## Benchmarks after PR #106
+
+Moving the scope of everything down to a struct allowed to reduce a bit garbage and pooling.
+
+On top of that, ToGoName (and thus ToVarName) have been subject to a minor optimization, removing a few allocations.
+
+Overall timings improve by ~ -10%.
+
+go1.24
+
+```
+goos: linux
+goarch: amd64
+pkg: github.com/go-openapi/swag/mangling
+cpu: AMD Ryzen 7 5800X 8-Core Processor
+BenchmarkToXXXName/ToGoName-16 22496130 1618 ns/op 31 B/op 3 allocs/op
+BenchmarkToXXXName/ToVarName-16 22538068 1618 ns/op 33 B/op 3 allocs/op
+BenchmarkToXXXName/ToFileName-16 27722977 1236 ns/op 105 B/op 6 allocs/op
+BenchmarkToXXXName/ToCommandName-16 27967395 1258 ns/op 105 B/op 6 allocs/op
+BenchmarkToXXXName/ToHumanNameLower-16 18587901 1917 ns/op 103 B/op 6 allocs/op
+BenchmarkToXXXName/ToHumanNameTitle-16 17193208 2019 ns/op 108 B/op 7 allocs/op
+```
diff --git a/vendor/github.com/go-openapi/swag/mangling/LICENSE b/vendor/github.com/go-openapi/swag/mangling/LICENSE
new file mode 100644
index 000000000000..d64569567334
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/vendor/github.com/go-openapi/swag/mangling/doc.go b/vendor/github.com/go-openapi/swag/mangling/doc.go
new file mode 100644
index 000000000000..ce0d8904857a
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling/doc.go
@@ -0,0 +1,25 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+// Package mangling provides name mangling capabilities.
+//
+// Name mangling is an important stage when generating code:
+// it helps construct safe program identifiers that abide by the language rules
+// and play along with linters.
+//
+// Examples:
+//
+// Suppose we get an object name taken from an API spec: "json_object",
+//
+// We may generate a legit go type name using [NameMangler.ToGoName]: "JsonObject".
+//
+// We may then locate this type in a source file named using [NameMangler.ToFileName]: "json_object.go".
+//
+// The methods exposed by the NameMangler are used to generate code in many different contexts, such as:
+//
+// - generating exported or unexported go identifiers from a JSON schema or an API spec
+// - generating file names
+// - generating human-readable comments for types and variables
+// - generating JSON-like API identifiers from go code
+// - ...
+package mangling
diff --git a/vendor/github.com/go-openapi/swag/mangling/initialism_index.go b/vendor/github.com/go-openapi/swag/mangling/initialism_index.go
new file mode 100644
index 000000000000..e5b70c149388
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling/initialism_index.go
@@ -0,0 +1,270 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package mangling
+
+import (
+ "sort"
+ "strings"
+ "unicode"
+ "unicode/utf8"
+)
+
+// DefaultInitialisms returns all the initialisms configured by default for this package.
+//
+// # Motivation
+//
+// Common initialisms are acronyms for which the ordinary camel-casing rules are altered and
+// for which we retain the original case.
+//
+// This is largely specific to the go naming conventions enforced by golint (now revive).
+//
+// # Example
+//
+// In go, "id" is a good-looking identifier, but "Id" is not and "ID" is preferred
+// (notice that this stems only from conventions: the go compiler accepts all of these).
+//
+// Similarly, we may use "http", but not "Http". In this case, "HTTP" is preferred.
+//
+// # Reference and customization
+//
+// The default list of these casing-style exceptions is taken from the [github.com/mgechev/revive] linter for go:
+// https://github.com/mgechev/revive/blob/master/lint/name.go#L93
+//
+// There are a few additions to the original list, such as IPv4, IPv6 and OAI ("OpenAPI").
+//
+// For these additions, "IPv4" would be preferred to "Ipv4" or "IPV4", and "OAI" to "Oai"
+//
+// You may redefine this list entirely using the mangler option [WithInitialisms], or simply add extra definitions
+// using [WithAdditionalInitialisms].
+//
+// # Mixed-case and plurals
+//
+// Notice that initialisms are not necessarily fully upper-cased: a mixed-case initialism indicates the preferred casing.
+//
+// Obviously, lower-case only initialisms do not make a lot of sense: if lower-case only initialisms are added,
+// they will be considered fully capitalized.
+//
+// Plural forms use mixed case like "IDs". And so do values like "IPv4" or "IPv6".
+//
+// The [NameMangler] automatically detects simple plurals for words such as "IDs" or "APIs",
+// so you don't need to configure these variants.
+//
+// At this moment, it doesn't support pluralization of terms that ends with an 's' (or 'S'), since there is
+// no clear consensus on whether a word like DNS should be pluralized as DNSes or remain invariant.
+// The [NameMangler] consider those invariant. Therefore DNSs or DNSes are not recognized as plurals for DNS.
+//
+// Besids, we don't want to support pluralization of terms which would otherwise conflict with another one,
+// like "HTTPs" vs "HTTPS". All these should be considered invariant. Hence: "Https" matches "HTTPS" and
+// "HTTPSS" is "HTTPS" followed by "S".
+func DefaultInitialisms() []string {
+ return []string{
+ "ACL",
+ "API",
+ "ASCII",
+ "CPU",
+ "CSS",
+ "DNS",
+ "EOF",
+ "GUID",
+ "HTML",
+ "HTTPS",
+ "HTTP",
+ "ID",
+ "IP",
+ "IPv4", // prefer the mixed case outcome IPv4 over the capitalized IPV4
+ "IPv6", // prefer the mixed case outcome IPv6 over the capitalized IPV6
+ "JSON",
+ "LHS",
+ "OAI",
+ "QPS",
+ "RAM",
+ "RHS",
+ "RPC",
+ "SLA",
+ "SMTP",
+ "SQL",
+ "SSH",
+ "TCP",
+ "TLS",
+ "TTL",
+ "UDP",
+ "UI",
+ "UID",
+ "UUID",
+ "URI",
+ "URL",
+ "UTF8",
+ "VM",
+ "XML",
+ "XMPP",
+ "XSRF",
+ "XSS",
+ }
+}
+
+type indexOfInitialisms struct {
+ initialismsCache
+
+ index map[string]struct{}
+}
+
+func newIndexOfInitialisms() *indexOfInitialisms {
+ return &indexOfInitialisms{
+ index: make(map[string]struct{}),
+ }
+}
+
+func (m *indexOfInitialisms) add(words ...string) *indexOfInitialisms {
+ for _, word := range words {
+ // sanitization of injected words: trimmed from blanks, and must start with a letter
+ trimmed := strings.TrimSpace(word)
+
+ firstRune, _ := utf8.DecodeRuneInString(trimmed)
+ if !unicode.IsLetter(firstRune) {
+ continue
+ }
+
+ // Initialisms are case-sensitive. This means that we support mixed-case words.
+ // However, if specified as a lower-case string, the initialism should be fully capitalized.
+ if trimmed == strings.ToLower(trimmed) {
+ m.index[strings.ToUpper(trimmed)] = struct{}{}
+
+ continue
+ }
+
+ m.index[trimmed] = struct{}{}
+ }
+ return m
+}
+
+func (m *indexOfInitialisms) sorted() []string {
+ result := make([]string, 0, len(m.index))
+ for k := range m.index {
+ result = append(result, k)
+ }
+ sort.Sort(sort.Reverse(byInitialism(result)))
+ return result
+}
+
+func (m *indexOfInitialisms) buildCache() {
+ m.build(m.sorted(), m.pluralForm)
+}
+
+// initialismsCache caches all needed pre-computed and converted initialism entries,
+// in the desired resolution order.
+type initialismsCache struct {
+ initialisms []string
+ initialismsRunes [][]rune
+ initialismsUpperCased [][]rune // initialisms cached in their trimmed, upper-cased version
+ initialismsPluralForm []pluralForm
+}
+
+func (c *initialismsCache) build(in []string, pluralfunc func(string) pluralForm) {
+ c.initialisms = in
+ c.initialismsRunes = asRunes(c.initialisms)
+ c.initialismsUpperCased = asUpperCased(c.initialisms)
+ c.initialismsPluralForm = asPluralForms(c.initialisms, pluralfunc)
+}
+
+// pluralForm denotes the kind of pluralization to be used for initialisms.
+//
+// At this moment, initialisms are either invariant or follow a simple plural form with an
+// extra (lower case) "s".
+type pluralForm uint8
+
+const (
+ notPlural pluralForm = iota
+ invariantPlural
+ simplePlural
+)
+
+func (f pluralForm) String() string {
+ switch f {
+ case notPlural:
+ return "notPlural"
+ case invariantPlural:
+ return "invariantPlural"
+ case simplePlural:
+ return "simplePlural"
+ default:
+ return ""
+ }
+}
+
+// pluralForm indicates how we want to pluralize a given initialism.
+//
+// Besides configured invariant forms (like HTTP and HTTPS),
+// an initialism is normally pluralized by adding a single 's', like in IDs.
+//
+// Initialisms ending with an 'S' or an 's' are configured as invariant (we don't
+// support plural forms like CSSes or DNSes, however the mechanism could be extended to
+// do just that).
+func (m *indexOfInitialisms) pluralForm(key string) pluralForm {
+ if _, ok := m.index[key]; !ok {
+ return notPlural
+ }
+
+ if strings.HasSuffix(strings.ToUpper(key), "S") {
+ return invariantPlural
+ }
+
+ if _, ok := m.index[key+"s"]; ok {
+ return invariantPlural
+ }
+
+ if _, ok := m.index[key+"S"]; ok {
+ return invariantPlural
+ }
+
+ return simplePlural
+}
+
+type byInitialism []string
+
+func (s byInitialism) Len() int {
+ return len(s)
+}
+func (s byInitialism) Swap(i, j int) {
+ s[i], s[j] = s[j], s[i]
+}
+
+// Less specifies the order in which initialisms are prioritized:
+// 1. match longest first
+// 2. when equal length, match in reverse lexicographical order, lower case match comes first
+func (s byInitialism) Less(i, j int) bool {
+ if len(s[i]) != len(s[j]) {
+ return len(s[i]) < len(s[j])
+ }
+
+ return s[i] < s[j]
+}
+
+func asRunes(in []string) [][]rune {
+ out := make([][]rune, len(in))
+ for i, initialism := range in {
+ out[i] = []rune(initialism)
+ }
+
+ return out
+}
+
+func asUpperCased(in []string) [][]rune {
+ out := make([][]rune, len(in))
+
+ for i, initialism := range in {
+ out[i] = []rune(upper(trim(initialism)))
+ }
+
+ return out
+}
+
+// asPluralForms bakes an index of pluralization support.
+func asPluralForms(in []string, pluralFunc func(string) pluralForm) []pluralForm {
+ out := make([]pluralForm, len(in))
+ for i, initialism := range in {
+ out[i] = pluralFunc(initialism)
+ }
+
+ return out
+}
diff --git a/vendor/github.com/go-openapi/swag/mangling/name_lexem.go b/vendor/github.com/go-openapi/swag/mangling/name_lexem.go
new file mode 100644
index 000000000000..bc837e3b9f5d
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling/name_lexem.go
@@ -0,0 +1,186 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package mangling
+
+import (
+ "bytes"
+ "strings"
+ "unicode"
+ "unicode/utf8"
+)
+
+type (
+ lexemKind uint8
+
+ nameLexem struct {
+ original string
+ matchedInitialism string
+ kind lexemKind
+ }
+)
+
+const (
+ lexemKindCasualName lexemKind = iota
+ lexemKindInitialismName
+)
+
+func newInitialismNameLexem(original, matchedInitialism string) nameLexem {
+ return nameLexem{
+ kind: lexemKindInitialismName,
+ original: original,
+ matchedInitialism: matchedInitialism,
+ }
+}
+
+func newCasualNameLexem(original string) nameLexem {
+ return nameLexem{
+ kind: lexemKindCasualName,
+ original: trim(original), // TODO: save on calls to trim
+ }
+}
+
+// WriteTitleized writes the titleized lexeme to a bytes.Buffer.
+//
+// If the first letter cannot be capitalized, it doesn't write anything and return false,
+// so the caller may attempt some workaround strategy.
+func (l nameLexem) WriteTitleized(w *bytes.Buffer, alwaysUpper bool) bool {
+ if l.kind == lexemKindInitialismName {
+ w.WriteString(l.matchedInitialism)
+
+ return true
+ }
+
+ if len(l.original) == 0 {
+ return true
+ }
+
+ if len(l.original) == 1 {
+ // identifier is too short: casing will depend on the context
+ firstByte := l.original[0]
+ switch {
+ case 'A' <= firstByte && firstByte <= 'Z':
+ // safe
+ w.WriteByte(firstByte)
+
+ return true
+ case alwaysUpper && 'a' <= firstByte && firstByte <= 'z':
+ w.WriteByte(firstByte - 'a' + 'A')
+
+ return true
+ default:
+
+ // not a letter: skip and let the caller decide
+ return false
+ }
+ }
+
+ if firstByte := l.original[0]; firstByte < utf8.RuneSelf {
+ // ASCII
+ switch {
+ case 'A' <= firstByte && firstByte <= 'Z':
+ // already an upper case letter
+ w.WriteString(l.original)
+
+ return true
+ case 'a' <= firstByte && firstByte <= 'z':
+ w.WriteByte(firstByte - 'a' + 'A')
+ w.WriteString(l.original[1:])
+
+ return true
+ default:
+ // not a good candidate: doesn't start with a letter
+ return false
+ }
+ }
+
+ // unicode
+ firstRune, idx := utf8.DecodeRuneInString(l.original)
+ if !unicode.IsLetter(firstRune) || !unicode.IsUpper(unicode.ToUpper(firstRune)) {
+ // not a good candidate: doesn't start with a letter
+ // or a rune for which case doesn't make sense (e.g. East-Asian runes etc)
+ return false
+ }
+
+ rest := l.original[idx:]
+ w.WriteRune(unicode.ToUpper(firstRune))
+ w.WriteString(strings.ToLower(rest))
+
+ return true
+}
+
+// WriteLower is like write titleized but it writes a lower-case version of the lexeme.
+//
+// Similarly, there is no writing if the casing of the first rune doesn't make sense.
+func (l nameLexem) WriteLower(w *bytes.Buffer, alwaysLower bool) bool {
+ if l.kind == lexemKindInitialismName {
+ w.WriteString(lower(l.matchedInitialism))
+
+ return true
+ }
+
+ if len(l.original) == 0 {
+ return true
+ }
+
+ if len(l.original) == 1 {
+ // identifier is too short: casing will depend on the context
+ firstByte := l.original[0]
+ switch {
+ case 'a' <= firstByte && firstByte <= 'z':
+ // safe
+ w.WriteByte(firstByte)
+
+ return true
+ case alwaysLower && 'A' <= firstByte && firstByte <= 'Z':
+ w.WriteByte(firstByte - 'A' + 'a')
+
+ return true
+ default:
+
+ // not a letter: skip and let the caller decide
+ return false
+ }
+ }
+
+ if firstByte := l.original[0]; firstByte < utf8.RuneSelf {
+ // ASCII
+ switch {
+ case 'a' <= firstByte && firstByte <= 'z':
+ // already a lower case letter
+ w.WriteString(l.original)
+
+ return true
+ case 'A' <= firstByte && firstByte <= 'Z':
+ w.WriteByte(firstByte - 'A' + 'a')
+ w.WriteString(l.original[1:])
+
+ return true
+ default:
+ // not a good candidate: doesn't start with a letter
+ return false
+ }
+ }
+
+ // unicode
+ firstRune, idx := utf8.DecodeRuneInString(l.original)
+ if !unicode.IsLetter(firstRune) || !unicode.IsLower(unicode.ToLower(firstRune)) {
+ // not a good candidate: doesn't start with a letter
+ // or a rune for which case doesn't make sense (e.g. East-Asian runes etc)
+ return false
+ }
+
+ rest := l.original[idx:]
+ w.WriteRune(unicode.ToLower(firstRune))
+ w.WriteString(rest)
+
+ return true
+}
+
+func (l nameLexem) GetOriginal() string {
+ return l.original
+}
+
+func (l nameLexem) IsInitialism() bool {
+ return l.kind == lexemKindInitialismName
+}
diff --git a/vendor/github.com/go-openapi/swag/mangling/name_mangler.go b/vendor/github.com/go-openapi/swag/mangling/name_mangler.go
new file mode 100644
index 000000000000..da685681d08c
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling/name_mangler.go
@@ -0,0 +1,370 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package mangling
+
+import (
+ "strings"
+ "unicode"
+)
+
+// NameMangler knows how to transform sentences or words into
+// identifiers that are a better fit in contexts such as:
+//
+// - unexported or exported go variable identifiers
+// - file names
+// - camel cased identifiers
+// - ...
+//
+// The [NameMangler] is safe for concurrent use, save for its [NameMangler.AddInitialisms] method,
+// which is not.
+//
+// # Known limitations
+//
+// At this moment, the [NameMangler] doesn't play well with "all caps" text:
+//
+// unless every single upper-cased word is declared as an initialism, capitalized words would generally
+// not be transformed with the expected result, e.g.
+//
+// ToFileName("THIS_IS_ALL_CAPS")
+//
+// yields the weird outcome
+//
+// "t_h_i_s_i_s_a_l_l_c_a_p_s"
+type NameMangler struct {
+ options
+
+ index *indexOfInitialisms
+
+ splitter splitter
+ splitterWithPostSplit splitter
+
+ _ struct{}
+}
+
+// NewNameMangler builds a name mangler ready to convert strings.
+//
+// The default name mangler is configured with default common initialisms and all default options.
+func NewNameMangler(opts ...Option) NameMangler {
+ m := NameMangler{
+ options: optionsWithDefaults(opts),
+ index: newIndexOfInitialisms(),
+ }
+ m.addInitialisms(m.commonInitialisms...)
+
+ // a splitter that returns matches lexemes as ready-to-assemble strings:
+ // details of the lexemes are redeemed.
+ m.splitter = newSplitter(
+ withInitialismsCache(&m.index.initialismsCache),
+ withReplaceFunc(m.replaceFunc),
+ )
+
+ // a splitter that returns matches lexemes ready for post-processing
+ m.splitterWithPostSplit = newSplitter(
+ withInitialismsCache(&m.index.initialismsCache),
+ withReplaceFunc(m.replaceFunc),
+ withPostSplitInitialismCheck,
+ )
+
+ return m
+}
+
+// AddInitialisms declares extra initialisms to the mangler.
+//
+// It declares extra words as "initialisms" (i.e. words that won't be camel cased or titled cased),
+// on top of the existing list of common initialisms (such as ID, HTTP...).
+//
+// Added words must start with a (unicode) letter. If some don't, they are ignored.
+// Added words are either fully capitalized or mixed-cased. Lower-case only words are considered capitalized.
+//
+// It is typically used just after initializing the [NameMangler].
+//
+// When all initialisms are known at the time the mangler is initialized, it is preferable to
+// use [NewNameMangler] with the option [WithAdditionalInitialisms].
+//
+// Adding initialisms mutates the mangler and should not be carried out concurrently with other calls to the mangler.
+func (m *NameMangler) AddInitialisms(words ...string) {
+ m.addInitialisms(words...)
+}
+
+// Initialisms renders the list of initialisms supported by this mangler.
+func (m *NameMangler) Initialisms() []string {
+ return m.index.initialisms
+}
+
+// Camelize a single word.
+//
+// Example:
+//
+// - "HELLO" and "hello" become "Hello".
+func (m NameMangler) Camelize(word string) string {
+ ru := []rune(word)
+
+ switch len(ru) {
+ case 0:
+ return ""
+ case 1:
+ return string(unicode.ToUpper(ru[0]))
+ default:
+ camelized := poolOfBuffers.BorrowBuffer(len(word))
+ camelized.Grow(len(word))
+ defer func() {
+ poolOfBuffers.RedeemBuffer(camelized)
+ }()
+
+ camelized.WriteRune(unicode.ToUpper(ru[0]))
+ for _, ru := range ru[1:] {
+ camelized.WriteRune(unicode.ToLower(ru))
+ }
+
+ return camelized.String()
+ }
+}
+
+// ToFileName generates a suitable snake-case file name from a sentence.
+//
+// It lower-cases everything with underscore (_) as a word separator.
+//
+// Examples:
+//
+// - "Hello, Swagger" becomes "hello_swagger"
+// - "HelloSwagger" becomes "hello_swagger"
+func (m NameMangler) ToFileName(name string) string {
+ inptr := m.split(name)
+ in := *inptr
+ out := make([]string, 0, len(in))
+
+ for _, w := range in {
+ out = append(out, lower(w))
+ }
+ poolOfStrings.RedeemStrings(inptr)
+
+ return strings.Join(out, "_")
+}
+
+// ToCommandName generates a suitable CLI command name from a sentence.
+//
+// It lower-cases everything with dash (-) as a word separator.
+//
+// Examples:
+//
+// - "Hello, Swagger" becomes "hello-swagger"
+// - "HelloSwagger" becomes "hello-swagger"
+func (m NameMangler) ToCommandName(name string) string {
+ inptr := m.split(name)
+ in := *inptr
+ out := make([]string, 0, len(in))
+
+ for _, w := range in {
+ out = append(out, lower(w))
+ }
+ poolOfStrings.RedeemStrings(inptr)
+
+ return strings.Join(out, "-")
+}
+
+// ToHumanNameLower represents a code name as a human-readable series of words.
+//
+// It lower-cases everything with blank space as a word separator.
+//
+// NOTE: parts recognized as initialisms just keep their original casing.
+//
+// Examples:
+//
+// - "Hello, Swagger" becomes "hello swagger"
+// - "HelloSwagger" or "Hello-Swagger" become "hello swagger"
+func (m NameMangler) ToHumanNameLower(name string) string {
+ s := m.splitterWithPostSplit
+ in := s.split(name)
+ out := make([]string, 0, len(*in))
+
+ for _, w := range *in {
+ if !w.IsInitialism() {
+ out = append(out, lower(w.GetOriginal()))
+ } else {
+ out = append(out, trim(w.GetOriginal()))
+ }
+ }
+
+ poolOfLexems.RedeemLexems(in)
+
+ return strings.Join(out, " ")
+}
+
+// ToHumanNameTitle represents a code name as a human-readable series of titleized words.
+//
+// It titleizes every word with blank space as a word separator.
+//
+// Examples:
+//
+// - "hello, Swagger" becomes "Hello Swagger"
+// - "helloSwagger" becomes "Hello Swagger"
+func (m NameMangler) ToHumanNameTitle(name string) string {
+ s := m.splitterWithPostSplit
+ in := s.split(name)
+
+ out := make([]string, 0, len(*in))
+ for _, w := range *in {
+ original := trim(w.GetOriginal())
+ if !w.IsInitialism() {
+ out = append(out, m.Camelize(original))
+ } else {
+ out = append(out, original)
+ }
+ }
+ poolOfLexems.RedeemLexems(in)
+
+ return strings.Join(out, " ")
+}
+
+// ToJSONName generates a camelized single-word version of a sentence.
+//
+// The output assembles every camelized word, but for the first word, which
+// is lower-cased.
+//
+// Example:
+//
+// - "Hello_swagger" becomes "helloSwagger"
+func (m NameMangler) ToJSONName(name string) string {
+ inptr := m.split(name)
+ in := *inptr
+ out := make([]string, 0, len(in))
+
+ for i, w := range in {
+ if i == 0 {
+ out = append(out, lower(w))
+ continue
+ }
+ out = append(out, m.Camelize(trim(w)))
+ }
+
+ poolOfStrings.RedeemStrings(inptr)
+
+ return strings.Join(out, "")
+}
+
+// ToVarName generates a legit unexported go variable name from a sentence.
+//
+// The generated name plays well with linters (see also [NameMangler.ToGoName]).
+//
+// Examples:
+//
+// - "Hello_swagger" becomes "helloSwagger"
+// - "Http_server" becomes "httpServer"
+//
+// This name applies the same rules as [NameMangler.ToGoName] (legit exported variable), save the
+// capitalization of the initial rune.
+//
+// Special case: when the initial part is a recognized as an initialism (like in the example above),
+// the full part is lower-cased.
+func (m NameMangler) ToVarName(name string) string {
+ return m.goIdentifier(name, false)
+}
+
+// ToGoName generates a legit exported go variable name from a sentence.
+//
+// The generated name plays well with most linters.
+//
+// ToGoName abides by the go "exported" symbol rule starting with an upper-case letter.
+//
+// Examples:
+//
+// - "hello_swagger" becomes "HelloSwagger"
+// - "Http_server" becomes "HTTPServer"
+//
+// # Edge cases
+//
+// Whenever the first rune is not eligible to upper case, a special prefix is prepended to the resulting name.
+// By default this is simply "X" and you may customize this behavior using the [WithGoNamePrefixFunc] option.
+//
+// This happens when the first rune is not a letter, e.g. a digit, or a symbol that has no word transliteration
+// (see also [WithReplaceFunc] about symbol transliterations),
+// as well as for most East Asian or Devanagari runes, for which there is no such concept as upper-case.
+//
+// # Linting
+//
+// [revive], the successor of golint is the reference linter.
+//
+// This means that [NameMangler.ToGoName] supports the initialisms that revive checks (see also [DefaultInitialisms]).
+//
+// At this moment, there is no attempt to transliterate unicode into ascii, meaning that some linters
+// (e.g. asciicheck, gosmopolitan) may croak on go identifiers generated from unicode input.
+//
+// [revive]: https://github.com/mgechev/revive
+func (m NameMangler) ToGoName(name string) string {
+ return m.goIdentifier(name, true)
+}
+
+func (m NameMangler) goIdentifier(name string, exported bool) string {
+ s := m.splitterWithPostSplit
+ lexems := s.split(name)
+ defer func() {
+ poolOfLexems.RedeemLexems(lexems)
+ }()
+ lexemes := *lexems
+
+ if len(lexemes) == 0 {
+ return ""
+ }
+
+ result := poolOfBuffers.BorrowBuffer(len(name))
+ defer func() {
+ poolOfBuffers.RedeemBuffer(result)
+ }()
+
+ firstPart := lexemes[0]
+ if !exported {
+ if ok := firstPart.WriteLower(result, true); !ok {
+ // NOTE: an initialism as the first part is lower-cased: no longer generates stuff like hTTPxyz.
+ //
+ // same prefixing rule applied to unexported variable as to an exported one, so that we have consistent
+ // names, whether the generated identifier is exported or not.
+ result.WriteString(strings.ToLower(m.prefixFunc()(name)))
+ result.WriteString(lexemes[0].GetOriginal())
+ }
+ } else {
+ if ok := firstPart.WriteTitleized(result, true); !ok {
+ // "repairs" a lexeme that doesn't start with a letter to become
+ // the start a legit go name. The current strategy is very crude and simply adds a fixed prefix,
+ // e.g. "X".
+ // For instance "1_sesame_street" would be split into lexemes ["1", "sesame", "street"] and
+ // the first one ("1") would result in something like "X1" (with the default prefix function).
+ //
+ // NOTE: no longer forcing the first part to be fully upper-cased
+ result.WriteString(m.prefixFunc()(name))
+ result.WriteString(lexemes[0].GetOriginal())
+ }
+ }
+
+ for _, lexem := range lexemes[1:] {
+ // NOTE: no longer forcing initialism parts to be fully upper-cased:
+ // * pluralized initialism preserve their trailing "s"
+ // * mixed-cased initialisms, such as IPv4, are preserved
+ if ok := lexem.WriteTitleized(result, false); !ok {
+ // it's not titleized: perhaps it's too short, perhaps the first rune is not a letter.
+ // write anyway
+ result.WriteString(lexem.GetOriginal())
+ }
+ }
+
+ return result.String()
+}
+
+func (m *NameMangler) addInitialisms(words ...string) {
+ m.index.add(words...)
+ m.index.buildCache()
+}
+
+// split calls the inner splitter.
+func (m NameMangler) split(str string) *[]string {
+ s := m.splitter
+ lexems := s.split(str)
+ result := poolOfStrings.BorrowStrings()
+
+ for _, lexem := range *lexems {
+ *result = append(*result, lexem.GetOriginal())
+ }
+ poolOfLexems.RedeemLexems(lexems)
+
+ return result
+}
diff --git a/vendor/github.com/go-openapi/swag/mangling/options.go b/vendor/github.com/go-openapi/swag/mangling/options.go
new file mode 100644
index 000000000000..3c92b2f18bf1
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling/options.go
@@ -0,0 +1,150 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package mangling
+
+type (
+ // PrefixFunc defines a safeguard rule (that may depend on the input string), to prefix
+ // a generated go name (in [NameMangler.ToGoName] and [NameMangler.ToVarName]).
+ //
+ // See [NameMangler.ToGoName] for more about which edge cases the prefix function covers.
+ PrefixFunc func(string) string
+
+ // ReplaceFunc is a transliteration function to replace special runes by a word.
+ ReplaceFunc func(r rune) (string, bool)
+
+ // Option to configure a [NameMangler].
+ Option func(*options)
+
+ options struct {
+ commonInitialisms []string
+
+ goNamePrefixFunc PrefixFunc
+ goNamePrefixFuncPtr *PrefixFunc
+ replaceFunc func(r rune) (string, bool)
+ }
+)
+
+func (o *options) prefixFunc() PrefixFunc {
+ if o.goNamePrefixFuncPtr != nil && *o.goNamePrefixFuncPtr != nil {
+ return *o.goNamePrefixFuncPtr
+ }
+
+ return o.goNamePrefixFunc
+}
+
+// WithGoNamePrefixFunc overrides the default prefix rule to safeguard generated go names.
+//
+// Example:
+//
+// This helps convert "123" into "{prefix}123" (a very crude strategy indeed, but it works).
+//
+// See [github.com/go-swagger/go-swagger/generator.DefaultFuncMap] for an example.
+//
+// The prefix function is assumed to return a string that starts with an upper case letter.
+//
+// The default is to prefix with "X".
+//
+// See [NameMangler.ToGoName] for more about which edge cases the prefix function covers.
+func WithGoNamePrefixFunc(fn PrefixFunc) Option {
+ return func(o *options) {
+ o.goNamePrefixFunc = fn
+ }
+}
+
+// WithGoNamePrefixFuncPtr is like [WithGoNamePrefixFunc] but it specifies a pointer to a function.
+//
+// [WithGoNamePrefixFunc] should be preferred in most situations. This option should only serve the
+// purpose of handling special situations where the prefix function is not an internal variable
+// (e.g. an exported package global).
+//
+// [WithGoNamePrefixFuncPtr] supersedes [WithGoNamePrefixFunc] if it also specified.
+//
+// If the provided pointer is nil or points to a nil value, this option has no effect.
+//
+// The caller should ensure that no undesirable concurrent changes are applied to the function pointed to.
+func WithGoNamePrefixFuncPtr(ptr *PrefixFunc) Option {
+ return func(o *options) {
+ o.goNamePrefixFuncPtr = ptr
+ }
+}
+
+// WithInitialisms declares the initialisms this mangler supports.
+//
+// This supersedes any pre-loaded defaults (see [DefaultInitialisms] for more about what initialisms are).
+//
+// It declares words to be recognized as "initialisms" (i.e. words that won't be camel cased or titled cased).
+//
+// Words must start with a (unicode) letter. If some don't, they are ignored.
+// Words are either fully capitalized or mixed-cased. Lower-case only words are considered capitalized.
+func WithInitialisms(words ...string) Option {
+ return func(o *options) {
+ o.commonInitialisms = words
+ }
+}
+
+// WithAdditionalInitialisms adds new initialisms to the currently supported list (see [DefaultInitialisms]).
+//
+// The same sanitization rules apply as those described for [WithInitialisms].
+func WithAdditionalInitialisms(words ...string) Option {
+ return func(o *options) {
+ o.commonInitialisms = append(o.commonInitialisms, words...)
+ }
+}
+
+// WithReplaceFunc specifies a custom transliteration function instead of the default.
+//
+// The default translates the following characters into words as follows:
+//
+// - '@' -> 'At'
+// - '&' -> 'And'
+// - '|' -> 'Pipe'
+// - '$' -> 'Dollar'
+// - '!' -> 'Bang'
+//
+// Notice that the outcome of a transliteration should always be titleized.
+func WithReplaceFunc(fn ReplaceFunc) Option {
+ return func(o *options) {
+ o.replaceFunc = fn
+ }
+}
+
+func defaultPrefixFunc(_ string) string {
+ return "X"
+}
+
+// defaultReplaceTable finds a word representation for special characters.
+func defaultReplaceTable(r rune) (string, bool) {
+ switch r {
+ case '@':
+ return "At ", true
+ case '&':
+ return "And ", true
+ case '|':
+ return "Pipe ", true
+ case '$':
+ return "Dollar ", true
+ case '!':
+ return "Bang ", true
+ case '-':
+ return "", true
+ case '_':
+ return "", true
+ default:
+ return "", false
+ }
+}
+
+func optionsWithDefaults(opts []Option) options {
+ o := options{
+ commonInitialisms: DefaultInitialisms(),
+ goNamePrefixFunc: defaultPrefixFunc,
+ replaceFunc: defaultReplaceTable,
+ }
+
+ for _, apply := range opts {
+ apply(&o)
+ }
+
+ return o
+}
diff --git a/vendor/github.com/go-openapi/swag/mangling/pools.go b/vendor/github.com/go-openapi/swag/mangling/pools.go
new file mode 100644
index 000000000000..f8104351445d
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling/pools.go
@@ -0,0 +1,123 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package mangling
+
+import (
+ "bytes"
+ "sync"
+)
+
+const maxAllocMatches = 8
+
+type (
+ // memory pools of temporary objects.
+ //
+ // These are used to recycle temporarily allocated objects
+ // and relieve the GC from undue pressure.
+
+ matchesPool struct {
+ *sync.Pool
+ }
+
+ buffersPool struct {
+ *sync.Pool
+ }
+
+ lexemsPool struct {
+ *sync.Pool
+ }
+
+ stringsPool struct {
+ *sync.Pool
+ }
+)
+
+var (
+ // poolOfMatches holds temporary slices for recycling during the initialism match process
+ poolOfMatches = matchesPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := make(initialismMatches, 0, maxAllocMatches)
+
+ return &s
+ },
+ },
+ }
+
+ poolOfBuffers = buffersPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ return new(bytes.Buffer)
+ },
+ },
+ }
+
+ poolOfLexems = lexemsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := make([]nameLexem, 0, maxAllocMatches)
+
+ return &s
+ },
+ },
+ }
+
+ poolOfStrings = stringsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := make([]string, 0, maxAllocMatches)
+
+ return &s
+ },
+ },
+ }
+)
+
+func (p matchesPool) BorrowMatches() *initialismMatches {
+ s := p.Get().(*initialismMatches)
+ *s = (*s)[:0] // reset slice, keep allocated capacity
+
+ return s
+}
+
+func (p buffersPool) BorrowBuffer(size int) *bytes.Buffer {
+ s := p.Get().(*bytes.Buffer)
+ s.Reset()
+
+ if s.Cap() < size {
+ s.Grow(size)
+ }
+
+ return s
+}
+
+func (p lexemsPool) BorrowLexems() *[]nameLexem {
+ s := p.Get().(*[]nameLexem)
+ *s = (*s)[:0] // reset slice, keep allocated capacity
+
+ return s
+}
+
+func (p stringsPool) BorrowStrings() *[]string {
+ s := p.Get().(*[]string)
+ *s = (*s)[:0] // reset slice, keep allocated capacity
+
+ return s
+}
+
+func (p matchesPool) RedeemMatches(s *initialismMatches) {
+ p.Put(s)
+}
+
+func (p buffersPool) RedeemBuffer(s *bytes.Buffer) {
+ p.Put(s)
+}
+
+func (p lexemsPool) RedeemLexems(s *[]nameLexem) {
+ p.Put(s)
+}
+
+func (p stringsPool) RedeemStrings(s *[]string) {
+ p.Put(s)
+}
diff --git a/vendor/github.com/go-openapi/swag/mangling/split.go b/vendor/github.com/go-openapi/swag/mangling/split.go
new file mode 100644
index 000000000000..ed12ea256746
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling/split.go
@@ -0,0 +1,341 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package mangling
+
+import (
+ "fmt"
+ "unicode"
+)
+
+type splitterOption func(*splitter)
+
+// withPostSplitInitialismCheck allows to catch initialisms after main split process
+func withPostSplitInitialismCheck(s *splitter) {
+ s.postSplitInitialismCheck = true
+}
+
+func withReplaceFunc(fn ReplaceFunc) func(*splitter) {
+ return func(s *splitter) {
+ s.replaceFunc = fn
+ }
+}
+
+func withInitialismsCache(c *initialismsCache) splitterOption {
+ return func(s *splitter) {
+ s.initialismsCache = c
+ }
+}
+
+type (
+ initialismMatch struct {
+ body []rune
+ start, end int
+ complete bool
+ hasPlural pluralForm
+ }
+ initialismMatches []initialismMatch
+)
+
+// String representation of a match, e.g. for debugging.
+func (m initialismMatch) String() string {
+ return fmt.Sprintf("{body: %s (%d), start: %d, end; %d, complete: %t, hasPlural: %v}",
+ string(m.body), len(m.body), m.start, m.end, m.complete, m.hasPlural,
+ )
+}
+
+func (m initialismMatch) isZero() bool {
+ return m.start == 0 && m.end == 0
+}
+
+type splitter struct {
+ *initialismsCache
+
+ postSplitInitialismCheck bool
+ replaceFunc ReplaceFunc
+}
+
+func newSplitter(options ...splitterOption) splitter {
+ var s splitter
+
+ for _, option := range options {
+ option(&s)
+ }
+
+ if s.replaceFunc == nil {
+ s.replaceFunc = defaultReplaceTable
+ }
+
+ return s
+}
+
+func (s splitter) split(name string) *[]nameLexem {
+ nameRunes := []rune(name)
+ matches := s.gatherInitialismMatches(nameRunes)
+ if matches == nil {
+ return poolOfLexems.BorrowLexems()
+ }
+
+ return s.mapMatchesToNameLexems(nameRunes, matches)
+}
+
+func (s splitter) gatherInitialismMatches(nameRunes []rune) *initialismMatches {
+ matches := poolOfMatches.BorrowMatches()
+ const minLenInitialism = 1
+ if len(nameRunes) < minLenInitialism+1 {
+ // can't match initialism with 0 or 1 rune
+ return matches
+ }
+
+ // first iteration
+ s.findMatches(matches, nameRunes, nameRunes[0], 0)
+
+ for i, currentRune := range nameRunes[1:] {
+ currentRunePosition := i + 1
+ // recycle allocations as we loop over runes
+ // with such recycling, only 2 slices should be allocated per call
+ // instead of o(n).
+ //
+ // BorrowMatches always yields slices with zero length (with some capacity)
+ newMatches := poolOfMatches.BorrowMatches()
+
+ // check current initialism matches
+ for _, match := range *matches {
+ if keepCompleteMatch := match.complete; keepCompleteMatch {
+ // the match is already complete: keep it then move on to the next match
+ *newMatches = append(*newMatches, match)
+ continue
+ }
+
+ if currentRunePosition-match.start == len(match.body) {
+ // unmatched: skip
+ continue
+ }
+
+ // 1. by construction of the matches, we can't have currentRunePosition - match.start < 0
+ // because matches have been computed with their start <= currentRunePosition in the previous
+ // iterations.
+ // 2. by construction of the matches, we can't have currentRunePosition - match.start >= len(match.body)
+
+ currentMatchRune := match.body[currentRunePosition-match.start]
+ if currentMatchRune != currentRune {
+ // failed match, discard it then move on to the next match
+ continue
+ }
+
+ // try to complete the current match
+ if currentRunePosition-match.start == len(match.body)-1 {
+ // we are close: the next step is to check the symbol ahead
+ // if it is a lowercase letter, then it is not the end of match
+ // but the beginning of the next word.
+ //
+ // NOTE(fredbi): this heuristic sometimes leads to counterintuitive splits and
+ // perhaps (not sure yet) we should check against case _alternance_.
+ //
+ // Example:
+ //
+ // In the current version, in the sentence "IDS initialism", "ID" is recognized as an initialism,
+ // leading to a split like "id_s_initialism" (or IDSInitialism),
+ // whereas in the sentence "IDx initialism", it is not and produces something like
+ // "i_d_x_initialism" (or IDxInitialism). The generated file name is not great.
+ //
+ // Both go identifiers are tolerated by linters.
+ //
+ // Notice that the slightly different input "IDs initialism" is correctly detected
+ // as a pluralized initialism and produces something like "ids_initialism" (or IDsInitialism).
+
+ if currentRunePosition < len(nameRunes)-1 { // when before the last rune
+ nextRune := nameRunes[currentRunePosition+1]
+
+ // recognize a plural form for this initialism (only simple english pluralization is supported).
+ if nextRune == 's' && match.hasPlural == simplePlural {
+ // detected a pluralized initialism
+ match.body = append(match.body, nextRune)
+ lookAhead := currentRunePosition + 1
+ if lookAhead < len(nameRunes)-1 {
+ nextRune = nameRunes[lookAhead+1]
+ if newWord := unicode.IsLower(nextRune); newWord {
+ // it is the start of a new word.
+ // Match is only partial and the initialism is not recognized:
+ // move on to the next match, but do not advance the rune position
+ continue
+ }
+ }
+
+ // this is a pluralized match: keep it
+ currentRunePosition++
+ match.complete = true
+ match.hasPlural = simplePlural
+ match.end = currentRunePosition
+ *newMatches = append(*newMatches, match)
+
+ // match is complete: keep it then move on to the next match
+ continue
+ }
+
+ // other cases
+ // example: invariant plural such as "TLS"
+ if newWord := unicode.IsLower(nextRune); newWord {
+ // it is the start of a new word
+ // Match is only partial and the initialism is not recognized : move on
+ continue
+ }
+ }
+
+ match.complete = true
+ match.end = currentRunePosition
+ }
+
+ // append the ongoing matching attempt: it is not necessarily complete, but was successful so far.
+ // Let's see if it still matches on the next rune.
+ *newMatches = append(*newMatches, match)
+ }
+
+ s.findMatches(newMatches, nameRunes, currentRune, currentRunePosition)
+
+ poolOfMatches.RedeemMatches(matches)
+ matches = newMatches
+ }
+
+ // it is up to the caller to redeem this last slice
+ return matches
+}
+
+func (s splitter) findMatches(newMatches *initialismMatches, nameRunes []rune, currentRune rune, currentRunePosition int) {
+ // check for new initialism matches, based on the first character
+ for i, r := range s.initialismsRunes {
+ if r[0] != currentRune {
+ continue
+ }
+
+ if currentRunePosition+len(r) > len(nameRunes) {
+ continue // not eligible: would spilll over the initial string
+ }
+
+ // possible matches: all initialisms starting with the current rune and that can fit the given string (nameRunes)
+ *newMatches = append(*newMatches, initialismMatch{
+ start: currentRunePosition,
+ body: r,
+ complete: false,
+ hasPlural: s.initialismsPluralForm[i],
+ })
+ }
+}
+
+func (s splitter) mapMatchesToNameLexems(nameRunes []rune, matches *initialismMatches) *[]nameLexem {
+ nameLexems := poolOfLexems.BorrowLexems()
+
+ var lastAcceptedMatch initialismMatch
+ for _, match := range *matches {
+ if !match.complete {
+ continue
+ }
+
+ if firstMatch := lastAcceptedMatch.isZero(); firstMatch {
+ s.appendBrokenDownCasualString(nameLexems, nameRunes[:match.start])
+ *nameLexems = append(*nameLexems, s.breakInitialism(string(match.body)))
+
+ lastAcceptedMatch = match
+
+ continue
+ }
+
+ if overlappedMatch := match.start <= lastAcceptedMatch.end; overlappedMatch {
+ continue
+ }
+
+ middle := nameRunes[lastAcceptedMatch.end+1 : match.start]
+ s.appendBrokenDownCasualString(nameLexems, middle)
+ *nameLexems = append(*nameLexems, s.breakInitialism(string(match.body)))
+
+ lastAcceptedMatch = match
+ }
+
+ // we have not found any accepted matches
+ if lastAcceptedMatch.isZero() {
+ *nameLexems = (*nameLexems)[:0]
+ s.appendBrokenDownCasualString(nameLexems, nameRunes)
+ } else if lastAcceptedMatch.end+1 != len(nameRunes) {
+ rest := nameRunes[lastAcceptedMatch.end+1:]
+ s.appendBrokenDownCasualString(nameLexems, rest)
+ }
+
+ poolOfMatches.RedeemMatches(matches)
+
+ return nameLexems
+}
+
+func (s splitter) breakInitialism(original string) nameLexem {
+ return newInitialismNameLexem(original, original)
+}
+
+func (s splitter) appendBrokenDownCasualString(segments *[]nameLexem, str []rune) {
+ currentSegment := poolOfBuffers.BorrowBuffer(len(str)) // unlike strings.Builder, bytes.Buffer initial storage can reused
+ defer func() {
+ poolOfBuffers.RedeemBuffer(currentSegment)
+ }()
+
+ addCasualNameLexem := func(original string) {
+ *segments = append(*segments, newCasualNameLexem(original))
+ }
+
+ addInitialismNameLexem := func(original, match string) {
+ *segments = append(*segments, newInitialismNameLexem(original, match))
+ }
+
+ var addNameLexem func(string)
+ if s.postSplitInitialismCheck {
+ addNameLexem = func(original string) {
+ for i := range s.initialisms {
+ if isEqualFoldIgnoreSpace(s.initialismsUpperCased[i], original) {
+ addInitialismNameLexem(original, s.initialisms[i])
+
+ return
+ }
+ }
+
+ addCasualNameLexem(original)
+ }
+ } else {
+ addNameLexem = addCasualNameLexem
+ }
+
+ // NOTE: (performance). The few remaining non-amortized allocations
+ // lay in the code below: using String() forces
+ for _, rn := range str {
+ if replace, found := s.replaceFunc(rn); found {
+ if currentSegment.Len() > 0 {
+ addNameLexem(currentSegment.String())
+ currentSegment.Reset()
+ }
+
+ if replace != "" {
+ addNameLexem(replace)
+ }
+
+ continue
+ }
+
+ if !unicode.In(rn, unicode.L, unicode.M, unicode.N, unicode.Pc) {
+ if currentSegment.Len() > 0 {
+ addNameLexem(currentSegment.String())
+ currentSegment.Reset()
+ }
+
+ continue
+ }
+
+ if unicode.IsUpper(rn) {
+ if currentSegment.Len() > 0 {
+ addNameLexem(currentSegment.String())
+ }
+ currentSegment.Reset()
+ }
+
+ currentSegment.WriteRune(rn)
+ }
+
+ if currentSegment.Len() > 0 {
+ addNameLexem(currentSegment.String())
+ }
+}
diff --git a/vendor/github.com/go-openapi/swag/string_bytes.go b/vendor/github.com/go-openapi/swag/mangling/string_bytes.go
similarity index 60%
rename from vendor/github.com/go-openapi/swag/string_bytes.go
rename to vendor/github.com/go-openapi/swag/mangling/string_bytes.go
index 90745d5ca9f1..28daaf72b1a1 100644
--- a/vendor/github.com/go-openapi/swag/string_bytes.go
+++ b/vendor/github.com/go-openapi/swag/mangling/string_bytes.go
@@ -1,4 +1,7 @@
-package swag
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package mangling
import "unsafe"
diff --git a/vendor/github.com/go-openapi/swag/mangling/util.go b/vendor/github.com/go-openapi/swag/mangling/util.go
new file mode 100644
index 000000000000..0636417e360b
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling/util.go
@@ -0,0 +1,118 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package mangling
+
+import (
+ "strings"
+ "unicode"
+ "unicode/utf8"
+)
+
+// Removes leading whitespaces
+func trim(str string) string { return strings.TrimSpace(str) }
+
+// upper is strings.ToUpper() combined with trim
+func upper(str string) string {
+ return strings.ToUpper(trim(str))
+}
+
+// lower is strings.ToLower() combined with trim
+func lower(str string) string {
+ return strings.ToLower(trim(str))
+}
+
+// isEqualFoldIgnoreSpace is the same as strings.EqualFold, but
+// it ignores leading and trailing blank spaces in the compared
+// string.
+//
+// base is assumed to be composed of upper-cased runes, and be already
+// trimmed.
+//
+// This code is heavily inspired from strings.EqualFold.
+func isEqualFoldIgnoreSpace(base []rune, str string) bool {
+ var i, baseIndex int
+ // equivalent to b := []byte(str), but without data copy
+ b := hackStringBytes(str)
+
+ for i < len(b) {
+ if c := b[i]; c < utf8.RuneSelf {
+ // fast path for ASCII
+ if c != ' ' && c != '\t' {
+ break
+ }
+ i++
+
+ continue
+ }
+
+ // unicode case
+ r, size := utf8.DecodeRune(b[i:])
+ if !unicode.IsSpace(r) {
+ break
+ }
+ i += size
+ }
+
+ if i >= len(b) {
+ return len(base) == 0
+ }
+
+ for _, baseRune := range base {
+ if i >= len(b) {
+ break
+ }
+
+ if c := b[i]; c < utf8.RuneSelf {
+ // single byte rune case (ASCII)
+ if baseRune >= utf8.RuneSelf {
+ return false
+ }
+
+ baseChar := byte(baseRune)
+ if c != baseChar && ((c < 'a') || (c > 'z') || (c-'a'+'A' != baseChar)) {
+ return false
+ }
+
+ baseIndex++
+ i++
+
+ continue
+ }
+
+ // unicode case
+ r, size := utf8.DecodeRune(b[i:])
+ if unicode.ToUpper(r) != baseRune {
+ return false
+ }
+ baseIndex++
+ i += size
+ }
+
+ if baseIndex != len(base) {
+ return false
+ }
+
+ // all passed: now we should only have blanks
+ for i < len(b) {
+ if c := b[i]; c < utf8.RuneSelf {
+ // fast path for ASCII
+ if c != ' ' && c != '\t' {
+ return false
+ }
+ i++
+
+ continue
+ }
+
+ // unicode case
+ r, size := utf8.DecodeRune(b[i:])
+ if !unicode.IsSpace(r) {
+ return false
+ }
+
+ i += size
+ }
+
+ return true
+}
diff --git a/vendor/github.com/go-openapi/swag/mangling_iface.go b/vendor/github.com/go-openapi/swag/mangling_iface.go
new file mode 100644
index 000000000000..98b9a9992930
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/mangling_iface.go
@@ -0,0 +1,69 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package swag
+
+import "github.com/go-openapi/swag/mangling"
+
+// GoNamePrefixFunc sets an optional rule to prefix go names
+// which do not start with a letter.
+//
+// GoNamePrefixFunc should not be written to while concurrently using the other mangling functions of this package.
+//
+// Deprecated: use [mangling.WithGoNamePrefixFunc] instead.
+var GoNamePrefixFunc mangling.PrefixFunc
+
+// swagNameMangler is a global instance of the name mangler specifically alloted
+// to support deprecated functions.
+var swagNameMangler = mangling.NewNameMangler(
+ mangling.WithGoNamePrefixFuncPtr(&GoNamePrefixFunc),
+)
+
+// AddInitialisms adds additional initialisms to the default list (see [mangling.DefaultInitialisms]).
+//
+// AddInitialisms is not safe to be called concurrently.
+//
+// Deprecated: use [mangling.WithAdditionalInitialisms] instead.
+func AddInitialisms(words ...string) {
+ swagNameMangler.AddInitialisms(words...)
+}
+
+// Camelize a single word.
+//
+// Deprecated: use [mangling.NameMangler.Camelize] instead.
+func Camelize(word string) string { return swagNameMangler.Camelize(word) }
+
+// ToFileName lowercases and underscores a go type name.
+//
+// Deprecated: use [mangling.NameMangler.ToFileName] instead.
+func ToFileName(name string) string { return swagNameMangler.ToFileName(name) }
+
+// ToCommandName lowercases and underscores a go type name.
+//
+// Deprecated: use [mangling.NameMangler.ToCommandName] instead.
+func ToCommandName(name string) string { return swagNameMangler.ToCommandName(name) }
+
+// ToHumanNameLower represents a code name as a human series of words.
+//
+// Deprecated: use [mangling.NameMangler.ToHumanNameLower] instead.
+func ToHumanNameLower(name string) string { return swagNameMangler.ToHumanNameLower(name) }
+
+// ToHumanNameTitle represents a code name as a human series of words with the first letters titleized.
+//
+// Deprecated: use [mangling.NameMangler.ToHumanNameTitle] instead.
+func ToHumanNameTitle(name string) string { return swagNameMangler.ToHumanNameTitle(name) }
+
+// ToJSONName camel-cases a name which can be underscored or pascal-cased.
+//
+// Deprecated: use [mangling.NameMangler.ToJSONName] instead.
+func ToJSONName(name string) string { return swagNameMangler.ToJSONName(name) }
+
+// ToVarName camel-cases a name which can be underscored or pascal-cased.
+//
+// Deprecated: use [mangling.NameMangler.ToVarName] instead.
+func ToVarName(name string) string { return swagNameMangler.ToVarName(name) }
+
+// ToGoName translates a swagger name which can be underscored or camel cased to a name that golint likes.
+//
+// Deprecated: use [mangling.NameMangler.ToGoName] instead.
+func ToGoName(name string) string { return swagNameMangler.ToGoName(name) }
diff --git a/vendor/github.com/go-openapi/swag/name_lexem.go b/vendor/github.com/go-openapi/swag/name_lexem.go
deleted file mode 100644
index 8bb64ac32f90..000000000000
--- a/vendor/github.com/go-openapi/swag/name_lexem.go
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 swag
-
-import (
- "unicode"
- "unicode/utf8"
-)
-
-type (
- lexemKind uint8
-
- nameLexem struct {
- original string
- matchedInitialism string
- kind lexemKind
- }
-)
-
-const (
- lexemKindCasualName lexemKind = iota
- lexemKindInitialismName
-)
-
-func newInitialismNameLexem(original, matchedInitialism string) nameLexem {
- return nameLexem{
- kind: lexemKindInitialismName,
- original: original,
- matchedInitialism: matchedInitialism,
- }
-}
-
-func newCasualNameLexem(original string) nameLexem {
- return nameLexem{
- kind: lexemKindCasualName,
- original: original,
- }
-}
-
-func (l nameLexem) GetUnsafeGoName() string {
- if l.kind == lexemKindInitialismName {
- return l.matchedInitialism
- }
-
- var (
- first rune
- rest string
- )
-
- for i, orig := range l.original {
- if i == 0 {
- first = orig
- continue
- }
-
- if i > 0 {
- rest = l.original[i:]
- break
- }
- }
-
- if len(l.original) > 1 {
- b := poolOfBuffers.BorrowBuffer(utf8.UTFMax + len(rest))
- defer func() {
- poolOfBuffers.RedeemBuffer(b)
- }()
- b.WriteRune(unicode.ToUpper(first))
- b.WriteString(lower(rest))
- return b.String()
- }
-
- return l.original
-}
-
-func (l nameLexem) GetOriginal() string {
- return l.original
-}
-
-func (l nameLexem) IsInitialism() bool {
- return l.kind == lexemKindInitialismName
-}
diff --git a/vendor/github.com/go-openapi/swag/net.go b/vendor/github.com/go-openapi/swag/net.go
deleted file mode 100644
index 821235f84d4a..000000000000
--- a/vendor/github.com/go-openapi/swag/net.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 swag
-
-import (
- "net"
- "strconv"
-)
-
-// SplitHostPort splits a network address into a host and a port.
-// The port is -1 when there is no port to be found
-func SplitHostPort(addr string) (host string, port int, err error) {
- h, p, err := net.SplitHostPort(addr)
- if err != nil {
- return "", -1, err
- }
- if p == "" {
- return "", -1, &net.AddrError{Err: "missing port in address", Addr: addr}
- }
-
- pi, err := strconv.Atoi(p)
- if err != nil {
- return "", -1, err
- }
- return h, pi, nil
-}
diff --git a/vendor/github.com/go-openapi/swag/netutils/LICENSE b/vendor/github.com/go-openapi/swag/netutils/LICENSE
new file mode 100644
index 000000000000..d64569567334
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/netutils/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/vendor/github.com/go-openapi/swag/netutils/doc.go b/vendor/github.com/go-openapi/swag/netutils/doc.go
new file mode 100644
index 000000000000..74282f8e51c5
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/netutils/doc.go
@@ -0,0 +1,5 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+// Package netutils provides helpers for network-related tasks.
+package netutils
diff --git a/vendor/github.com/go-openapi/swag/netutils/net.go b/vendor/github.com/go-openapi/swag/netutils/net.go
new file mode 100644
index 000000000000..82a1544af7bf
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/netutils/net.go
@@ -0,0 +1,31 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package netutils
+
+import (
+ "net"
+ "strconv"
+)
+
+// SplitHostPort splits a network address into a host and a port.
+//
+// The difference with the standard net.SplitHostPort is that the port is converted to an int.
+//
+// The port is -1 when there is no port to be found.
+func SplitHostPort(addr string) (host string, port int, err error) {
+ h, p, err := net.SplitHostPort(addr)
+ if err != nil {
+ return "", -1, err
+ }
+ if p == "" {
+ return "", -1, &net.AddrError{Err: "missing port in address", Addr: addr}
+ }
+
+ pi, err := strconv.Atoi(p)
+ if err != nil {
+ return "", -1, err
+ }
+
+ return h, pi, nil
+}
diff --git a/vendor/github.com/go-openapi/swag/netutils_iface.go b/vendor/github.com/go-openapi/swag/netutils_iface.go
new file mode 100644
index 000000000000..d658de25b3f3
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/netutils_iface.go
@@ -0,0 +1,13 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package swag
+
+import "github.com/go-openapi/swag/netutils"
+
+// SplitHostPort splits a network address into a host and a port.
+//
+// Deprecated: use [netutils.SplitHostPort] instead.
+func SplitHostPort(addr string) (host string, port int, err error) {
+ return netutils.SplitHostPort(addr)
+}
diff --git a/vendor/github.com/go-openapi/swag/split.go b/vendor/github.com/go-openapi/swag/split.go
deleted file mode 100644
index 274727a866c4..000000000000
--- a/vendor/github.com/go-openapi/swag/split.go
+++ /dev/null
@@ -1,508 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 swag
-
-import (
- "bytes"
- "sync"
- "unicode"
- "unicode/utf8"
-)
-
-type (
- splitter struct {
- initialisms []string
- initialismsRunes [][]rune
- initialismsUpperCased [][]rune // initialisms cached in their trimmed, upper-cased version
- postSplitInitialismCheck bool
- }
-
- splitterOption func(*splitter)
-
- initialismMatch struct {
- body []rune
- start, end int
- complete bool
- }
- initialismMatches []initialismMatch
-)
-
-type (
- // memory pools of temporary objects.
- //
- // These are used to recycle temporarily allocated objects
- // and relieve the GC from undue pressure.
-
- matchesPool struct {
- *sync.Pool
- }
-
- buffersPool struct {
- *sync.Pool
- }
-
- lexemsPool struct {
- *sync.Pool
- }
-
- splittersPool struct {
- *sync.Pool
- }
-)
-
-var (
- // poolOfMatches holds temporary slices for recycling during the initialism match process
- poolOfMatches = matchesPool{
- Pool: &sync.Pool{
- New: func() any {
- s := make(initialismMatches, 0, maxAllocMatches)
-
- return &s
- },
- },
- }
-
- poolOfBuffers = buffersPool{
- Pool: &sync.Pool{
- New: func() any {
- return new(bytes.Buffer)
- },
- },
- }
-
- poolOfLexems = lexemsPool{
- Pool: &sync.Pool{
- New: func() any {
- s := make([]nameLexem, 0, maxAllocMatches)
-
- return &s
- },
- },
- }
-
- poolOfSplitters = splittersPool{
- Pool: &sync.Pool{
- New: func() any {
- s := newSplitter()
-
- return &s
- },
- },
- }
-)
-
-// nameReplaceTable finds a word representation for special characters.
-func nameReplaceTable(r rune) (string, bool) {
- switch r {
- case '@':
- return "At ", true
- case '&':
- return "And ", true
- case '|':
- return "Pipe ", true
- case '$':
- return "Dollar ", true
- case '!':
- return "Bang ", true
- case '-':
- return "", true
- case '_':
- return "", true
- default:
- return "", false
- }
-}
-
-// split calls the splitter.
-//
-// Use newSplitter for more control and options
-func split(str string) []string {
- s := poolOfSplitters.BorrowSplitter()
- lexems := s.split(str)
- result := make([]string, 0, len(*lexems))
-
- for _, lexem := range *lexems {
- result = append(result, lexem.GetOriginal())
- }
- poolOfLexems.RedeemLexems(lexems)
- poolOfSplitters.RedeemSplitter(s)
-
- return result
-
-}
-
-func newSplitter(options ...splitterOption) splitter {
- s := splitter{
- postSplitInitialismCheck: false,
- initialisms: initialisms,
- initialismsRunes: initialismsRunes,
- initialismsUpperCased: initialismsUpperCased,
- }
-
- for _, option := range options {
- option(&s)
- }
-
- return s
-}
-
-// withPostSplitInitialismCheck allows to catch initialisms after main split process
-func withPostSplitInitialismCheck(s *splitter) {
- s.postSplitInitialismCheck = true
-}
-
-func (p matchesPool) BorrowMatches() *initialismMatches {
- s := p.Get().(*initialismMatches)
- *s = (*s)[:0] // reset slice, keep allocated capacity
-
- return s
-}
-
-func (p buffersPool) BorrowBuffer(size int) *bytes.Buffer {
- s := p.Get().(*bytes.Buffer)
- s.Reset()
-
- if s.Cap() < size {
- s.Grow(size)
- }
-
- return s
-}
-
-func (p lexemsPool) BorrowLexems() *[]nameLexem {
- s := p.Get().(*[]nameLexem)
- *s = (*s)[:0] // reset slice, keep allocated capacity
-
- return s
-}
-
-func (p splittersPool) BorrowSplitter(options ...splitterOption) *splitter {
- s := p.Get().(*splitter)
- s.postSplitInitialismCheck = false // reset options
- for _, apply := range options {
- apply(s)
- }
-
- return s
-}
-
-func (p matchesPool) RedeemMatches(s *initialismMatches) {
- p.Put(s)
-}
-
-func (p buffersPool) RedeemBuffer(s *bytes.Buffer) {
- p.Put(s)
-}
-
-func (p lexemsPool) RedeemLexems(s *[]nameLexem) {
- p.Put(s)
-}
-
-func (p splittersPool) RedeemSplitter(s *splitter) {
- p.Put(s)
-}
-
-func (m initialismMatch) isZero() bool {
- return m.start == 0 && m.end == 0
-}
-
-func (s splitter) split(name string) *[]nameLexem {
- nameRunes := []rune(name)
- matches := s.gatherInitialismMatches(nameRunes)
- if matches == nil {
- return poolOfLexems.BorrowLexems()
- }
-
- return s.mapMatchesToNameLexems(nameRunes, matches)
-}
-
-func (s splitter) gatherInitialismMatches(nameRunes []rune) *initialismMatches {
- var matches *initialismMatches
-
- for currentRunePosition, currentRune := range nameRunes {
- // recycle these allocations as we loop over runes
- // with such recycling, only 2 slices should be allocated per call
- // instead of o(n).
- newMatches := poolOfMatches.BorrowMatches()
-
- // check current initialism matches
- if matches != nil { // skip first iteration
- for _, match := range *matches {
- if keepCompleteMatch := match.complete; keepCompleteMatch {
- *newMatches = append(*newMatches, match)
- continue
- }
-
- // drop failed match
- currentMatchRune := match.body[currentRunePosition-match.start]
- if currentMatchRune != currentRune {
- continue
- }
-
- // try to complete ongoing match
- if currentRunePosition-match.start == len(match.body)-1 {
- // we are close; the next step is to check the symbol ahead
- // if it is a small letter, then it is not the end of match
- // but beginning of the next word
-
- if currentRunePosition < len(nameRunes)-1 {
- nextRune := nameRunes[currentRunePosition+1]
- if newWord := unicode.IsLower(nextRune); newWord {
- // oh ok, it was the start of a new word
- continue
- }
- }
-
- match.complete = true
- match.end = currentRunePosition
- }
-
- *newMatches = append(*newMatches, match)
- }
- }
-
- // check for new initialism matches
- for i := range s.initialisms {
- initialismRunes := s.initialismsRunes[i]
- if initialismRunes[0] == currentRune {
- *newMatches = append(*newMatches, initialismMatch{
- start: currentRunePosition,
- body: initialismRunes,
- complete: false,
- })
- }
- }
-
- if matches != nil {
- poolOfMatches.RedeemMatches(matches)
- }
- matches = newMatches
- }
-
- // up to the caller to redeem this last slice
- return matches
-}
-
-func (s splitter) mapMatchesToNameLexems(nameRunes []rune, matches *initialismMatches) *[]nameLexem {
- nameLexems := poolOfLexems.BorrowLexems()
-
- var lastAcceptedMatch initialismMatch
- for _, match := range *matches {
- if !match.complete {
- continue
- }
-
- if firstMatch := lastAcceptedMatch.isZero(); firstMatch {
- s.appendBrokenDownCasualString(nameLexems, nameRunes[:match.start])
- *nameLexems = append(*nameLexems, s.breakInitialism(string(match.body)))
-
- lastAcceptedMatch = match
-
- continue
- }
-
- if overlappedMatch := match.start <= lastAcceptedMatch.end; overlappedMatch {
- continue
- }
-
- middle := nameRunes[lastAcceptedMatch.end+1 : match.start]
- s.appendBrokenDownCasualString(nameLexems, middle)
- *nameLexems = append(*nameLexems, s.breakInitialism(string(match.body)))
-
- lastAcceptedMatch = match
- }
-
- // we have not found any accepted matches
- if lastAcceptedMatch.isZero() {
- *nameLexems = (*nameLexems)[:0]
- s.appendBrokenDownCasualString(nameLexems, nameRunes)
- } else if lastAcceptedMatch.end+1 != len(nameRunes) {
- rest := nameRunes[lastAcceptedMatch.end+1:]
- s.appendBrokenDownCasualString(nameLexems, rest)
- }
-
- poolOfMatches.RedeemMatches(matches)
-
- return nameLexems
-}
-
-func (s splitter) breakInitialism(original string) nameLexem {
- return newInitialismNameLexem(original, original)
-}
-
-func (s splitter) appendBrokenDownCasualString(segments *[]nameLexem, str []rune) {
- currentSegment := poolOfBuffers.BorrowBuffer(len(str)) // unlike strings.Builder, bytes.Buffer initial storage can reused
- defer func() {
- poolOfBuffers.RedeemBuffer(currentSegment)
- }()
-
- addCasualNameLexem := func(original string) {
- *segments = append(*segments, newCasualNameLexem(original))
- }
-
- addInitialismNameLexem := func(original, match string) {
- *segments = append(*segments, newInitialismNameLexem(original, match))
- }
-
- var addNameLexem func(string)
- if s.postSplitInitialismCheck {
- addNameLexem = func(original string) {
- for i := range s.initialisms {
- if isEqualFoldIgnoreSpace(s.initialismsUpperCased[i], original) {
- addInitialismNameLexem(original, s.initialisms[i])
-
- return
- }
- }
-
- addCasualNameLexem(original)
- }
- } else {
- addNameLexem = addCasualNameLexem
- }
-
- for _, rn := range str {
- if replace, found := nameReplaceTable(rn); found {
- if currentSegment.Len() > 0 {
- addNameLexem(currentSegment.String())
- currentSegment.Reset()
- }
-
- if replace != "" {
- addNameLexem(replace)
- }
-
- continue
- }
-
- if !unicode.In(rn, unicode.L, unicode.M, unicode.N, unicode.Pc) {
- if currentSegment.Len() > 0 {
- addNameLexem(currentSegment.String())
- currentSegment.Reset()
- }
-
- continue
- }
-
- if unicode.IsUpper(rn) {
- if currentSegment.Len() > 0 {
- addNameLexem(currentSegment.String())
- }
- currentSegment.Reset()
- }
-
- currentSegment.WriteRune(rn)
- }
-
- if currentSegment.Len() > 0 {
- addNameLexem(currentSegment.String())
- }
-}
-
-// isEqualFoldIgnoreSpace is the same as strings.EqualFold, but
-// it ignores leading and trailing blank spaces in the compared
-// string.
-//
-// base is assumed to be composed of upper-cased runes, and be already
-// trimmed.
-//
-// This code is heavily inspired from strings.EqualFold.
-func isEqualFoldIgnoreSpace(base []rune, str string) bool {
- var i, baseIndex int
- // equivalent to b := []byte(str), but without data copy
- b := hackStringBytes(str)
-
- for i < len(b) {
- if c := b[i]; c < utf8.RuneSelf {
- // fast path for ASCII
- if c != ' ' && c != '\t' {
- break
- }
- i++
-
- continue
- }
-
- // unicode case
- r, size := utf8.DecodeRune(b[i:])
- if !unicode.IsSpace(r) {
- break
- }
- i += size
- }
-
- if i >= len(b) {
- return len(base) == 0
- }
-
- for _, baseRune := range base {
- if i >= len(b) {
- break
- }
-
- if c := b[i]; c < utf8.RuneSelf {
- // single byte rune case (ASCII)
- if baseRune >= utf8.RuneSelf {
- return false
- }
-
- baseChar := byte(baseRune)
- if c != baseChar &&
- !('a' <= c && c <= 'z' && c-'a'+'A' == baseChar) {
- return false
- }
-
- baseIndex++
- i++
-
- continue
- }
-
- // unicode case
- r, size := utf8.DecodeRune(b[i:])
- if unicode.ToUpper(r) != baseRune {
- return false
- }
- baseIndex++
- i += size
- }
-
- if baseIndex != len(base) {
- return false
- }
-
- // all passed: now we should only have blanks
- for i < len(b) {
- if c := b[i]; c < utf8.RuneSelf {
- // fast path for ASCII
- if c != ' ' && c != '\t' {
- return false
- }
- i++
-
- continue
- }
-
- // unicode case
- r, size := utf8.DecodeRune(b[i:])
- if !unicode.IsSpace(r) {
- return false
- }
-
- i += size
- }
-
- return true
-}
diff --git a/vendor/github.com/go-openapi/swag/stringutils/LICENSE b/vendor/github.com/go-openapi/swag/stringutils/LICENSE
new file mode 100644
index 000000000000..d64569567334
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/stringutils/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/vendor/github.com/go-openapi/swag/stringutils/collection_formats.go b/vendor/github.com/go-openapi/swag/stringutils/collection_formats.go
new file mode 100644
index 000000000000..28056ad25c38
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/stringutils/collection_formats.go
@@ -0,0 +1,74 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package stringutils
+
+import "strings"
+
+const (
+ // collectionFormatComma = "csv"
+ collectionFormatSpace = "ssv"
+ collectionFormatTab = "tsv"
+ collectionFormatPipe = "pipes"
+ collectionFormatMulti = "multi"
+
+ collectionFormatDefaultSep = ","
+)
+
+// JoinByFormat joins a string array by a known format (e.g. swagger's collectionFormat attribute):
+//
+// ssv: space separated value
+// tsv: tab separated value
+// pipes: pipe (|) separated value
+// csv: comma separated value (default)
+func JoinByFormat(data []string, format string) []string {
+ if len(data) == 0 {
+ return data
+ }
+ var sep string
+ switch format {
+ case collectionFormatSpace:
+ sep = " "
+ case collectionFormatTab:
+ sep = "\t"
+ case collectionFormatPipe:
+ sep = "|"
+ case collectionFormatMulti:
+ return data
+ default:
+ sep = collectionFormatDefaultSep
+ }
+ return []string{strings.Join(data, sep)}
+}
+
+// SplitByFormat splits a string by a known format:
+//
+// ssv: space separated value
+// tsv: tab separated value
+// pipes: pipe (|) separated value
+// csv: comma separated value (default)
+func SplitByFormat(data, format string) []string {
+ if data == "" {
+ return nil
+ }
+ var sep string
+ switch format {
+ case collectionFormatSpace:
+ sep = " "
+ case collectionFormatTab:
+ sep = "\t"
+ case collectionFormatPipe:
+ sep = "|"
+ case collectionFormatMulti:
+ return nil
+ default:
+ sep = collectionFormatDefaultSep
+ }
+ var result []string
+ for _, s := range strings.Split(data, sep) {
+ if ts := strings.TrimSpace(s); ts != "" {
+ result = append(result, ts)
+ }
+ }
+ return result
+}
diff --git a/vendor/github.com/go-openapi/swag/stringutils/doc.go b/vendor/github.com/go-openapi/swag/stringutils/doc.go
new file mode 100644
index 000000000000..c6d17a1160bd
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/stringutils/doc.go
@@ -0,0 +1,5 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+// Package stringutils exposes helpers to search and process strings.
+package stringutils
diff --git a/vendor/github.com/go-openapi/swag/stringutils/strings.go b/vendor/github.com/go-openapi/swag/stringutils/strings.go
new file mode 100644
index 000000000000..cd792b7d0834
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/stringutils/strings.go
@@ -0,0 +1,23 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package stringutils
+
+import (
+ "slices"
+ "strings"
+)
+
+// ContainsStrings searches a slice of strings for a case-sensitive match
+//
+// Now equivalent to the standard library [slice.Contains].
+func ContainsStrings(coll []string, item string) bool {
+ return slices.Contains(coll, item)
+}
+
+// ContainsStringsCI searches a slice of strings for a case-insensitive match
+func ContainsStringsCI(coll []string, item string) bool {
+ return slices.ContainsFunc(coll, func(e string) bool {
+ return strings.EqualFold(e, item)
+ })
+}
diff --git a/vendor/github.com/go-openapi/swag/stringutils_iface.go b/vendor/github.com/go-openapi/swag/stringutils_iface.go
new file mode 100644
index 000000000000..dbfa48484306
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/stringutils_iface.go
@@ -0,0 +1,34 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package swag
+
+import "github.com/go-openapi/swag/stringutils"
+
+// ContainsStrings searches a slice of strings for a case-sensitive match.
+//
+// Deprecated: use [slices.Contains] or [stringutils.ContainsStrings] instead.
+func ContainsStrings(coll []string, item string) bool {
+ return stringutils.ContainsStrings(coll, item)
+}
+
+// ContainsStringsCI searches a slice of strings for a case-insensitive match.
+//
+// Deprecated: use [stringutils.ContainsStringsCI] instead.
+func ContainsStringsCI(coll []string, item string) bool {
+ return stringutils.ContainsStringsCI(coll, item)
+}
+
+// JoinByFormat joins a string array by a known format (e.g. swagger's collectionFormat attribute).
+//
+// Deprecated: use [stringutils.JoinByFormat] instead.
+func JoinByFormat(data []string, format string) []string {
+ return stringutils.JoinByFormat(data, format)
+}
+
+// SplitByFormat splits a string by a known format.
+//
+// Deprecated: use [stringutils.SplitByFormat] instead.
+func SplitByFormat(data, format string) []string {
+ return stringutils.SplitByFormat(data, format)
+}
diff --git a/vendor/github.com/go-openapi/swag/typeutils/LICENSE b/vendor/github.com/go-openapi/swag/typeutils/LICENSE
new file mode 100644
index 000000000000..d64569567334
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/typeutils/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/vendor/github.com/go-openapi/swag/typeutils/doc.go b/vendor/github.com/go-openapi/swag/typeutils/doc.go
new file mode 100644
index 000000000000..66bed20dff0e
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/typeutils/doc.go
@@ -0,0 +1,5 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+// Package typeutils exposes utilities to inspect generic types.
+package typeutils
diff --git a/vendor/github.com/go-openapi/swag/typeutils/types.go b/vendor/github.com/go-openapi/swag/typeutils/types.go
new file mode 100644
index 000000000000..55487a673c4b
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/typeutils/types.go
@@ -0,0 +1,80 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package typeutils
+
+import "reflect"
+
+type zeroable interface {
+ IsZero() bool
+}
+
+// IsZero returns true when the value passed into the function is a zero value.
+// This allows for safer checking of interface values.
+func IsZero(data any) bool {
+ v := reflect.ValueOf(data)
+ // check for nil data
+ switch v.Kind() { //nolint:exhaustive
+ case
+ reflect.Interface,
+ reflect.Func,
+ reflect.Chan,
+ reflect.Pointer,
+ reflect.UnsafePointer,
+ reflect.Map,
+ reflect.Slice:
+ if v.IsNil() {
+ return true
+ }
+ }
+
+ // check for things that have an IsZero method instead
+ if vv, ok := data.(zeroable); ok {
+ return vv.IsZero()
+ }
+
+ // continue with slightly more complex reflection
+ switch v.Kind() { //nolint:exhaustive
+ case reflect.String:
+ return v.Len() == 0
+ case reflect.Bool:
+ return !v.Bool()
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ return v.Int() == 0
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
+ return v.Uint() == 0
+ case reflect.Float32, reflect.Float64:
+ return v.Float() == 0
+ case reflect.Struct, reflect.Array:
+ return reflect.DeepEqual(data, reflect.Zero(v.Type()).Interface())
+ case reflect.Invalid:
+ return true
+ default:
+ return false
+ }
+}
+
+// IsNil checks if input is nil.
+//
+// For types chan, func, interface, map, pointer, or slice it returns true if its argument is nil.
+//
+// See [reflect.Value.IsNil].
+func IsNil(input any) bool {
+ if input == nil {
+ return true
+ }
+
+ kind := reflect.TypeOf(input).Kind()
+ switch kind { //nolint:exhaustive
+ case reflect.Pointer,
+ reflect.UnsafePointer,
+ reflect.Map,
+ reflect.Slice,
+ reflect.Chan,
+ reflect.Interface,
+ reflect.Func:
+ return reflect.ValueOf(input).IsNil()
+ default:
+ return false
+ }
+}
diff --git a/vendor/github.com/go-openapi/swag/typeutils_iface.go b/vendor/github.com/go-openapi/swag/typeutils_iface.go
new file mode 100644
index 000000000000..b63813ea408e
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/typeutils_iface.go
@@ -0,0 +1,12 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package swag
+
+import "github.com/go-openapi/swag/typeutils"
+
+// IsZero returns true when the value passed into the function is a zero value.
+// This allows for safer checking of interface values.
+//
+// Deprecated: use [typeutils.IsZero] instead.
+func IsZero(data any) bool { return typeutils.IsZero(data) }
diff --git a/vendor/github.com/go-openapi/swag/util.go b/vendor/github.com/go-openapi/swag/util.go
deleted file mode 100644
index 5051401c49ff..000000000000
--- a/vendor/github.com/go-openapi/swag/util.go
+++ /dev/null
@@ -1,364 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 swag
-
-import (
- "reflect"
- "strings"
- "unicode"
- "unicode/utf8"
-)
-
-// GoNamePrefixFunc sets an optional rule to prefix go names
-// which do not start with a letter.
-//
-// The prefix function is assumed to return a string that starts with an upper case letter.
-//
-// e.g. to help convert "123" into "{prefix}123"
-//
-// The default is to prefix with "X"
-var GoNamePrefixFunc func(string) string
-
-func prefixFunc(name, in string) string {
- if GoNamePrefixFunc == nil {
- return "X" + in
- }
-
- return GoNamePrefixFunc(name) + in
-}
-
-const (
- // collectionFormatComma = "csv"
- collectionFormatSpace = "ssv"
- collectionFormatTab = "tsv"
- collectionFormatPipe = "pipes"
- collectionFormatMulti = "multi"
-)
-
-// JoinByFormat joins a string array by a known format (e.g. swagger's collectionFormat attribute):
-//
-// ssv: space separated value
-// tsv: tab separated value
-// pipes: pipe (|) separated value
-// csv: comma separated value (default)
-func JoinByFormat(data []string, format string) []string {
- if len(data) == 0 {
- return data
- }
- var sep string
- switch format {
- case collectionFormatSpace:
- sep = " "
- case collectionFormatTab:
- sep = "\t"
- case collectionFormatPipe:
- sep = "|"
- case collectionFormatMulti:
- return data
- default:
- sep = ","
- }
- return []string{strings.Join(data, sep)}
-}
-
-// SplitByFormat splits a string by a known format:
-//
-// ssv: space separated value
-// tsv: tab separated value
-// pipes: pipe (|) separated value
-// csv: comma separated value (default)
-func SplitByFormat(data, format string) []string {
- if data == "" {
- return nil
- }
- var sep string
- switch format {
- case collectionFormatSpace:
- sep = " "
- case collectionFormatTab:
- sep = "\t"
- case collectionFormatPipe:
- sep = "|"
- case collectionFormatMulti:
- return nil
- default:
- sep = ","
- }
- var result []string
- for _, s := range strings.Split(data, sep) {
- if ts := strings.TrimSpace(s); ts != "" {
- result = append(result, ts)
- }
- }
- return result
-}
-
-// Removes leading whitespaces
-func trim(str string) string {
- return strings.TrimSpace(str)
-}
-
-// Shortcut to strings.ToUpper()
-func upper(str string) string {
- return strings.ToUpper(trim(str))
-}
-
-// Shortcut to strings.ToLower()
-func lower(str string) string {
- return strings.ToLower(trim(str))
-}
-
-// Camelize an uppercased word
-func Camelize(word string) string {
- camelized := poolOfBuffers.BorrowBuffer(len(word))
- defer func() {
- poolOfBuffers.RedeemBuffer(camelized)
- }()
-
- for pos, ru := range []rune(word) {
- if pos > 0 {
- camelized.WriteRune(unicode.ToLower(ru))
- } else {
- camelized.WriteRune(unicode.ToUpper(ru))
- }
- }
- return camelized.String()
-}
-
-// ToFileName lowercases and underscores a go type name
-func ToFileName(name string) string {
- in := split(name)
- out := make([]string, 0, len(in))
-
- for _, w := range in {
- out = append(out, lower(w))
- }
-
- return strings.Join(out, "_")
-}
-
-// ToCommandName lowercases and underscores a go type name
-func ToCommandName(name string) string {
- in := split(name)
- out := make([]string, 0, len(in))
-
- for _, w := range in {
- out = append(out, lower(w))
- }
- return strings.Join(out, "-")
-}
-
-// ToHumanNameLower represents a code name as a human series of words
-func ToHumanNameLower(name string) string {
- s := poolOfSplitters.BorrowSplitter(withPostSplitInitialismCheck)
- in := s.split(name)
- poolOfSplitters.RedeemSplitter(s)
- out := make([]string, 0, len(*in))
-
- for _, w := range *in {
- if !w.IsInitialism() {
- out = append(out, lower(w.GetOriginal()))
- } else {
- out = append(out, trim(w.GetOriginal()))
- }
- }
- poolOfLexems.RedeemLexems(in)
-
- return strings.Join(out, " ")
-}
-
-// ToHumanNameTitle represents a code name as a human series of words with the first letters titleized
-func ToHumanNameTitle(name string) string {
- s := poolOfSplitters.BorrowSplitter(withPostSplitInitialismCheck)
- in := s.split(name)
- poolOfSplitters.RedeemSplitter(s)
-
- out := make([]string, 0, len(*in))
- for _, w := range *in {
- original := trim(w.GetOriginal())
- if !w.IsInitialism() {
- out = append(out, Camelize(original))
- } else {
- out = append(out, original)
- }
- }
- poolOfLexems.RedeemLexems(in)
-
- return strings.Join(out, " ")
-}
-
-// ToJSONName camelcases a name which can be underscored or pascal cased
-func ToJSONName(name string) string {
- in := split(name)
- out := make([]string, 0, len(in))
-
- for i, w := range in {
- if i == 0 {
- out = append(out, lower(w))
- continue
- }
- out = append(out, Camelize(trim(w)))
- }
- return strings.Join(out, "")
-}
-
-// ToVarName camelcases a name which can be underscored or pascal cased
-func ToVarName(name string) string {
- res := ToGoName(name)
- if isInitialism(res) {
- return lower(res)
- }
- if len(res) <= 1 {
- return lower(res)
- }
- return lower(res[:1]) + res[1:]
-}
-
-// ToGoName translates a swagger name which can be underscored or camel cased to a name that golint likes
-func ToGoName(name string) string {
- s := poolOfSplitters.BorrowSplitter(withPostSplitInitialismCheck)
- lexems := s.split(name)
- poolOfSplitters.RedeemSplitter(s)
- defer func() {
- poolOfLexems.RedeemLexems(lexems)
- }()
- lexemes := *lexems
-
- if len(lexemes) == 0 {
- return ""
- }
-
- result := poolOfBuffers.BorrowBuffer(len(name))
- defer func() {
- poolOfBuffers.RedeemBuffer(result)
- }()
-
- // check if not starting with a letter, upper case
- firstPart := lexemes[0].GetUnsafeGoName()
- if lexemes[0].IsInitialism() {
- firstPart = upper(firstPart)
- }
-
- if c := firstPart[0]; c < utf8.RuneSelf {
- // ASCII
- switch {
- case 'A' <= c && c <= 'Z':
- result.WriteString(firstPart)
- case 'a' <= c && c <= 'z':
- result.WriteByte(c - 'a' + 'A')
- result.WriteString(firstPart[1:])
- default:
- result.WriteString(prefixFunc(name, firstPart))
- // NOTE: no longer check if prefixFunc returns a string that starts with uppercase:
- // assume this is always the case
- }
- } else {
- // unicode
- firstRune, _ := utf8.DecodeRuneInString(firstPart)
- switch {
- case !unicode.IsLetter(firstRune):
- result.WriteString(prefixFunc(name, firstPart))
- case !unicode.IsUpper(firstRune):
- result.WriteString(prefixFunc(name, firstPart))
- /*
- result.WriteRune(unicode.ToUpper(firstRune))
- result.WriteString(firstPart[offset:])
- */
- default:
- result.WriteString(firstPart)
- }
- }
-
- for _, lexem := range lexemes[1:] {
- goName := lexem.GetUnsafeGoName()
-
- // to support old behavior
- if lexem.IsInitialism() {
- goName = upper(goName)
- }
- result.WriteString(goName)
- }
-
- return result.String()
-}
-
-// ContainsStrings searches a slice of strings for a case-sensitive match
-func ContainsStrings(coll []string, item string) bool {
- for _, a := range coll {
- if a == item {
- return true
- }
- }
- return false
-}
-
-// ContainsStringsCI searches a slice of strings for a case-insensitive match
-func ContainsStringsCI(coll []string, item string) bool {
- for _, a := range coll {
- if strings.EqualFold(a, item) {
- return true
- }
- }
- return false
-}
-
-type zeroable interface {
- IsZero() bool
-}
-
-// IsZero returns true when the value passed into the function is a zero value.
-// This allows for safer checking of interface values.
-func IsZero(data interface{}) bool {
- v := reflect.ValueOf(data)
- // check for nil data
- switch v.Kind() { //nolint:exhaustive
- case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
- if v.IsNil() {
- return true
- }
- }
-
- // check for things that have an IsZero method instead
- if vv, ok := data.(zeroable); ok {
- return vv.IsZero()
- }
-
- // continue with slightly more complex reflection
- switch v.Kind() { //nolint:exhaustive
- case reflect.String:
- return v.Len() == 0
- case reflect.Bool:
- return !v.Bool()
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- return v.Int() == 0
- case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
- return v.Uint() == 0
- case reflect.Float32, reflect.Float64:
- return v.Float() == 0
- case reflect.Struct, reflect.Array:
- return reflect.DeepEqual(data, reflect.Zero(v.Type()).Interface())
- case reflect.Invalid:
- return true
- default:
- return false
- }
-}
-
-// CommandLineOptionsGroup represents a group of user-defined command line options
-type CommandLineOptionsGroup struct {
- ShortDescription string
- LongDescription string
- Options interface{}
-}
diff --git a/vendor/github.com/go-openapi/swag/yaml.go b/vendor/github.com/go-openapi/swag/yaml.go
deleted file mode 100644
index f59e0259320c..000000000000
--- a/vendor/github.com/go-openapi/swag/yaml.go
+++ /dev/null
@@ -1,481 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 swag
-
-import (
- "encoding/json"
- "errors"
- "fmt"
- "path/filepath"
- "reflect"
- "sort"
- "strconv"
-
- "github.com/mailru/easyjson/jlexer"
- "github.com/mailru/easyjson/jwriter"
- yaml "gopkg.in/yaml.v3"
-)
-
-// YAMLMatcher matches yaml
-func YAMLMatcher(path string) bool {
- ext := filepath.Ext(path)
- return ext == ".yaml" || ext == ".yml"
-}
-
-// YAMLToJSON converts YAML unmarshaled data into json compatible data
-func YAMLToJSON(data interface{}) (json.RawMessage, error) {
- jm, err := transformData(data)
- if err != nil {
- return nil, err
- }
- b, err := WriteJSON(jm)
- return json.RawMessage(b), err
-}
-
-// BytesToYAMLDoc converts a byte slice into a YAML document
-func BytesToYAMLDoc(data []byte) (interface{}, error) {
- var document yaml.Node // preserve order that is present in the document
- if err := yaml.Unmarshal(data, &document); err != nil {
- return nil, err
- }
- if document.Kind != yaml.DocumentNode || len(document.Content) != 1 || document.Content[0].Kind != yaml.MappingNode {
- return nil, errors.New("only YAML documents that are objects are supported")
- }
- return &document, nil
-}
-
-func yamlNode(root *yaml.Node) (interface{}, error) {
- switch root.Kind {
- case yaml.DocumentNode:
- return yamlDocument(root)
- case yaml.SequenceNode:
- return yamlSequence(root)
- case yaml.MappingNode:
- return yamlMapping(root)
- case yaml.ScalarNode:
- return yamlScalar(root)
- case yaml.AliasNode:
- return yamlNode(root.Alias)
- default:
- return nil, fmt.Errorf("unsupported YAML node type: %v", root.Kind)
- }
-}
-
-func yamlDocument(node *yaml.Node) (interface{}, error) {
- if len(node.Content) != 1 {
- return nil, fmt.Errorf("unexpected YAML Document node content length: %d", len(node.Content))
- }
- return yamlNode(node.Content[0])
-}
-
-func yamlMapping(node *yaml.Node) (interface{}, error) {
- m := make(JSONMapSlice, len(node.Content)/2)
-
- var j int
- for i := 0; i < len(node.Content); i += 2 {
- var nmi JSONMapItem
- k, err := yamlStringScalarC(node.Content[i])
- if err != nil {
- return nil, fmt.Errorf("unable to decode YAML map key: %w", err)
- }
- nmi.Key = k
- v, err := yamlNode(node.Content[i+1])
- if err != nil {
- return nil, fmt.Errorf("unable to process YAML map value for key %q: %w", k, err)
- }
- nmi.Value = v
- m[j] = nmi
- j++
- }
- return m, nil
-}
-
-func yamlSequence(node *yaml.Node) (interface{}, error) {
- s := make([]interface{}, 0)
-
- for i := 0; i < len(node.Content); i++ {
-
- v, err := yamlNode(node.Content[i])
- if err != nil {
- return nil, fmt.Errorf("unable to decode YAML sequence value: %w", err)
- }
- s = append(s, v)
- }
- return s, nil
-}
-
-const ( // See https://yaml.org/type/
- yamlStringScalar = "tag:yaml.org,2002:str"
- yamlIntScalar = "tag:yaml.org,2002:int"
- yamlBoolScalar = "tag:yaml.org,2002:bool"
- yamlFloatScalar = "tag:yaml.org,2002:float"
- yamlTimestamp = "tag:yaml.org,2002:timestamp"
- yamlNull = "tag:yaml.org,2002:null"
-)
-
-func yamlScalar(node *yaml.Node) (interface{}, error) {
- switch node.LongTag() {
- case yamlStringScalar:
- return node.Value, nil
- case yamlBoolScalar:
- b, err := strconv.ParseBool(node.Value)
- if err != nil {
- return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting bool content: %w", node.Value, err)
- }
- return b, nil
- case yamlIntScalar:
- i, err := strconv.ParseInt(node.Value, 10, 64)
- if err != nil {
- return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting integer content: %w", node.Value, err)
- }
- return i, nil
- case yamlFloatScalar:
- f, err := strconv.ParseFloat(node.Value, 64)
- if err != nil {
- return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting float content: %w", node.Value, err)
- }
- return f, nil
- case yamlTimestamp:
- return node.Value, nil
- case yamlNull:
- return nil, nil //nolint:nilnil
- default:
- return nil, fmt.Errorf("YAML tag %q is not supported", node.LongTag())
- }
-}
-
-func yamlStringScalarC(node *yaml.Node) (string, error) {
- if node.Kind != yaml.ScalarNode {
- return "", fmt.Errorf("expecting a string scalar but got %q", node.Kind)
- }
- switch node.LongTag() {
- case yamlStringScalar, yamlIntScalar, yamlFloatScalar:
- return node.Value, nil
- default:
- return "", fmt.Errorf("YAML tag %q is not supported as map key", node.LongTag())
- }
-}
-
-// JSONMapSlice represent a JSON object, with the order of keys maintained
-type JSONMapSlice []JSONMapItem
-
-// MarshalJSON renders a JSONMapSlice as JSON
-func (s JSONMapSlice) MarshalJSON() ([]byte, error) {
- w := &jwriter.Writer{Flags: jwriter.NilMapAsEmpty | jwriter.NilSliceAsEmpty}
- s.MarshalEasyJSON(w)
- return w.BuildBytes()
-}
-
-// MarshalEasyJSON renders a JSONMapSlice as JSON, using easyJSON
-func (s JSONMapSlice) MarshalEasyJSON(w *jwriter.Writer) {
- w.RawByte('{')
-
- ln := len(s)
- last := ln - 1
- for i := 0; i < ln; i++ {
- s[i].MarshalEasyJSON(w)
- if i != last { // last item
- w.RawByte(',')
- }
- }
-
- w.RawByte('}')
-}
-
-// UnmarshalJSON makes a JSONMapSlice from JSON
-func (s *JSONMapSlice) UnmarshalJSON(data []byte) error {
- l := jlexer.Lexer{Data: data}
- s.UnmarshalEasyJSON(&l)
- return l.Error()
-}
-
-// UnmarshalEasyJSON makes a JSONMapSlice from JSON, using easyJSON
-func (s *JSONMapSlice) UnmarshalEasyJSON(in *jlexer.Lexer) {
- if in.IsNull() {
- in.Skip()
- return
- }
-
- var result JSONMapSlice
- in.Delim('{')
- for !in.IsDelim('}') {
- var mi JSONMapItem
- mi.UnmarshalEasyJSON(in)
- result = append(result, mi)
- }
- *s = result
-}
-
-func (s JSONMapSlice) MarshalYAML() (interface{}, error) {
- var n yaml.Node
- n.Kind = yaml.DocumentNode
- var nodes []*yaml.Node
- for _, item := range s {
- nn, err := json2yaml(item.Value)
- if err != nil {
- return nil, err
- }
- ns := []*yaml.Node{
- {
- Kind: yaml.ScalarNode,
- Tag: yamlStringScalar,
- Value: item.Key,
- },
- nn,
- }
- nodes = append(nodes, ns...)
- }
-
- n.Content = []*yaml.Node{
- {
- Kind: yaml.MappingNode,
- Content: nodes,
- },
- }
-
- return yaml.Marshal(&n)
-}
-
-func isNil(input interface{}) bool {
- if input == nil {
- return true
- }
- kind := reflect.TypeOf(input).Kind()
- switch kind { //nolint:exhaustive
- case reflect.Ptr, reflect.Map, reflect.Slice, reflect.Chan:
- return reflect.ValueOf(input).IsNil()
- default:
- return false
- }
-}
-
-func json2yaml(item interface{}) (*yaml.Node, error) {
- if isNil(item) {
- return &yaml.Node{
- Kind: yaml.ScalarNode,
- Value: "null",
- }, nil
- }
-
- switch val := item.(type) {
- case JSONMapSlice:
- var n yaml.Node
- n.Kind = yaml.MappingNode
- for i := range val {
- childNode, err := json2yaml(&val[i].Value)
- if err != nil {
- return nil, err
- }
- n.Content = append(n.Content, &yaml.Node{
- Kind: yaml.ScalarNode,
- Tag: yamlStringScalar,
- Value: val[i].Key,
- }, childNode)
- }
- return &n, nil
- case map[string]interface{}:
- var n yaml.Node
- n.Kind = yaml.MappingNode
- keys := make([]string, 0, len(val))
- for k := range val {
- keys = append(keys, k)
- }
- sort.Strings(keys)
-
- for _, k := range keys {
- v := val[k]
- childNode, err := json2yaml(v)
- if err != nil {
- return nil, err
- }
- n.Content = append(n.Content, &yaml.Node{
- Kind: yaml.ScalarNode,
- Tag: yamlStringScalar,
- Value: k,
- }, childNode)
- }
- return &n, nil
- case []interface{}:
- var n yaml.Node
- n.Kind = yaml.SequenceNode
- for i := range val {
- childNode, err := json2yaml(val[i])
- if err != nil {
- return nil, err
- }
- n.Content = append(n.Content, childNode)
- }
- return &n, nil
- case string:
- return &yaml.Node{
- Kind: yaml.ScalarNode,
- Tag: yamlStringScalar,
- Value: val,
- }, nil
- case float64:
- return &yaml.Node{
- Kind: yaml.ScalarNode,
- Tag: yamlFloatScalar,
- Value: strconv.FormatFloat(val, 'f', -1, 64),
- }, nil
- case int64:
- return &yaml.Node{
- Kind: yaml.ScalarNode,
- Tag: yamlIntScalar,
- Value: strconv.FormatInt(val, 10),
- }, nil
- case uint64:
- return &yaml.Node{
- Kind: yaml.ScalarNode,
- Tag: yamlIntScalar,
- Value: strconv.FormatUint(val, 10),
- }, nil
- case bool:
- return &yaml.Node{
- Kind: yaml.ScalarNode,
- Tag: yamlBoolScalar,
- Value: strconv.FormatBool(val),
- }, nil
- default:
- return nil, fmt.Errorf("unhandled type: %T", val)
- }
-}
-
-// JSONMapItem represents the value of a key in a JSON object held by JSONMapSlice
-type JSONMapItem struct {
- Key string
- Value interface{}
-}
-
-// MarshalJSON renders a JSONMapItem as JSON
-func (s JSONMapItem) MarshalJSON() ([]byte, error) {
- w := &jwriter.Writer{Flags: jwriter.NilMapAsEmpty | jwriter.NilSliceAsEmpty}
- s.MarshalEasyJSON(w)
- return w.BuildBytes()
-}
-
-// MarshalEasyJSON renders a JSONMapItem as JSON, using easyJSON
-func (s JSONMapItem) MarshalEasyJSON(w *jwriter.Writer) {
- w.String(s.Key)
- w.RawByte(':')
- w.Raw(WriteJSON(s.Value))
-}
-
-// UnmarshalJSON makes a JSONMapItem from JSON
-func (s *JSONMapItem) UnmarshalJSON(data []byte) error {
- l := jlexer.Lexer{Data: data}
- s.UnmarshalEasyJSON(&l)
- return l.Error()
-}
-
-// UnmarshalEasyJSON makes a JSONMapItem from JSON, using easyJSON
-func (s *JSONMapItem) UnmarshalEasyJSON(in *jlexer.Lexer) {
- key := in.UnsafeString()
- in.WantColon()
- value := in.Interface()
- in.WantComma()
- s.Key = key
- s.Value = value
-}
-
-func transformData(input interface{}) (out interface{}, err error) {
- format := func(t interface{}) (string, error) {
- switch k := t.(type) {
- case string:
- return k, nil
- case uint:
- return strconv.FormatUint(uint64(k), 10), nil
- case uint8:
- return strconv.FormatUint(uint64(k), 10), nil
- case uint16:
- return strconv.FormatUint(uint64(k), 10), nil
- case uint32:
- return strconv.FormatUint(uint64(k), 10), nil
- case uint64:
- return strconv.FormatUint(k, 10), nil
- case int:
- return strconv.Itoa(k), nil
- case int8:
- return strconv.FormatInt(int64(k), 10), nil
- case int16:
- return strconv.FormatInt(int64(k), 10), nil
- case int32:
- return strconv.FormatInt(int64(k), 10), nil
- case int64:
- return strconv.FormatInt(k, 10), nil
- default:
- return "", fmt.Errorf("unexpected map key type, got: %T", k)
- }
- }
-
- switch in := input.(type) {
- case yaml.Node:
- return yamlNode(&in)
- case *yaml.Node:
- return yamlNode(in)
- case map[interface{}]interface{}:
- o := make(JSONMapSlice, 0, len(in))
- for ke, va := range in {
- var nmi JSONMapItem
- if nmi.Key, err = format(ke); err != nil {
- return nil, err
- }
-
- v, ert := transformData(va)
- if ert != nil {
- return nil, ert
- }
- nmi.Value = v
- o = append(o, nmi)
- }
- return o, nil
- case []interface{}:
- len1 := len(in)
- o := make([]interface{}, len1)
- for i := 0; i < len1; i++ {
- o[i], err = transformData(in[i])
- if err != nil {
- return nil, err
- }
- }
- return o, nil
- }
- return input, nil
-}
-
-// YAMLDoc loads a yaml document from either http or a file and converts it to json
-func YAMLDoc(path string) (json.RawMessage, error) {
- yamlDoc, err := YAMLData(path)
- if err != nil {
- return nil, err
- }
-
- data, err := YAMLToJSON(yamlDoc)
- if err != nil {
- return nil, err
- }
-
- return data, nil
-}
-
-// YAMLData loads a yaml document from either http or a file
-func YAMLData(path string) (interface{}, error) {
- data, err := LoadFromFileOrHTTP(path)
- if err != nil {
- return nil, err
- }
-
- return BytesToYAMLDoc(data)
-}
diff --git a/vendor/github.com/go-openapi/swag/yamlutils/LICENSE b/vendor/github.com/go-openapi/swag/yamlutils/LICENSE
new file mode 100644
index 000000000000..d64569567334
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/yamlutils/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/vendor/github.com/go-openapi/swag/yamlutils/doc.go b/vendor/github.com/go-openapi/swag/yamlutils/doc.go
new file mode 100644
index 000000000000..7bb92a82f1b0
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/yamlutils/doc.go
@@ -0,0 +1,13 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+// Package yamlutils provides utilities to work with YAML documents.
+//
+// - [BytesToYAMLDoc] to construct a [yaml.Node] document
+// - [YAMLToJSON] to convert a [yaml.Node] document to JSON bytes
+// - [YAMLMapSlice] to serialize and deserialize YAML with the order of keys maintained
+package yamlutils
+
+import (
+ _ "go.yaml.in/yaml/v3" // for documentation purpose only
+)
diff --git a/vendor/github.com/go-openapi/swag/yamlutils/errors.go b/vendor/github.com/go-openapi/swag/yamlutils/errors.go
new file mode 100644
index 000000000000..e87bc5e8beb3
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/yamlutils/errors.go
@@ -0,0 +1,15 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package yamlutils
+
+type yamlError string
+
+const (
+ // ErrYAML is an error raised by YAML utilities
+ ErrYAML yamlError = "yaml error"
+)
+
+func (e yamlError) Error() string {
+ return string(e)
+}
diff --git a/vendor/github.com/go-openapi/swag/yamlutils/ordered_map.go b/vendor/github.com/go-openapi/swag/yamlutils/ordered_map.go
new file mode 100644
index 000000000000..3daf68dbba0c
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/yamlutils/ordered_map.go
@@ -0,0 +1,316 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package yamlutils
+
+import (
+ "fmt"
+ "iter"
+ "slices"
+ "sort"
+ "strconv"
+
+ "github.com/go-openapi/swag/conv"
+ "github.com/go-openapi/swag/jsonutils"
+ "github.com/go-openapi/swag/jsonutils/adapters/ifaces"
+ "github.com/go-openapi/swag/typeutils"
+ yaml "go.yaml.in/yaml/v3"
+)
+
+var (
+ _ yaml.Marshaler = YAMLMapSlice{}
+ _ yaml.Unmarshaler = &YAMLMapSlice{}
+)
+
+// YAMLMapSlice represents a YAML object, with the order of keys maintained.
+//
+// It is similar to [jsonutils.JSONMapSlice] and also knows how to marshal and unmarshal YAML.
+//
+// It behaves like an ordered map, but keys can't be accessed in constant time.
+type YAMLMapSlice []YAMLMapItem
+
+// YAMLMapItem represents the value of a key in a YAML object held by [YAMLMapSlice].
+//
+// It is entirely equivalent to [jsonutils.JSONMapItem], with the same limitation that
+// you should not Marshal or Unmarshal directly this type, outside of a [YAMLMapSlice].
+type YAMLMapItem = jsonutils.JSONMapItem
+
+func (s YAMLMapSlice) OrderedItems() iter.Seq2[string, any] {
+ return func(yield func(string, any) bool) {
+ for _, item := range s {
+ if !yield(item.Key, item.Value) {
+ return
+ }
+ }
+ }
+}
+
+// SetOrderedItems implements [ifaces.SetOrdered]: it merges keys passed by the iterator argument
+// into the [YAMLMapSlice].
+func (s *YAMLMapSlice) SetOrderedItems(items iter.Seq2[string, any]) {
+ if items == nil {
+ // force receiver to be a nil slice
+ *s = nil
+
+ return
+ }
+
+ m := *s
+ if len(m) > 0 {
+ // update mode: short-circuited when unmarshaling fresh data structures
+ idx := make(map[string]int, len(m))
+
+ for i, item := range m {
+ idx[item.Key] = i
+ }
+
+ for k, v := range items {
+ idx, ok := idx[k]
+ if ok {
+ m[idx].Value = v
+
+ continue
+ }
+
+ m = append(m, YAMLMapItem{Key: k, Value: v})
+ }
+
+ *s = m
+
+ return
+ }
+
+ for k, v := range items {
+ m = append(m, YAMLMapItem{Key: k, Value: v})
+ }
+
+ *s = m
+}
+
+// MarshalJSON renders this YAML object as JSON bytes.
+//
+// The difference with standard JSON marshaling is that the order of keys is maintained.
+func (s YAMLMapSlice) MarshalJSON() ([]byte, error) {
+ return jsonutils.JSONMapSlice(s).MarshalJSON()
+}
+
+// UnmarshalJSON builds this YAML object from JSON bytes.
+//
+// The difference with standard JSON marshaling is that the order of keys is maintained.
+func (s *YAMLMapSlice) UnmarshalJSON(data []byte) error {
+ js := jsonutils.JSONMapSlice(*s)
+
+ if err := js.UnmarshalJSON(data); err != nil {
+ return err
+ }
+
+ *s = YAMLMapSlice(js)
+
+ return nil
+}
+
+// MarshalYAML produces a YAML document as bytes
+//
+// The difference with standard YAML marshaling is that the order of keys is maintained.
+//
+// It implements [yaml.Marshaler].
+func (s YAMLMapSlice) MarshalYAML() (any, error) {
+ if typeutils.IsNil(s) {
+ return []byte("null\n"), nil
+ }
+ var n yaml.Node
+ n.Kind = yaml.DocumentNode
+ var nodes []*yaml.Node
+
+ for _, item := range s {
+ nn, err := json2yaml(item.Value)
+ if err != nil {
+ return nil, err
+ }
+
+ ns := []*yaml.Node{
+ {
+ Kind: yaml.ScalarNode,
+ Tag: yamlStringScalar,
+ Value: item.Key,
+ },
+ nn,
+ }
+ nodes = append(nodes, ns...)
+ }
+
+ n.Content = []*yaml.Node{
+ {
+ Kind: yaml.MappingNode,
+ Content: nodes,
+ },
+ }
+
+ return yaml.Marshal(&n)
+}
+
+// UnmarshalYAML builds a YAMLMapSlice object from a YAML document [yaml.Node].
+//
+// It implements [yaml.Unmarshaler].
+func (s *YAMLMapSlice) UnmarshalYAML(node *yaml.Node) error {
+ if typeutils.IsNil(*s) {
+ // allow to unmarshal with a simple var declaration (nil slice)
+ *s = YAMLMapSlice{}
+ }
+ if node == nil {
+ *s = nil
+ return nil
+ }
+
+ const sensibleAllocDivider = 2
+ m := slices.Grow(*s, len(node.Content)/sensibleAllocDivider)
+ m = m[:0]
+
+ for i := 0; i < len(node.Content); i += 2 {
+ var nmi YAMLMapItem
+ k, err := yamlStringScalarC(node.Content[i])
+ if err != nil {
+ return fmt.Errorf("unable to decode YAML map key: %w: %w", err, ErrYAML)
+ }
+ nmi.Key = k
+ v, err := yamlNode(node.Content[i+1])
+ if err != nil {
+ return fmt.Errorf("unable to process YAML map value for key %q: %w: %w", k, err, ErrYAML)
+ }
+ nmi.Value = v
+ m = append(m, nmi)
+ }
+
+ *s = m
+
+ return nil
+}
+
+func json2yaml(item any) (*yaml.Node, error) {
+ if typeutils.IsNil(item) {
+ return &yaml.Node{
+ Kind: yaml.ScalarNode,
+ Value: "null",
+ }, nil
+ }
+
+ switch val := item.(type) {
+ case ifaces.Ordered:
+ return orderedYAML(val)
+
+ case map[string]any:
+ var n yaml.Node
+ n.Kind = yaml.MappingNode
+ keys := make([]string, 0, len(val))
+ for k := range val {
+ keys = append(keys, k)
+ }
+ sort.Strings(keys)
+
+ for _, k := range keys {
+ v := val[k]
+ childNode, err := json2yaml(v)
+ if err != nil {
+ return nil, err
+ }
+ n.Content = append(n.Content, &yaml.Node{
+ Kind: yaml.ScalarNode,
+ Tag: yamlStringScalar,
+ Value: k,
+ }, childNode)
+ }
+ return &n, nil
+
+ case []any:
+ var n yaml.Node
+ n.Kind = yaml.SequenceNode
+ for i := range val {
+ childNode, err := json2yaml(val[i])
+ if err != nil {
+ return nil, err
+ }
+ n.Content = append(n.Content, childNode)
+ }
+ return &n, nil
+ case string:
+ return &yaml.Node{
+ Kind: yaml.ScalarNode,
+ Tag: yamlStringScalar,
+ Value: val,
+ }, nil
+ case float32:
+ return floatNode(val)
+ case float64:
+ return floatNode(val)
+ case int:
+ return integerNode(val)
+ case int8:
+ return integerNode(val)
+ case int16:
+ return integerNode(val)
+ case int32:
+ return integerNode(val)
+ case int64:
+ return integerNode(val)
+ case uint:
+ return uintegerNode(val)
+ case uint8:
+ return uintegerNode(val)
+ case uint16:
+ return uintegerNode(val)
+ case uint32:
+ return uintegerNode(val)
+ case uint64:
+ return uintegerNode(val)
+ case bool:
+ return &yaml.Node{
+ Kind: yaml.ScalarNode,
+ Tag: yamlBoolScalar,
+ Value: strconv.FormatBool(val),
+ }, nil
+ default:
+ return nil, fmt.Errorf("unhandled type: %T: %w", val, ErrYAML)
+ }
+}
+
+func floatNode[T conv.Float](val T) (*yaml.Node, error) {
+ return &yaml.Node{
+ Kind: yaml.ScalarNode,
+ Tag: yamlFloatScalar,
+ Value: conv.FormatFloat(val),
+ }, nil
+}
+
+func integerNode[T conv.Signed](val T) (*yaml.Node, error) {
+ return &yaml.Node{
+ Kind: yaml.ScalarNode,
+ Tag: yamlIntScalar,
+ Value: conv.FormatInteger(val),
+ }, nil
+}
+
+func uintegerNode[T conv.Unsigned](val T) (*yaml.Node, error) {
+ return &yaml.Node{
+ Kind: yaml.ScalarNode,
+ Tag: yamlIntScalar,
+ Value: conv.FormatUinteger(val),
+ }, nil
+}
+
+func orderedYAML[T ifaces.Ordered](val T) (*yaml.Node, error) {
+ var n yaml.Node
+ n.Kind = yaml.MappingNode
+ for key, value := range val.OrderedItems() {
+ childNode, err := json2yaml(value)
+ if err != nil {
+ return nil, err
+ }
+
+ n.Content = append(n.Content, &yaml.Node{
+ Kind: yaml.ScalarNode,
+ Tag: yamlStringScalar,
+ Value: key,
+ }, childNode)
+ }
+ return &n, nil
+}
diff --git a/vendor/github.com/go-openapi/swag/yamlutils/yaml.go b/vendor/github.com/go-openapi/swag/yamlutils/yaml.go
new file mode 100644
index 000000000000..e3aff3c2fde9
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/yamlutils/yaml.go
@@ -0,0 +1,211 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package yamlutils
+
+import (
+ json "encoding/json"
+ "fmt"
+ "strconv"
+
+ "github.com/go-openapi/swag/jsonutils"
+ yaml "go.yaml.in/yaml/v3"
+)
+
+// YAMLToJSON converts a YAML document into JSON bytes.
+//
+// Note: a YAML document is the output from a [yaml.Marshaler], e.g a pointer to a [yaml.Node].
+//
+// [YAMLToJSON] is typically called after [BytesToYAMLDoc].
+func YAMLToJSON(value any) (json.RawMessage, error) {
+ jm, err := transformData(value)
+ if err != nil {
+ return nil, err
+ }
+
+ b, err := jsonutils.WriteJSON(jm)
+
+ return json.RawMessage(b), err
+}
+
+// BytesToYAMLDoc converts a byte slice into a YAML document.
+//
+// This function only supports root documents that are objects.
+//
+// A YAML document is a pointer to a [yaml.Node].
+func BytesToYAMLDoc(data []byte) (any, error) {
+ var document yaml.Node // preserve order that is present in the document
+ if err := yaml.Unmarshal(data, &document); err != nil {
+ return nil, err
+ }
+ if document.Kind != yaml.DocumentNode || len(document.Content) != 1 || document.Content[0].Kind != yaml.MappingNode {
+ return nil, fmt.Errorf("only YAML documents that are objects are supported: %w", ErrYAML)
+ }
+ return &document, nil
+}
+
+func yamlNode(root *yaml.Node) (any, error) {
+ switch root.Kind {
+ case yaml.DocumentNode:
+ return yamlDocument(root)
+ case yaml.SequenceNode:
+ return yamlSequence(root)
+ case yaml.MappingNode:
+ return yamlMapping(root)
+ case yaml.ScalarNode:
+ return yamlScalar(root)
+ case yaml.AliasNode:
+ return yamlNode(root.Alias)
+ default:
+ return nil, fmt.Errorf("unsupported YAML node type: %v: %w", root.Kind, ErrYAML)
+ }
+}
+
+func yamlDocument(node *yaml.Node) (any, error) {
+ if len(node.Content) != 1 {
+ return nil, fmt.Errorf("unexpected YAML Document node content length: %d: %w", len(node.Content), ErrYAML)
+ }
+ return yamlNode(node.Content[0])
+}
+
+func yamlMapping(node *yaml.Node) (any, error) {
+ const sensibleAllocDivider = 2 // nodes concatenate (key,value) sequences
+ m := make(YAMLMapSlice, len(node.Content)/sensibleAllocDivider)
+
+ if err := m.UnmarshalYAML(node); err != nil {
+ return nil, err
+ }
+
+ return m, nil
+}
+
+func yamlSequence(node *yaml.Node) (any, error) {
+ s := make([]any, 0)
+
+ for i := range len(node.Content) {
+ v, err := yamlNode(node.Content[i])
+ if err != nil {
+ return nil, fmt.Errorf("unable to decode YAML sequence value: %w: %w", err, ErrYAML)
+ }
+ s = append(s, v)
+ }
+ return s, nil
+}
+
+const ( // See https://yaml.org/type/
+ yamlStringScalar = "tag:yaml.org,2002:str"
+ yamlIntScalar = "tag:yaml.org,2002:int"
+ yamlBoolScalar = "tag:yaml.org,2002:bool"
+ yamlFloatScalar = "tag:yaml.org,2002:float"
+ yamlTimestamp = "tag:yaml.org,2002:timestamp"
+ yamlNull = "tag:yaml.org,2002:null"
+)
+
+func yamlScalar(node *yaml.Node) (any, error) {
+ switch node.LongTag() {
+ case yamlStringScalar:
+ return node.Value, nil
+ case yamlBoolScalar:
+ b, err := strconv.ParseBool(node.Value)
+ if err != nil {
+ return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting bool content: %w: %w", node.Value, err, ErrYAML)
+ }
+ return b, nil
+ case yamlIntScalar:
+ i, err := strconv.ParseInt(node.Value, 10, 64)
+ if err != nil {
+ return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting integer content: %w: %w", node.Value, err, ErrYAML)
+ }
+ return i, nil
+ case yamlFloatScalar:
+ f, err := strconv.ParseFloat(node.Value, 64)
+ if err != nil {
+ return nil, fmt.Errorf("unable to process scalar node. Got %q. Expecting float content: %w: %w", node.Value, err, ErrYAML)
+ }
+ return f, nil
+ case yamlTimestamp:
+ // YAML timestamp is marshaled as string, not time
+ return node.Value, nil
+ case yamlNull:
+ return nil, nil //nolint:nilnil
+ default:
+ return nil, fmt.Errorf("YAML tag %q is not supported: %w", node.LongTag(), ErrYAML)
+ }
+}
+
+func yamlStringScalarC(node *yaml.Node) (string, error) {
+ if node.Kind != yaml.ScalarNode {
+ return "", fmt.Errorf("expecting a string scalar but got %q: %w", node.Kind, ErrYAML)
+ }
+ switch node.LongTag() {
+ case yamlStringScalar, yamlIntScalar, yamlFloatScalar:
+ return node.Value, nil
+ default:
+ return "", fmt.Errorf("YAML tag %q is not supported as map key: %w", node.LongTag(), ErrYAML)
+ }
+}
+
+func format(t any) (string, error) {
+ switch k := t.(type) {
+ case string:
+ return k, nil
+ case uint:
+ return strconv.FormatUint(uint64(k), 10), nil
+ case uint8:
+ return strconv.FormatUint(uint64(k), 10), nil
+ case uint16:
+ return strconv.FormatUint(uint64(k), 10), nil
+ case uint32:
+ return strconv.FormatUint(uint64(k), 10), nil
+ case uint64:
+ return strconv.FormatUint(k, 10), nil
+ case int:
+ return strconv.Itoa(k), nil
+ case int8:
+ return strconv.FormatInt(int64(k), 10), nil
+ case int16:
+ return strconv.FormatInt(int64(k), 10), nil
+ case int32:
+ return strconv.FormatInt(int64(k), 10), nil
+ case int64:
+ return strconv.FormatInt(k, 10), nil
+ default:
+ return "", fmt.Errorf("unexpected map key type, got: %T: %w", k, ErrYAML)
+ }
+}
+
+func transformData(input any) (out any, err error) {
+ switch in := input.(type) {
+ case yaml.Node:
+ return yamlNode(&in)
+ case *yaml.Node:
+ return yamlNode(in)
+ case map[any]any:
+ o := make(YAMLMapSlice, 0, len(in))
+ for ke, va := range in {
+ var nmi YAMLMapItem
+ if nmi.Key, err = format(ke); err != nil {
+ return nil, err
+ }
+
+ v, ert := transformData(va)
+ if ert != nil {
+ return nil, ert
+ }
+ nmi.Value = v
+ o = append(o, nmi)
+ }
+ return o, nil
+ case []any:
+ len1 := len(in)
+ o := make([]any, len1)
+ for i := range len1 {
+ o[i], err = transformData(in[i])
+ if err != nil {
+ return nil, err
+ }
+ }
+ return o, nil
+ }
+ return input, nil
+}
diff --git a/vendor/github.com/go-openapi/swag/yamlutils_iface.go b/vendor/github.com/go-openapi/swag/yamlutils_iface.go
new file mode 100644
index 000000000000..57767efc567f
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/yamlutils_iface.go
@@ -0,0 +1,20 @@
+// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
+// SPDX-License-Identifier: Apache-2.0
+
+package swag
+
+import (
+ "encoding/json"
+
+ "github.com/go-openapi/swag/yamlutils"
+)
+
+// YAMLToJSON converts YAML unmarshaled data into json compatible data
+//
+// Deprecated: use [yamlutils.YAMLToJSON] instead.
+func YAMLToJSON(data any) (json.RawMessage, error) { return yamlutils.YAMLToJSON(data) }
+
+// BytesToYAMLDoc converts a byte slice into a YAML document
+//
+// Deprecated: use [yamlutils.BytesToYAMLDoc] instead.
+func BytesToYAMLDoc(data []byte) (any, error) { return yamlutils.BytesToYAMLDoc(data) }
diff --git a/vendor/github.com/gogo/protobuf/sortkeys/sortkeys.go b/vendor/github.com/gogo/protobuf/sortkeys/sortkeys.go
deleted file mode 100644
index ceadde6a5e10..000000000000
--- a/vendor/github.com/gogo/protobuf/sortkeys/sortkeys.go
+++ /dev/null
@@ -1,101 +0,0 @@
-// Protocol Buffers for Go with Gadgets
-//
-// Copyright (c) 2013, The GoGo Authors. All rights reserved.
-// http://github.com/gogo/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-//
-// 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
-// OWNER 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.
-
-package sortkeys
-
-import (
- "sort"
-)
-
-func Strings(l []string) {
- sort.Strings(l)
-}
-
-func Float64s(l []float64) {
- sort.Float64s(l)
-}
-
-func Float32s(l []float32) {
- sort.Sort(Float32Slice(l))
-}
-
-func Int64s(l []int64) {
- sort.Sort(Int64Slice(l))
-}
-
-func Int32s(l []int32) {
- sort.Sort(Int32Slice(l))
-}
-
-func Uint64s(l []uint64) {
- sort.Sort(Uint64Slice(l))
-}
-
-func Uint32s(l []uint32) {
- sort.Sort(Uint32Slice(l))
-}
-
-func Bools(l []bool) {
- sort.Sort(BoolSlice(l))
-}
-
-type BoolSlice []bool
-
-func (p BoolSlice) Len() int { return len(p) }
-func (p BoolSlice) Less(i, j int) bool { return p[j] }
-func (p BoolSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
-
-type Int64Slice []int64
-
-func (p Int64Slice) Len() int { return len(p) }
-func (p Int64Slice) Less(i, j int) bool { return p[i] < p[j] }
-func (p Int64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
-
-type Int32Slice []int32
-
-func (p Int32Slice) Len() int { return len(p) }
-func (p Int32Slice) Less(i, j int) bool { return p[i] < p[j] }
-func (p Int32Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
-
-type Uint64Slice []uint64
-
-func (p Uint64Slice) Len() int { return len(p) }
-func (p Uint64Slice) Less(i, j int) bool { return p[i] < p[j] }
-func (p Uint64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
-
-type Uint32Slice []uint32
-
-func (p Uint32Slice) Len() int { return len(p) }
-func (p Uint32Slice) Less(i, j int) bool { return p[i] < p[j] }
-func (p Uint32Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
-
-type Float32Slice []float32
-
-func (p Float32Slice) Len() int { return len(p) }
-func (p Float32Slice) Less(i, j int) bool { return p[i] < p[j] }
-func (p Float32Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
diff --git a/vendor/github.com/golang/groupcache/LICENSE b/vendor/github.com/golang/groupcache/LICENSE
deleted file mode 100644
index 37ec93a14fdc..000000000000
--- a/vendor/github.com/golang/groupcache/LICENSE
+++ /dev/null
@@ -1,191 +0,0 @@
-Apache License
-Version 2.0, January 2004
-http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and
-distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright
-owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities
-that control, are controlled by, or are under common control with that entity.
-For the purposes of this definition, "control" means (i) the power, direct or
-indirect, to cause the direction or management of such entity, whether by
-contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
-outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising
-permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including
-but not limited to software source code, documentation source, and configuration
-files.
-
-"Object" form shall mean any form resulting from mechanical transformation or
-translation of a Source form, including but not limited to compiled object code,
-generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made
-available under the License, as indicated by a copyright notice that is included
-in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that
-is based on (or derived from) the Work and for which the editorial revisions,
-annotations, elaborations, or other modifications represent, as a whole, an
-original work of authorship. For the purposes of this License, Derivative Works
-shall not include works that remain separable from, or merely link (or bind by
-name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version
-of the Work and any modifications or additions to that Work or Derivative Works
-thereof, that is intentionally submitted to Licensor for inclusion in the Work
-by the copyright owner or by an individual or Legal Entity authorized to submit
-on behalf of the copyright owner. For the purposes of this definition,
-"submitted" means any form of electronic, verbal, or written communication sent
-to the Licensor or its representatives, including but not limited to
-communication on electronic mailing lists, source code control systems, and
-issue tracking systems that are managed by, or on behalf of, the Licensor for
-the purpose of discussing and improving the Work, but excluding communication
-that is conspicuously marked or otherwise designated in writing by the copyright
-owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
-of whom a Contribution has been received by Licensor and subsequently
-incorporated within the Work.
-
-2. Grant of Copyright License.
-
-Subject to the terms and conditions of this License, each Contributor hereby
-grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
-irrevocable copyright license to reproduce, prepare Derivative Works of,
-publicly display, publicly perform, sublicense, and distribute the Work and such
-Derivative Works in Source or Object form.
-
-3. Grant of Patent License.
-
-Subject to the terms and conditions of this License, each Contributor hereby
-grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
-irrevocable (except as stated in this section) patent license to make, have
-made, use, offer to sell, sell, import, and otherwise transfer the Work, where
-such license applies only to those patent claims licensable by such Contributor
-that are necessarily infringed by their Contribution(s) alone or by combination
-of their Contribution(s) with the Work to which such Contribution(s) was
-submitted. If You institute patent litigation against any entity (including a
-cross-claim or counterclaim in a lawsuit) alleging that the Work or a
-Contribution incorporated within the Work constitutes direct or contributory
-patent infringement, then any patent licenses granted to You under this License
-for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution.
-
-You may reproduce and distribute copies of the Work or Derivative Works thereof
-in any medium, with or without modifications, and in Source or Object form,
-provided that You meet the following conditions:
-
-You must give any other recipients of the Work or Derivative Works a copy of
-this License; and
-You must cause any modified files to carry prominent notices stating that You
-changed the files; and
-You must retain, in the Source form of any Derivative Works that You distribute,
-all copyright, patent, trademark, and attribution notices from the Source form
-of the Work, excluding those notices that do not pertain to any part of the
-Derivative Works; and
-If the Work includes a "NOTICE" text file as part of its distribution, then any
-Derivative Works that You distribute must include a readable copy of the
-attribution notices contained within such NOTICE file, excluding those notices
-that do not pertain to any part of the Derivative Works, in at least one of the
-following places: within a NOTICE text file distributed as part of the
-Derivative Works; within the Source form or documentation, if provided along
-with the Derivative Works; or, within a display generated by the Derivative
-Works, if and wherever such third-party notices normally appear. The contents of
-the NOTICE file are for informational purposes only and do not modify the
-License. You may add Your own attribution notices within Derivative Works that
-You distribute, alongside or as an addendum to the NOTICE text from the Work,
-provided that such additional attribution notices cannot be construed as
-modifying the License.
-You may add Your own copyright statement to Your modifications and may provide
-additional or different license terms and conditions for use, reproduction, or
-distribution of Your modifications, or for any such Derivative Works as a whole,
-provided Your use, reproduction, and distribution of the Work otherwise complies
-with the conditions stated in this License.
-
-5. Submission of Contributions.
-
-Unless You explicitly state otherwise, any Contribution intentionally submitted
-for inclusion in the Work by You to the Licensor shall be under the terms and
-conditions of this License, without any additional terms or conditions.
-Notwithstanding the above, nothing herein shall supersede or modify the terms of
-any separate license agreement you may have executed with Licensor regarding
-such Contributions.
-
-6. Trademarks.
-
-This License does not grant permission to use the trade names, trademarks,
-service marks, or product names of the Licensor, except as required for
-reasonable and customary use in describing the origin of the Work and
-reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty.
-
-Unless required by applicable law or agreed to in writing, Licensor provides the
-Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
-including, without limitation, any warranties or conditions of TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
-solely responsible for determining the appropriateness of using or
-redistributing the Work and assume any risks associated with Your exercise of
-permissions under this License.
-
-8. Limitation of Liability.
-
-In no event and under no legal theory, whether in tort (including negligence),
-contract, or otherwise, unless required by applicable law (such as deliberate
-and grossly negligent acts) or agreed to in writing, shall any Contributor be
-liable to You for damages, including any direct, indirect, special, incidental,
-or consequential damages of any character arising as a result of this License or
-out of the use or inability to use the Work (including but not limited to
-damages for loss of goodwill, work stoppage, computer failure or malfunction, or
-any and all other commercial damages or losses), even if such Contributor has
-been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability.
-
-While redistributing the Work or Derivative Works thereof, You may choose to
-offer, and charge a fee for, acceptance of support, warranty, indemnity, or
-other liability obligations and/or rights consistent with this License. However,
-in accepting such obligations, You may act only on Your own behalf and on Your
-sole responsibility, not on behalf of any other Contributor, and only if You
-agree to indemnify, defend, and hold each Contributor harmless for any liability
-incurred by, or claims asserted against, such Contributor by reason of your
-accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Apache License to your work
-
-To apply the Apache License to your work, attach the following boilerplate
-notice, with the fields enclosed by brackets "[]" replaced with your own
-identifying information. (Don't include the brackets!) The text should be
-enclosed in the appropriate comment syntax for the file format. We also
-recommend that a file or class name and description of purpose be included on
-the same "printed page" as the copyright notice for easier identification within
-third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/vendor/github.com/golang/groupcache/lru/lru.go b/vendor/github.com/golang/groupcache/lru/lru.go
deleted file mode 100644
index eac1c7664f99..000000000000
--- a/vendor/github.com/golang/groupcache/lru/lru.go
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
-Copyright 2013 Google Inc.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT 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 lru implements an LRU cache.
-package lru
-
-import "container/list"
-
-// Cache is an LRU cache. It is not safe for concurrent access.
-type Cache struct {
- // MaxEntries is the maximum number of cache entries before
- // an item is evicted. Zero means no limit.
- MaxEntries int
-
- // OnEvicted optionally specifies a callback function to be
- // executed when an entry is purged from the cache.
- OnEvicted func(key Key, value interface{})
-
- ll *list.List
- cache map[interface{}]*list.Element
-}
-
-// A Key may be any value that is comparable. See http://golang.org/ref/spec#Comparison_operators
-type Key interface{}
-
-type entry struct {
- key Key
- value interface{}
-}
-
-// New creates a new Cache.
-// If maxEntries is zero, the cache has no limit and it's assumed
-// that eviction is done by the caller.
-func New(maxEntries int) *Cache {
- return &Cache{
- MaxEntries: maxEntries,
- ll: list.New(),
- cache: make(map[interface{}]*list.Element),
- }
-}
-
-// Add adds a value to the cache.
-func (c *Cache) Add(key Key, value interface{}) {
- if c.cache == nil {
- c.cache = make(map[interface{}]*list.Element)
- c.ll = list.New()
- }
- if ee, ok := c.cache[key]; ok {
- c.ll.MoveToFront(ee)
- ee.Value.(*entry).value = value
- return
- }
- ele := c.ll.PushFront(&entry{key, value})
- c.cache[key] = ele
- if c.MaxEntries != 0 && c.ll.Len() > c.MaxEntries {
- c.RemoveOldest()
- }
-}
-
-// Get looks up a key's value from the cache.
-func (c *Cache) Get(key Key) (value interface{}, ok bool) {
- if c.cache == nil {
- return
- }
- if ele, hit := c.cache[key]; hit {
- c.ll.MoveToFront(ele)
- return ele.Value.(*entry).value, true
- }
- return
-}
-
-// Remove removes the provided key from the cache.
-func (c *Cache) Remove(key Key) {
- if c.cache == nil {
- return
- }
- if ele, hit := c.cache[key]; hit {
- c.removeElement(ele)
- }
-}
-
-// RemoveOldest removes the oldest item from the cache.
-func (c *Cache) RemoveOldest() {
- if c.cache == nil {
- return
- }
- ele := c.ll.Back()
- if ele != nil {
- c.removeElement(ele)
- }
-}
-
-func (c *Cache) removeElement(e *list.Element) {
- c.ll.Remove(e)
- kv := e.Value.(*entry)
- delete(c.cache, kv.key)
- if c.OnEvicted != nil {
- c.OnEvicted(kv.key, kv.value)
- }
-}
-
-// Len returns the number of items in the cache.
-func (c *Cache) Len() int {
- if c.cache == nil {
- return 0
- }
- return c.ll.Len()
-}
-
-// Clear purges all stored items from the cache.
-func (c *Cache) Clear() {
- if c.OnEvicted != nil {
- for _, e := range c.cache {
- kv := e.Value.(*entry)
- c.OnEvicted(kv.key, kv.value)
- }
- }
- c.ll = nil
- c.cache = nil
-}
diff --git a/vendor/github.com/golang/mock/gomock/call.go b/vendor/github.com/golang/mock/gomock/call.go
index 13c9f44b1ef2..98881596d137 100644
--- a/vendor/github.com/golang/mock/gomock/call.go
+++ b/vendor/github.com/golang/mock/gomock/call.go
@@ -108,19 +108,25 @@ func (c *Call) MaxTimes(n int) *Call {
// DoAndReturn declares the action to run when the call is matched.
// The return values from this function are returned by the mocked function.
// It takes an interface{} argument to support n-arity functions.
+// The anonymous function must match the function signature mocked method.
func (c *Call) DoAndReturn(f interface{}) *Call {
// TODO: Check arity and types here, rather than dying badly elsewhere.
v := reflect.ValueOf(f)
c.addAction(func(args []interface{}) []interface{} {
c.t.Helper()
- vArgs := make([]reflect.Value, len(args))
ft := v.Type()
if c.methodType.NumIn() != ft.NumIn() {
- c.t.Fatalf("wrong number of arguments in DoAndReturn func for %T.%v: got %d, want %d [%s]",
- c.receiver, c.method, ft.NumIn(), c.methodType.NumIn(), c.origin)
+ if ft.IsVariadic() {
+ c.t.Fatalf("wrong number of arguments in DoAndReturn func for %T.%v The function signature must match the mocked method, a variadic function cannot be used.",
+ c.receiver, c.method)
+ } else {
+ c.t.Fatalf("wrong number of arguments in DoAndReturn func for %T.%v: got %d, want %d [%s]",
+ c.receiver, c.method, ft.NumIn(), c.methodType.NumIn(), c.origin)
+ }
return nil
}
+ vArgs := make([]reflect.Value, len(args))
for i := 0; i < len(args); i++ {
if args[i] != nil {
vArgs[i] = reflect.ValueOf(args[i])
@@ -143,19 +149,25 @@ func (c *Call) DoAndReturn(f interface{}) *Call {
// return values are ignored to retain backward compatibility. To use the
// return values call DoAndReturn.
// It takes an interface{} argument to support n-arity functions.
+// The anonymous function must match the function signature mocked method.
func (c *Call) Do(f interface{}) *Call {
// TODO: Check arity and types here, rather than dying badly elsewhere.
v := reflect.ValueOf(f)
c.addAction(func(args []interface{}) []interface{} {
c.t.Helper()
- if c.methodType.NumIn() != v.Type().NumIn() {
- c.t.Fatalf("wrong number of arguments in Do func for %T.%v: got %d, want %d [%s]",
- c.receiver, c.method, v.Type().NumIn(), c.methodType.NumIn(), c.origin)
+ ft := v.Type()
+ if c.methodType.NumIn() != ft.NumIn() {
+ if ft.IsVariadic() {
+ c.t.Fatalf("wrong number of arguments in Do func for %T.%v The function signature must match the mocked method, a variadic function cannot be used.",
+ c.receiver, c.method)
+ } else {
+ c.t.Fatalf("wrong number of arguments in Do func for %T.%v: got %d, want %d [%s]",
+ c.receiver, c.method, ft.NumIn(), c.methodType.NumIn(), c.origin)
+ }
return nil
}
vArgs := make([]reflect.Value, len(args))
- ft := v.Type()
for i := 0; i < len(args); i++ {
if args[i] != nil {
vArgs[i] = reflect.ValueOf(args[i])
@@ -217,8 +229,8 @@ func (c *Call) Times(n int) *Call {
}
// SetArg declares an action that will set the nth argument's value,
-// indirected through a pointer. Or, in the case of a slice, SetArg
-// will copy value's elements into the nth argument.
+// indirected through a pointer. Or, in the case of a slice and map, SetArg
+// will copy value's elements/key-value pairs into the nth argument.
func (c *Call) SetArg(n int, value interface{}) *Call {
c.t.Helper()
@@ -243,8 +255,10 @@ func (c *Call) SetArg(n int, value interface{}) *Call {
// nothing to do
case reflect.Slice:
// nothing to do
+ case reflect.Map:
+ // nothing to do
default:
- c.t.Fatalf("SetArg(%d, ...) referring to argument of non-pointer non-interface non-slice type %v [%s]",
+ c.t.Fatalf("SetArg(%d, ...) referring to argument of non-pointer non-interface non-slice non-map type %v [%s]",
n, at, c.origin)
}
@@ -253,6 +267,8 @@ func (c *Call) SetArg(n int, value interface{}) *Call {
switch reflect.TypeOf(args[n]).Kind() {
case reflect.Slice:
setSlice(args[n], v)
+ case reflect.Map:
+ setMap(args[n], v)
default:
reflect.ValueOf(args[n]).Elem().Set(v)
}
@@ -432,6 +448,16 @@ func setSlice(arg interface{}, v reflect.Value) {
}
}
+func setMap(arg interface{}, v reflect.Value) {
+ va := reflect.ValueOf(arg)
+ for _, e := range va.MapKeys() {
+ va.SetMapIndex(e, reflect.Value{})
+ }
+ for _, e := range v.MapKeys() {
+ va.SetMapIndex(e, v.MapIndex(e))
+ }
+}
+
func (c *Call) addAction(action func([]interface{}) []interface{}) {
c.actions = append(c.actions, action)
}
diff --git a/vendor/github.com/golang/mock/gomock/controller.go b/vendor/github.com/golang/mock/gomock/controller.go
index f054200d56cc..5e2def135bf6 100644
--- a/vendor/github.com/golang/mock/gomock/controller.go
+++ b/vendor/github.com/golang/mock/gomock/controller.go
@@ -12,44 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Package gomock is a mock framework for Go.
-//
-// Standard usage:
-// (1) Define an interface that you wish to mock.
-// type MyInterface interface {
-// SomeMethod(x int64, y string)
-// }
-// (2) Use mockgen to generate a mock from the interface.
-// (3) Use the mock in a test:
-// func TestMyThing(t *testing.T) {
-// mockCtrl := gomock.NewController(t)
-// defer mockCtrl.Finish()
-//
-// mockObj := something.NewMockMyInterface(mockCtrl)
-// mockObj.EXPECT().SomeMethod(4, "blah")
-// // pass mockObj to a real object and play with it.
-// }
-//
-// By default, expected calls are not enforced to run in any particular order.
-// Call order dependency can be enforced by use of InOrder and/or Call.After.
-// Call.After can create more varied call order dependencies, but InOrder is
-// often more convenient.
-//
-// The following examples create equivalent call order dependencies.
-//
-// Example of using Call.After to chain expected call order:
-//
-// firstCall := mockObj.EXPECT().SomeMethod(1, "first")
-// secondCall := mockObj.EXPECT().SomeMethod(2, "second").After(firstCall)
-// mockObj.EXPECT().SomeMethod(3, "third").After(secondCall)
-//
-// Example of using InOrder to declare expected call order:
-//
-// gomock.InOrder(
-// mockObj.EXPECT().SomeMethod(1, "first"),
-// mockObj.EXPECT().SomeMethod(2, "second"),
-// mockObj.EXPECT().SomeMethod(3, "third"),
-// )
package gomock
import (
diff --git a/vendor/github.com/golang/mock/gomock/doc.go b/vendor/github.com/golang/mock/gomock/doc.go
new file mode 100644
index 000000000000..1706b504858f
--- /dev/null
+++ b/vendor/github.com/golang/mock/gomock/doc.go
@@ -0,0 +1,59 @@
+// Copyright 2022 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 gomock is a mock framework for Go.
+//
+// Standard usage:
+// (1) Define an interface that you wish to mock.
+// type MyInterface interface {
+// SomeMethod(x int64, y string)
+// }
+// (2) Use mockgen to generate a mock from the interface.
+// (3) Use the mock in a test:
+// func TestMyThing(t *testing.T) {
+// mockCtrl := gomock.NewController(t)//
+// mockObj := something.NewMockMyInterface(mockCtrl)
+// mockObj.EXPECT().SomeMethod(4, "blah")
+// // pass mockObj to a real object and play with it.
+// }
+//
+// By default, expected calls are not enforced to run in any particular order.
+// Call order dependency can be enforced by use of InOrder and/or Call.After.
+// Call.After can create more varied call order dependencies, but InOrder is
+// often more convenient.
+//
+// The following examples create equivalent call order dependencies.
+//
+// Example of using Call.After to chain expected call order:
+//
+// firstCall := mockObj.EXPECT().SomeMethod(1, "first")
+// secondCall := mockObj.EXPECT().SomeMethod(2, "second").After(firstCall)
+// mockObj.EXPECT().SomeMethod(3, "third").After(secondCall)
+//
+// Example of using InOrder to declare expected call order:
+//
+// gomock.InOrder(
+// mockObj.EXPECT().SomeMethod(1, "first"),
+// mockObj.EXPECT().SomeMethod(2, "second"),
+// mockObj.EXPECT().SomeMethod(3, "third"),
+// )
+//
+// The standard TestReporter most users will pass to `NewController` is a
+// `*testing.T` from the context of the test. Note that this will use the
+// standard `t.Error` and `t.Fatal` methods to report what happened in the test.
+// In some cases this can leave your testing package in a weird state if global
+// state is used since `t.Fatal` is like calling panic in the middle of a
+// function. In these cases it is recommended that you pass in your own
+// `TestReporter`.
+package gomock
diff --git a/vendor/github.com/golang/protobuf/ptypes/any.go b/vendor/github.com/golang/protobuf/ptypes/any.go
deleted file mode 100644
index fdff3fdb4cba..000000000000
--- a/vendor/github.com/golang/protobuf/ptypes/any.go
+++ /dev/null
@@ -1,180 +0,0 @@
-// 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 ptypes
-
-import (
- "fmt"
- "strings"
-
- "github.com/golang/protobuf/proto"
- "google.golang.org/protobuf/reflect/protoreflect"
- "google.golang.org/protobuf/reflect/protoregistry"
-
- anypb "github.com/golang/protobuf/ptypes/any"
-)
-
-const urlPrefix = "type.googleapis.com/"
-
-// AnyMessageName returns the message name contained in an anypb.Any message.
-// Most type assertions should use the Is function instead.
-//
-// Deprecated: Call the any.MessageName method instead.
-func AnyMessageName(any *anypb.Any) (string, error) {
- name, err := anyMessageName(any)
- return string(name), err
-}
-func anyMessageName(any *anypb.Any) (protoreflect.FullName, error) {
- if any == nil {
- return "", fmt.Errorf("message is nil")
- }
- name := protoreflect.FullName(any.TypeUrl)
- if i := strings.LastIndex(any.TypeUrl, "/"); i >= 0 {
- name = name[i+len("/"):]
- }
- if !name.IsValid() {
- return "", fmt.Errorf("message type url %q is invalid", any.TypeUrl)
- }
- return name, nil
-}
-
-// MarshalAny marshals the given message m into an anypb.Any message.
-//
-// Deprecated: Call the anypb.New function instead.
-func MarshalAny(m proto.Message) (*anypb.Any, error) {
- switch dm := m.(type) {
- case DynamicAny:
- m = dm.Message
- case *DynamicAny:
- if dm == nil {
- return nil, proto.ErrNil
- }
- m = dm.Message
- }
- b, err := proto.Marshal(m)
- if err != nil {
- return nil, err
- }
- return &anypb.Any{TypeUrl: urlPrefix + proto.MessageName(m), Value: b}, nil
-}
-
-// Empty returns a new message of the type specified in an anypb.Any message.
-// It returns protoregistry.NotFound if the corresponding message type could not
-// be resolved in the global registry.
-//
-// Deprecated: Use protoregistry.GlobalTypes.FindMessageByName instead
-// to resolve the message name and create a new instance of it.
-func Empty(any *anypb.Any) (proto.Message, error) {
- name, err := anyMessageName(any)
- if err != nil {
- return nil, err
- }
- mt, err := protoregistry.GlobalTypes.FindMessageByName(name)
- if err != nil {
- return nil, err
- }
- return proto.MessageV1(mt.New().Interface()), nil
-}
-
-// UnmarshalAny unmarshals the encoded value contained in the anypb.Any message
-// into the provided message m. It returns an error if the target message
-// does not match the type in the Any message or if an unmarshal error occurs.
-//
-// The target message m may be a *DynamicAny message. If the underlying message
-// type could not be resolved, then this returns protoregistry.NotFound.
-//
-// Deprecated: Call the any.UnmarshalTo method instead.
-func UnmarshalAny(any *anypb.Any, m proto.Message) error {
- if dm, ok := m.(*DynamicAny); ok {
- if dm.Message == nil {
- var err error
- dm.Message, err = Empty(any)
- if err != nil {
- return err
- }
- }
- m = dm.Message
- }
-
- anyName, err := AnyMessageName(any)
- if err != nil {
- return err
- }
- msgName := proto.MessageName(m)
- if anyName != msgName {
- return fmt.Errorf("mismatched message type: got %q want %q", anyName, msgName)
- }
- return proto.Unmarshal(any.Value, m)
-}
-
-// Is reports whether the Any message contains a message of the specified type.
-//
-// Deprecated: Call the any.MessageIs method instead.
-func Is(any *anypb.Any, m proto.Message) bool {
- if any == nil || m == nil {
- return false
- }
- name := proto.MessageName(m)
- if !strings.HasSuffix(any.TypeUrl, name) {
- return false
- }
- return len(any.TypeUrl) == len(name) || any.TypeUrl[len(any.TypeUrl)-len(name)-1] == '/'
-}
-
-// DynamicAny is a value that can be passed to UnmarshalAny to automatically
-// allocate a proto.Message for the type specified in an anypb.Any message.
-// The allocated message is stored in the embedded proto.Message.
-//
-// Example:
-//
-// var x ptypes.DynamicAny
-// if err := ptypes.UnmarshalAny(a, &x); err != nil { ... }
-// fmt.Printf("unmarshaled message: %v", x.Message)
-//
-// Deprecated: Use the any.UnmarshalNew method instead to unmarshal
-// the any message contents into a new instance of the underlying message.
-type DynamicAny struct{ proto.Message }
-
-func (m DynamicAny) String() string {
- if m.Message == nil {
- return ""
- }
- return m.Message.String()
-}
-func (m DynamicAny) Reset() {
- if m.Message == nil {
- return
- }
- m.Message.Reset()
-}
-func (m DynamicAny) ProtoMessage() {
- return
-}
-func (m DynamicAny) ProtoReflect() protoreflect.Message {
- if m.Message == nil {
- return nil
- }
- return dynamicAny{proto.MessageReflect(m.Message)}
-}
-
-type dynamicAny struct{ protoreflect.Message }
-
-func (m dynamicAny) Type() protoreflect.MessageType {
- return dynamicAnyType{m.Message.Type()}
-}
-func (m dynamicAny) New() protoreflect.Message {
- return dynamicAnyType{m.Message.Type()}.New()
-}
-func (m dynamicAny) Interface() protoreflect.ProtoMessage {
- return DynamicAny{proto.MessageV1(m.Message.Interface())}
-}
-
-type dynamicAnyType struct{ protoreflect.MessageType }
-
-func (t dynamicAnyType) New() protoreflect.Message {
- return dynamicAny{t.MessageType.New()}
-}
-func (t dynamicAnyType) Zero() protoreflect.Message {
- return dynamicAny{t.MessageType.Zero()}
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go b/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go
deleted file mode 100644
index 0ef27d33deb9..000000000000
--- a/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go
+++ /dev/null
@@ -1,62 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: github.com/golang/protobuf/ptypes/any/any.proto
-
-package any
-
-import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
- anypb "google.golang.org/protobuf/types/known/anypb"
- reflect "reflect"
-)
-
-// Symbols defined in public import of google/protobuf/any.proto.
-
-type Any = anypb.Any
-
-var File_github_com_golang_protobuf_ptypes_any_any_proto protoreflect.FileDescriptor
-
-var file_github_com_golang_protobuf_ptypes_any_any_proto_rawDesc = []byte{
- 0x0a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c,
- 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79,
- 0x70, 0x65, 0x73, 0x2f, 0x61, 0x6e, 0x79, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x2b, 0x5a, 0x29,
- 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e,
- 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79, 0x70, 0x65,
- 0x73, 0x2f, 0x61, 0x6e, 0x79, 0x3b, 0x61, 0x6e, 0x79, 0x50, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x33,
-}
-
-var file_github_com_golang_protobuf_ptypes_any_any_proto_goTypes = []interface{}{}
-var file_github_com_golang_protobuf_ptypes_any_any_proto_depIdxs = []int32{
- 0, // [0:0] is the sub-list for method output_type
- 0, // [0:0] is the sub-list for method input_type
- 0, // [0:0] is the sub-list for extension type_name
- 0, // [0:0] is the sub-list for extension extendee
- 0, // [0:0] is the sub-list for field type_name
-}
-
-func init() { file_github_com_golang_protobuf_ptypes_any_any_proto_init() }
-func file_github_com_golang_protobuf_ptypes_any_any_proto_init() {
- if File_github_com_golang_protobuf_ptypes_any_any_proto != nil {
- return
- }
- type x struct{}
- out := protoimpl.TypeBuilder{
- File: protoimpl.DescBuilder{
- GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_github_com_golang_protobuf_ptypes_any_any_proto_rawDesc,
- NumEnums: 0,
- NumMessages: 0,
- NumExtensions: 0,
- NumServices: 0,
- },
- GoTypes: file_github_com_golang_protobuf_ptypes_any_any_proto_goTypes,
- DependencyIndexes: file_github_com_golang_protobuf_ptypes_any_any_proto_depIdxs,
- }.Build()
- File_github_com_golang_protobuf_ptypes_any_any_proto = out.File
- file_github_com_golang_protobuf_ptypes_any_any_proto_rawDesc = nil
- file_github_com_golang_protobuf_ptypes_any_any_proto_goTypes = nil
- file_github_com_golang_protobuf_ptypes_any_any_proto_depIdxs = nil
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/doc.go b/vendor/github.com/golang/protobuf/ptypes/doc.go
deleted file mode 100644
index d3c33259d28d..000000000000
--- a/vendor/github.com/golang/protobuf/ptypes/doc.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// 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 ptypes provides functionality for interacting with well-known types.
-//
-// Deprecated: Well-known types have specialized functionality directly
-// injected into the generated packages for each message type.
-// See the deprecation notice for each function for the suggested alternative.
-package ptypes
diff --git a/vendor/github.com/golang/protobuf/ptypes/duration.go b/vendor/github.com/golang/protobuf/ptypes/duration.go
deleted file mode 100644
index b2b55dd851f5..000000000000
--- a/vendor/github.com/golang/protobuf/ptypes/duration.go
+++ /dev/null
@@ -1,76 +0,0 @@
-// 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 ptypes
-
-import (
- "errors"
- "fmt"
- "time"
-
- durationpb "github.com/golang/protobuf/ptypes/duration"
-)
-
-// Range of google.protobuf.Duration as specified in duration.proto.
-// This is about 10,000 years in seconds.
-const (
- maxSeconds = int64(10000 * 365.25 * 24 * 60 * 60)
- minSeconds = -maxSeconds
-)
-
-// Duration converts a durationpb.Duration to a time.Duration.
-// Duration returns an error if dur is invalid or overflows a time.Duration.
-//
-// Deprecated: Call the dur.AsDuration and dur.CheckValid methods instead.
-func Duration(dur *durationpb.Duration) (time.Duration, error) {
- if err := validateDuration(dur); err != nil {
- return 0, err
- }
- d := time.Duration(dur.Seconds) * time.Second
- if int64(d/time.Second) != dur.Seconds {
- return 0, fmt.Errorf("duration: %v is out of range for time.Duration", dur)
- }
- if dur.Nanos != 0 {
- d += time.Duration(dur.Nanos) * time.Nanosecond
- if (d < 0) != (dur.Nanos < 0) {
- return 0, fmt.Errorf("duration: %v is out of range for time.Duration", dur)
- }
- }
- return d, nil
-}
-
-// DurationProto converts a time.Duration to a durationpb.Duration.
-//
-// Deprecated: Call the durationpb.New function instead.
-func DurationProto(d time.Duration) *durationpb.Duration {
- nanos := d.Nanoseconds()
- secs := nanos / 1e9
- nanos -= secs * 1e9
- return &durationpb.Duration{
- Seconds: int64(secs),
- Nanos: int32(nanos),
- }
-}
-
-// validateDuration determines whether the durationpb.Duration is valid
-// according to the definition in google/protobuf/duration.proto.
-// A valid durpb.Duration may still be too large to fit into a time.Duration
-// Note that the range of durationpb.Duration is about 10,000 years,
-// while the range of time.Duration is about 290 years.
-func validateDuration(dur *durationpb.Duration) error {
- if dur == nil {
- return errors.New("duration: nil Duration")
- }
- if dur.Seconds < minSeconds || dur.Seconds > maxSeconds {
- return fmt.Errorf("duration: %v: seconds out of range", dur)
- }
- if dur.Nanos <= -1e9 || dur.Nanos >= 1e9 {
- return fmt.Errorf("duration: %v: nanos out of range", dur)
- }
- // Seconds and Nanos must have the same sign, unless d.Nanos is zero.
- if (dur.Seconds < 0 && dur.Nanos > 0) || (dur.Seconds > 0 && dur.Nanos < 0) {
- return fmt.Errorf("duration: %v: seconds and nanos have different signs", dur)
- }
- return nil
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go b/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go
deleted file mode 100644
index d0079ee3ef37..000000000000
--- a/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go
+++ /dev/null
@@ -1,63 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: github.com/golang/protobuf/ptypes/duration/duration.proto
-
-package duration
-
-import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
- durationpb "google.golang.org/protobuf/types/known/durationpb"
- reflect "reflect"
-)
-
-// Symbols defined in public import of google/protobuf/duration.proto.
-
-type Duration = durationpb.Duration
-
-var File_github_com_golang_protobuf_ptypes_duration_duration_proto protoreflect.FileDescriptor
-
-var file_github_com_golang_protobuf_ptypes_duration_duration_proto_rawDesc = []byte{
- 0x0a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c,
- 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79,
- 0x70, 0x65, 0x73, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x64, 0x75, 0x72,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x35, 0x5a, 0x33, 0x67,
- 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67,
- 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79, 0x70, 0x65, 0x73,
- 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x50, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
-
-var file_github_com_golang_protobuf_ptypes_duration_duration_proto_goTypes = []interface{}{}
-var file_github_com_golang_protobuf_ptypes_duration_duration_proto_depIdxs = []int32{
- 0, // [0:0] is the sub-list for method output_type
- 0, // [0:0] is the sub-list for method input_type
- 0, // [0:0] is the sub-list for extension type_name
- 0, // [0:0] is the sub-list for extension extendee
- 0, // [0:0] is the sub-list for field type_name
-}
-
-func init() { file_github_com_golang_protobuf_ptypes_duration_duration_proto_init() }
-func file_github_com_golang_protobuf_ptypes_duration_duration_proto_init() {
- if File_github_com_golang_protobuf_ptypes_duration_duration_proto != nil {
- return
- }
- type x struct{}
- out := protoimpl.TypeBuilder{
- File: protoimpl.DescBuilder{
- GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_github_com_golang_protobuf_ptypes_duration_duration_proto_rawDesc,
- NumEnums: 0,
- NumMessages: 0,
- NumExtensions: 0,
- NumServices: 0,
- },
- GoTypes: file_github_com_golang_protobuf_ptypes_duration_duration_proto_goTypes,
- DependencyIndexes: file_github_com_golang_protobuf_ptypes_duration_duration_proto_depIdxs,
- }.Build()
- File_github_com_golang_protobuf_ptypes_duration_duration_proto = out.File
- file_github_com_golang_protobuf_ptypes_duration_duration_proto_rawDesc = nil
- file_github_com_golang_protobuf_ptypes_duration_duration_proto_goTypes = nil
- file_github_com_golang_protobuf_ptypes_duration_duration_proto_depIdxs = nil
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp.go b/vendor/github.com/golang/protobuf/ptypes/timestamp.go
deleted file mode 100644
index 8368a3f70d38..000000000000
--- a/vendor/github.com/golang/protobuf/ptypes/timestamp.go
+++ /dev/null
@@ -1,112 +0,0 @@
-// 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 ptypes
-
-import (
- "errors"
- "fmt"
- "time"
-
- timestamppb "github.com/golang/protobuf/ptypes/timestamp"
-)
-
-// Range of google.protobuf.Duration as specified in timestamp.proto.
-const (
- // Seconds field of the earliest valid Timestamp.
- // This is time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC).Unix().
- minValidSeconds = -62135596800
- // Seconds field just after the latest valid Timestamp.
- // This is time.Date(10000, 1, 1, 0, 0, 0, 0, time.UTC).Unix().
- maxValidSeconds = 253402300800
-)
-
-// Timestamp converts a timestamppb.Timestamp to a time.Time.
-// It returns an error if the argument is invalid.
-//
-// Unlike most Go functions, if Timestamp returns an error, the first return
-// value is not the zero time.Time. Instead, it is the value obtained from the
-// time.Unix function when passed the contents of the Timestamp, in the UTC
-// locale. This may or may not be a meaningful time; many invalid Timestamps
-// do map to valid time.Times.
-//
-// A nil Timestamp returns an error. The first return value in that case is
-// undefined.
-//
-// Deprecated: Call the ts.AsTime and ts.CheckValid methods instead.
-func Timestamp(ts *timestamppb.Timestamp) (time.Time, error) {
- // Don't return the zero value on error, because corresponds to a valid
- // timestamp. Instead return whatever time.Unix gives us.
- var t time.Time
- if ts == nil {
- t = time.Unix(0, 0).UTC() // treat nil like the empty Timestamp
- } else {
- t = time.Unix(ts.Seconds, int64(ts.Nanos)).UTC()
- }
- return t, validateTimestamp(ts)
-}
-
-// TimestampNow returns a google.protobuf.Timestamp for the current time.
-//
-// Deprecated: Call the timestamppb.Now function instead.
-func TimestampNow() *timestamppb.Timestamp {
- ts, err := TimestampProto(time.Now())
- if err != nil {
- panic("ptypes: time.Now() out of Timestamp range")
- }
- return ts
-}
-
-// TimestampProto converts the time.Time to a google.protobuf.Timestamp proto.
-// It returns an error if the resulting Timestamp is invalid.
-//
-// Deprecated: Call the timestamppb.New function instead.
-func TimestampProto(t time.Time) (*timestamppb.Timestamp, error) {
- ts := ×tamppb.Timestamp{
- Seconds: t.Unix(),
- Nanos: int32(t.Nanosecond()),
- }
- if err := validateTimestamp(ts); err != nil {
- return nil, err
- }
- return ts, nil
-}
-
-// TimestampString returns the RFC 3339 string for valid Timestamps.
-// For invalid Timestamps, it returns an error message in parentheses.
-//
-// Deprecated: Call the ts.AsTime method instead,
-// followed by a call to the Format method on the time.Time value.
-func TimestampString(ts *timestamppb.Timestamp) string {
- t, err := Timestamp(ts)
- if err != nil {
- return fmt.Sprintf("(%v)", err)
- }
- return t.Format(time.RFC3339Nano)
-}
-
-// validateTimestamp determines whether a Timestamp is valid.
-// A valid timestamp represents a time in the range [0001-01-01, 10000-01-01)
-// and has a Nanos field in the range [0, 1e9).
-//
-// If the Timestamp is valid, validateTimestamp returns nil.
-// Otherwise, it returns an error that describes the problem.
-//
-// Every valid Timestamp can be represented by a time.Time,
-// but the converse is not true.
-func validateTimestamp(ts *timestamppb.Timestamp) error {
- if ts == nil {
- return errors.New("timestamp: nil Timestamp")
- }
- if ts.Seconds < minValidSeconds {
- return fmt.Errorf("timestamp: %v before 0001-01-01", ts)
- }
- if ts.Seconds >= maxValidSeconds {
- return fmt.Errorf("timestamp: %v after 10000-01-01", ts)
- }
- if ts.Nanos < 0 || ts.Nanos >= 1e9 {
- return fmt.Errorf("timestamp: %v: nanos not in range [0, 1e9)", ts)
- }
- return nil
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go b/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
deleted file mode 100644
index a76f80760094..000000000000
--- a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
+++ /dev/null
@@ -1,64 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: github.com/golang/protobuf/ptypes/timestamp/timestamp.proto
-
-package timestamp
-
-import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
- timestamppb "google.golang.org/protobuf/types/known/timestamppb"
- reflect "reflect"
-)
-
-// Symbols defined in public import of google/protobuf/timestamp.proto.
-
-type Timestamp = timestamppb.Timestamp
-
-var File_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto protoreflect.FileDescriptor
-
-var file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_rawDesc = []byte{
- 0x0a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c,
- 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79,
- 0x70, 0x65, 0x73, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2f, 0x74, 0x69,
- 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74,
- 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x37,
- 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c,
- 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79,
- 0x70, 0x65, 0x73, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x3b, 0x74, 0x69,
- 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x50, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x33,
-}
-
-var file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_goTypes = []interface{}{}
-var file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_depIdxs = []int32{
- 0, // [0:0] is the sub-list for method output_type
- 0, // [0:0] is the sub-list for method input_type
- 0, // [0:0] is the sub-list for extension type_name
- 0, // [0:0] is the sub-list for extension extendee
- 0, // [0:0] is the sub-list for field type_name
-}
-
-func init() { file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_init() }
-func file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_init() {
- if File_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto != nil {
- return
- }
- type x struct{}
- out := protoimpl.TypeBuilder{
- File: protoimpl.DescBuilder{
- GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_rawDesc,
- NumEnums: 0,
- NumMessages: 0,
- NumExtensions: 0,
- NumServices: 0,
- },
- GoTypes: file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_goTypes,
- DependencyIndexes: file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_depIdxs,
- }.Build()
- File_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto = out.File
- file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_rawDesc = nil
- file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_goTypes = nil
- file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_depIdxs = nil
-}
diff --git a/vendor/github.com/google/cel-go/cel/BUILD.bazel b/vendor/github.com/google/cel-go/cel/BUILD.bazel
index 0905f6353955..c12e4904da4d 100644
--- a/vendor/github.com/google/cel-go/cel/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/cel/BUILD.bazel
@@ -10,13 +10,18 @@ go_library(
"cel.go",
"decls.go",
"env.go",
+ "folding.go",
+ "inlining.go",
"io.go",
"library.go",
"macro.go",
+ "optimizer.go",
"options.go",
"program.go",
+ "prompt.go",
"validator.go",
],
+ embedsrcs = ["//cel/templates"],
importpath = "github.com/google/cel-go/cel",
visibility = ["//visibility:public"],
deps = [
@@ -26,6 +31,7 @@ go_library(
"//common/ast:go_default_library",
"//common/containers:go_default_library",
"//common/decls:go_default_library",
+ "//common/env:go_default_library",
"//common/functions:go_default_library",
"//common/operators:go_default_library",
"//common/overloads:go_default_library",
@@ -36,6 +42,7 @@ go_library(
"//common/types/traits:go_default_library",
"//interpreter:go_default_library",
"//parser:go_default_library",
+ "@dev_cel_expr//:expr",
"@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
"@org_golang_google_protobuf//reflect/protodesc:go_default_library",
@@ -56,7 +63,12 @@ go_test(
"cel_test.go",
"decls_test.go",
"env_test.go",
+ "folding_test.go",
+ "inlining_test.go",
"io_test.go",
+ "optimizer_test.go",
+ "prompt_test.go",
+ "validator_test.go",
],
data = [
"//cel/testdata:gen_test_fds",
@@ -64,19 +76,22 @@ go_test(
embed = [
":go_default_library",
],
+ embedsrcs = [
+ "//cel/testdata:prompts",
+ ],
deps = [
"//common/operators:go_default_library",
"//common/overloads:go_default_library",
"//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",
- "@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
"@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",
+ "@org_golang_google_protobuf//proto:go_default_library",
"@org_golang_google_protobuf//types/known/structpb:go_default_library",
"@org_golang_google_protobuf//types/known/wrapperspb: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 0f9501341b4c..4d4873bd6b1f 100644
--- a/vendor/github.com/google/cel-go/cel/decls.go
+++ b/vendor/github.com/google/cel-go/cel/decls.go
@@ -23,6 +23,7 @@ import (
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
+ celpb "cel.dev/expr"
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
@@ -141,8 +142,23 @@ func Constant(name string, t *Type, v ref.Val) EnvOption {
// Variable creates an instance of a variable declaration with a variable name and type.
func Variable(name string, t *Type) EnvOption {
+ return VariableWithDoc(name, t, "")
+}
+
+// VariableWithDoc creates an instance of a variable declaration with a variable name, type, and doc string.
+func VariableWithDoc(name string, t *Type, doc string) EnvOption {
+ return func(e *Env) (*Env, error) {
+ e.variables = append(e.variables, decls.NewVariableWithDoc(name, t, doc))
+ return e, nil
+ }
+}
+
+// VariableDecls configures a set of fully defined cel.VariableDecl instances in the environment.
+func VariableDecls(vars ...*decls.VariableDecl) EnvOption {
return func(e *Env) (*Env, error) {
- e.variables = append(e.variables, decls.NewVariable(name, t))
+ for _, v := range vars {
+ e.variables = append(e.variables, v)
+ }
return e, nil
}
}
@@ -182,13 +198,38 @@ func Function(name string, opts ...FunctionOpt) EnvOption {
if err != nil {
return nil, err
}
- if existing, found := e.functions[fn.Name()]; found {
- fn, err = existing.Merge(fn)
- if err != nil {
- return nil, err
+ return FunctionDecls(fn)(e)
+ }
+}
+
+// OverloadSelector selects an overload associated with a given function when it returns true.
+//
+// Used in combination with the FunctionDecl.Subset method.
+type OverloadSelector = decls.OverloadSelector
+
+// IncludeOverloads defines an OverloadSelector which allow-lists a set of overloads by their ids.
+func IncludeOverloads(overloadIDs ...string) OverloadSelector {
+ return decls.IncludeOverloads(overloadIDs...)
+}
+
+// ExcludeOverloads defines an OverloadSelector which deny-lists a set of overloads by their ids.
+func ExcludeOverloads(overloadIDs ...string) OverloadSelector {
+ return decls.ExcludeOverloads(overloadIDs...)
+}
+
+// FunctionDecls provides one or more fully formed function declarations to be added to the environment.
+func FunctionDecls(funcs ...*decls.FunctionDecl) EnvOption {
+ return func(e *Env) (*Env, error) {
+ var err error
+ for _, fn := range funcs {
+ if existing, found := e.functions[fn.Name()]; found {
+ fn, err = existing.Merge(fn)
+ if err != nil {
+ return nil, err
+ }
}
+ e.functions[fn.Name()] = fn
}
- e.functions[fn.Name()] = fn
return e, nil
}
}
@@ -196,6 +237,13 @@ func Function(name string, opts ...FunctionOpt) EnvOption {
// FunctionOpt defines a functional option for configuring a function declaration.
type FunctionOpt = decls.FunctionOpt
+// FunctionDocs provides a general usage documentation for the function.
+//
+// Use OverloadExamples to provide example usage instructions for specific overloads.
+func FunctionDocs(docs ...string) FunctionOpt {
+ return decls.FunctionDocs(docs...)
+}
+
// SingletonUnaryBinding creates a singleton function definition to be used for all function overloads.
//
// Note, this approach works well if operand is expected to have a specific trait which it implements,
@@ -269,6 +317,11 @@ func MemberOverload(overloadID string, args []*Type, resultType *Type, opts ...O
// OverloadOpt is a functional option for configuring a function overload.
type OverloadOpt = decls.OverloadOpt
+// OverloadExamples configures an example of how to invoke the overload.
+func OverloadExamples(docs ...string) OverloadOpt {
+ return decls.OverloadExamples(docs...)
+}
+
// UnaryBinding provides the implementation of a unary overload. The provided function is protected by a runtime
// type-guard which ensures runtime type agreement between the overload signature and runtime argument types.
func UnaryBinding(binding functions.UnaryOp) OverloadOpt {
@@ -287,6 +340,12 @@ func FunctionBinding(binding functions.FunctionOp) OverloadOpt {
return decls.FunctionBinding(binding)
}
+// LateFunctionBinding indicates that the function has a binding which is not known at compile time.
+// This is useful for functions which have side-effects or are not deterministically computable.
+func LateFunctionBinding() OverloadOpt {
+ return decls.LateFunctionBinding()
+}
+
// OverloadIsNonStrict enables the function to be called with error and unknown argument values.
//
// Note: do not use this option unless absoluately necessary as it should be an uncommon feature.
@@ -312,20 +371,34 @@ func ExprTypeToType(t *exprpb.Type) (*Type, error) {
// ExprDeclToDeclaration converts a protobuf CEL declaration to a CEL-native declaration, either a Variable or Function.
func ExprDeclToDeclaration(d *exprpb.Decl) (EnvOption, error) {
+ return AlphaProtoAsDeclaration(d)
+}
+
+// AlphaProtoAsDeclaration converts a v1alpha1.Decl value describing a variable or function into an EnvOption.
+func AlphaProtoAsDeclaration(d *exprpb.Decl) (EnvOption, error) {
+ canonical := &celpb.Decl{}
+ if err := convertProto(d, canonical); err != nil {
+ return nil, err
+ }
+ return ProtoAsDeclaration(canonical)
+}
+
+// ProtoAsDeclaration converts a canonical celpb.Decl value describing a variable or function into an EnvOption.
+func ProtoAsDeclaration(d *celpb.Decl) (EnvOption, error) {
switch d.GetDeclKind().(type) {
- case *exprpb.Decl_Function:
+ case *celpb.Decl_Function:
overloads := d.GetFunction().GetOverloads()
opts := make([]FunctionOpt, len(overloads))
for i, o := range overloads {
args := make([]*Type, len(o.GetParams()))
for j, p := range o.GetParams() {
- a, err := types.ExprTypeToType(p)
+ a, err := types.ProtoAsType(p)
if err != nil {
return nil, err
}
args[j] = a
}
- res, err := types.ExprTypeToType(o.GetResultType())
+ res, err := types.ProtoAsType(o.GetResultType())
if err != nil {
return nil, err
}
@@ -336,15 +409,15 @@ func ExprDeclToDeclaration(d *exprpb.Decl) (EnvOption, error) {
}
}
return Function(d.GetName(), opts...), nil
- case *exprpb.Decl_Ident:
- t, err := types.ExprTypeToType(d.GetIdent().GetType())
+ case *celpb.Decl_Ident:
+ t, err := types.ProtoAsType(d.GetIdent().GetType())
if err != nil {
return nil, err
}
if d.GetIdent().GetValue() == nil {
return Variable(d.GetName(), t), nil
}
- val, err := ast.ConstantToVal(d.GetIdent().GetValue())
+ val, err := ast.ProtoConstantAsVal(d.GetIdent().GetValue())
if err != nil {
return nil, err
}
@@ -353,43 +426,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 b5c3b4cc5566..bb3014464e52 100644
--- a/vendor/github.com/google/cel-go/cel/env.go
+++ b/vendor/github.com/google/cel-go/cel/env.go
@@ -16,6 +16,8 @@ package cel
import (
"errors"
+ "fmt"
+ "math"
"sync"
"github.com/google/cel-go/checker"
@@ -24,12 +26,15 @@ import (
celast "github.com/google/cel-go/common/ast"
"github.com/google/cel-go/common/containers"
"github.com/google/cel-go/common/decls"
+ "github.com/google/cel-go/common/env"
+ "github.com/google/cel-go/common/stdlib"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
"github.com/google/cel-go/interpreter"
"github.com/google/cel-go/parser"
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ "google.golang.org/protobuf/reflect/protoreflect"
)
// Source interface representing a user-provided expression.
@@ -38,26 +43,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 {
+ if ast == nil {
+ return nil
+ }
+ 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.NativeRep().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
+ return ast.NativeRep().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.NativeRep().SourceInfo())
+ return pbInfo
}
// ResultType returns the output type of the expression if the Ast has been type-checked, else
@@ -65,9 +86,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 +97,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.NativeRep().GetType(ast.NativeRep().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
}
@@ -112,12 +132,13 @@ type Env struct {
Container *containers.Container
variables []*decls.VariableDecl
functions map[string]*decls.FunctionDecl
- macros []parser.Macro
+ macros []Macro
+ contextProto protoreflect.MessageDescriptor
adapter types.Adapter
provider types.Provider
features map[int]bool
appliedFeatures map[int]bool
- libraries map[string]bool
+ libraries map[string]SingletonLibrary
validators []ASTValidator
costOptions []checker.CostOption
@@ -136,6 +157,134 @@ type Env struct {
progOpts []ProgramOption
}
+// ToConfig produces a YAML-serializable env.Config object from the given environment.
+//
+// The serialized configuration value is intended to represent a baseline set of config
+// options which could be used as input to an EnvOption to configure the majority of the
+// environment from a file.
+//
+// Note: validators, features, flags, and safe-guard settings are not yet supported by
+// the serialize method. Since optimizers are a separate construct from the environment
+// and the standard expression components (parse, check, evalute), they are also not
+// supported by the serialize method.
+func (e *Env) ToConfig(name string) (*env.Config, error) {
+ conf := env.NewConfig(name)
+ // Container settings
+ if e.Container != containers.DefaultContainer {
+ conf.SetContainer(e.Container.Name())
+ }
+ for _, typeName := range e.Container.AliasSet() {
+ conf.AddImports(env.NewImport(typeName))
+ }
+
+ libOverloads := map[string][]string{}
+ for libName, lib := range e.libraries {
+ // Track the options which have been configured by a library and
+ // then diff the library version against the configured function
+ // to detect incremental overloads or rewrites.
+ libEnv, _ := NewCustomEnv()
+ libEnv, _ = Lib(lib)(libEnv)
+ for fnName, fnDecl := range libEnv.Functions() {
+ if len(fnDecl.OverloadDecls()) == 0 {
+ continue
+ }
+ overloads, exist := libOverloads[fnName]
+ if !exist {
+ overloads = make([]string, 0, len(fnDecl.OverloadDecls()))
+ }
+ for _, o := range fnDecl.OverloadDecls() {
+ overloads = append(overloads, o.ID())
+ }
+ libOverloads[fnName] = overloads
+ }
+ subsetLib, canSubset := lib.(LibrarySubsetter)
+ alias := ""
+ if aliasLib, canAlias := lib.(LibraryAliaser); canAlias {
+ alias = aliasLib.LibraryAlias()
+ libName = alias
+ }
+ if libName == "stdlib" && canSubset {
+ conf.SetStdLib(subsetLib.LibrarySubset())
+ continue
+ }
+ version := uint32(math.MaxUint32)
+ if versionLib, isVersioned := lib.(LibraryVersioner); isVersioned {
+ version = versionLib.LibraryVersion()
+ }
+ conf.AddExtensions(env.NewExtension(libName, version))
+ }
+
+ // If this is a custom environment without the standard env, mark the stdlib as disabled.
+ if conf.StdLib == nil && !e.HasLibrary("cel.lib.std") {
+ conf.SetStdLib(env.NewLibrarySubset().SetDisabled(true))
+ }
+
+ // Serialize the variables
+ vars := make([]*decls.VariableDecl, 0, len(e.Variables()))
+ stdTypeVars := map[string]*decls.VariableDecl{}
+ for _, v := range stdlib.Types() {
+ stdTypeVars[v.Name()] = v
+ }
+ for _, v := range e.Variables() {
+ if _, isStdType := stdTypeVars[v.Name()]; isStdType {
+ continue
+ }
+ vars = append(vars, v)
+ }
+ if e.contextProto != nil {
+ conf.SetContextVariable(env.NewContextVariable(string(e.contextProto.FullName())))
+ skipVariables := map[string]bool{}
+ fields := e.contextProto.Fields()
+ for i := 0; i < fields.Len(); i++ {
+ field := fields.Get(i)
+ variable, err := fieldToVariable(field)
+ if err != nil {
+ return nil, fmt.Errorf("could not serialize context field variable %q, reason: %w", field.FullName(), err)
+ }
+ skipVariables[variable.Name()] = true
+ }
+ for _, v := range vars {
+ if _, found := skipVariables[v.Name()]; !found {
+ conf.AddVariableDecls(v)
+ }
+ }
+ } else {
+ conf.AddVariableDecls(vars...)
+ }
+
+ // Serialize functions which are distinct from the ones configured by libraries.
+ for fnName, fnDecl := range e.Functions() {
+ if excludedOverloads, found := libOverloads[fnName]; found {
+ if newDecl := fnDecl.Subset(decls.ExcludeOverloads(excludedOverloads...)); newDecl != nil {
+ conf.AddFunctionDecls(newDecl)
+ }
+ } else {
+ conf.AddFunctionDecls(fnDecl)
+ }
+ }
+
+ // Serialize validators
+ for _, val := range e.Validators() {
+ // Only add configurable validators to the env.Config as all others are
+ // expected to be implicitly enabled via extension libraries.
+ if confVal, ok := val.(ConfigurableASTValidator); ok {
+ conf.AddValidators(confVal.ToConfig())
+ }
+ }
+
+ // Serialize features
+ for featID, enabled := range e.features {
+ featName, found := featureNameByID(featID)
+ if !found {
+ // If the feature isn't named, it isn't intended to be publicly exposed
+ continue
+ }
+ conf.AddFeatures(env.NewFeature(featName, enabled))
+ }
+
+ return conf, nil
+}
+
// NewEnv creates a program environment configured with the standard library of CEL functions and
// macros. The Env value returned can parse and check any CEL program which builds upon the core
// features documented in the CEL specification.
@@ -179,7 +328,7 @@ func NewCustomEnv(opts ...EnvOption) (*Env, error) {
provider: registry,
features: map[int]bool{},
appliedFeatures: map[int]bool{},
- libraries: map[string]bool{},
+ libraries: map[string]SingletonLibrary{},
validators: []ASTValidator{},
progOpts: []ProgramOption{},
costOptions: []checker.CostOption{},
@@ -198,29 +347,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())
+ errs.ReportErrorString(common.NoLocation, err.Error())
+ return nil, NewIssuesWithSourceInfo(errs, ast.NativeRep().SourceInfo())
}
- res, errs := checker.Check(pe, ast.Source(), chk)
+ checked, errs := checker.Check(ast.NativeRep(), ast.Source(), chk)
if len(errs.GetErrors()) > 0 {
- return nil, NewIssuesWithSourceInfo(errs, ast.SourceInfo())
+ return nil, NewIssuesWithSourceInfo(errs, ast.NativeRep().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 +378,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.NativeRep().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
@@ -295,17 +443,13 @@ func (e *Env) Extend(opts ...EnvOption) (*Env, error) {
copy(chkOptsCopy, e.chkOpts)
// Copy the declarations if needed.
- varsCopy := []*decls.VariableDecl{}
if chk != nil {
// If the type-checker has already been instantiated, then the e.declarations have been
// validated within the chk instance.
chkOptsCopy = append(chkOptsCopy, checker.ValidatedDeclarations(chk))
- } else {
- // If the type-checker has not been instantiated, ensure the unvalidated declarations are
- // provided to the extended Env instance.
- varsCopy = make([]*decls.VariableDecl, len(e.variables))
- copy(varsCopy, e.variables)
}
+ varsCopy := make([]*decls.VariableDecl, len(e.variables))
+ copy(varsCopy, e.variables)
// Copy macros and program options
macsCopy := make([]parser.Macro, len(e.macros))
@@ -352,7 +496,7 @@ func (e *Env) Extend(opts ...EnvOption) (*Env, error) {
for k, v := range e.functions {
funcsCopy[k] = v
}
- libsCopy := make(map[string]bool, len(e.libraries))
+ libsCopy := make(map[string]SingletonLibrary, len(e.libraries))
for k, v := range e.libraries {
libsCopy[k] = v
}
@@ -366,6 +510,7 @@ func (e *Env) Extend(opts ...EnvOption) (*Env, error) {
variables: varsCopy,
functions: funcsCopy,
macros: macsCopy,
+ contextProto: e.contextProto,
progOpts: progOptsCopy,
adapter: adapter,
features: featuresCopy,
@@ -389,8 +534,8 @@ func (e *Env) HasFeature(flag int) bool {
// HasLibrary returns whether a specific SingletonLibrary has been configured in the environment.
func (e *Env) HasLibrary(libName string) bool {
- configured, exists := e.libraries[libName]
- return exists && configured
+ _, exists := e.libraries[libName]
+ return exists
}
// Libraries returns a list of SingletonLibrary that have been configured in the environment.
@@ -402,6 +547,35 @@ func (e *Env) Libraries() []string {
return libraries
}
+// HasFunction returns whether a specific function has been configured in the environment
+func (e *Env) HasFunction(functionName string) bool {
+ _, ok := e.functions[functionName]
+ return ok
+}
+
+// Functions returns a shallow copy of the Functions, keyed by function name, that have been configured in the environment.
+func (e *Env) Functions() map[string]*decls.FunctionDecl {
+ shallowCopy := make(map[string]*decls.FunctionDecl, len(e.functions))
+ for nm, fn := range e.functions {
+ shallowCopy[nm] = fn
+ }
+ return shallowCopy
+}
+
+// Variables returns a shallow copy of the variables associated with the environment.
+func (e *Env) Variables() []*decls.VariableDecl {
+ shallowCopy := make([]*decls.VariableDecl, len(e.variables))
+ copy(shallowCopy, e.variables)
+ return shallowCopy
+}
+
+// Macros returns a shallow copy of macros associated with the environment.
+func (e *Env) Macros() []Macro {
+ shallowCopy := make([]Macro, len(e.macros))
+ copy(shallowCopy, e.macros)
+ return shallowCopy
+}
+
// HasValidator returns whether a specific ASTValidator has been configured in the environment.
func (e *Env) HasValidator(name string) bool {
for _, v := range e.validators {
@@ -412,6 +586,11 @@ func (e *Env) HasValidator(name string) bool {
return false
}
+// Validators returns the set of ASTValidators configured on the environment.
+func (e *Env) Validators() []ASTValidator {
+ return e.validators[:]
+}
+
// Parse parses the input expression value `txt` to a Ast and/or a set of Issues.
//
// This form of Parse creates a Source value for the input `txt` and forwards to the
@@ -429,20 +608,21 @@ 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).
func (e *Env) Program(ast *Ast, opts ...ProgramOption) (Program, error) {
+ return e.PlanProgram(ast.NativeRep(), opts...)
+}
+
+// PlanProgram generates an evaluable instance of the AST in the go-native representation within
+// the environment (Env).
+func (e *Env) PlanProgram(a *celast.AST, opts ...ProgramOption) (Program, error) {
optSet := e.progOpts
if len(opts) != 0 {
mergedOpts := []ProgramOption{}
@@ -450,7 +630,7 @@ func (e *Env) Program(ast *Ast, opts ...ProgramOption) (Program, error) {
mergedOpts = append(mergedOpts, opts...)
optSet = mergedOpts
}
- return newProgram(e, ast, optSet)
+ return newProgram(e, a, optSet)
}
// CELTypeAdapter returns the `types.Adapter` configured for the environment.
@@ -480,31 +660,30 @@ func (e *Env) TypeProvider() ref.TypeProvider {
return &interopLegacyTypeProvider{Provider: e.provider}
}
-// UnknownVars returns an interpreter.PartialActivation which marks all variables declared in the
-// Env as unknown AttributePattern values.
+// UnknownVars returns a PartialActivation which marks all variables declared in the Env as
+// unknown AttributePattern values.
//
-// Note, the UnknownVars will behave the same as an interpreter.EmptyActivation unless the
-// PartialAttributes option is provided as a ProgramOption.
-func (e *Env) UnknownVars() interpreter.PartialActivation {
+// Note, the UnknownVars will behave the same as an cel.NoVars() unless the PartialAttributes
+// option is provided as a ProgramOption.
+func (e *Env) UnknownVars() PartialActivation {
act := interpreter.EmptyActivation()
part, _ := PartialVars(act, e.computeUnknownVars(act)...)
return part
}
-// PartialVars returns an interpreter.PartialActivation where all variables not in the input variable
+// PartialVars returns a PartialActivation where all variables not in the input variable
// set, but which have been configured in the environment, are marked as unknown.
//
-// The `vars` value may either be an interpreter.Activation or any valid input to the
-// interpreter.NewActivation call.
+// The `vars` value may either be an Activation or any valid input to the cel.NewActivation call.
//
// Note, this is equivalent to calling cel.PartialVars and manually configuring the set of unknown
// variables. For more advanced use cases of partial state where portions of an object graph, rather
// than top-level variables, are missing the PartialVars() method may be a more suitable choice.
//
-// Note, the PartialVars will behave the same as an interpreter.EmptyActivation unless the
-// PartialAttributes option is provided as a ProgramOption.
-func (e *Env) PartialVars(vars any) (interpreter.PartialActivation, error) {
- act, err := interpreter.NewActivation(vars)
+// Note, the PartialVars will behave the same as cel.NoVars() unless the PartialAttributes
+// option is provided as a ProgramOption.
+func (e *Env) PartialVars(vars any) (PartialActivation, error) {
+ act, err := NewActivation(vars)
if err != nil {
return nil, err
}
@@ -534,8 +713,10 @@ 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))
+ ast := a.NativeRep()
+ pruned := interpreter.PruneAst(ast.Expr(), ast.SourceInfo().MacroCalls(), details.State())
+ newAST := &Ast{source: a.Source(), impl: pruned}
+ expr, err := AstToString(newAST)
if err != nil {
return nil, err
}
@@ -556,16 +737,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.NativeRep(), estimator, extendedOpts...)
}
// configure applies a series of EnvOptions to the current environment.
@@ -580,10 +755,15 @@ func (e *Env) configure(opts []EnvOption) (*Env, error) {
}
}
- // If the default UTC timezone fix has been enabled, make sure the library is configured
- e, err = e.maybeApplyFeature(featureDefaultUTCTimeZone, Lib(timeUTCLibrary{}))
- if err != nil {
- return nil, err
+ // If the default UTC timezone has been disabled, configure the legacy overloads
+ if utcTime, isSet := e.features[featureDefaultUTCTimeZone]; isSet && !utcTime {
+ if !e.appliedFeatures[featureDefaultUTCTimeZone] {
+ e.appliedFeatures[featureDefaultUTCTimeZone] = true
+ e, err = Lib(timeLegacyLibrary{})(e)
+ if err != nil {
+ return nil, err
+ }
+ }
}
// Configure the parser.
@@ -597,6 +777,9 @@ func (e *Env) configure(opts []EnvOption) (*Env, error) {
if e.HasFeature(featureVariadicLogicalASTs) {
prsrOpts = append(prsrOpts, parser.EnableVariadicOperatorASTs(true))
}
+ if e.HasFeature(featureIdentEscapeSyntax) {
+ prsrOpts = append(prsrOpts, parser.EnableIdentEscapeSyntax(true))
+ }
e.prsr, err = parser.NewParser(prsrOpts...)
if err != nil {
return nil, err
@@ -664,30 +847,9 @@ func (e *Env) getCheckerOrError() (*checker.Env, error) {
return e.chk, e.chkErr
}
-// maybeApplyFeature determines whether the feature-guarded option is enabled, and if so applies
-// the feature if it has not already been enabled.
-func (e *Env) maybeApplyFeature(feature int, option EnvOption) (*Env, error) {
- if !e.HasFeature(feature) {
- return e, nil
- }
- _, applied := e.appliedFeatures[feature]
- if applied {
- return e, nil
- }
- e, err := option(e)
- if err != nil {
- return nil, err
- }
- // record that the feature has been applied since it will generate declarations
- // and functions which will be propagated on Extend() calls and which should only
- // be registered once.
- e.appliedFeatures[feature] = true
- return e, nil
-}
-
// computeUnknownVars determines a set of missing variables based on the input activation and the
// environment's configured declaration set.
-func (e *Env) computeUnknownVars(vars interpreter.Activation) []*interpreter.AttributePattern {
+func (e *Env) computeUnknownVars(vars Activation) []*interpreter.AttributePattern {
var unknownPatterns []*interpreter.AttributePattern
for _, v := range e.variables {
varName := v.Name()
@@ -707,7 +869,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 +880,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,
@@ -749,10 +911,10 @@ func (i *Issues) Append(other *Issues) *Issues {
if i == nil {
return other
}
- if other == nil {
+ if other == nil || i == other {
return i
}
- return NewIssues(i.errs.Append(other.errs.GetErrors()))
+ return NewIssuesWithSourceInfo(i.errs.Append(other.errs.GetErrors()), i.info)
}
// String converts the issues to a suitable display string.
@@ -768,30 +930,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.
@@ -809,7 +948,7 @@ type interopCELTypeProvider struct {
// FindStructType returns a types.Type instance for the given fully-qualified typeName if one exists.
//
-// This method proxies to the underyling ref.TypeProvider's FindType method and converts protobuf type
+// This method proxies to the underlying ref.TypeProvider's FindType method and converts protobuf type
// into a native type representation. If the conversion fails, the type is listed as not found.
func (p *interopCELTypeProvider) FindStructType(typeName string) (*types.Type, bool) {
if et, found := p.FindType(typeName); found {
@@ -822,10 +961,17 @@ 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.
//
-// This method proxies to the underyling ref.TypeProvider's FindFieldType method and converts protobuf type
+// This method proxies to the underlying ref.TypeProvider's FindFieldType method and converts protobuf type
// into a native type representation. If the conversion fails, the type is listed as not found.
func (p *interopCELTypeProvider) FindStructFieldType(structType, fieldName string) (*types.FieldType, bool) {
if ft, found := p.FindFieldType(structType, fieldName); found {
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 000000000000..40d843ecea30
--- /dev/null
+++ b/vendor/github.com/google/cel-go/cel/folding.go
@@ -0,0 +1,603 @@
+// 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
+ }
+}
+
+// Adds an Activation which provides known values for the folding evaluator
+//
+// Any values the activation provides will be used by the constant folder and turned into
+// literals in the AST.
+//
+// Defaults to the NoVars() Activation
+func FoldKnownValues(knownValues Activation) ConstantFoldingOption {
+ return func(opt *constantFoldingOptimizer) (*constantFoldingOptimizer, error) {
+ if knownValues != nil {
+ opt.knownValues = knownValues
+ } else {
+ opt.knownValues = NoVars()
+ }
+ 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
+ knownValues Activation
+}
+
+// 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.
+ constantExprMatcherCapture := func(e ast.NavigableExpr) bool { return opt.constantExprMatcher(ctx, a, e) }
+ foldableExprs := ast.MatchDescendants(root, constantExprMatcherCapture)
+ 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
+ }
+ // Late-bound function calls cannot be folded.
+ if fold.Kind() == ast.CallKind && isLateBoundFunctionCall(ctx, a, fold) {
+ continue
+ }
+ // Otherwise, assume all context is needed to evaluate the expression.
+ err := opt.tryFold(ctx, a, fold)
+ // Ignore errors for identifiers, since there is no guarantee that the environment
+ // has a value for them.
+ if err != nil && fold.Kind() != ast.IdentKind {
+ ctx.ReportErrorAtID(fold.ID(), "constant-folding evaluation failed: %v", err.Error())
+ return a
+ }
+ }
+ foldCount++
+ foldableExprs = ast.MatchDescendants(root, constantExprMatcherCapture)
+ }
+ // 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)) {
+ opt.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 (opt *constantFoldingOptimizer) 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
+ }
+ activation := opt.knownValues
+ if activation == nil {
+ activation = NoVars()
+ }
+ out, _, err := prg.Eval(activation)
+ if err != nil {
+ return err
+ }
+ // Update the fold expression to be a literal.
+ ctx.UpdateExpr(expr, ctx.NewLiteral(out))
+ return nil
+}
+
+func isLateBoundFunctionCall(ctx *OptimizerContext, a *ast.AST, expr ast.Expr) bool {
+ call := expr.AsCall()
+ function := ctx.Functions()[call.FunctionName()]
+ if function == nil {
+ return false
+ }
+ return function.HasLateBinding()
+}
+
+// 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 (opt *constantFoldingOptimizer) constantExprMatcher(ctx *OptimizerContext, a *ast.AST, 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.IdentKind:
+ return opt.knownValues != nil && a.ReferenceMap()[e.ID()] != nil
+ 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
+ }
+ // Late-bound function calls cannot be folded.
+ if e.Kind() == ast.CallKind && isLateBoundFunctionCall(ctx, a, e) {
+ 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 000000000000..a4530e19e7e6
--- /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.NativeRep()}
+}
+
+// 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 80f63140e306..2e611228d95d 100644
--- a/vendor/github.com/google/cel-go/cel/io.go
+++ b/vendor/github.com/google/cel-go/cel/io.go
@@ -28,6 +28,7 @@ import (
"github.com/google/cel-go/common/types/traits"
"github.com/google/cel-go/parser"
+ celpb "cel.dev/expr"
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
anypb "google.golang.org/protobuf/types/known/anypb"
)
@@ -47,17 +48,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 +62,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.NativeRep())
}
// ParsedExprToAst converts a parsed expression proto message to an Ast.
@@ -89,18 +78,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,80 +99,151 @@ 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 ExprToString(a.NativeRep().Expr(), a.NativeRep().SourceInfo())
+}
+
+// ExprToString converts an AST Expr node back to a string using macro call tracking metadata from
+// source info if any macros are encountered within the expression.
+func ExprToString(e ast.Expr, info *ast.SourceInfo) (string, error) {
+ return parser.Unparse(e, info)
}
-// RefValueToValue converts between ref.Val and api.expr.Value.
+// RefValueToValue converts between ref.Val and google.api.expr.v1alpha1.Value.
// The result Value is the serialized proto form. The ref.Val must not be error or unknown.
func RefValueToValue(res ref.Val) (*exprpb.Value, error) {
+ return ValueAsAlphaProto(res)
+}
+
+// ValueAsAlphaProto converts between ref.Val and google.api.expr.v1alpha1.Value.
+// The result Value is the serialized proto form. The ref.Val must not be error or unknown.
+func ValueAsAlphaProto(res ref.Val) (*exprpb.Value, error) {
+ canonical, err := ValueAsProto(res)
+ if err != nil {
+ return nil, err
+ }
+ alpha := &exprpb.Value{}
+ err = convertProto(canonical, alpha)
+ return alpha, err
+}
+
+// RefValToExprValue converts between ref.Val and google.api.expr.v1alpha1.ExprValue.
+// The result ExprValue is the serialized proto form.
+func RefValToExprValue(res ref.Val) (*exprpb.ExprValue, error) {
+ return ExprValueAsAlphaProto(res)
+}
+
+// ExprValueAsAlphaProto converts between ref.Val and google.api.expr.v1alpha1.ExprValue.
+// The result ExprValue is the serialized proto form.
+func ExprValueAsAlphaProto(res ref.Val) (*exprpb.ExprValue, error) {
+ canonical, err := ExprValueAsProto(res)
+ if err != nil {
+ return nil, err
+ }
+ alpha := &exprpb.ExprValue{}
+ err = convertProto(canonical, alpha)
+ return alpha, err
+}
+
+// ExprValueAsProto converts between ref.Val and cel.expr.ExprValue.
+// The result ExprValue is the serialized proto form.
+func ExprValueAsProto(res ref.Val) (*celpb.ExprValue, error) {
+ switch res := res.(type) {
+ case *types.Unknown:
+ return &celpb.ExprValue{
+ Kind: &celpb.ExprValue_Unknown{
+ Unknown: &celpb.UnknownSet{
+ Exprs: res.IDs(),
+ },
+ }}, nil
+ case *types.Err:
+ return &celpb.ExprValue{
+ Kind: &celpb.ExprValue_Error{
+ Error: &celpb.ErrorSet{
+ // Keeping the error code as UNKNOWN since there's no error codes associated with
+ // Cel-Go runtime errors.
+ Errors: []*celpb.Status{{Code: 2, Message: res.Error()}},
+ },
+ },
+ }, nil
+ default:
+ val, err := ValueAsProto(res)
+ if err != nil {
+ return nil, err
+ }
+ return &celpb.ExprValue{
+ Kind: &celpb.ExprValue_Value{Value: val}}, nil
+ }
+}
+
+// ValueAsProto converts between ref.Val and cel.expr.Value.
+// The result Value is the serialized proto form. The ref.Val must not be error or unknown.
+func ValueAsProto(res ref.Val) (*celpb.Value, error) {
switch res.Type() {
case types.BoolType:
- return &exprpb.Value{
- Kind: &exprpb.Value_BoolValue{BoolValue: res.Value().(bool)}}, nil
+ return &celpb.Value{
+ Kind: &celpb.Value_BoolValue{BoolValue: res.Value().(bool)}}, nil
case types.BytesType:
- return &exprpb.Value{
- Kind: &exprpb.Value_BytesValue{BytesValue: res.Value().([]byte)}}, nil
+ return &celpb.Value{
+ Kind: &celpb.Value_BytesValue{BytesValue: res.Value().([]byte)}}, nil
case types.DoubleType:
- return &exprpb.Value{
- Kind: &exprpb.Value_DoubleValue{DoubleValue: res.Value().(float64)}}, nil
+ return &celpb.Value{
+ Kind: &celpb.Value_DoubleValue{DoubleValue: res.Value().(float64)}}, nil
case types.IntType:
- return &exprpb.Value{
- Kind: &exprpb.Value_Int64Value{Int64Value: res.Value().(int64)}}, nil
+ return &celpb.Value{
+ Kind: &celpb.Value_Int64Value{Int64Value: res.Value().(int64)}}, nil
case types.ListType:
l := res.(traits.Lister)
sz := l.Size().(types.Int)
- elts := make([]*exprpb.Value, 0, int64(sz))
+ elts := make([]*celpb.Value, 0, int64(sz))
for i := types.Int(0); i < sz; i++ {
- v, err := RefValueToValue(l.Get(i))
+ v, err := ValueAsProto(l.Get(i))
if err != nil {
return nil, err
}
elts = append(elts, v)
}
- return &exprpb.Value{
- Kind: &exprpb.Value_ListValue{
- ListValue: &exprpb.ListValue{Values: elts}}}, nil
+ return &celpb.Value{
+ Kind: &celpb.Value_ListValue{
+ ListValue: &celpb.ListValue{Values: elts}}}, nil
case types.MapType:
mapper := res.(traits.Mapper)
sz := mapper.Size().(types.Int)
- entries := make([]*exprpb.MapValue_Entry, 0, int64(sz))
+ entries := make([]*celpb.MapValue_Entry, 0, int64(sz))
for it := mapper.Iterator(); it.HasNext().(types.Bool); {
k := it.Next()
v := mapper.Get(k)
- kv, err := RefValueToValue(k)
+ kv, err := ValueAsProto(k)
if err != nil {
return nil, err
}
- vv, err := RefValueToValue(v)
+ vv, err := ValueAsProto(v)
if err != nil {
return nil, err
}
- entries = append(entries, &exprpb.MapValue_Entry{Key: kv, Value: vv})
+ entries = append(entries, &celpb.MapValue_Entry{Key: kv, Value: vv})
}
- return &exprpb.Value{
- Kind: &exprpb.Value_MapValue{
- MapValue: &exprpb.MapValue{Entries: entries}}}, nil
+ return &celpb.Value{
+ Kind: &celpb.Value_MapValue{
+ MapValue: &celpb.MapValue{Entries: entries}}}, nil
case types.NullType:
- return &exprpb.Value{
- Kind: &exprpb.Value_NullValue{}}, nil
+ return &celpb.Value{
+ Kind: &celpb.Value_NullValue{}}, nil
case types.StringType:
- return &exprpb.Value{
- Kind: &exprpb.Value_StringValue{StringValue: res.Value().(string)}}, nil
+ return &celpb.Value{
+ Kind: &celpb.Value_StringValue{StringValue: res.Value().(string)}}, nil
case types.TypeType:
typeName := res.(ref.Type).TypeName()
- return &exprpb.Value{Kind: &exprpb.Value_TypeValue{TypeValue: typeName}}, nil
+ return &celpb.Value{Kind: &celpb.Value_TypeValue{TypeValue: typeName}}, nil
case types.UintType:
- return &exprpb.Value{
- Kind: &exprpb.Value_Uint64Value{Uint64Value: res.Value().(uint64)}}, nil
+ return &celpb.Value{
+ Kind: &celpb.Value_Uint64Value{Uint64Value: res.Value().(uint64)}}, nil
default:
any, err := res.ConvertToNative(anyPbType)
if err != nil {
return nil, err
}
- return &exprpb.Value{
- Kind: &exprpb.Value_ObjectValue{ObjectValue: any.(*anypb.Any)}}, nil
+ return &celpb.Value{
+ Kind: &celpb.Value_ObjectValue{ObjectValue: any.(*anypb.Any)}}, nil
}
}
@@ -210,57 +264,71 @@ var (
anyPbType = reflect.TypeOf(&anypb.Any{})
)
-// ValueToRefValue converts between exprpb.Value and ref.Val.
+// ValueToRefValue converts between google.api.expr.v1alpha1.Value and ref.Val.
func ValueToRefValue(adapter types.Adapter, v *exprpb.Value) (ref.Val, error) {
+ return AlphaProtoAsValue(adapter, v)
+}
+
+// AlphaProtoAsValue converts between google.api.expr.v1alpha1.Value and ref.Val.
+func AlphaProtoAsValue(adapter types.Adapter, v *exprpb.Value) (ref.Val, error) {
+ canonical := &celpb.Value{}
+ if err := convertProto(v, canonical); err != nil {
+ return nil, err
+ }
+ return ProtoAsValue(adapter, canonical)
+}
+
+// ProtoAsValue converts between cel.expr.Value and ref.Val.
+func ProtoAsValue(adapter types.Adapter, v *celpb.Value) (ref.Val, error) {
switch v.Kind.(type) {
- case *exprpb.Value_NullValue:
+ case *celpb.Value_NullValue:
return types.NullValue, nil
- case *exprpb.Value_BoolValue:
+ case *celpb.Value_BoolValue:
return types.Bool(v.GetBoolValue()), nil
- case *exprpb.Value_Int64Value:
+ case *celpb.Value_Int64Value:
return types.Int(v.GetInt64Value()), nil
- case *exprpb.Value_Uint64Value:
+ case *celpb.Value_Uint64Value:
return types.Uint(v.GetUint64Value()), nil
- case *exprpb.Value_DoubleValue:
+ case *celpb.Value_DoubleValue:
return types.Double(v.GetDoubleValue()), nil
- case *exprpb.Value_StringValue:
+ case *celpb.Value_StringValue:
return types.String(v.GetStringValue()), nil
- case *exprpb.Value_BytesValue:
+ case *celpb.Value_BytesValue:
return types.Bytes(v.GetBytesValue()), nil
- case *exprpb.Value_ObjectValue:
+ case *celpb.Value_ObjectValue:
any := v.GetObjectValue()
msg, err := anypb.UnmarshalNew(any, proto.UnmarshalOptions{DiscardUnknown: true})
if err != nil {
return nil, err
}
return adapter.NativeToValue(msg), nil
- case *exprpb.Value_MapValue:
+ case *celpb.Value_MapValue:
m := v.GetMapValue()
entries := make(map[ref.Val]ref.Val)
for _, entry := range m.Entries {
- key, err := ValueToRefValue(adapter, entry.Key)
+ key, err := ProtoAsValue(adapter, entry.Key)
if err != nil {
return nil, err
}
- pb, err := ValueToRefValue(adapter, entry.Value)
+ pb, err := ProtoAsValue(adapter, entry.Value)
if err != nil {
return nil, err
}
entries[key] = pb
}
return adapter.NativeToValue(entries), nil
- case *exprpb.Value_ListValue:
+ case *celpb.Value_ListValue:
l := v.GetListValue()
elts := make([]ref.Val, len(l.Values))
for i, e := range l.Values {
- rv, err := ValueToRefValue(adapter, e)
+ rv, err := ProtoAsValue(adapter, e)
if err != nil {
return nil, err
}
elts[i] = rv
}
return adapter.NativeToValue(elts), nil
- case *exprpb.Value_TypeValue:
+ case *celpb.Value_TypeValue:
typeName := v.GetTypeValue()
tv, ok := typeNameToTypeValue[typeName]
if ok {
@@ -270,3 +338,12 @@ func ValueToRefValue(adapter types.Adapter, v *exprpb.Value) (ref.Val, error) {
}
return nil, errors.New("unknown value")
}
+
+func convertProto(src, dst proto.Message) error {
+ pb, err := proto.Marshal(src)
+ if err != nil {
+ return err
+ }
+ err = proto.Unmarshal(pb, dst)
+ return err
+}
diff --git a/vendor/github.com/google/cel-go/cel/library.go b/vendor/github.com/google/cel-go/cel/library.go
index 4d232085c249..59a10e81dea1 100644
--- a/vendor/github.com/google/cel-go/cel/library.go
+++ b/vendor/github.com/google/cel-go/cel/library.go
@@ -15,11 +15,13 @@
package cel
import (
+ "fmt"
"math"
- "strconv"
- "strings"
- "time"
+ "github.com/google/cel-go/common"
+ "github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/decls"
+ "github.com/google/cel-go/common/env"
"github.com/google/cel-go/common/operators"
"github.com/google/cel-go/common/overloads"
"github.com/google/cel-go/common/stdlib"
@@ -28,17 +30,17 @@ 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 (
optMapMacro = "optMap"
optFlatMapMacro = "optFlatMap"
hasValueFunc = "hasValue"
+ unwrapOptFunc = "unwrapOpt"
optionalNoneFunc = "optional.none"
optionalOfFunc = "optional.of"
optionalOfNonZeroValueFunc = "optional.ofNonZeroValue"
+ optionalUnwrapFunc = "optional.unwrap"
valueFunc = "value"
unusedIterVar = "#unused"
)
@@ -69,6 +71,23 @@ type SingletonLibrary interface {
LibraryName() string
}
+// LibraryAliaser generates a simple named alias for the library, for use during environment serialization.
+type LibraryAliaser interface {
+ LibraryAlias() string
+}
+
+// LibrarySubsetter provides the subset description associated with the library, nil if not subset.
+type LibrarySubsetter interface {
+ LibrarySubset() *env.LibrarySubset
+}
+
+// LibraryVersioner provides a version number for the library.
+//
+// If not implemented, the library version will be flagged as 'latest' during environment serialization.
+type LibraryVersioner interface {
+ LibraryVersion() uint32
+}
+
// Lib creates an EnvOption out of a Library, allowing libraries to be provided as functional args,
// and to be linked to each other.
func Lib(l Library) EnvOption {
@@ -78,7 +97,7 @@ func Lib(l Library) EnvOption {
if e.HasLibrary(singleton.LibraryName()) {
return e, nil
}
- e.libraries[singleton.LibraryName()] = true
+ e.libraries[singleton.LibraryName()] = singleton
}
var err error
for _, opt := range l.CompileOptions() {
@@ -92,26 +111,79 @@ func Lib(l Library) EnvOption {
}
}
+// StdLibOption specifies a functional option for configuring the standard CEL library.
+type StdLibOption func(*stdLibrary) *stdLibrary
+
+// StdLibSubset configures the standard library to use a subset of its functions and macros.
+//
+// Since the StdLib is a singleton library, only the first instance of the StdLib() environment options
+// will be configured on the environment which means only the StdLibSubset() initially configured with
+// the library will be used.
+func StdLibSubset(subset *env.LibrarySubset) StdLibOption {
+ return func(lib *stdLibrary) *stdLibrary {
+ lib.subset = subset
+ return lib
+ }
+}
+
// StdLib returns an EnvOption for the standard library of CEL functions and macros.
-func StdLib() EnvOption {
- return Lib(stdLibrary{})
+func StdLib(opts ...StdLibOption) EnvOption {
+ lib := &stdLibrary{}
+ for _, o := range opts {
+ lib = o(lib)
+ }
+ return Lib(lib)
}
// stdLibrary implements the Library interface and provides functional options for the core CEL
// features documented in the specification.
-type stdLibrary struct{}
+type stdLibrary struct {
+ subset *env.LibrarySubset
+}
// LibraryName implements the SingletonLibrary interface method.
-func (stdLibrary) LibraryName() string {
+func (*stdLibrary) LibraryName() string {
return "cel.lib.std"
}
+// LibraryAlias returns the simple name of the library.
+func (*stdLibrary) LibraryAlias() string {
+ return "stdlib"
+}
+
+// LibrarySubset returns the env.LibrarySubset definition associated with the CEL Library.
+func (lib *stdLibrary) LibrarySubset() *env.LibrarySubset {
+ return lib.subset
+}
+
// CompileOptions returns options for the standard CEL function declarations and macros.
-func (stdLibrary) CompileOptions() []EnvOption {
+func (lib *stdLibrary) CompileOptions() []EnvOption {
+ funcs := stdlib.Functions()
+ macros := StandardMacros
+ if lib.subset != nil {
+ subMacros := []Macro{}
+ for _, m := range macros {
+ if lib.subset.SubsetMacro(m.Function()) {
+ subMacros = append(subMacros, m)
+ }
+ }
+ macros = subMacros
+ subFuncs := []*decls.FunctionDecl{}
+ for _, fn := range funcs {
+ if f, include := lib.subset.SubsetFunction(fn); include {
+ subFuncs = append(subFuncs, f)
+ }
+ }
+ funcs = subFuncs
+ }
return []EnvOption{
func(e *Env) (*Env, error) {
var err error
- for _, fn := range stdlib.Functions() {
+ if err = lib.subset.Validate(); err != nil {
+ return nil, err
+ }
+ e.variables = append(e.variables, stdlib.Types()...)
+ for _, fn := range funcs {
existing, found := e.functions[fn.Name()]
if found {
fn, err = existing.Merge(fn)
@@ -123,16 +195,12 @@ func (stdLibrary) CompileOptions() []EnvOption {
}
return e, nil
},
- func(e *Env) (*Env, error) {
- e.variables = append(e.variables, stdlib.Types()...)
- return e, nil
- },
- Macros(StandardMacros...),
+ Macros(macros...),
}
}
// ProgramOptions returns function implementations for the standard CEL functions.
-func (stdLibrary) ProgramOptions() []ProgramOption {
+func (*stdLibrary) ProgramOptions() []ProgramOption {
return []ProgramOption{}
}
@@ -261,6 +329,36 @@ func (stdLibrary) ProgramOptions() []ProgramOption {
// be expressed with `optMap`.
//
// msg.?elements.optFlatMap(e, e[?0]) // return the first element if present.
+//
+// # First
+//
+// Introduced in version: 2
+//
+// Returns an optional with the first value from the right hand list, or
+// optional.None.
+//
+// [1, 2, 3].first().value() == 1
+//
+// # Last
+//
+// Introduced in version: 2
+//
+// Returns an optional with the last value from the right hand list, or
+// optional.None.
+//
+// [1, 2, 3].last().value() == 3
+//
+// This is syntactic sugar for msg.elements[msg.elements.size()-1].
+//
+// # Unwrap / UnwrapOpt
+//
+// Introduced in version: 2
+//
+// Returns a list of all the values that are not none in the input list of optional values.
+// Can be used as optional.unwrap(List[T]) or with postfix notation: List[T].unwrapOpt()
+//
+// optional.unwrap([optional.of(42), optional.none()]) == [42]
+// [optional.of(42), optional.none()].unwrapOpt() == [42]
func OptionalTypes(opts ...OptionalTypesOption) EnvOption {
lib := &optionalLib{version: math.MaxUint32}
for _, opt := range opts {
@@ -293,10 +391,20 @@ func OptionalTypesVersion(version uint32) OptionalTypesOption {
}
// LibraryName implements the SingletonLibrary interface method.
-func (lib *optionalLib) LibraryName() string {
+func (*optionalLib) LibraryName() string {
return "cel.lib.optional"
}
+// LibraryAlias returns the simple name of the library.
+func (*optionalLib) LibraryAlias() string {
+ return "optional"
+}
+
+// LibraryVersion returns the version of the library.
+func (lib *optionalLib) LibraryVersion() uint32 {
+ return lib.version
+}
+
// CompileOptions implements the Library interface method.
func (lib *optionalLib) CompileOptions() []EnvOption {
paramTypeK := TypeParamType("K")
@@ -304,6 +412,7 @@ func (lib *optionalLib) CompileOptions() []EnvOption {
optionalTypeV := OptionalType(paramTypeV)
listTypeV := ListType(paramTypeV)
mapTypeKV := MapType(paramTypeK, paramTypeV)
+ listOptionalTypeV := ListType(optionalTypeV)
opts := []EnvOption{
// Enable the optional syntax in the parser.
@@ -313,16 +422,29 @@ func (lib *optionalLib) CompileOptions() []EnvOption {
Types(types.OptionalType),
// Configure the optMap and optFlatMap macros.
- Macros(NewReceiverMacro(optMapMacro, 2, optMap)),
+ Macros(ReceiverMacro(optMapMacro, 2, optMap,
+ MacroDocs(`perform computation on the value if present and return the result as an optional`),
+ MacroExamples(
+ common.MultilineDescription(
+ `// sub with the prefix 'dev.cel' or optional.none()`,
+ `request.auth.tokens.?sub.optMap(id, 'dev.cel.' + id)`),
+ `optional.none().optMap(i, i * 2) // optional.none()`))),
// Global and member functions for working with optional values.
Function(optionalOfFunc,
+ FunctionDocs(`create a new optional_type(T) with a value where any value is considered valid`),
Overload("optional_of", []*Type{paramTypeV}, optionalTypeV,
+ OverloadExamples(`optional.of(1) // optional(1)`),
UnaryBinding(func(value ref.Val) ref.Val {
return types.OptionalOf(value)
}))),
Function(optionalOfNonZeroValueFunc,
+ FunctionDocs(`create a new optional_type(T) with a value, if the value is not a zero or empty value`),
Overload("optional_ofNonZeroValue", []*Type{paramTypeV}, optionalTypeV,
+ OverloadExamples(
+ `optional.ofNonZeroValue(null) // optional.none()`,
+ `optional.ofNonZeroValue("") // optional.none()`,
+ `optional.ofNonZeroValue("hello") // optional.of('hello')`),
UnaryBinding(func(value ref.Val) ref.Val {
v, isZeroer := value.(traits.Zeroer)
if !isZeroer || !v.IsZeroValue() {
@@ -331,18 +453,26 @@ func (lib *optionalLib) CompileOptions() []EnvOption {
return types.OptionalNone
}))),
Function(optionalNoneFunc,
+ FunctionDocs(`singleton value representing an optional without a value`),
Overload("optional_none", []*Type{}, optionalTypeV,
+ OverloadExamples(`optional.none()`),
FunctionBinding(func(values ...ref.Val) ref.Val {
return types.OptionalNone
}))),
Function(valueFunc,
+ FunctionDocs(`obtain the value contained by the optional, error if optional.none()`),
MemberOverload("optional_value", []*Type{optionalTypeV}, paramTypeV,
+ OverloadExamples(
+ `optional.of(1).value() // 1`,
+ `optional.none().value() // error`),
UnaryBinding(func(value ref.Val) ref.Val {
opt := value.(*types.Optional)
return opt.GetValue()
}))),
Function(hasValueFunc,
+ FunctionDocs(`determine whether the optional contains a value`),
MemberOverload("optional_hasValue", []*Type{optionalTypeV}, BoolType,
+ OverloadExamples(`optional.of({1: 2}).hasValue() // true`),
UnaryBinding(func(value ref.Val) ref.Val {
opt := value.(*types.Optional)
return types.Bool(opt.HasValue())
@@ -351,21 +481,43 @@ func (lib *optionalLib) CompileOptions() []EnvOption {
// Implementation of 'or' and 'orValue' are special-cased to support short-circuiting in the
// evaluation chain.
Function("or",
- MemberOverload("optional_or_optional", []*Type{optionalTypeV, optionalTypeV}, optionalTypeV)),
+ FunctionDocs(`chain optional expressions together, picking the first valued optional expression`),
+ MemberOverload("optional_or_optional", []*Type{optionalTypeV, optionalTypeV}, optionalTypeV,
+ OverloadExamples(
+ `optional.none().or(optional.of(1)) // optional.of(1)`,
+ common.MultilineDescription(
+ `// either a value from the first list, a value from the second, or optional.none()`,
+ `[1, 2, 3][?x].or([3, 4, 5][?y])`)))),
Function("orValue",
- MemberOverload("optional_orValue_value", []*Type{optionalTypeV, paramTypeV}, paramTypeV)),
+ FunctionDocs(`chain optional expressions together picking the first valued optional or the default value`),
+ MemberOverload("optional_orValue_value", []*Type{optionalTypeV, paramTypeV}, paramTypeV,
+ OverloadExamples(
+ common.MultilineDescription(
+ `// pick the value for the given key if the key exists, otherwise return 'you'`,
+ `{'hello': 'world', 'goodbye': 'cruel world'}[?greeting].orValue('you')`)))),
// OptSelect is handled specially by the type-checker, so the receiver's field type is used to determine the
// optput type.
Function(operators.OptSelect,
- Overload("select_optional_field", []*Type{DynType, StringType}, optionalTypeV)),
+ FunctionDocs(`if the field is present create an optional of the field value, otherwise return optional.none()`),
+ Overload("select_optional_field", []*Type{DynType, StringType}, optionalTypeV,
+ OverloadExamples(
+ `msg.?field // optional.of(field) if non-empty, otherwise optional.none()`,
+ `msg.?field.?nested_field // optional.of(nested_field) if both field and nested_field are non-empty.`))),
// OptIndex is handled mostly like any other indexing operation on a list or map, so the type-checker can use
// these signatures to determine type-agreement without any special handling.
Function(operators.OptIndex,
- Overload("list_optindex_optional_int", []*Type{listTypeV, IntType}, optionalTypeV),
+ FunctionDocs(`if the index is present create an optional of the field value, otherwise return optional.none()`),
+ Overload("list_optindex_optional_int", []*Type{listTypeV, IntType}, optionalTypeV,
+ OverloadExamples(`[1, 2, 3][?x] // element value if x is in the list size, else optional.none()`)),
Overload("optional_list_optindex_optional_int", []*Type{OptionalType(listTypeV), IntType}, optionalTypeV),
- Overload("map_optindex_optional_value", []*Type{mapTypeKV, paramTypeK}, optionalTypeV),
+ Overload("map_optindex_optional_value", []*Type{mapTypeKV, paramTypeK}, optionalTypeV,
+ OverloadExamples(
+ `map_value[?key] // value at the key if present, else optional.none()`,
+ common.MultilineDescription(
+ `// map key-value if index is a valid map key, else optional.none()`,
+ `{0: 2, 2: 4, 6: 8}[?index]`))),
Overload("optional_map_optindex_optional_value", []*Type{OptionalType(mapTypeKV), paramTypeK}, optionalTypeV)),
// Index overloads to accommodate using an optional value as the operand.
@@ -374,8 +526,65 @@ 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,
+ MacroDocs(`perform computation on the value if present and produce an optional value within the computation`),
+ MacroExamples(
+ common.MultilineDescription(
+ `// m = {'key': {}}`,
+ `m.?key.optFlatMap(k, k.?subkey) // optional.none()`),
+ common.MultilineDescription(
+ `// m = {'key': {'subkey': 'value'}}`,
+ `m.?key.optFlatMap(k, k.?subkey) // optional.of('value')`),
+ ))))
+ }
+
+ if lib.version >= 2 {
+ opts = append(opts, Function("last",
+ FunctionDocs(`return the last value in a list if present, otherwise optional.none()`),
+ MemberOverload("list_last", []*Type{listTypeV}, optionalTypeV,
+ OverloadExamples(
+ `[].last() // optional.none()`,
+ `[1, 2, 3].last() ? optional.of(3)`),
+ UnaryBinding(func(v ref.Val) ref.Val {
+ list := v.(traits.Lister)
+ sz := list.Size().(types.Int)
+ if sz == types.IntZero {
+ return types.OptionalNone
+ }
+ return types.OptionalOf(list.Get(types.Int(sz - 1)))
+ }),
+ ),
+ ))
+
+ opts = append(opts, Function("first",
+ FunctionDocs(`return the first value in a list if present, otherwise optional.none()`),
+ MemberOverload("list_first", []*Type{listTypeV}, optionalTypeV,
+ OverloadExamples(
+ `[].first() // optional.none()`,
+ `[1, 2, 3].first() ? optional.of(1)`),
+ UnaryBinding(func(v ref.Val) ref.Val {
+ list := v.(traits.Lister)
+ sz := list.Size().(types.Int)
+ if sz == types.IntZero {
+ return types.OptionalNone
+ }
+ return types.OptionalOf(list.Get(types.Int(0)))
+ }),
+ ),
+ ))
+
+ opts = append(opts, Function(optionalUnwrapFunc,
+ FunctionDocs(`convert a list of optional values to a list containing only value which are not optional.none()`),
+ Overload("optional_unwrap", []*Type{listOptionalTypeV}, listTypeV,
+ OverloadExamples(`optional.unwrap([optional.of(1), optional.none()]) // [1]`),
+ UnaryBinding(optUnwrap))))
+ opts = append(opts, Function(unwrapOptFunc,
+ FunctionDocs(`convert a list of optional values to a list containing only value which are not optional.none()`),
+ MemberOverload("optional_unwrapOpt", []*Type{listOptionalTypeV}, listTypeV,
+ OverloadExamples(`[optional.of(1), optional.none()].unwrapOpt() // [1]`),
+ UnaryBinding(optUnwrap))))
}
+
return opts
}
@@ -386,60 +595,82 @@ func (lib *optionalLib) ProgramOptions() []ProgramOption {
}
}
-func optMap(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *Error) {
+// Version returns the current version of the library.
+func (lib *optionalLib) Version() uint32 {
+ return lib.version
+}
+
+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, meh.Copy(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, meh.Copy(target)),
+ meh.NewLiteral(types.False),
+ meh.NewIdent(varName),
mapExpr,
),
- meh.GlobalCall(optionalNoneFunc),
+ meh.NewCall(optionalNoneFunc),
), nil
}
+func optUnwrap(value ref.Val) ref.Val {
+ list := value.(traits.Lister)
+ var unwrappedList []ref.Val
+ iter := list.Iterator()
+ for iter.HasNext() == types.True {
+ val := iter.Next()
+ opt, isOpt := val.(*types.Optional)
+ if !isOpt {
+ return types.WrapErr(fmt.Errorf("value %v is not optional", val))
+ }
+ if opt.HasValue() {
+ unwrappedList = append(unwrappedList, opt.GetValue())
+ }
+ }
+ return types.DefaultTypeAdapter.NativeToValue(unwrappedList)
+}
+
func enableOptionalSyntax() EnvOption {
return func(e *Env) (*Env, error) {
e.prsrOpts = append(e.prsrOpts, parser.EnableOptionalSyntax(true))
@@ -447,6 +678,12 @@ func enableOptionalSyntax() EnvOption {
}
}
+// EnableErrorOnBadPresenceTest enables error generation when a presence test or optional field
+// selection is performed on a primitive type.
+func EnableErrorOnBadPresenceTest(value bool) EnvOption {
+ return features(featureEnableErrorOnBadPresenceTest, value)
+}
+
func decorateOptionalOr(i interpreter.Interpretable) (interpreter.Interpretable, error) {
call, ok := i.(interpreter.InterpretableCall)
if !ok {
@@ -536,250 +773,99 @@ func (opt *evalOptionalOrValue) Eval(ctx interpreter.Activation) ref.Val {
return opt.rhs.Eval(ctx)
}
-type timeUTCLibrary struct{}
+type timeLegacyLibrary struct{}
-func (timeUTCLibrary) CompileOptions() []EnvOption {
+func (timeLegacyLibrary) CompileOptions() []EnvOption {
return timeOverloadDeclarations
}
-func (timeUTCLibrary) ProgramOptions() []ProgramOption {
+func (timeLegacyLibrary) ProgramOptions() []ProgramOption {
return []ProgramOption{}
}
// Declarations and functions which enable using UTC on time.Time inputs when the timezone is unspecified
// in the CEL expression.
var (
- utcTZ = types.String("UTC")
-
timeOverloadDeclarations = []EnvOption{
- Function(overloads.TimeGetHours,
- MemberOverload(overloads.DurationToHours, []*Type{DurationType}, IntType,
- UnaryBinding(types.DurationGetHours))),
- Function(overloads.TimeGetMinutes,
- MemberOverload(overloads.DurationToMinutes, []*Type{DurationType}, IntType,
- UnaryBinding(types.DurationGetMinutes))),
- Function(overloads.TimeGetSeconds,
- MemberOverload(overloads.DurationToSeconds, []*Type{DurationType}, IntType,
- UnaryBinding(types.DurationGetSeconds))),
- Function(overloads.TimeGetMilliseconds,
- MemberOverload(overloads.DurationToMilliseconds, []*Type{DurationType}, IntType,
- UnaryBinding(types.DurationGetMilliseconds))),
Function(overloads.TimeGetFullYear,
MemberOverload(overloads.TimestampToYear, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetFullYear(ts, utcTZ)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetFullYear, overloads.TimestampToYear, []ref.Val{})
}),
),
- MemberOverload(overloads.TimestampToYearWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(timestampGetFullYear),
- ),
),
Function(overloads.TimeGetMonth,
MemberOverload(overloads.TimestampToMonth, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetMonth(ts, utcTZ)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetMonth, overloads.TimestampToMonth, []ref.Val{})
}),
),
- MemberOverload(overloads.TimestampToMonthWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(timestampGetMonth),
- ),
),
Function(overloads.TimeGetDayOfYear,
MemberOverload(overloads.TimestampToDayOfYear, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetDayOfYear(ts, utcTZ)
- }),
- ),
- MemberOverload(overloads.TimestampToDayOfYearWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(func(ts, tz ref.Val) ref.Val {
- return timestampGetDayOfYear(ts, tz)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetDayOfYear, overloads.TimestampToDayOfYear, []ref.Val{})
}),
),
),
Function(overloads.TimeGetDayOfMonth,
MemberOverload(overloads.TimestampToDayOfMonthZeroBased, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetDayOfMonthZeroBased(ts, utcTZ)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetDayOfMonth, overloads.TimestampToDayOfMonthZeroBased, []ref.Val{})
}),
),
- MemberOverload(overloads.TimestampToDayOfMonthZeroBasedWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(timestampGetDayOfMonthZeroBased),
- ),
),
Function(overloads.TimeGetDate,
MemberOverload(overloads.TimestampToDayOfMonthOneBased, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetDayOfMonthOneBased(ts, utcTZ)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetDate, overloads.TimestampToDayOfMonthOneBased, []ref.Val{})
}),
),
- MemberOverload(overloads.TimestampToDayOfMonthOneBasedWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(timestampGetDayOfMonthOneBased),
- ),
),
Function(overloads.TimeGetDayOfWeek,
MemberOverload(overloads.TimestampToDayOfWeek, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetDayOfWeek(ts, utcTZ)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetDayOfWeek, overloads.TimestampToDayOfWeek, []ref.Val{})
}),
),
- MemberOverload(overloads.TimestampToDayOfWeekWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(timestampGetDayOfWeek),
- ),
),
Function(overloads.TimeGetHours,
MemberOverload(overloads.TimestampToHours, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetHours(ts, utcTZ)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetHours, overloads.TimestampToHours, []ref.Val{})
}),
),
- MemberOverload(overloads.TimestampToHoursWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(timestampGetHours),
- ),
),
Function(overloads.TimeGetMinutes,
MemberOverload(overloads.TimestampToMinutes, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetMinutes(ts, utcTZ)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetMinutes, overloads.TimestampToMinutes, []ref.Val{})
}),
),
- MemberOverload(overloads.TimestampToMinutesWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(timestampGetMinutes),
- ),
),
Function(overloads.TimeGetSeconds,
MemberOverload(overloads.TimestampToSeconds, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetSeconds(ts, utcTZ)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetSeconds, overloads.TimestampToSeconds, []ref.Val{})
}),
),
- MemberOverload(overloads.TimestampToSecondsWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(timestampGetSeconds),
- ),
),
Function(overloads.TimeGetMilliseconds,
MemberOverload(overloads.TimestampToMilliseconds, []*Type{TimestampType}, IntType,
UnaryBinding(func(ts ref.Val) ref.Val {
- return timestampGetMilliseconds(ts, utcTZ)
+ t := ts.(types.Timestamp)
+ return t.Receive(overloads.TimeGetMilliseconds, overloads.TimestampToMilliseconds, []ref.Val{})
}),
),
- MemberOverload(overloads.TimestampToMillisecondsWithTz, []*Type{TimestampType, StringType}, IntType,
- BinaryBinding(timestampGetMilliseconds),
- ),
),
}
)
-
-func timestampGetFullYear(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- return types.Int(t.Year())
-}
-
-func timestampGetMonth(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- // CEL spec indicates that the month should be 0-based, but the Time value
- // for Month() is 1-based.
- return types.Int(t.Month() - 1)
-}
-
-func timestampGetDayOfYear(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- return types.Int(t.YearDay() - 1)
-}
-
-func timestampGetDayOfMonthZeroBased(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- return types.Int(t.Day() - 1)
-}
-
-func timestampGetDayOfMonthOneBased(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- return types.Int(t.Day())
-}
-
-func timestampGetDayOfWeek(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- return types.Int(t.Weekday())
-}
-
-func timestampGetHours(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- return types.Int(t.Hour())
-}
-
-func timestampGetMinutes(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- return types.Int(t.Minute())
-}
-
-func timestampGetSeconds(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- return types.Int(t.Second())
-}
-
-func timestampGetMilliseconds(ts, tz ref.Val) ref.Val {
- t, err := inTimeZone(ts, tz)
- if err != nil {
- return types.NewErr(err.Error())
- }
- return types.Int(t.Nanosecond() / 1000000)
-}
-
-func inTimeZone(ts, tz ref.Val) (time.Time, error) {
- t := ts.(types.Timestamp)
- val := string(tz.(types.String))
- ind := strings.Index(val, ":")
- if ind == -1 {
- loc, err := time.LoadLocation(val)
- if err != nil {
- return time.Time{}, err
- }
- return t.In(loc), nil
- }
-
- // If the input is not the name of a timezone (for example, 'US/Central'), it should be a numerical offset from UTC
- // in the format ^(+|-)(0[0-9]|1[0-4]):[0-5][0-9]$. The numerical input is parsed in terms of hours and minutes.
- hr, err := strconv.Atoi(string(val[0:ind]))
- if err != nil {
- return time.Time{}, err
- }
- min, err := strconv.Atoi(string(val[ind+1:]))
- if err != nil {
- return time.Time{}, err
- }
- var offset int
- if string(val[0]) == "-" {
- offset = hr*60 - min
- } else {
- offset = hr*60 + min
- }
- secondsEastOfUTC := int((time.Duration(offset) * time.Minute).Seconds())
- timezone := time.FixedZone("", secondsEastOfUTC)
- return t.In(timezone), nil
-}
diff --git a/vendor/github.com/google/cel-go/cel/macro.go b/vendor/github.com/google/cel-go/cel/macro.go
index 1eb414c8be4c..3d3c5be1b7cf 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,211 @@ 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
+}
+
+// MacroOpt defines a functional option for configuring macro behavior.
+type MacroOpt = parser.MacroOpt
+
+// MacroDocs configures a list of strings into a multiline description for the macro.
+func MacroDocs(docs ...string) MacroOpt {
+ return parser.MacroDocs(docs...)
+}
+
+// MacroExamples configures a list of examples, either as a string or common.MultilineString,
+// into an example set to be provided with the macro Documentation() call.
+func MacroExamples(examples ...string) MacroOpt {
+ return parser.MacroExamples(examples...)
+}
+
+// GlobalMacro creates a Macro for a global function with the specified arg count.
+func GlobalMacro(function string, argCount int, factory MacroFactory, opts ...MacroOpt) Macro {
+ return parser.NewGlobalMacro(function, argCount, factory, opts...)
+}
+
+// ReceiverMacro creates a Macro for a receiver function matching the specified arg count.
+func ReceiverMacro(function string, argCount int, factory MacroFactory, opts ...MacroOpt) Macro {
+ return parser.NewReceiverMacro(function, argCount, factory, opts...)
+}
+
+// GlobalVarArgMacro creates a Macro for a global function with a variable arg count.
+func GlobalVarArgMacro(function string, factory MacroFactory, opts ...MacroOpt) Macro {
+ return parser.NewGlobalVarArgMacro(function, factory, opts...)
+}
+
+// ReceiverVarArgMacro creates a Macro for a receiver function matching a variable arg count.
+func ReceiverVarArgMacro(function string, factory MacroFactory, opts ...MacroOpt) Macro {
+ return parser.NewReceiverVarArgMacro(function, factory, opts...)
+}
// 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 +266,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 +333,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 000000000000..9a2a97a6477c
--- /dev/null
+++ b/vendor/github.com/google/cel-go/cel/optimizer.go
@@ -0,0 +1,535 @@
+// 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 (
+ "sort"
+
+ "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.NativeRep())
+ ids := newIDGenerator(ast.MaxID(a.NativeRep()))
+
+ // 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.NativeRep()
+ }
+
+ // 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
+ }
+
+ // Sort the macro ids to make sure that the renumbering of macro-specific variables
+ // is stable across normalization calls.
+ sortedMacroIDs := []int64{}
+ for id := range info.MacroCalls() {
+ sortedMacroIDs = append(sortedMacroIDs, id)
+ }
+ sort.Slice(sortedMacroIDs, func(i, j int) bool { return sortedMacroIDs[i] < sortedMacroIDs[j] })
+
+ // First, update the macro call ids themselves.
+ callIDMap := map[int64]int64{}
+ for _, id := range sortedMacroIDs {
+ 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 := range sortedMacroIDs {
+ newID := callIDMap[oldID]
+ 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
+}
+
+// ExtendEnv auguments the context's environment with the additional options.
+func (opt *OptimizerContext) ExtendEnv(opts ...EnvOption) error {
+ e, err := opt.Env.Extend(opts...)
+ if err != nil {
+ return err
+ }
+ opt.Env = e
+ return nil
+}
+
+// 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)
+}
+
+// MacroCalls returns the map of macro calls currently in the context.
+func (opt *optimizerExprFactory) MacroCalls() map[int64]ast.Expr {
+ return opt.sourceInfo.MacroCalls()
+}
+
+// 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 05867730d36b..fee67323c8f8 100644
--- a/vendor/github.com/google/cel-go/cel/options.go
+++ b/vendor/github.com/google/cel-go/cel/options.go
@@ -15,6 +15,7 @@
package cel
import (
+ "errors"
"fmt"
"google.golang.org/protobuf/proto"
@@ -25,6 +26,8 @@ import (
"github.com/google/cel-go/checker"
"github.com/google/cel-go/common/containers"
+ "github.com/google/cel-go/common/decls"
+ "github.com/google/cel-go/common/env"
"github.com/google/cel-go/common/functions"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/pb"
@@ -61,8 +64,35 @@ const (
// compressing the logic graph to a single call when multiple like-operator
// expressions occur: e.g. a && b && c && d -> call(_&&_, [a, b, c, d])
featureVariadicLogicalASTs
+
+ // Enable error generation when a presence test or optional field selection is
+ // performed on a primitive type.
+ featureEnableErrorOnBadPresenceTest
+
+ // Enable escape syntax for field identifiers (`).
+ featureIdentEscapeSyntax
)
+var featureIDsToNames = map[int]string{
+ featureEnableMacroCallTracking: "cel.feature.macro_call_tracking",
+ featureCrossTypeNumericComparisons: "cel.feature.cross_type_numeric_comparisons",
+ featureIdentEscapeSyntax: "cel.feature.backtick_escape_syntax",
+}
+
+func featureNameByID(id int) (string, bool) {
+ name, found := featureIDsToNames[id]
+ return name, found
+}
+
+func featureIDByName(name string) (int, bool) {
+ for id, n := range featureIDsToNames {
+ if n == name {
+ return id, true
+ }
+ }
+ return 0, false
+}
+
// EnvOption is a functional interface for configuring the environment.
type EnvOption func(e *Env) (*Env, error)
@@ -105,6 +135,8 @@ func CustomTypeProvider(provider any) EnvOption {
// Note: Declarations will by default be appended to the pre-existing declaration set configured
// for the environment. The NewEnv call builds on top of the standard CEL declarations. For a
// purely custom set of declarations use NewCustomEnv.
+//
+// Deprecated: use FunctionDecls and VariableDecls or FromConfig instead.
func Declarations(decls ...*exprpb.Decl) EnvOption {
declOpts := []EnvOption{}
var err error
@@ -243,6 +275,13 @@ func Abbrevs(qualifiedNames ...string) EnvOption {
}
}
+// customTypeRegistry is an internal-only interface containing the minimum methods required to support
+// custom types. It is a subset of methods from ref.TypeRegistry.
+type customTypeRegistry interface {
+ RegisterDescriptor(protoreflect.FileDescriptor) error
+ RegisterType(...ref.Type) error
+}
+
// Types adds one or more type declarations to the environment, allowing for construction of
// type-literals whose definitions are included in the common expression built-in set.
//
@@ -255,12 +294,7 @@ func Abbrevs(qualifiedNames ...string) EnvOption {
// Note: This option must be specified after the CustomTypeProvider option when used together.
func Types(addTypes ...any) EnvOption {
return func(e *Env) (*Env, error) {
- var reg ref.TypeRegistry
- var isReg bool
- reg, isReg = e.provider.(*types.Registry)
- if !isReg {
- reg, isReg = e.provider.(ref.TypeRegistry)
- }
+ reg, isReg := e.provider.(customTypeRegistry)
if !isReg {
return nil, fmt.Errorf("custom types not supported by provider: %T", e.provider)
}
@@ -297,7 +331,7 @@ func Types(addTypes ...any) EnvOption {
// extension or by re-using the same EnvOption with another NewEnv() call.
func TypeDescs(descs ...any) EnvOption {
return func(e *Env) (*Env, error) {
- reg, isReg := e.provider.(ref.TypeRegistry)
+ reg, isReg := e.provider.(customTypeRegistry)
if !isReg {
return nil, fmt.Errorf("custom types not supported by provider: %T", e.provider)
}
@@ -345,7 +379,7 @@ func TypeDescs(descs ...any) EnvOption {
}
}
-func registerFileSet(reg ref.TypeRegistry, fileSet *descpb.FileDescriptorSet) error {
+func registerFileSet(reg customTypeRegistry, fileSet *descpb.FileDescriptorSet) error {
files, err := protodesc.NewFiles(fileSet)
if err != nil {
return fmt.Errorf("protodesc.NewFiles(%v) failed: %v", fileSet, err)
@@ -353,7 +387,7 @@ func registerFileSet(reg ref.TypeRegistry, fileSet *descpb.FileDescriptorSet) er
return registerFiles(reg, files)
}
-func registerFiles(reg ref.TypeRegistry, files *protoregistry.Files) error {
+func registerFiles(reg customTypeRegistry, files *protoregistry.Files) error {
var err error
files.RangeFiles(func(fd protoreflect.FileDescriptor) bool {
err = reg.RegisterDescriptor(fd)
@@ -370,7 +404,7 @@ type ProgramOption func(p *prog) (*prog, error)
// InterpretableDecorators can be used to inspect, alter, or replace the Program plan.
func CustomDecorator(dec interpreter.InterpretableDecorator) ProgramOption {
return func(p *prog) (*prog, error) {
- p.decorators = append(p.decorators, dec)
+ p.plannerOptions = append(p.plannerOptions, interpreter.CustomDecorator(dec))
return p, nil
}
}
@@ -392,10 +426,10 @@ func Functions(funcs ...*functions.Overload) ProgramOption {
// variables with the same name provided to the Eval() call. If Globals is used in a Library with
// a Lib EnvOption, vars may shadow variables provided by previously added libraries.
//
-// The vars value may either be an `interpreter.Activation` instance or a `map[string]any`.
+// The vars value may either be an `cel.Activation` instance or a `map[string]any`.
func Globals(vars any) ProgramOption {
return func(p *prog) (*prog, error) {
- defaultVars, err := interpreter.NewActivation(vars)
+ defaultVars, err := NewActivation(vars)
if err != nil {
return nil, err
}
@@ -417,6 +451,174 @@ func OptimizeRegex(regexOptimizations ...*interpreter.RegexOptimization) Program
}
}
+// ConfigOptionFactory declares a signature which accepts a configuration element, e.g. env.Extension
+// and optionally produces an EnvOption in response.
+//
+// If there are multiple ConfigOptionFactory values which could apply to the same configuration node
+// the first one that returns an EnvOption and a `true` response will be used, and the config node
+// will not be passed along to any other option factory.
+//
+// Only the *env.Extension type is provided at this time, but validators, optimizers, and other tuning
+// parameters may be supported in the future.
+type ConfigOptionFactory func(any) (EnvOption, bool)
+
+// FromConfig produces and applies a set of EnvOption values derived from an env.Config object.
+//
+// For configuration elements which refer to features outside of the `cel` package, an optional set of
+// ConfigOptionFactory values may be passed in to support the conversion from static configuration to
+// configured cel.Env value.
+//
+// Note: disabling the standard library will clear the EnvOptions values previously set for the
+// environment with the exception of propagating types and adapters over to the new environment.
+//
+// Note: to support custom types referenced in the configuration file, you must ensure that one of
+// the following options appears before the FromConfig option: Types, TypeDescs, or CustomTypeProvider
+// as the type provider configured at the time when the config is processed is the one used to derive
+// type references from the configuration.
+func FromConfig(config *env.Config, optFactories ...ConfigOptionFactory) EnvOption {
+ return func(e *Env) (*Env, error) {
+ if err := config.Validate(); err != nil {
+ return nil, err
+ }
+ opts, err := configToEnvOptions(config, e.CELTypeProvider(), optFactories)
+ if err != nil {
+ return nil, err
+ }
+ for _, o := range opts {
+ e, err = o(e)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return e, nil
+ }
+}
+
+// configToEnvOptions generates a set of EnvOption values (or error) based on a config, a type provider,
+// and an optional set of environment options.
+func configToEnvOptions(config *env.Config, provider types.Provider, optFactories []ConfigOptionFactory) ([]EnvOption, error) {
+ envOpts := []EnvOption{}
+ // Configure the standard lib subset.
+ if config.StdLib != nil {
+ envOpts = append(envOpts, func(e *Env) (*Env, error) {
+ if e.HasLibrary("cel.lib.std") {
+ return nil, errors.New("invalid subset of stdlib: create a custom env")
+ }
+ return e, nil
+ })
+ if !config.StdLib.Disabled {
+ envOpts = append(envOpts, StdLib(StdLibSubset(config.StdLib)))
+ }
+ } else {
+ envOpts = append(envOpts, StdLib())
+ }
+
+ // Configure the container
+ if config.Container != "" {
+ envOpts = append(envOpts, Container(config.Container))
+ }
+
+ // Configure abbreviations
+ for _, imp := range config.Imports {
+ envOpts = append(envOpts, Abbrevs(imp.Name))
+ }
+
+ // Configure the context variable declaration
+ if config.ContextVariable != nil {
+ typeName := config.ContextVariable.TypeName
+ if _, found := provider.FindStructType(typeName); !found {
+ return nil, fmt.Errorf("invalid context proto type: %q", typeName)
+ }
+ // Attempt to instantiate the proto in order to reflect to its descriptor
+ msg := provider.NewValue(typeName, map[string]ref.Val{})
+ pbMsg, ok := msg.Value().(proto.Message)
+ if !ok {
+ return nil, fmt.Errorf("unsupported context type: %T", msg.Value())
+ }
+ envOpts = append(envOpts, DeclareContextProto(pbMsg.ProtoReflect().Descriptor()))
+ }
+
+ // Configure variables
+ if len(config.Variables) != 0 {
+ vars := make([]*decls.VariableDecl, 0, len(config.Variables))
+ for _, v := range config.Variables {
+ vDef, err := v.AsCELVariable(provider)
+ if err != nil {
+ return nil, err
+ }
+ vars = append(vars, vDef)
+ }
+ envOpts = append(envOpts, VariableDecls(vars...))
+ }
+
+ // Configure functions
+ if len(config.Functions) != 0 {
+ funcs := make([]*decls.FunctionDecl, 0, len(config.Functions))
+ for _, f := range config.Functions {
+ fnDef, err := f.AsCELFunction(provider)
+ if err != nil {
+ return nil, err
+ }
+ funcs = append(funcs, fnDef)
+ }
+ envOpts = append(envOpts, FunctionDecls(funcs...))
+ }
+
+ // Configure features
+ for _, feat := range config.Features {
+ // Note, if a feature is not found, it is skipped as it is possible the feature
+ // is not intended to be supported publicly. In the future, a refinement of
+ // to this strategy to report unrecognized features and validators should probably
+ // be covered as a standard ConfigOptionFactory
+ if id, found := featureIDByName(feat.Name); found {
+ envOpts = append(envOpts, features(id, feat.Enabled))
+ }
+ }
+
+ // Configure validators
+ for _, val := range config.Validators {
+ if fac, found := astValidatorFactories[val.Name]; found {
+ envOpts = append(envOpts, func(e *Env) (*Env, error) {
+ validator, err := fac(val)
+ if err != nil {
+ return nil, fmt.Errorf("%w", err)
+ }
+ return ASTValidators(validator)(e)
+ })
+ } else if opt, handled := handleExtendedConfigOption(val, optFactories); handled {
+ envOpts = append(envOpts, opt)
+ }
+ // we don't error when the validator isn't found as it may be part
+ // of an extension library and enabled implicitly.
+ }
+
+ // Configure extensions
+ for _, ext := range config.Extensions {
+ // version number has been validated by the call to `Validate`
+ ver, _ := ext.VersionNumber()
+ if ext.Name == "optional" {
+ envOpts = append(envOpts, OptionalTypes(OptionalTypesVersion(ver)))
+ } else {
+ opt, handled := handleExtendedConfigOption(ext, optFactories)
+ if !handled {
+ return nil, fmt.Errorf("unrecognized extension: %s", ext.Name)
+ }
+ envOpts = append(envOpts, opt)
+ }
+ }
+
+ return envOpts, nil
+}
+
+func handleExtendedConfigOption(conf any, optFactories []ConfigOptionFactory) (EnvOption, bool) {
+ for _, optFac := range optFactories {
+ if opt, useOption := optFac(conf); useOption {
+ return opt, true
+ }
+ }
+ return nil, false
+}
+
// EvalOption indicates an evaluation option that may affect the evaluation behavior or information
// in the output result.
type EvalOption int
@@ -448,6 +650,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
)
@@ -523,7 +727,7 @@ func fieldToCELType(field protoreflect.FieldDescriptor) (*Type, error) {
return nil, fmt.Errorf("field %s type %s not implemented", field.FullName(), field.Kind().String())
}
-func fieldToVariable(field protoreflect.FieldDescriptor) (EnvOption, error) {
+func fieldToVariable(field protoreflect.FieldDescriptor) (*decls.VariableDecl, error) {
name := string(field.Name())
if field.IsMap() {
mapKey := field.MapKey()
@@ -536,20 +740,20 @@ func fieldToVariable(field protoreflect.FieldDescriptor) (EnvOption, error) {
if err != nil {
return nil, err
}
- return Variable(name, MapType(keyType, valueType)), nil
+ return decls.NewVariable(name, MapType(keyType, valueType)), nil
}
if field.IsList() {
elemType, err := fieldToCELType(field)
if err != nil {
return nil, err
}
- return Variable(name, ListType(elemType)), nil
+ return decls.NewVariable(name, ListType(elemType)), nil
}
celType, err := fieldToCELType(field)
if err != nil {
return nil, err
}
- return Variable(name, celType), nil
+ return decls.NewVariable(name, celType), nil
}
// DeclareContextProto returns an option to extend CEL environment with declarations from the given context proto.
@@ -557,17 +761,25 @@ func fieldToVariable(field protoreflect.FieldDescriptor) (EnvOption, error) {
// https://github.com/google/cel-spec/blob/master/doc/langdef.md#evaluation-environment
func DeclareContextProto(descriptor protoreflect.MessageDescriptor) EnvOption {
return func(e *Env) (*Env, error) {
+ if e.contextProto != nil {
+ return nil, fmt.Errorf("context proto already declared as %q, got %q",
+ e.contextProto.FullName(), descriptor.FullName())
+ }
+ e.contextProto = descriptor
fields := descriptor.Fields()
+ vars := make([]*decls.VariableDecl, 0, fields.Len())
for i := 0; i < fields.Len(); i++ {
field := fields.Get(i)
variable, err := fieldToVariable(field)
if err != nil {
return nil, err
}
- e, err = variable(e)
- if err != nil {
- return nil, err
- }
+ vars = append(vars, variable)
+ }
+ var err error
+ e, err = VariableDecls(vars...)(e)
+ if err != nil {
+ return nil, err
}
return Types(dynamicpb.NewMessage(descriptor))(e)
}
@@ -577,7 +789,7 @@ func DeclareContextProto(descriptor protoreflect.MessageDescriptor) EnvOption {
//
// Consider using with `DeclareContextProto` to simplify variable type declarations and publishing when using
// protocol buffers.
-func ContextProtoVars(ctx proto.Message) (interpreter.Activation, error) {
+func ContextProtoVars(ctx proto.Message) (Activation, error) {
if ctx == nil || !ctx.ProtoReflect().IsValid() {
return interpreter.EmptyActivation(), nil
}
@@ -601,7 +813,7 @@ func ContextProtoVars(ctx proto.Message) (interpreter.Activation, error) {
}
vars[field.TextName()] = fieldVal
}
- return interpreter.NewActivation(vars)
+ return NewActivation(vars)
}
// EnableMacroCallTracking ensures that call expressions which are replaced by macros
@@ -610,6 +822,12 @@ func EnableMacroCallTracking() EnvOption {
return features(featureEnableMacroCallTracking, true)
}
+// EnableIdentifierEscapeSyntax enables identifier escaping (`) syntax for
+// fields.
+func EnableIdentifierEscapeSyntax() EnvOption {
+ return features(featureIdentEscapeSyntax, true)
+}
+
// CrossTypeNumericComparisons makes it possible to compare across numeric types, e.g. double < int
func CrossTypeNumericComparisons(enabled bool) EnvOption {
return features(featureCrossTypeNumericComparisons, enabled)
@@ -647,6 +865,15 @@ func ParserExpressionSizeLimit(limit int) EnvOption {
}
}
+// EnableHiddenAccumulatorName sets the parser to use the identifier '@result' for accumulators
+// which is not normally accessible from CEL source.
+func EnableHiddenAccumulatorName(enabled bool) EnvOption {
+ return func(e *Env) (*Env, error) {
+ e.prsrOpts = append(e.prsrOpts, parser.EnableHiddenAccumulatorName(enabled))
+ return e, nil
+ }
+}
+
func maybeInteropProvider(provider any) (types.Provider, error) {
switch p := provider.(type) {
case types.Provider:
diff --git a/vendor/github.com/google/cel-go/cel/program.go b/vendor/github.com/google/cel-go/cel/program.go
index 2dd72f75010c..24f41a4a77ee 100644
--- a/vendor/github.com/google/cel-go/cel/program.go
+++ b/vendor/github.com/google/cel-go/cel/program.go
@@ -19,7 +19,7 @@ import (
"fmt"
"sync"
- celast "github.com/google/cel-go/common/ast"
+ "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"
@@ -29,7 +29,7 @@ import (
type Program interface {
// Eval returns the result of an evaluation of the Ast and environment against the input vars.
//
- // The vars value may either be an `interpreter.Activation` or a `map[string]any`.
+ // The vars value may either be an `Activation` or a `map[string]any`.
//
// If the `OptTrackState`, `OptTrackCost` or `OptExhaustiveEval` flags are used, the `details` response will
// be non-nil. Given this caveat on `details`, the return state from evaluation will be:
@@ -47,14 +47,39 @@ type Program interface {
// to support cancellation and timeouts. This method must be used in conjunction with the
// InterruptCheckFrequency() option for cancellation interrupts to be impact evaluation.
//
- // The vars value may either be an `interpreter.Activation` or `map[string]any`.
+ // The vars value may either be an `Activation` or `map[string]any`.
//
// The output contract for `ContextEval` is otherwise identical to the `Eval` method.
ContextEval(context.Context, any) (ref.Val, *EvalDetails, error)
}
+// Activation used to resolve identifiers by name and references by id.
+//
+// An Activation is the primary mechanism by which a caller supplies input into a CEL program.
+type Activation = interpreter.Activation
+
+// NewActivation returns an activation based on a map-based binding where the map keys are
+// expected to be qualified names used with ResolveName calls.
+//
+// The input `bindings` may either be of type `Activation` or `map[string]any`.
+//
+// Lazy bindings may be supplied within the map-based input in either of the following forms:
+// - func() any
+// - func() ref.Val
+//
+// The output of the lazy binding will overwrite the variable reference in the internal map.
+//
+// Values which are not represented as ref.Val types on input may be adapted to a ref.Val using
+// the types.Adapter configured in the environment.
+func NewActivation(bindings any) (Activation, error) {
+ return interpreter.NewActivation(bindings)
+}
+
+// PartialActivation extends the Activation interface with a set of unknown AttributePatterns.
+type PartialActivation = interpreter.PartialActivation
+
// NoVars returns an empty Activation.
-func NoVars() interpreter.Activation {
+func NoVars() Activation {
return interpreter.EmptyActivation()
}
@@ -64,10 +89,9 @@ func NoVars() interpreter.Activation {
// This method relies on manually configured sets of missing attribute patterns. For a method which
// infers the missing variables from the input and the configured environment, use Env.PartialVars().
//
-// The `vars` value may either be an interpreter.Activation or any valid input to the
-// interpreter.NewActivation call.
+// The `vars` value may either be an Activation or any valid input to the NewActivation call.
func PartialVars(vars any,
- unknowns ...*interpreter.AttributePattern) (interpreter.PartialActivation, error) {
+ unknowns ...*AttributePatternType) (PartialActivation, error) {
return interpreter.NewPartialActivation(vars, unknowns...)
}
@@ -84,12 +108,15 @@ func PartialVars(vars any,
// fully qualified variable name may be `ns.app.a`, `ns.a`, or `a` per the CEL namespace resolution
// rules. Pick the fully qualified variable name that makes sense within the container as the
// AttributePattern `varName` argument.
+func AttributePattern(varName string) *AttributePatternType {
+ return interpreter.NewAttributePattern(varName)
+}
+
+// AttributePatternType represents a top-level variable with an optional set of qualifier patterns.
//
// See the interpreter.AttributePattern and interpreter.AttributeQualifierPattern for more info
// about how to create and manipulate AttributePattern values.
-func AttributePattern(varName string) *interpreter.AttributePattern {
- return interpreter.NewAttributePattern(varName)
-}
+type AttributePatternType = interpreter.AttributePattern
// EvalDetails holds additional information observed during the Eval() call.
type EvalDetails struct {
@@ -100,6 +127,9 @@ type EvalDetails struct {
// State of the evaluation, non-nil if the OptTrackState or OptExhaustiveEval is specified
// within EvalOptions.
func (ed *EvalDetails) State() interpreter.EvalState {
+ if ed == nil {
+ return interpreter.NewEvalState()
+ }
return ed.state
}
@@ -117,52 +147,39 @@ func (ed *EvalDetails) ActualCost() *uint64 {
type prog struct {
*Env
evalOpts EvalOption
- defaultVars interpreter.Activation
+ defaultVars Activation
dispatcher interpreter.Dispatcher
interpreter interpreter.Interpreter
interruptCheckFrequency uint
// Intermediate state used to configure the InterpretableDecorator set provided
// to the initInterpretable call.
- decorators []interpreter.InterpretableDecorator
+ plannerOptions []interpreter.PlannerOption
regexOptimizations []*interpreter.RegexOptimization
// Interpretable configured from an Ast and aggregate decorator set based on program options.
interpretable interpreter.Interpretable
+ observable *interpreter.ObservableInterpretable
callCostEstimator interpreter.ActualCostEstimator
costOptions []interpreter.CostTrackerOption
costLimit *uint64
}
-func (p *prog) clone() *prog {
- costOptsCopy := make([]interpreter.CostTrackerOption, len(p.costOptions))
- copy(costOptsCopy, p.costOptions)
-
- return &prog{
- Env: p.Env,
- evalOpts: p.evalOpts,
- defaultVars: p.defaultVars,
- dispatcher: p.dispatcher,
- interpreter: p.interpreter,
- interruptCheckFrequency: p.interruptCheckFrequency,
- }
-}
-
// newProgram creates a program instance with an environment, an ast, and an optional list of
// 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.AST, opts []ProgramOption) (Program, error) {
// Build the dispatcher, interpreter, and default program value.
disp := interpreter.NewDispatcher()
// Ensure the default attribute factory is set after the adapter and provider are
// configured.
p := &prog{
- Env: e,
- decorators: []interpreter.InterpretableDecorator{},
- dispatcher: disp,
- costOptions: []interpreter.CostTrackerOption{},
+ Env: e,
+ plannerOptions: []interpreter.PlannerOption{},
+ dispatcher: disp,
+ costOptions: []interpreter.CostTrackerOption{},
}
// Configure the program via the ProgramOption values.
@@ -188,128 +205,83 @@ func newProgram(e *Env, ast *Ast, opts []ProgramOption) (Program, error) {
// Set the attribute factory after the options have been set.
var attrFactory interpreter.AttributeFactory
+ attrFactorOpts := []interpreter.AttrFactoryOption{
+ interpreter.EnableErrorOnBadPresenceTest(p.HasFeature(featureEnableErrorOnBadPresenceTest)),
+ }
if p.evalOpts&OptPartialEval == OptPartialEval {
- attrFactory = interpreter.NewPartialAttributeFactory(e.Container, e.adapter, e.provider)
+ attrFactory = interpreter.NewPartialAttributeFactory(e.Container, e.adapter, e.provider, attrFactorOpts...)
} else {
- attrFactory = interpreter.NewAttributeFactory(e.Container, e.adapter, e.provider)
+ attrFactory = interpreter.NewAttributeFactory(e.Container, e.adapter, e.provider, attrFactorOpts...)
}
interp := interpreter.NewInterpreter(disp, e.Container, e.provider, e.adapter, attrFactory)
p.interpreter = interp
// Translate the EvalOption flags into InterpretableDecorator instances.
- decorators := make([]interpreter.InterpretableDecorator, len(p.decorators))
- copy(decorators, p.decorators)
+ plannerOptions := make([]interpreter.PlannerOption, len(p.plannerOptions))
+ copy(plannerOptions, p.plannerOptions)
// Enable interrupt checking if there's a non-zero check frequency
if p.interruptCheckFrequency > 0 {
- decorators = append(decorators, interpreter.InterruptableEval())
+ plannerOptions = append(plannerOptions, interpreter.InterruptableEval())
}
// Enable constant folding first.
if p.evalOpts&OptOptimize == OptOptimize {
- decorators = append(decorators, interpreter.Optimize())
+ plannerOptions = append(plannerOptions, interpreter.Optimize())
p.regexOptimizations = append(p.regexOptimizations, interpreter.MatchesRegexOptimization)
}
// Enable regex compilation of constants immediately after folding constants.
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))
+ plannerOptions = append(plannerOptions, interpreter.CompileRegexConstants(p.regexOptimizations...))
}
// Enable exhaustive eval, state tracking and cost tracking last since they require a factory.
if p.evalOpts&(OptExhaustiveEval|OptTrackState|OptTrackCost) != 0 {
- factory := func(state interpreter.EvalState, costTracker *interpreter.CostTracker) (Program, error) {
- costTracker.Estimator = p.callCostEstimator
- costTracker.Limit = p.costLimit
- for _, costOpt := range p.costOptions {
- err := costOpt(costTracker)
- if err != nil {
- return nil, err
- }
- }
- // Limit capacity to guarantee a reallocation when calling 'append(decs, ...)' below. This
- // prevents the underlying memory from being shared between factory function calls causing
- // undesired mutations.
- decs := decorators[:len(decorators):len(decorators)]
- var observers []interpreter.EvalObserver
-
- if p.evalOpts&(OptExhaustiveEval|OptTrackState) != 0 {
- // EvalStateObserver is required for OptExhaustiveEval.
- observers = append(observers, interpreter.EvalStateObserver(state))
- }
- if p.evalOpts&OptTrackCost == OptTrackCost {
- observers = append(observers, interpreter.CostObserver(costTracker))
- }
-
- // Enable exhaustive eval over a basic observer since it offers a superset of features.
- if p.evalOpts&OptExhaustiveEval == OptExhaustiveEval {
- decs = append(decs, interpreter.ExhaustiveEval(), interpreter.Observe(observers...))
- } else if len(observers) > 0 {
- decs = append(decs, interpreter.Observe(observers...))
- }
-
- return p.clone().initInterpretable(ast, decs)
+ costOptCount := len(p.costOptions)
+ if p.costLimit != nil {
+ costOptCount++
}
- return newProgGen(factory)
- }
- return p.initInterpretable(ast, 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
+ costOpts := make([]interpreter.CostTrackerOption, 0, costOptCount)
+ costOpts = append(costOpts, p.costOptions...)
+ if p.costLimit != nil {
+ costOpts = append(costOpts, interpreter.CostTrackerLimit(*p.costLimit))
+ }
+ trackerFactory := func() (*interpreter.CostTracker, error) {
+ return interpreter.NewCostTracker(p.callCostEstimator, costOpts...)
+ }
+ var observers []interpreter.PlannerOption
+ if p.evalOpts&(OptExhaustiveEval|OptTrackState) != 0 {
+ // EvalStateObserver is required for OptExhaustiveEval.
+ observers = append(observers, interpreter.EvalStateObserver())
+ }
+ if p.evalOpts&OptTrackCost == OptTrackCost {
+ observers = append(observers, interpreter.CostObserver(interpreter.CostTrackerFactory(trackerFactory)))
+ }
+ // Enable exhaustive eval over a basic observer since it offers a superset of features.
+ if p.evalOpts&OptExhaustiveEval == OptExhaustiveEval {
+ plannerOptions = append(plannerOptions,
+ append([]interpreter.PlannerOption{interpreter.ExhaustiveEval()}, observers...)...)
+ } else if len(observers) > 0 {
+ plannerOptions = append(plannerOptions, observers...)
}
- p.interpretable = interpretable
- return p, nil
}
+ return p.initInterpretable(a, plannerOptions)
+}
- // 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.AST, plannerOptions []interpreter.PlannerOption) (*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, plannerOptions...)
if err != nil {
return nil, err
}
p.interpretable = interpretable
+ if oi, ok := interpretable.(*interpreter.ObservableInterpretable); ok {
+ p.observable = oi
+ }
return p, nil
}
// Eval implements the Program interface method.
-func (p *prog) Eval(input any) (v ref.Val, det *EvalDetails, err error) {
+func (p *prog) Eval(input any) (out ref.Val, det *EvalDetails, err error) {
// Configure error recovery for unexpected panics during evaluation. Note, the use of named
// return values makes it possible to modify the error response during the recovery
// function.
@@ -324,9 +296,9 @@ func (p *prog) Eval(input any) (v ref.Val, det *EvalDetails, err error) {
}
}()
// Build a hierarchical activation if there are default vars set.
- var vars interpreter.Activation
+ var vars Activation
switch v := input.(type) {
- case interpreter.Activation:
+ case Activation:
vars = v
case map[string]any:
vars = activationPool.Setup(v)
@@ -337,12 +309,24 @@ func (p *prog) Eval(input any) (v ref.Val, det *EvalDetails, err error) {
if p.defaultVars != nil {
vars = interpreter.NewHierarchicalActivation(p.defaultVars, vars)
}
- v = p.interpretable.Eval(vars)
+ if p.observable != nil {
+ det = &EvalDetails{}
+ out = p.observable.ObserveEval(vars, func(observed any) {
+ switch o := observed.(type) {
+ case interpreter.EvalState:
+ det.state = o
+ case *interpreter.CostTracker:
+ det.costTracker = o
+ }
+ })
+ } else {
+ out = p.interpretable.Eval(vars)
+ }
// The output of an internal Eval may have a value (`v`) that is a types.Err. This step
// translates the CEL value to a Go error response. This interface does not quite match the
// RPC signature which allows for multiple errors to be returned, but should be sufficient.
- if types.IsError(v) {
- err = v.(*types.Err)
+ if types.IsError(out) {
+ err = out.(*types.Err)
}
return
}
@@ -354,9 +338,9 @@ func (p *prog) ContextEval(ctx context.Context, input any) (ref.Val, *EvalDetail
}
// Configure the input, making sure to wrap Activation inputs in the special ctxActivation which
// exposes the #interrupted variable and manages rate-limited checks of the ctx.Done() state.
- var vars interpreter.Activation
+ var vars Activation
switch v := input.(type) {
- case interpreter.Activation:
+ case Activation:
vars = ctxActivationPool.Setup(v, ctx.Done(), p.interruptCheckFrequency)
defer ctxActivationPool.Put(vars)
case map[string]any:
@@ -370,90 +354,8 @@ func (p *prog) ContextEval(ctx context.Context, input any) (ref.Val, *EvalDetail
return p.Eval(vars)
}
-// progFactory is a helper alias for marking a program creation factory function.
-type progFactory func(interpreter.EvalState, *interpreter.CostTracker) (Program, error)
-
-// progGen holds a reference to a progFactory instance and implements the Program interface.
-type progGen struct {
- factory progFactory
-}
-
-// newProgGen tests the factory object by calling it once and returns a factory-based Program if
-// the test is successful.
-func newProgGen(factory progFactory) (Program, error) {
- // Test the factory to make sure that configuration errors are spotted at config
- tracker, err := interpreter.NewCostTracker(nil)
- if err != nil {
- return nil, err
- }
- _, err = factory(interpreter.NewEvalState(), tracker)
- if err != nil {
- return nil, err
- }
- return &progGen{factory: factory}, nil
-}
-
-// Eval implements the Program interface method.
-func (gen *progGen) Eval(input any) (ref.Val, *EvalDetails, error) {
- // The factory based Eval() differs from the standard evaluation model in that it generates a
- // new EvalState instance for each call to ensure that unique evaluations yield unique stateful
- // results.
- state := interpreter.NewEvalState()
- costTracker, err := interpreter.NewCostTracker(nil)
- if err != nil {
- return nil, nil, err
- }
- det := &EvalDetails{state: state, costTracker: costTracker}
-
- // Generate a new instance of the interpretable using the factory configured during the call to
- // newProgram(). It is incredibly unlikely that the factory call will generate an error given
- // the factory test performed within the Program() call.
- p, err := gen.factory(state, costTracker)
- if err != nil {
- return nil, det, err
- }
-
- // Evaluate the input, returning the result and the 'state' within EvalDetails.
- v, _, err := p.Eval(input)
- if err != nil {
- return v, det, err
- }
- return v, det, nil
-}
-
-// ContextEval implements the Program interface method.
-func (gen *progGen) ContextEval(ctx context.Context, input any) (ref.Val, *EvalDetails, error) {
- if ctx == nil {
- return nil, nil, fmt.Errorf("context can not be nil")
- }
- // The factory based Eval() differs from the standard evaluation model in that it generates a
- // new EvalState instance for each call to ensure that unique evaluations yield unique stateful
- // results.
- state := interpreter.NewEvalState()
- costTracker, err := interpreter.NewCostTracker(nil)
- if err != nil {
- return nil, nil, err
- }
- det := &EvalDetails{state: state, costTracker: costTracker}
-
- // Generate a new instance of the interpretable using the factory configured during the call to
- // newProgram(). It is incredibly unlikely that the factory call will generate an error given
- // the factory test performed within the Program() call.
- p, err := gen.factory(state, costTracker)
- if err != nil {
- return nil, det, err
- }
-
- // Evaluate the input, returning the result and the 'state' within EvalDetails.
- v, _, err := p.ContextEval(ctx, input)
- if err != nil {
- return v, det, err
- }
- return v, det, nil
-}
-
type ctxEvalActivation struct {
- parent interpreter.Activation
+ parent Activation
interrupt <-chan struct{}
interruptCheckCount uint
interruptCheckFrequency uint
@@ -477,10 +379,15 @@ func (a *ctxEvalActivation) ResolveName(name string) (any, bool) {
return a.parent.ResolveName(name)
}
-func (a *ctxEvalActivation) Parent() interpreter.Activation {
+func (a *ctxEvalActivation) Parent() Activation {
return a.parent
}
+func (a *ctxEvalActivation) AsPartialActivation() (interpreter.PartialActivation, bool) {
+ pa, ok := a.parent.(interpreter.PartialActivation)
+ return pa, ok
+}
+
func newCtxEvalActivationPool() *ctxEvalActivationPool {
return &ctxEvalActivationPool{
Pool: sync.Pool{
@@ -496,7 +403,7 @@ type ctxEvalActivationPool struct {
}
// Setup initializes a pooled Activation with the ability check for context.Context cancellation
-func (p *ctxEvalActivationPool) Setup(vars interpreter.Activation, done <-chan struct{}, interruptCheckRate uint) *ctxEvalActivation {
+func (p *ctxEvalActivationPool) Setup(vars Activation, done <-chan struct{}, interruptCheckRate uint) *ctxEvalActivation {
a := p.Pool.Get().(*ctxEvalActivation)
a.parent = vars
a.interrupt = done
@@ -545,8 +452,8 @@ func (a *evalActivation) ResolveName(name string) (any, bool) {
}
}
-// Parent implements the interpreter.Activation interface
-func (a *evalActivation) Parent() interpreter.Activation {
+// Parent implements the Activation interface
+func (a *evalActivation) Parent() Activation {
return nil
}
@@ -580,8 +487,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/prompt.go b/vendor/github.com/google/cel-go/cel/prompt.go
new file mode 100644
index 000000000000..929a26f91f97
--- /dev/null
+++ b/vendor/github.com/google/cel-go/cel/prompt.go
@@ -0,0 +1,155 @@
+// Copyright 2025 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
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 (
+ _ "embed"
+ "sort"
+ "strings"
+ "text/template"
+
+ "github.com/google/cel-go/common"
+ "github.com/google/cel-go/common/operators"
+ "github.com/google/cel-go/common/overloads"
+)
+
+//go:embed templates/authoring.tmpl
+var authoringPrompt string
+
+// AuthoringPrompt creates a prompt template from a CEL environment for the purpose of AI-assisted authoring.
+func AuthoringPrompt(env *Env) (*Prompt, error) {
+ funcMap := template.FuncMap{
+ "split": func(str string) []string { return strings.Split(str, "\n") },
+ }
+ tmpl := template.New("cel").Funcs(funcMap)
+ tmpl, err := tmpl.Parse(authoringPrompt)
+ if err != nil {
+ return nil, err
+ }
+ return &Prompt{
+ Persona: defaultPersona,
+ FormatRules: defaultFormatRules,
+ GeneralUsage: defaultGeneralUsage,
+ tmpl: tmpl,
+ env: env,
+ }, nil
+}
+
+// Prompt represents the core components of an LLM prompt based on a CEL environment.
+//
+// All fields of the prompt may be overwritten / modified with support for rendering the
+// prompt to a human-readable string.
+type Prompt struct {
+ // Persona indicates something about the kind of user making the request
+ Persona string
+
+ // FormatRules indicate how the LLM should generate its output
+ FormatRules string
+
+ // GeneralUsage specifies additional context on how CEL should be used.
+ GeneralUsage string
+
+ // tmpl is the text template base-configuration for rendering text.
+ tmpl *template.Template
+
+ // env reference used to collect variables, functions, and macros available to the prompt.
+ env *Env
+}
+
+type promptInst struct {
+ *Prompt
+
+ Variables []*common.Doc
+ Macros []*common.Doc
+ Functions []*common.Doc
+ UserPrompt string
+}
+
+// Render renders the user prompt with the associated context from the prompt template
+// for use with LLM generators.
+func (p *Prompt) Render(userPrompt string) string {
+ var buffer strings.Builder
+ vars := make([]*common.Doc, len(p.env.Variables()))
+ for i, v := range p.env.Variables() {
+ vars[i] = v.Documentation()
+ }
+ sort.SliceStable(vars, func(i, j int) bool {
+ return vars[i].Name < vars[j].Name
+ })
+ macs := make([]*common.Doc, len(p.env.Macros()))
+ for i, m := range p.env.Macros() {
+ macs[i] = m.(common.Documentor).Documentation()
+ }
+ funcs := make([]*common.Doc, 0, len(p.env.Functions()))
+ for _, f := range p.env.Functions() {
+ if _, hidden := hiddenFunctions[f.Name()]; hidden {
+ continue
+ }
+ funcs = append(funcs, f.Documentation())
+ }
+ sort.SliceStable(funcs, func(i, j int) bool {
+ return funcs[i].Name < funcs[j].Name
+ })
+ inst := &promptInst{
+ Prompt: p,
+ Variables: vars,
+ Macros: macs,
+ Functions: funcs,
+ UserPrompt: userPrompt}
+ p.tmpl.Execute(&buffer, inst)
+ return buffer.String()
+}
+
+const (
+ defaultPersona = `You are a software engineer with expertise in networking and application security
+authoring boolean Common Expression Language (CEL) expressions to ensure firewall,
+networking, authentication, and data access is only permitted when all conditions
+are satisfied.`
+
+ defaultFormatRules = `Output your response as a CEL expression.
+
+Write the expression with the comment on the first line and the expression on the
+subsequent lines. Format the expression using 80-character line limits commonly
+found in C++ or Java code.`
+
+ defaultGeneralUsage = `CEL supports Protocol Buffer and JSON types, as well as simple types and aggregate types.
+
+Simple types include bool, bytes, double, int, string, and uint:
+
+* double literals must always include a decimal point: 1.0, 3.5, -2.2
+* uint literals must be positive values suffixed with a 'u': 42u
+* byte literals are strings prefixed with a 'b': b'1235'
+* string literals can use either single quotes or double quotes: 'hello', "world"
+* string literals can also be treated as raw strings that do not require any
+ escaping within the string by using the 'R' prefix: R"""quote: "hi" """
+
+Aggregate types include list and map:
+
+* list literals consist of zero or more values between brackets: "['a', 'b', 'c']"
+* map literal consist of colon-separated key-value pairs within braces: "{'key1': 1, 'key2': 2}"
+* Only int, uint, string, and bool types are valid map keys.
+* Maps containing HTTP headers must always use lower-cased string keys.
+
+Comments start with two-forward slashes followed by text and a newline.`
+)
+
+var (
+ hiddenFunctions = map[string]bool{
+ overloads.DeprecatedIn: true,
+ operators.OldIn: true,
+ operators.OldNotStrictlyFalse: true,
+ operators.NotStrictlyFalse: true,
+ }
+)
diff --git a/vendor/github.com/google/cel-go/cel/templates/authoring.tmpl b/vendor/github.com/google/cel-go/cel/templates/authoring.tmpl
new file mode 100644
index 000000000000..d6b3da5c6c0b
--- /dev/null
+++ b/vendor/github.com/google/cel-go/cel/templates/authoring.tmpl
@@ -0,0 +1,56 @@
+{{define "variable"}}{{.Name}} is a {{.Type}}
+{{- end -}}
+
+{{define "macro" -}}
+{{.Name}} macro{{if .Description}} - {{range split .Description}}{{.}} {{end}}
+{{end}}
+{{range .Children}}{{range split .Description}} {{.}}
+{{end}}
+{{- end -}}
+{{- end -}}
+
+{{define "overload" -}}
+{{if .Children}}{{range .Children}}{{range split .Description}} {{.}}
+{{end}}
+{{- end -}}
+{{else}} {{.Signature}}
+{{end}}
+{{- end -}}
+
+{{define "function" -}}
+{{.Name}}{{if .Description}} - {{range split .Description}}{{.}} {{end}}
+{{end}}
+{{range .Children}}{{template "overload" .}}{{end}}
+{{- end -}}
+
+{{.Persona}}
+
+{{.FormatRules}}
+
+{{if or .Variables .Macros .Functions -}}
+Only use the following variables, macros, and functions in expressions.
+{{if .Variables}}
+Variables:
+
+{{range .Variables}}* {{template "variable" .}}
+{{end -}}
+
+{{end -}}
+{{if .Macros}}
+Macros:
+
+{{range .Macros}}* {{template "macro" .}}
+{{end -}}
+
+{{end -}}
+{{if .Functions}}
+Functions:
+
+{{range .Functions}}* {{template "function" .}}
+{{end -}}
+
+{{end -}}
+{{- end -}}
+{{.GeneralUsage}}
+
+{{.UserPrompt}}
diff --git a/vendor/github.com/google/cel-go/cel/validator.go b/vendor/github.com/google/cel-go/cel/validator.go
index 78b311381867..5f06b2dd55f3 100644
--- a/vendor/github.com/google/cel-go/cel/validator.go
+++ b/vendor/github.com/google/cel-go/cel/validator.go
@@ -20,13 +20,16 @@ import (
"regexp"
"github.com/google/cel-go/common/ast"
+ "github.com/google/cel-go/common/env"
"github.com/google/cel-go/common/overloads"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
const (
- homogeneousValidatorName = "cel.lib.std.validate.types.homogeneous"
+ durationValidatorName = "cel.validator.duration"
+ regexValidatorName = "cel.validator.matches"
+ timestampValidatorName = "cel.validator.timestamp"
+ homogeneousValidatorName = "cel.validator.homogeneous_literals"
+ nestingLimitValidatorName = "cel.validator.comprehension_nesting_limit"
// HomogeneousAggregateLiteralExemptFunctions is the ValidatorConfig key used to configure
// the set of function names which are exempt from homogeneous type checks. The expected type
@@ -38,6 +41,35 @@ const (
HomogeneousAggregateLiteralExemptFunctions = homogeneousValidatorName + ".exempt"
)
+var (
+ astValidatorFactories = map[string]ASTValidatorFactory{
+ nestingLimitValidatorName: func(val *env.Validator) (ASTValidator, error) {
+ if limit, found := val.ConfigValue("limit"); found {
+ if val, isInt := limit.(int); isInt {
+ return ValidateComprehensionNestingLimit(val), nil
+ }
+ return nil, fmt.Errorf("invalid validator: %s unsupported limit type: %v", nestingLimitValidatorName, limit)
+ }
+ return nil, fmt.Errorf("invalid validator: %s missing limit", nestingLimitValidatorName)
+ },
+ durationValidatorName: func(*env.Validator) (ASTValidator, error) {
+ return ValidateDurationLiterals(), nil
+ },
+ regexValidatorName: func(*env.Validator) (ASTValidator, error) {
+ return ValidateRegexLiterals(), nil
+ },
+ timestampValidatorName: func(*env.Validator) (ASTValidator, error) {
+ return ValidateTimestampLiterals(), nil
+ },
+ homogeneousValidatorName: func(*env.Validator) (ASTValidator, error) {
+ return ValidateHomogeneousAggregateLiterals(), nil
+ },
+ }
+)
+
+// ASTValidatorFactory creates an ASTValidator as configured by the input map
+type ASTValidatorFactory func(*env.Validator) (ASTValidator, error)
+
// ASTValidators configures a set of ASTValidator instances into the target environment.
//
// Validators are applied in the order in which the are specified and are treated as singletons.
@@ -69,7 +101,19 @@ 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)
+}
+
+// ConfigurableASTValidator supports conversion of an object to an `env.Validator` instance used for
+// YAML serialization.
+type ConfigurableASTValidator interface {
+ // ToConfig converts the internal configuration of an ASTValidator into an env.Validator instance
+ // which minimally must include the validator name, but may also include a map[string]any config
+ // object to be serialized to YAML. The string keys represent the configuration parameter name,
+ // and the any value must mirror the internally supported type associated with the config key.
+ //
+ // Note: only primitive CEL types are supported by CEL validators at this time.
+ ToConfig() *env.Validator
}
// ValidatorConfig provides an accessor method for querying validator configuration state.
@@ -180,7 +224,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{
@@ -198,13 +242,18 @@ type formatValidator struct {
// Name returns the unique name of this function format validator.
func (v formatValidator) Name() string {
- return fmt.Sprintf("cel.lib.std.validate.functions.%s", v.funcName)
+ return fmt.Sprintf("cel.validator.%s", v.funcName)
+}
+
+// ToConfig converts the ASTValidator to an env.Validator specifying the validator name.
+func (v formatValidator) ToConfig() *env.Validator {
+ return env.NewValidator(v.Name())
}
// 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 +270,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 +280,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 +293,19 @@ 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)
+// ToConfig converts the ASTValidator to an env.Validator specifying the validator name.
+func (v homogeneousAggregateLiteralValidator) ToConfig() *env.Validator {
+ return env.NewValidator(v.Name())
}
// 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 +316,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 +339,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 +360,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 +370,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
}
@@ -349,12 +392,20 @@ type nestingLimitValidator struct {
limit int
}
+// Name returns the name of the nesting limit validator.
func (v nestingLimitValidator) Name() string {
- return "cel.lib.std.validate.comprehension_nesting_limit"
+ return nestingLimitValidatorName
+}
+
+// ToConfig converts the ASTValidator to an env.Validator specifying the validator name and the nesting limit
+// as an integer value: {"limit": int}
+func (v nestingLimitValidator) ToConfig() *env.Validator {
+ return env.NewValidator(v.Name()).SetConfig(map[string]any{"limit": v.limit})
}
-func (v nestingLimitValidator) Validate(e *Env, _ ValidatorConfig, a *ast.CheckedAST, iss *Issues) {
- root := ast.NavigateCheckedAST(a)
+// Validate implements the ASTValidator interface method.
+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 0459d35239f8..678b412a955d 100644
--- a/vendor/github.com/google/cel-go/checker/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/checker/BUILD.bazel
@@ -16,7 +16,6 @@ go_library(
"options.go",
"printer.go",
"scopes.go",
- "standard.go",
"types.go",
],
importpath = "github.com/google/cel-go/checker",
@@ -60,7 +59,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 720e4fa968f4..0057c16ccb58 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,37 @@ 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()
+ if len(call.Args()) != 2 || call.IsMemberFunction() {
+ t := ""
+ if call.IsMemberFunction() {
+ t = " member call with"
+ }
+ c.errors.notAnOptionalFieldSelectionCall(e.ID(), c.location(e),
+ fmt.Sprintf(
+ "incorrect signature.%s argument count: %d", t, len(call.Args())))
+ return
+ }
+
+ 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 +170,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 +188,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 +202,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 +214,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 +252,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 +261,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 +277,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 +295,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 +327,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 +373,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 +407,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 +437,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 +469,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,45 +477,62 @@ 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)
- var varType *types.Type
+func (c *checker) checkComprehension(e ast.Expr) {
+ comp := e.AsComprehension()
+ c.check(comp.IterRange())
+ c.check(comp.AccuInit())
+ rangeType := substitute(c.mappings, c.getType(comp.IterRange()), false)
+ // 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.
+ accuType := c.getType(comp.AccuInit())
+ c.env = c.env.enterScope()
+ c.env.AddIdents(decls.NewVariable(comp.AccuVar(), accuType))
+
+ var varType, var2Type *types.Type
switch rangeType.Kind() {
case types.ListKind:
+ // varType represents the list element type for one-variable comprehensions.
varType = rangeType.Parameters()[0]
+ if comp.HasIterVar2() {
+ // varType represents the list index (int) for two-variable comprehensions,
+ // and var2Type represents the list element type.
+ var2Type = varType
+ varType = types.IntType
+ }
case types.MapKind:
- // Ranges over the keys.
+ // varType represents the map entry key for all comprehension types.
varType = rangeType.Parameters()[0]
+ if comp.HasIterVar2() {
+ // var2Type represents the map entry value for two-variable comprehensions.
+ var2Type = rangeType.Parameters()[1]
+ }
case types.DynKind, types.ErrorKind, types.TypeParamKind:
// Set the range type to DYN to prevent assignment to a potentially incorrect type
// at a later point in type-checking. The isAssignable call will update the type
@@ -563,33 +540,38 @@ func (c *checker) checkComprehension(e *exprpb.Expr) {
c.isAssignable(types.DynType, rangeType)
// Set the range iteration variable to type DYN as well.
varType = types.DynType
+ if comp.HasIterVar2() {
+ var2Type = 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
+ if comp.HasIterVar2() {
+ var2Type = 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))
// 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))
+ if comp.HasIterVar2() {
+ c.env.AddIdents(decls.NewVariable(comp.IterVar2(), var2Type))
+ }
// 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 +581,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 +615,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 +665,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 f232f30daca4..5bc6318ed080 100644
--- a/vendor/github.com/google/cel-go/checker/cost.go
+++ b/vendor/github.com/google/cel-go/checker/cost.go
@@ -22,23 +22,26 @@ 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
// CostEstimator estimates the sizes of variable length input data and the costs of functions.
type CostEstimator interface {
- // EstimateSize returns a SizeEstimate for the given AstNode, or nil if
- // the estimator has no estimate to provide. The size is equivalent to the result of the CEL `size()` function:
- // length of strings and bytes, number of map entries or number of list items.
- // EstimateSize is only called for AstNodes where
- // CEL does not know the size; EstimateSize is not called for values defined inline in CEL where the size
- // is already obvious to CEL.
+ // EstimateSize returns a SizeEstimate for the given AstNode, or nil if the estimator has no
+ // estimate to provide.
+ //
+ // The size is equivalent to the result of the CEL `size()` function:
+ // * Number of unicode characters in a string
+ // * Number of bytes in a sequence
+ // * Number of map entries or number of list items.
+ //
+ // EstimateSize is only called for AstNodes where CEL does not know the size; EstimateSize is not
+ // called for values defined inline in CEL where the size is already obvious to CEL.
EstimateSize(element AstNode) *SizeEstimate
- // EstimateCallCost returns the estimated cost of an invocation, or nil if
- // the estimator has no estimate to provide.
+
+ // EstimateCallCost returns the estimated cost of an invocation, or nil if the estimator has no
+ // estimate to provide.
EstimateCallCost(function, overloadID string, target *AstNode, args []AstNode) *CallEstimate
}
@@ -46,6 +49,7 @@ type CostEstimator interface {
// The ResultSize should only be provided if the call results in a map, list, string or bytes.
type CallEstimate struct {
CostEstimate
+
ResultSize *SizeEstimate
}
@@ -55,10 +59,13 @@ type AstNode interface {
// represent type directly reachable from the provided type declarations.
// The first path element is a variable. All subsequent path elements are one of: field name, '@items', '@keys', '@values'.
Path() []string
+
// 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 +76,7 @@ type AstNode interface {
type astNode struct {
path []string
t *types.Type
- expr *exprpb.Expr
+ expr ast.Expr
derivedSize *SizeEstimate
}
@@ -81,43 +88,12 @@ func (e astNode) Type() *types.Type {
return e.t
}
-func (e astNode) Expr() *exprpb.Expr {
+func (e astNode) Expr() ast.Expr {
return e.expr
}
func (e astNode) ComputedSize() *SizeEstimate {
- if e.derivedSize != nil {
- 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:
- // 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(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()))
- }
- default:
- return nil
- }
-
- return &SizeEstimate{Min: v, Max: v}
+ return e.derivedSize
}
// SizeEstimate represents an estimated size of a variable length string, bytes, map or list.
@@ -125,6 +101,16 @@ type SizeEstimate struct {
Min, Max uint64
}
+// UnknownSizeEstimate returns a size between 0 and max uint
+func UnknownSizeEstimate() SizeEstimate {
+ return unknownSizeEstimate
+}
+
+// FixedSizeEstimate returns a size estimate with a fixed min and max range.
+func FixedSizeEstimate(size uint64) SizeEstimate {
+ return SizeEstimate{Min: size, Max: size}
+}
+
// Add adds to another SizeEstimate and returns the sum.
// If add would result in an uint64 overflow, the result is math.MaxUint64.
func (se SizeEstimate) Add(sizeEstimate SizeEstimate) SizeEstimate {
@@ -179,12 +165,22 @@ type CostEstimate struct {
Min, Max uint64
}
+// UnknownCostEstimate returns a cost with an unknown impact.
+func UnknownCostEstimate() CostEstimate {
+ return unknownCostEstimate
+}
+
+// FixedCostEstimate returns a cost with a fixed min and max range.
+func FixedCostEstimate(cost uint64) CostEstimate {
+ return CostEstimate{Min: cost, Max: cost}
+}
+
// Add adds the costs and returns the sum.
// If add would result in an uint64 overflow for the min or max, the value is set to math.MaxUint64.
func (ce CostEstimate) Add(cost CostEstimate) CostEstimate {
return CostEstimate{
- addUint64NoOverflow(ce.Min, cost.Min),
- addUint64NoOverflow(ce.Max, cost.Max),
+ Min: addUint64NoOverflow(ce.Min, cost.Min),
+ Max: addUint64NoOverflow(ce.Max, cost.Max),
}
}
@@ -192,8 +188,8 @@ func (ce CostEstimate) Add(cost CostEstimate) CostEstimate {
// If multiply would result in an uint64 overflow, the result is math.MaxUint64.
func (ce CostEstimate) Multiply(cost CostEstimate) CostEstimate {
return CostEstimate{
- multiplyUint64NoOverflow(ce.Min, cost.Min),
- multiplyUint64NoOverflow(ce.Max, cost.Max),
+ Min: multiplyUint64NoOverflow(ce.Min, cost.Min),
+ Max: multiplyUint64NoOverflow(ce.Max, cost.Max),
}
}
@@ -201,8 +197,8 @@ func (ce CostEstimate) Multiply(cost CostEstimate) CostEstimate {
// nearest integer of the result, rounded up.
func (ce CostEstimate) MultiplyByCostFactor(costPerUnit float64) CostEstimate {
return CostEstimate{
- multiplyByCostFactor(ce.Min, costPerUnit),
- multiplyByCostFactor(ce.Max, costPerUnit),
+ Min: multiplyByCostFactor(ce.Min, costPerUnit),
+ Max: multiplyByCostFactor(ce.Max, costPerUnit),
}
}
@@ -249,49 +245,6 @@ func multiplyByCostFactor(x uint64, y float64) uint64 {
return uint64(ceil)
}
-var (
- selectAndIdentCost = CostEstimate{Min: common.SelectAndIdentCost, Max: common.SelectAndIdentCost}
- constCost = CostEstimate{Min: common.ConstCost, Max: common.ConstCost}
-
- createListBaseCost = CostEstimate{Min: common.ListCreateBaseCost, Max: common.ListCreateBaseCost}
- createMapBaseCost = CostEstimate{Min: common.MapCreateBaseCost, Max: common.MapCreateBaseCost}
- createMessageBaseCost = CostEstimate{Min: common.StructCreateBaseCost, Max: common.StructCreateBaseCost}
-)
-
-type coster struct {
- // exprPath maps from Expr Id to field path.
- exprPath map[int64][]string
- // iterRanges tracks the iterRange of each iterVar.
- iterRanges iterRangeScopes
- // computedSizes tracks the computed sizes of call results.
- computedSizes map[int64]SizeEstimate
- checkedAST *ast.CheckedAST
- estimator CostEstimator
- overloadEstimators map[string]FunctionEstimator
- // presenceTestCost will either be a zero or one based on whether has() macros count against cost computations.
- presenceTestCost CostEstimate
-}
-
-// 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) pop(varName string) {
- varStack := vs[varName]
- vs[varName] = varStack[:len(varStack)-1]
-}
-
-func (vs iterRangeScopes) peek(varName string) (int64, bool) {
- varStack := vs[varName]
- if len(varStack) > 0 {
- return varStack[len(varStack)-1], true
- }
- return 0, false
-}
-
// CostOption configures flags which affect cost computations.
type CostOption func(*coster) error
@@ -304,7 +257,7 @@ func PresenceTestHasCost(hasCost bool) CostOption {
c.presenceTestCost = selectAndIdentCost
return nil
}
- c.presenceTestCost = CostEstimate{Min: 0, Max: 0}
+ c.presenceTestCost = FixedCostEstimate(0)
return nil
}
}
@@ -324,15 +277,16 @@ 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{},
- iterRanges: map[string][]int64{},
+ exprPaths: map[int64][]string{},
+ localVars: make(scopes),
computedSizes: map[int64]SizeEstimate{},
- presenceTestCost: CostEstimate{Min: 1, Max: 1},
+ computedEntrySizes: map[int64]entrySizeEstimate{},
+ presenceTestCost: FixedCostEstimate(1),
}
for _, opt := range opts {
err := opt(c)
@@ -340,83 +294,244 @@ 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 {
+type coster struct {
+ // exprPaths maps from Expr Id to field path.
+ exprPaths map[int64][]string
+ // localVars tracks the local and iteration variables assigned during evaluation.
+ localVars scopes
+ // computedSizes tracks the computed sizes of call results.
+ computedSizes map[int64]SizeEstimate
+ // computedEntrySizes tracks the size of list and map entries
+ computedEntrySizes map[int64]entrySizeEstimate
+
+ 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.
+ presenceTestCost CostEstimate
+}
+
+// entrySizeEstimate captures the container kind and associated key/index and value SizeEstimate values.
+//
+// An entrySizeEstimate only exists if both the key/index and the value have SizeEstimate values, otherwise
+// a nil entrySizeEstimate should be used.
+type entrySizeEstimate struct {
+ containerKind types.Kind
+ key SizeEstimate
+ val SizeEstimate
+}
+
+// container returns the container kind (list or map) of the entry.
+func (s *entrySizeEstimate) container() types.Kind {
+ if s == nil {
+ return types.UnknownKind
+ }
+ return s.containerKind
+}
+
+// keySize returns the SizeEstimate for the key if one exists.
+func (s *entrySizeEstimate) keySize() *SizeEstimate {
+ if s == nil {
+ return nil
+ }
+ return &s.key
+}
+
+// valSize returns the SizeEstimate for the value if one exists.
+func (s *entrySizeEstimate) valSize() *SizeEstimate {
+ if s == nil {
+ return nil
+ }
+ return &s.val
+}
+
+func (s *entrySizeEstimate) union(other *entrySizeEstimate) *entrySizeEstimate {
+ if s == nil || other == nil {
+ return nil
+ }
+ sk := s.key.Union(other.key)
+ sv := s.val.Union(other.val)
+ return &entrySizeEstimate{
+ containerKind: s.containerKind,
+ key: sk,
+ val: sv,
+ }
+}
+
+// localVar captures the local variable size and entrySize estimates if they exist for variables
+type localVar struct {
+ exprID int64
+ path []string
+ size *SizeEstimate
+ entrySize *entrySizeEstimate
+}
+
+// scopes is a stack of variable name to integer id stack to handle scopes created by cel.bind() like macros
+type scopes map[string][]*localVar
+
+func (s scopes) push(varName string, expr ast.Expr, path []string, size *SizeEstimate, entrySize *entrySizeEstimate) {
+ s[varName] = append(s[varName], &localVar{
+ exprID: expr.ID(),
+ path: path,
+ size: size,
+ entrySize: entrySize,
+ })
+}
+
+func (s scopes) pop(varName string) {
+ varStack := s[varName]
+ s[varName] = varStack[:len(varStack)-1]
+}
+
+func (s scopes) peek(varName string) (*localVar, bool) {
+ varStack := s[varName]
+ if len(varStack) > 0 {
+ return varStack[len(varStack)-1], true
+ }
+ return nil, false
+}
+
+func (c *coster) pushIterKey(varName string, rangeExpr ast.Expr) {
+ entrySize := c.computeEntrySize(rangeExpr)
+ size := entrySize.keySize()
+ path := c.getPath(rangeExpr)
+ container := entrySize.container()
+ if container == types.UnknownKind {
+ container = c.getType(rangeExpr).Kind()
+ }
+ subpath := "@keys"
+ if container == types.ListKind {
+ subpath = "@indices"
+ }
+ c.localVars.push(varName, rangeExpr, append(path, subpath), size, nil)
+}
+
+func (c *coster) pushIterValue(varName string, rangeExpr ast.Expr) {
+ entrySize := c.computeEntrySize(rangeExpr)
+ size := entrySize.valSize()
+ path := c.getPath(rangeExpr)
+ container := entrySize.container()
+ if container == types.UnknownKind {
+ container = c.getType(rangeExpr).Kind()
+ }
+ subpath := "@values"
+ if container == types.ListKind {
+ subpath = "@items"
+ }
+ c.localVars.push(varName, rangeExpr, append(path, subpath), size, nil)
+}
+
+func (c *coster) pushIterSingle(varName string, rangeExpr ast.Expr) {
+ entrySize := c.computeEntrySize(rangeExpr)
+ size := entrySize.keySize()
+ subpath := "@keys"
+ container := entrySize.container()
+ if container == types.UnknownKind {
+ container = c.getType(rangeExpr).Kind()
+ }
+ if container == types.ListKind {
+ size = entrySize.valSize()
+ subpath = "@items"
+ }
+ path := c.getPath(rangeExpr)
+ c.localVars.push(varName, rangeExpr, append(path, subpath), size, nil)
+}
+
+func (c *coster) pushLocalVar(varName string, e ast.Expr) {
+ path := c.getPath(e)
+ // note: retrieve the entry size for the local variable based on the size of the binding expression
+ // since the binding expression could be a list or map, the entry size should also be propagated
+ entrySize := c.computeEntrySize(e)
+ c.localVars.push(varName, e, path, c.computeSize(e), entrySize)
+}
+
+func (c *coster) peekLocalVar(varName string) (*localVar, bool) {
+ return c.localVars.peek(varName)
+}
+
+func (c *coster) popLocalVar(varName string) {
+ c.localVars.pop(varName)
+}
+
+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:
- cost = c.costComprehension(e)
+ case ast.ComprehensionKind:
+ if c.isBind(e) {
+ cost = c.costBind(e)
+ } else {
+ cost = c.costComprehension(e)
+ }
default:
return 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() {
- case types.ListKind:
- c.addPath(e, append(c.exprPath[iterRange], "@items"))
- case types.MapKind:
- c.addPath(e, append(c.exprPath[iterRange], "@keys"))
- }
+ if v, ok := c.peekLocalVar(identName); ok {
+ c.addPath(e, v.path)
} 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 {
+ // Dyn is just a way to disable type-checking, so return the cost of 1 with the cost of the argument
+ if dynEstimate := c.maybeUnwrapDynCall(e); dynEstimate != nil {
+ return *dynEstimate
+ }
+ // Continue estimating the cost of all other calls.
+ call := e.AsCall()
+ args := call.Args()
var sum CostEstimate
argTypes := make([]AstNode, len(args))
@@ -426,22 +541,21 @@ 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())
- }
+ var targetType *AstNode
+ if call.IsMemberFunction() {
+ sum = sum.Add(c.cost(call.Target()))
+ var t AstNode = c.newAstNode(call.Target())
+ targetType = &t
}
// 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(e, call.FunctionName(), overload, targetType, argTypes, argCosts)
fnCost = fnCost.Union(overloadCost.CostEstimate)
if overloadCost.ResultSize != nil {
if resultSize == nil {
@@ -455,97 +569,161 @@ func (c *coster) costCall(e *exprpb.Expr) CostEstimate {
switch overload {
case overloads.IndexList:
if len(args) > 0 {
+ // note: assigning resultSize here could be redundant with the path-based lookup later
+ resultSize = c.computeEntrySize(args[0]).valSize()
c.addPath(e, append(c.getPath(args[0]), "@items"))
}
case overloads.IndexMap:
if len(args) > 0 {
+ resultSize = c.computeEntrySize(args[0]).valSize()
c.addPath(e, append(c.getPath(args[0]), "@values"))
}
}
+ if resultSize == nil {
+ resultSize = c.computeSize(e)
+ }
}
- if resultSize != nil {
- c.computedSizes[e.GetId()] = *resultSize
- }
+ c.setSize(e, resultSize)
return sum.Add(fnCost)
}
-func (c *coster) costCreateList(e *exprpb.Expr) CostEstimate {
- create := e.GetListExpr()
- var sum CostEstimate
- for _, e := range create.GetElements() {
- sum = sum.Add(c.cost(e))
+func (c *coster) maybeUnwrapDynCall(e ast.Expr) *CostEstimate {
+ call := e.AsCall()
+ if call.FunctionName() != "dyn" {
+ return nil
}
- return sum.Add(createListBaseCost)
+ arg := call.Args()[0]
+ argCost := c.cost(arg)
+ c.copySizeEstimates(e, arg)
+ callCost := FixedCostEstimate(1).Add(argCost)
+ return &callCost
}
-func (c *coster) costCreateStruct(e *exprpb.Expr) CostEstimate {
- str := e.GetStructExpr()
- if str.MessageName != "" {
- return c.costCreateMessage(e)
+func (c *coster) costCreateList(e ast.Expr) CostEstimate {
+ create := e.AsList()
+ var sum CostEstimate
+ itemSize := SizeEstimate{Min: math.MaxUint64, Max: 0}
+ if create.Size() == 0 {
+ itemSize.Min = 0
+ }
+ for _, e := range create.Elements() {
+ sum = sum.Add(c.cost(e))
+ is := c.sizeOrUnknown(e)
+ itemSize = itemSize.Union(is)
}
- return c.costCreateMap(e)
+ c.setEntrySize(e, &entrySizeEstimate{containerKind: types.ListKind, key: FixedSizeEstimate(1), val: itemSize})
+ return sum.Add(createListBaseCost)
}
-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()))
+ keySize := SizeEstimate{Min: math.MaxUint64, Max: 0}
+ valSize := SizeEstimate{Min: math.MaxUint64, Max: 0}
+ if mapVal.Size() == 0 {
+ valSize.Min = 0
+ keySize.Min = 0
}
+ for _, ent := range mapVal.Entries() {
+ entry := ent.AsMapEntry()
+ sum = sum.Add(c.cost(entry.Key()))
+ sum = sum.Add(c.cost(entry.Value()))
+ // Compute the key size range
+ ks := c.sizeOrUnknown(entry.Key())
+ keySize = keySize.Union(ks)
+ // Compute the value size range
+ vs := c.sizeOrUnknown(entry.Value())
+ valSize = valSize.Union(vs)
+ }
+ c.setEntrySize(e, &entrySizeEstimate{containerKind: types.MapKind, key: keySize, val: valSize})
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()))
-
- // 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()))
+ sum = sum.Add(c.cost(comp.IterRange()))
+ sum = sum.Add(c.cost(comp.AccuInit()))
+ c.pushLocalVar(comp.AccuVar(), comp.AccuInit())
+
+ // Track the iterRange of each IterVar and AccuVar for field path construction
+ if comp.HasIterVar2() {
+ c.pushIterKey(comp.IterVar(), comp.IterRange())
+ c.pushIterValue(comp.IterVar2(), comp.IterRange())
+ } else {
+ c.pushIterSingle(comp.IterVar(), comp.IterRange())
+ }
+
+ // Determine the cost for each element in the loop
+ loopCost := c.cost(comp.LoopCondition())
+ stepCost := c.cost(comp.LoopStep())
+
+ // Clear the intermediate variable tracking.
+ c.popLocalVar(comp.IterVar())
+ if comp.HasIterVar2() {
+ c.popLocalVar(comp.IterVar2())
+ }
+
+ // Determine the result cost.
+ sum = sum.Add(c.cost(comp.Result()))
+ c.localVars.pop(comp.AccuVar())
+
+ // Estimate the cost of the loop.
+ rangeCnt := c.sizeOrUnknown(comp.IterRange())
rangeCost := rangeCnt.MultiplyByCost(stepCost.Add(loopCost))
sum = sum.Add(rangeCost)
+ switch k := comp.AccuInit().Kind(); k {
+ case ast.LiteralKind:
+ c.setSize(e, c.computeSize(comp.AccuInit()))
+ case ast.ListKind, ast.MapKind:
+ c.setSize(e, &rangeCnt)
+ // For a step which produces a container value, it will have an entry size associated
+ // with its expression id.
+ if stepEntrySize := c.computeEntrySize(comp.LoopStep()); stepEntrySize != nil {
+ c.setEntrySize(e, stepEntrySize)
+ break
+ }
+ }
return sum
}
-func (c *coster) sizeEstimate(t AstNode) SizeEstimate {
- if l := t.ComputedSize(); l != nil {
- return *l
- }
- if l := c.estimator.EstimateSize(t); l != nil {
- return *l
- }
- // return an estimate of 1 for return types of set
- // lengths, since strings/bytes/more complex objects could be of
- // variable length
- if isScalar(t.Type()) {
- // TODO: since the logic for size estimation is split between
- // ComputedSize and isScalar, changing one will likely require changing
- // the other, so they should be merged in the future if possible
- return SizeEstimate{Min: 1, Max: 1}
- }
- return SizeEstimate{Min: 0, Max: math.MaxUint64}
+func (c *coster) isBind(e ast.Expr) bool {
+ comp := e.AsComprehension()
+ iterRange := comp.IterRange()
+ loopCond := comp.LoopCondition()
+ return iterRange.Kind() == ast.ListKind && iterRange.AsList().Size() == 0 &&
+ loopCond.Kind() == ast.LiteralKind && loopCond.AsLiteral() == types.False &&
+ comp.AccuVar() != parser.AccumulatorName
+}
+
+func (c *coster) costBind(e ast.Expr) CostEstimate {
+ comp := e.AsComprehension()
+ var sum CostEstimate
+ // Binds are lazily initialized, so we retain the cost of an empty iteration range.
+ sum = sum.Add(c.cost(comp.IterRange()))
+ sum = sum.Add(c.cost(comp.AccuInit()))
+
+ c.pushLocalVar(comp.AccuVar(), comp.AccuInit())
+ sum = sum.Add(c.cost(comp.Result()))
+ c.popLocalVar(comp.AccuVar())
+
+ // Associate the bind output size with the result size.
+ c.copySizeEstimates(e, comp.Result())
+ return sum
}
-func (c *coster) functionCost(function, overloadID string, target *AstNode, args []AstNode, argCosts []CostEstimate) CallEstimate {
+func (c *coster) functionCost(e ast.Expr, function, overloadID string, target *AstNode, args []AstNode, argCosts []CostEstimate) CallEstimate {
argCostSum := func() CostEstimate {
var sum CostEstimate
for _, a := range argCosts {
@@ -570,35 +748,42 @@ func (c *coster) functionCost(function, overloadID string, target *AstNode, args
case overloads.ExtFormatString:
if target != nil {
// ResultSize not calculated because we can't bound the max size.
- return CallEstimate{CostEstimate: c.sizeEstimate(*target).MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum())}
+ return CallEstimate{
+ CostEstimate: c.sizeOrUnknown(*target).MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum())}
}
case overloads.StringToBytes:
if len(args) == 1 {
- sz := c.sizeEstimate(args[0])
+ sz := c.sizeOrUnknown(args[0])
// ResultSize max is when each char converts to 4 bytes.
- return CallEstimate{CostEstimate: sz.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()), ResultSize: &SizeEstimate{Min: sz.Min, Max: sz.Max * 4}}
+ return CallEstimate{
+ CostEstimate: sz.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()),
+ ResultSize: &SizeEstimate{Min: sz.Min, Max: sz.Max * 4}}
}
case overloads.BytesToString:
if len(args) == 1 {
- sz := c.sizeEstimate(args[0])
+ sz := c.sizeOrUnknown(args[0])
// ResultSize min is when 4 bytes convert to 1 char.
- return CallEstimate{CostEstimate: sz.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()), ResultSize: &SizeEstimate{Min: sz.Min / 4, Max: sz.Max}}
+ return CallEstimate{
+ CostEstimate: sz.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()),
+ ResultSize: &SizeEstimate{Min: sz.Min / 4, Max: sz.Max}}
}
case overloads.ExtQuoteString:
if len(args) == 1 {
- sz := c.sizeEstimate(args[0])
+ sz := c.sizeOrUnknown(args[0])
// ResultSize max is when each char is escaped. 2 quote chars always added.
- return CallEstimate{CostEstimate: sz.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()), ResultSize: &SizeEstimate{Min: sz.Min + 2, Max: sz.Max*2 + 2}}
+ return CallEstimate{
+ CostEstimate: sz.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()),
+ ResultSize: &SizeEstimate{Min: sz.Min + 2, Max: sz.Max*2 + 2}}
}
case overloads.StartsWithString, overloads.EndsWithString:
if len(args) == 1 {
- return CallEstimate{CostEstimate: c.sizeEstimate(args[0]).MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum())}
+ return CallEstimate{CostEstimate: c.sizeOrUnknown(args[0]).MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum())}
}
case overloads.InList:
// If a list is composed entirely of constant values this is O(1), but we don't account for that here.
// We just assume all list containment checks are O(n).
if len(args) == 2 {
- return CallEstimate{CostEstimate: c.sizeEstimate(args[1]).MultiplyByCostFactor(1).Add(argCostSum())}
+ return CallEstimate{CostEstimate: c.sizeOrUnknown(args[1]).MultiplyByCostFactor(1).Add(argCostSum())}
}
// O(nm) functions
case overloads.MatchesString:
@@ -606,19 +791,19 @@ func (c *coster) functionCost(function, overloadID string, target *AstNode, args
if target != nil && len(args) == 1 {
// 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 := c.sizeEstimate(*target).Add(SizeEstimate{Min: 1, Max: 1}).MultiplyByCostFactor(common.StringTraversalCostFactor)
+ strCost := c.sizeOrUnknown(*target).Add(SizeEstimate{Min: 1, Max: 1}).MultiplyByCostFactor(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 := c.sizeEstimate(args[0]).MultiplyByCostFactor(common.RegexStringLengthCostFactor)
+ regexCost := c.sizeOrUnknown(args[0]).MultiplyByCostFactor(common.RegexStringLengthCostFactor)
return CallEstimate{CostEstimate: strCost.Multiply(regexCost).Add(argCostSum())}
}
case overloads.ContainsString:
if target != nil && len(args) == 1 {
- strCost := c.sizeEstimate(*target).MultiplyByCostFactor(common.StringTraversalCostFactor)
- substrCost := c.sizeEstimate(args[0]).MultiplyByCostFactor(common.StringTraversalCostFactor)
+ strCost := c.sizeOrUnknown(*target).MultiplyByCostFactor(common.StringTraversalCostFactor)
+ substrCost := c.sizeOrUnknown(args[0]).MultiplyByCostFactor(common.StringTraversalCostFactor)
return CallEstimate{CostEstimate: strCost.Multiply(substrCost).Add(argCostSum())}
}
case overloads.LogicalOr, overloads.LogicalAnd:
@@ -628,7 +813,9 @@ func (c *coster) functionCost(function, overloadID string, target *AstNode, args
argCost := CostEstimate{Min: lhs.Min, Max: lhs.Add(rhs).Max}
return CallEstimate{CostEstimate: argCost}
case overloads.Conditional:
- size := c.sizeEstimate(args[1]).Union(c.sizeEstimate(args[2]))
+ size := c.sizeOrUnknown(args[1]).Union(c.sizeOrUnknown(args[2]))
+ resultEntrySize := c.computeEntrySize(args[1].Expr()).union(c.computeEntrySize(args[2].Expr()))
+ c.setEntrySize(e, resultEntrySize)
conditionalCost := argCosts[0]
ifTrueCost := argCosts[1]
ifFalseCost := argCosts[2]
@@ -636,13 +823,19 @@ func (c *coster) functionCost(function, overloadID string, target *AstNode, args
return CallEstimate{CostEstimate: argCost, ResultSize: &size}
case overloads.AddString, overloads.AddBytes, overloads.AddList:
if len(args) == 2 {
- lhsSize := c.sizeEstimate(args[0])
- rhsSize := c.sizeEstimate(args[1])
+ lhsSize := c.sizeOrUnknown(args[0])
+ rhsSize := c.sizeOrUnknown(args[1])
resultSize := lhsSize.Add(rhsSize)
+ rhsEntrySize := c.computeEntrySize(args[0].Expr())
+ lhsEntrySize := c.computeEntrySize(args[1].Expr())
+ resultEntrySize := rhsEntrySize.union(lhsEntrySize)
+ if resultEntrySize != nil {
+ c.setEntrySize(e, resultEntrySize)
+ }
switch overloadID {
case overloads.AddList:
// list concatenation is O(1), but we handle it here to track size
- return CallEstimate{CostEstimate: CostEstimate{Min: 1, Max: 1}.Add(argCostSum()), ResultSize: &resultSize}
+ return CallEstimate{CostEstimate: FixedCostEstimate(1).Add(argCostSum()), ResultSize: &resultSize}
default:
return CallEstimate{CostEstimate: resultSize.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()), ResultSize: &resultSize}
}
@@ -650,8 +843,8 @@ func (c *coster) functionCost(function, overloadID string, target *AstNode, args
case overloads.LessString, overloads.GreaterString, overloads.LessEqualsString, overloads.GreaterEqualsString,
overloads.LessBytes, overloads.GreaterBytes, overloads.LessEqualsBytes, overloads.GreaterEqualsBytes,
overloads.Equals, overloads.NotEquals:
- lhsCost := c.sizeEstimate(args[0])
- rhsCost := c.sizeEstimate(args[1])
+ lhsCost := c.sizeOrUnknown(args[0])
+ rhsCost := c.sizeOrUnknown(args[1])
min := uint64(0)
smallestMax := lhsCost.Max
if rhsCost.Max < smallestMax {
@@ -661,43 +854,162 @@ func (c *coster) functionCost(function, overloadID string, target *AstNode, args
min = 1
}
// equality of 2 scalar values results in a cost of 1
- return CallEstimate{CostEstimate: CostEstimate{Min: min, Max: smallestMax}.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum())}
+ return CallEstimate{
+ CostEstimate: CostEstimate{Min: min, Max: smallestMax}.MultiplyByCostFactor(common.StringTraversalCostFactor).Add(argCostSum()),
+ }
}
// O(1) functions
// See CostTracker.costCall for more details about O(1) cost calculations
// Benchmarks suggest that most of the other operations take +/- 50% of a base cost unit
// which on an Intel xeon 2.20GHz CPU is 50ns.
- return CallEstimate{CostEstimate: CostEstimate{Min: 1, Max: 1}.Add(argCostSum())}
+ return CallEstimate{CostEstimate: FixedCostEstimate(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 {
+ if e.Kind() == ast.IdentKind {
+ if v, found := c.peekLocalVar(e.AsIdent()); found {
+ return v.path[:]
+ }
+ }
+ return c.exprPaths[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.exprPaths[e.ID()] = path
}
-func (c *coster) newAstNode(e *exprpb.Expr) *astNode {
+func isAccumulatorVar(name string) bool {
+ return name == parser.AccumulatorName || name == parser.HiddenAccumulatorName
+}
+
+func (c *coster) newAstNode(e ast.Expr) *astNode {
path := c.getPath(e)
- if len(path) > 0 && path[0] == parser.AccumulatorName {
+ if len(path) > 0 && isAccumulatorVar(path[0]) {
// only provide paths to root vars; omit accumulator vars
path = nil
}
- var derivedSize *SizeEstimate
- if size, ok := c.computedSizes[e.GetId()]; ok {
- derivedSize = &size
- }
return &astNode{
path: path,
t: c.getType(e),
expr: e,
- derivedSize: derivedSize}
+ derivedSize: c.computeSize(e)}
+}
+
+func (c *coster) setSize(e ast.Expr, size *SizeEstimate) {
+ if size == nil {
+ return
+ }
+ // Store the computed size with the expression
+ c.computedSizes[e.ID()] = *size
+}
+
+func (c *coster) sizeOrUnknown(node any) SizeEstimate {
+ switch v := node.(type) {
+ case ast.Expr:
+ if sz := c.computeSize(v); sz != nil {
+ return *sz
+ }
+ case AstNode:
+ if sz := v.ComputedSize(); sz != nil {
+ return *sz
+ }
+ }
+ return UnknownSizeEstimate()
+}
+
+func (c *coster) copySizeEstimates(dst, src ast.Expr) {
+ c.setSize(dst, c.computeSize(src))
+ c.setEntrySize(dst, c.computeEntrySize(src))
+}
+
+func (c *coster) computeSize(e ast.Expr) *SizeEstimate {
+ if size, ok := c.computedSizes[e.ID()]; ok {
+ return &size
+ }
+ if size := computeExprSize(e); size != nil {
+ return size
+ }
+ // Ensure size estimates are computed first as users may choose to override the costs that
+ // CEL would otherwise ascribe to the type.
+ node := astNode{expr: e, path: c.getPath(e), t: c.getType(e)}
+ if size := c.estimator.EstimateSize(node); size != nil {
+ // storing the computed size should reduce calls to EstimateSize()
+ c.computedSizes[e.ID()] = *size
+ return size
+ }
+ if size := computeTypeSize(c.getType(e)); size != nil {
+ return size
+ }
+ if e.Kind() == ast.IdentKind {
+ varName := e.AsIdent()
+ if v, ok := c.peekLocalVar(varName); ok && v.size != nil {
+ return v.size
+ }
+ }
+ return nil
+}
+
+func (c *coster) setEntrySize(e ast.Expr, size *entrySizeEstimate) {
+ if size == nil {
+ return
+ }
+ c.computedEntrySizes[e.ID()] = *size
+}
+
+func (c *coster) computeEntrySize(e ast.Expr) *entrySizeEstimate {
+ if sz, found := c.computedEntrySizes[e.ID()]; found {
+ return &sz
+ }
+ if e.Kind() == ast.IdentKind {
+ varName := e.AsIdent()
+ if v, ok := c.peekLocalVar(varName); ok && v.entrySize != nil {
+ return v.entrySize
+ }
+ }
+ return nil
+}
+
+func computeExprSize(expr ast.Expr) *SizeEstimate {
+ var v uint64
+ switch expr.Kind() {
+ case ast.LiteralKind:
+ switch ck := 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)))
+ 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 ast.ListKind:
+ v = uint64(expr.AsList().Size())
+ case ast.MapKind:
+ v = uint64(expr.AsMap().Size())
+ default:
+ return nil
+ }
+ cost := FixedSizeEstimate(v)
+ return &cost
+}
+
+func computeTypeSize(t *types.Type) *SizeEstimate {
+ if isScalar(t) {
+ cost := FixedSizeEstimate(1)
+ return &cost
+ }
+ return nil
}
// isScalar returns true if the given type is known to be of a constant size at
@@ -707,10 +1019,24 @@ func isScalar(t *types.Type) bool {
switch t.Kind() {
case types.BoolKind, types.DoubleKind, types.DurationKind, types.IntKind, types.TimestampKind, types.UintKind:
return true
+ case types.OpaqueKind:
+ if t.TypeName() == "optional_type" {
+ return isScalar(t.Parameters()[0])
+ }
}
return false
}
var (
doubleTwoTo64 = math.Ldexp(1.0, 64)
+
+ unknownSizeEstimate = SizeEstimate{Min: 0, Max: math.MaxUint64}
+ unknownCostEstimate = unknownSizeEstimate.MultiplyByCostFactor(1)
+
+ selectAndIdentCost = FixedCostEstimate(common.SelectAndIdentCost)
+ constCost = FixedCostEstimate(common.ConstCost)
+
+ createListBaseCost = FixedCostEstimate(common.ListCreateBaseCost)
+ createMapBaseCost = FixedCostEstimate(common.MapCreateBaseCost)
+ createMessageBaseCost = FixedCostEstimate(common.StructCreateBaseCost)
)
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 0d91bef51451..e013d2c2b6d6 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
@@ -91,6 +91,17 @@ func NewFunction(name string,
Overloads: overloads}}}
}
+// NewFunctionWithDoc creates a named function declaration with a description and one or more overloads.
+func NewFunctionWithDoc(name, doc string,
+ overloads ...*exprpb.Decl_FunctionDecl_Overload) *exprpb.Decl {
+ return &exprpb.Decl{
+ Name: name,
+ DeclKind: &exprpb.Decl_Function{
+ Function: &exprpb.Decl_FunctionDecl{
+ // Doc: desc,
+ Overloads: overloads}}}
+}
+
// NewIdent creates a named identifier declaration with an optional literal
// value.
//
@@ -98,28 +109,37 @@ func NewFunction(name string,
//
// Deprecated: Use NewVar or NewConst instead.
func NewIdent(name string, t *exprpb.Type, v *exprpb.Constant) *exprpb.Decl {
+ return newIdent(name, t, v, "")
+}
+
+func newIdent(name string, t *exprpb.Type, v *exprpb.Constant, desc string) *exprpb.Decl {
return &exprpb.Decl{
Name: name,
DeclKind: &exprpb.Decl_Ident{
Ident: &exprpb.Decl_IdentDecl{
Type: t,
- Value: v}}}
+ Value: v,
+ Doc: desc}}}
}
// NewConst creates a constant identifier with a CEL constant literal value.
func NewConst(name string, t *exprpb.Type, v *exprpb.Constant) *exprpb.Decl {
- return NewIdent(name, t, v)
+ return newIdent(name, t, v, "")
}
// NewVar creates a variable identifier.
func NewVar(name string, t *exprpb.Type) *exprpb.Decl {
- return NewIdent(name, t, nil)
+ return newIdent(name, t, nil, "")
+}
+
+// NewVarWithDoc creates a variable identifier with a type and a description string.
+func NewVarWithDoc(name string, t *exprpb.Type, desc string) *exprpb.Decl {
+ return newIdent(name, t, nil, desc)
}
// NewInstanceOverload creates a instance function overload contract.
// First element of argTypes is instance.
-func NewInstanceOverload(id string, argTypes []*exprpb.Type,
- resultType *exprpb.Type) *exprpb.Decl_FunctionDecl_Overload {
+func NewInstanceOverload(id string, argTypes []*exprpb.Type, resultType *exprpb.Type) *exprpb.Decl_FunctionDecl_Overload {
return &exprpb.Decl_FunctionDecl_Overload{
OverloadId: id,
ResultType: resultType,
@@ -154,8 +174,7 @@ func NewObjectType(typeName string) *exprpb.Type {
// NewOverload creates a function overload declaration which contains a unique
// overload id as well as the expected argument and result types. Overloads
// must be aggregated within a Function declaration.
-func NewOverload(id string, argTypes []*exprpb.Type,
- resultType *exprpb.Type) *exprpb.Decl_FunctionDecl_Overload {
+func NewOverload(id string, argTypes []*exprpb.Type, resultType *exprpb.Type) *exprpb.Decl_FunctionDecl_Overload {
return &exprpb.Decl_FunctionDecl_Overload{
OverloadId: id,
ResultType: resultType,
@@ -231,7 +250,5 @@ func NewWrapperType(wrapped *exprpb.Type) *exprpb.Type {
// TODO: return an error
panic("Wrapped type must be a primitive")
}
- return &exprpb.Type{
- TypeKind: &exprpb.Type_Wrapper{
- Wrapper: primitive}}
+ return &exprpb.Type{TypeKind: &exprpb.Type_Wrapper{Wrapper: primitive}}
}
diff --git a/vendor/github.com/google/cel-go/checker/env.go b/vendor/github.com/google/cel-go/checker/env.go
index 70682b17c6b4..d5ac05014ee4 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 c2b96498d1d0..3535440baa4f 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,11 @@ 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) notAnOptionalFieldSelectionCall(id int64, l common.Location, err string) {
+ e.errs.ReportErrorAtID(id, l, "unsupported optional field selection: %s", err)
+}
+
+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 +61,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 +87,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 15cba06ee97a..7a3984f02ce5 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/standard.go b/vendor/github.com/google/cel-go/checker/standard.go
deleted file mode 100644
index 11b35b80ee28..000000000000
--- a/vendor/github.com/google/cel-go/checker/standard.go
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2018 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 checker
-
-import (
- "github.com/google/cel-go/common/stdlib"
-
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
-)
-
-// StandardFunctions returns the Decls for all functions in the evaluator.
-//
-// Deprecated: prefer stdlib.FunctionExprDecls()
-func StandardFunctions() []*exprpb.Decl {
- return stdlib.FunctionExprDecls()
-}
-
-// StandardTypes returns the set of type identifiers for standard library types.
-//
-// Deprecated: prefer stdlib.TypeExprDecls()
-func StandardTypes() []*exprpb.Decl {
- return stdlib.TypeExprDecls()
-}
diff --git a/vendor/github.com/google/cel-go/checker/types.go b/vendor/github.com/google/cel-go/checker/types.go
index e2373d1b7cba..4c65b2737cda 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/BUILD.bazel b/vendor/github.com/google/cel-go/common/BUILD.bazel
index d6165b13af05..1b1b7914d65c 100644
--- a/vendor/github.com/google/cel-go/common/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/common/BUILD.bazel
@@ -9,6 +9,7 @@ go_library(
name = "go_default_library",
srcs = [
"cost.go",
+ "doc.go",
"error.go",
"errors.go",
"location.go",
@@ -18,7 +19,6 @@ go_library(
deps = [
"//common/runes:go_default_library",
"@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
- "@org_golang_x_text//width:go_default_library",
],
)
@@ -26,6 +26,7 @@ go_test(
name = "go_default_test",
size = "small",
srcs = [
+ "doc_test.go",
"errors_test.go",
"source_test.go",
],
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 7269cdff5f7f..9824f57a9f85 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,13 +9,19 @@ 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 = [
+ deps = [
+ "//common:go_default_library",
"//common/types:go_default_library",
"//common/types/ref:go_default_library",
+ "@dev_cel_expr//:expr",
"@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",
],
)
@@ -29,17 +30,20 @@ go_test(
name = "go_default_test",
srcs = [
"ast_test.go",
+ "conversion_test.go",
"expr_test.go",
+ "navigable_test.go",
],
embed = [
":go_default_library",
],
- deps = [
+ deps = [
"//checker:go_default_library",
"//checker/decls:go_default_library",
"//common:go_default_library",
"//common/containers:go_default_library",
"//common/decls:go_default_library",
+ "//common/operators:go_default_library",
"//common/overloads:go_default_library",
"//common/stdlib:go_default_library",
"//common/types:go_default_library",
@@ -48,5 +52,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 b3c150793a94..62c09cfc6444 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,369 @@
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
+}
-// 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
- }
- refMap[id] = r
+// 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
+}
+
+// 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
}
- 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 &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
}
- 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 visitor.maxID + 1
+}
+
+// Heights computes the heights of all AST expressions and returns a map from expression id to height.
+func Heights(a *AST) map[int64]int {
+ visitor := make(heightVisitor)
+ PostOrderVisit(a.Expr(), visitor)
+ return visitor
+}
+
+// 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())
}
- 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
+ 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
+}
+
+// ClearOffsetRange removes the OffsetRange for the given expression id.
+func (s *SourceInfo) ClearOffsetRange(id int64) {
+ if s != nil {
+ delete(s.offsetRanges, id)
+ }
+}
+
+// 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 {
+ return s.GetLocationByOffset(o.Start)
+ }
+ 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 {
+ return s.GetLocationByOffset(o.Stop)
+ }
+ return common.NoLocation
+}
+
+// GetLocationByOffset returns the line and column information for a given character offset.
+func (s *SourceInfo) GetLocationByOffset(offset int32) common.Location {
+ line := 1
+ col := int(offset)
+ for _, lineOffset := range s.LineOffsets() {
+ if lineOffset > offset {
+ break
}
- typeMap[id] = t
+ line++
+ col = int(offset - lineOffset)
+ }
+ return common.NewLocation(line, col)
+}
+
+// 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
}
- return &CheckedAST{
- Expr: checked.GetExpr(),
- SourceInfo: checked.GetSourceInfo(),
- ReferenceMap: refMap,
- TypeMap: typeMap,
- }, nil
+ 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 +444,92 @@ 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
+type maxIDVisitor struct {
+ maxID int64
+ *baseVisitor
+}
+
+// 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 &exprpb.Reference{
- Name: info.Name,
- OverloadId: info.OverloadIDs,
- Value: c,
- }, nil
}
-// 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
+// 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()
}
- return &ReferenceInfo{
- Name: ref.GetName(),
- OverloadIDs: ref.GetOverloadId(),
- Value: v,
- }, nil
}
-// ValToConstant converts a CEL-native ref.Val to a protobuf Constant.
+type heightVisitor map[int64]int
+
+// VisitExpr computes the height of a given node as the max height of its children plus one.
//
-// 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())
+// Identifiers and literals are treated as having a height of zero.
+func (hv heightVisitor) VisitExpr(e Expr) {
+ // default includes IdentKind, LiteralKind
+ hv[e.ID()] = 0
+ switch e.Kind() {
+ case SelectKind:
+ hv[e.ID()] = 1 + hv[e.AsSelect().Operand().ID()]
+ case CallKind:
+ c := e.AsCall()
+ height := hv.maxHeight(c.Args()...)
+ if c.IsMemberFunction() {
+ tHeight := hv[c.Target().ID()]
+ if tHeight > height {
+ height = tHeight
+ }
+ }
+ hv[e.ID()] = 1 + height
+ case ListKind:
+ l := e.AsList()
+ hv[e.ID()] = 1 + hv.maxHeight(l.Elements()...)
+ case MapKind:
+ m := e.AsMap()
+ hv[e.ID()] = 1 + hv.maxEntryHeight(m.Entries()...)
+ case StructKind:
+ s := e.AsStruct()
+ hv[e.ID()] = 1 + hv.maxEntryHeight(s.Fields()...)
+ case ComprehensionKind:
+ comp := e.AsComprehension()
+ hv[e.ID()] = 1 + hv.maxHeight(comp.IterRange(), comp.AccuInit(), comp.LoopCondition(), comp.LoopStep(), comp.Result())
+ }
+}
+
+// VisitEntryExpr computes the max height of a map or struct entry and associates the height with the entry id.
+func (hv heightVisitor) VisitEntryExpr(e EntryExpr) {
+ hv[e.ID()] = 0
+ switch e.Kind() {
+ case MapEntryKind:
+ me := e.AsMapEntry()
+ hv[e.ID()] = hv.maxHeight(me.Value(), me.Key())
+ case StructFieldKind:
+ sf := e.AsStructField()
+ hv[e.ID()] = hv[sf.Value().ID()]
+ }
+}
+
+func (hv heightVisitor) maxHeight(exprs ...Expr) int {
+ max := 0
+ for _, e := range exprs {
+ h := hv[e.ID()]
+ if h > max {
+ max = h
+ }
+ }
+ return max
+}
+
+func (hv heightVisitor) maxEntryHeight(entries ...EntryExpr) int {
+ max := 0
+ for _, e := range entries {
+ h := hv[e.ID()]
+ if h > max {
+ max = h
+ }
+ }
+ return max
}
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 000000000000..435d8f654704
--- /dev/null
+++ b/vendor/github.com/google/cel-go/common/ast/conversion.go
@@ -0,0 +1,659 @@
+// 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"
+
+ "google.golang.org/protobuf/proto"
+
+ "github.com/google/cel-go/common/types"
+ "github.com/google/cel-go/common/types/ref"
+
+ celpb "cel.dev/expr"
+ exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ structpb "google.golang.org/protobuf/types/known/structpb"
+)
+
+// 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.NewComprehensionTwoVar(id,
+ iterRange,
+ comp.GetIterVar(),
+ comp.GetIterVar2(),
+ 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(),
+ IterVar2: comp.IterVar2(),
+ 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) {
+ return AlphaProtoConstantAsVal(c)
+}
+
+// AlphaProtoConstantAsVal converts a v1alpha1.Constant protobuf to a CEL-native ref.Val.
+func AlphaProtoConstantAsVal(c *exprpb.Constant) (ref.Val, error) {
+ if c == nil {
+ return nil, nil
+ }
+ canonical := &celpb.Constant{}
+ if err := convertProto(c, canonical); err != nil {
+ return nil, err
+ }
+ return ProtoConstantAsVal(canonical)
+}
+
+// ProtoConstantAsVal converts a canonical celpb.Constant protobuf to a CEL-native ref.Val.
+func ProtoConstantAsVal(c *celpb.Constant) (ref.Val, error) {
+ switch c.GetConstantKind().(type) {
+ case *celpb.Constant_BoolValue:
+ return types.Bool(c.GetBoolValue()), nil
+ case *celpb.Constant_BytesValue:
+ return types.Bytes(c.GetBytesValue()), nil
+ case *celpb.Constant_DoubleValue:
+ return types.Double(c.GetDoubleValue()), nil
+ case *celpb.Constant_Int64Value:
+ return types.Int(c.GetInt64Value()), nil
+ case *celpb.Constant_NullValue:
+ return types.NullValue, nil
+ case *celpb.Constant_StringValue:
+ return types.String(c.GetStringValue()), nil
+ case *celpb.Constant_Uint64Value:
+ return types.Uint(c.GetUint64Value()), nil
+ }
+ return nil, fmt.Errorf("unsupported constant kind: %v", c.GetConstantKind())
+}
+
+func convertProto(src, dst proto.Message) error {
+ pb, err := proto.Marshal(src)
+ if err != nil {
+ return err
+ }
+ err = proto.Unmarshal(pb, dst)
+ return err
+}
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 b63884a6028a..9f55cb3b9fcf 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.
-//
-// 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.
+// Expr represents the base expression node in a CEL abstract syntax tree.
//
-// 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 arguments.
+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,453 +206,679 @@ 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.
+ //
+ // For one-variable comprehensions, the iter var refers to the element value
+ // when iterating over a list, or the map key when iterating over a map.
+ //
+ // For two-variable comprehneions, the iter var refers to the list index or the
+ // map key.
IterVar() string
+ // IterVar2 returns the second iteration variable name.
+ //
+ // When the value is non-empty, the comprehension is a two-variable comprehension.
+ IterVar2() string
+
+ // HasIterVar2 returns true if the second iteration variable is non-empty.
+ HasIterVar2() bool
+
// AccuVar returns the accumulation variable name.
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()
+}
+
+var _ Expr = &expr{}
+
+type expr struct {
+ id int64
+ exprKindCase
+}
+
+type exprKindCase interface {
+ Kind() ExprKind
+
+ renumberIDs(IDGenerator)
+
+ 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,
+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(),
+ iterVar2: c.IterVar2(),
+ 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
+ iterVar2 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) IterVar2() string {
+ return e.iterVar2
}
-func (comp navigableComprehensionImpl) IterRange() NavigableExpr {
- return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetIterRange())
+func (e *baseComprehensionExpr) HasIterVar2() bool {
+ return e.iterVar2 != ""
}
-func (comp navigableComprehensionImpl) IterVar() string {
- return comp.ToExpr().GetComprehensionExpr().GetIterVar()
+func (e *baseComprehensionExpr) AccuVar() string {
+ return e.accuVar
}
-func (comp navigableComprehensionImpl) AccuVar() string {
- return comp.ToExpr().GetComprehensionExpr().GetAccuVar()
+func (e *baseComprehensionExpr) AccuInit() Expr {
+ if e == nil {
+ return nilExpr
+ }
+ return e.accuInit
}
-func (comp navigableComprehensionImpl) AccuInit() NavigableExpr {
- return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetAccuInit())
+func (e *baseComprehensionExpr) LoopCondition() Expr {
+ if e == nil {
+ return nilExpr
+ }
+ return e.loopCond
}
-func (comp navigableComprehensionImpl) LoopCondition() NavigableExpr {
- return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetLoopCondition())
+func (e *baseComprehensionExpr) LoopStep() Expr {
+ if e == nil {
+ return nilExpr
+ }
+ return e.loopStep
}
-func (comp navigableComprehensionImpl) LoopStep() NavigableExpr {
- return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetLoopStep())
+func (e *baseComprehensionExpr) Result() Expr {
+ if e == nil {
+ return nilExpr
+ }
+ return e.result
}
-func (comp navigableComprehensionImpl) Result() NavigableExpr {
- return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetResult())
+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)
}
-type navigableListImpl struct {
- *navigableExprImpl
+func (*baseComprehensionExpr) isExpr() {}
+
+var _ exprKindCase = baseIdentExpr("")
+
+type baseIdentExpr string
+
+func (baseIdentExpr) Kind() ExprKind {
+ return IdentKind
}
-func (l navigableListImpl) Elements() []NavigableExpr {
- return l.Children()
+func (e baseIdentExpr) renumberIDs(IDGenerator) {}
+
+func (baseIdentExpr) isExpr() {}
+
+var _ exprKindCase = &baseLiteral{}
+var _ ref.Val = &baseLiteral{}
+
+type baseLiteral struct {
+ ref.Val
}
-func (l navigableListImpl) OptionalIndices() []int32 {
- return l.ToExpr().GetListExpr().GetOptionalIndices()
+func (*baseLiteral) Kind() ExprKind {
+ return LiteralKind
}
-func (l navigableListImpl) Size() int {
- return len(l.ToExpr().GetListExpr().GetElements())
+func (l *baseLiteral) renumberIDs(IDGenerator) {}
+
+func (*baseLiteral) isExpr() {}
+
+var _ ListExpr = &baseListExpr{}
+
+type baseListExpr struct {
+ elements []Expr
+ optIndices []int32
+ optIndexMap map[int32]struct{}
}
-type navigableMapImpl struct {
- *navigableExprImpl
+func (*baseListExpr) Kind() ExprKind {
+ return ListKind
}
-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) Elements() []Expr {
+ if e == nil {
+ return []Expr{}
}
- return entries
+ return e.elements
}
-func (m navigableMapImpl) Size() int {
- return len(m.ToExpr().GetStructExpr().GetEntries())
+func (e *baseListExpr) IsOptional(index int32) bool {
+ _, found := e.optIndexMap[index]
+ return found
}
-type navigableEntryImpl struct {
- key NavigableExpr
- val NavigableExpr
- isOpt bool
+func (e *baseListExpr) OptionalIndices() []int32 {
+ if e == nil {
+ return []int32{}
+ }
+ return e.optIndices
}
-func (e navigableEntryImpl) Key() NavigableExpr {
- return e.key
+func (e *baseListExpr) Size() int {
+ return len(e.Elements())
}
-func (e navigableEntryImpl) Value() NavigableExpr {
- return e.val
+func (e *baseListExpr) renumberIDs(idGen IDGenerator) {
+ for _, elem := range e.Elements() {
+ elem.RenumberIDs(idGen)
+ }
}
-func (e navigableEntryImpl) IsOptional() bool {
- return e.isOpt
+func (*baseListExpr) isExpr() {}
+
+type baseMapExpr struct {
+ entries []EntryExpr
}
-func (e navigableEntryImpl) isNavigable() {}
+func (*baseMapExpr) Kind() ExprKind {
+ return MapKind
+}
-type navigableSelectImpl struct {
- *navigableExprImpl
+func (e *baseMapExpr) Entries() []EntryExpr {
+ if e == nil {
+ return []EntryExpr{}
+ }
+ return e.entries
}
-func (sel navigableSelectImpl) FieldName() string {
- return sel.ToExpr().GetSelectExpr().GetField()
+func (e *baseMapExpr) Size() int {
+ return len(e.Entries())
}
-func (sel navigableSelectImpl) IsTestOnly() bool {
- return sel.ToExpr().GetSelectExpr().GetTestOnly()
+func (e *baseMapExpr) renumberIDs(idGen IDGenerator) {
+ for _, entry := range e.Entries() {
+ entry.RenumberIDs(idGen)
+ }
}
-func (sel navigableSelectImpl) Operand() NavigableExpr {
- return sel.createChild(sel.ToExpr().GetSelectExpr().GetOperand())
+func (*baseMapExpr) isExpr() {}
+
+type baseSelectExpr struct {
+ operand Expr
+ field string
+ testOnly bool
}
-type navigableStructImpl struct {
- *navigableExprImpl
+func (*baseSelectExpr) Kind() ExprKind {
+ return SelectKind
}
-func (s navigableStructImpl) TypeName() string {
- return s.ToExpr().GetStructExpr().GetMessageName()
+func (e *baseSelectExpr) Operand() Expr {
+ if e == nil || e.operand == nil {
+ return nilExpr
+ }
+ return e.operand
}
-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) FieldName() string {
+ if e == nil {
+ return ""
+ }
+ return e.field
+}
+
+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() {}
-func noopFactory(*navigableExprImpl) []NavigableExpr {
- return nil
+type entryExprKindCase interface {
+ Kind() EntryExprKind
+
+ renumberIDs(IDGenerator)
+
+ isEntryExpr()
+}
+
+var _ EntryExpr = &entryExpr{}
+
+type entryExpr struct {
+ id int64
+ entryExprKindCase
}
-func selectFactory(nav *navigableExprImpl) []NavigableExpr {
- return []NavigableExpr{
- nav.createChild(nav.ToExpr().GetSelectExpr().GetOperand()),
+func (e *entryExpr) ID() int64 {
+ return e.id
+}
+
+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 000000000000..d4dcde4d947f
--- /dev/null
+++ b/vendor/github.com/google/cel-go/common/ast/factory.go
@@ -0,0 +1,332 @@
+// 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 one-variable comprehension over a value range.
+ NewComprehension(id int64, iterRange Expr, iterVar, accuVar string, accuInit, loopCondition, loopStep, result Expr) Expr
+
+ // NewComprehensionTwoVar creates an Expr value representing a two-variable comprehension over a value range.
+ NewComprehensionTwoVar(id int64, iterRange Expr, iterVar, iterVar2, 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
+
+ // AccuIdentName reports the name of the accumulator variable to be used within a comprehension.
+ AccuIdentName() string
+
+ // 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 indices 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 {
+ accumulatorName string
+}
+
+// NewExprFactory creates an ExprFactory instance.
+func NewExprFactory() ExprFactory {
+ return &baseExprFactory{
+ "@result",
+ }
+}
+
+// NewExprFactoryWithAccumulator creates an ExprFactory instance with a custom
+// accumulator identifier name.
+func NewExprFactoryWithAccumulator(id string) ExprFactory {
+ return &baseExprFactory{
+ id,
+ }
+}
+
+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 {
+ // Set the iter_var2 to empty string to indicate the second variable is omitted
+ return fac.NewComprehensionTwoVar(id, iterRange, iterVar, "", accuVar, accuInit, loopCond, loopStep, result)
+}
+
+func (fac *baseExprFactory) NewComprehensionTwoVar(id int64, iterRange Expr, iterVar, iterVar2, accuVar string, accuInit, loopCond, loopStep, result Expr) Expr {
+ return fac.newExpr(
+ id,
+ &baseComprehensionExpr{
+ iterRange: iterRange,
+ iterVar: iterVar,
+ iterVar2: iterVar2,
+ 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, fac.AccuIdentName())
+}
+
+func (fac *baseExprFactory) AccuIdentName() string {
+ return fac.accumulatorName
+}
+
+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.NewComprehensionTwoVar(e.ID(),
+ fac.CopyExpr(compre.IterRange()),
+ compre.IterVar(),
+ compre.IterVar2(),
+ 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 000000000000..13e5777b50d4
--- /dev/null
+++ b/vendor/github.com/google/cel-go/common/ast/navigable.go
@@ -0,0 +1,665 @@
+// 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() {
+ if order == preOrder {
+ visitor.VisitEntryExpr(f)
+ }
+ visit(f.AsStructField().Value(), visitor, order, depth+1, maxDepth)
+ if order == postOrder {
+ visitor.VisitEntryExpr(f)
+ }
+ }
+ }
+ 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) IterVar2() string {
+ return comp.Expr.AsComprehension().IterVar2()
+}
+
+func (comp navigableComprehensionImpl) HasIterVar2() bool {
+ return comp.Expr.AsComprehension().HasIterVar2()
+}
+
+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 3f3f07887124..81197f0641c3 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 d46698d3cdf4..fc146b6fc457 100644
--- a/vendor/github.com/google/cel-go/common/containers/container.go
+++ b/vendor/github.com/google/cel-go/common/containers/container.go
@@ -19,8 +19,9 @@ package containers
import (
"fmt"
"strings"
+ "unicode"
- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
+ "github.com/google/cel-go/common/ast"
)
var (
@@ -62,9 +63,9 @@ func (c *Container) Extend(opts ...ContainerOption) (*Container, error) {
}
// Copy the name and aliases of the existing container.
ext := &Container{name: c.Name()}
- if len(c.aliasSet()) > 0 {
- aliasSet := make(map[string]string, len(c.aliasSet()))
- for k, v := range c.aliasSet() {
+ if len(c.AliasSet()) > 0 {
+ aliasSet := make(map[string]string, len(c.AliasSet()))
+ for k, v := range c.AliasSet() {
aliasSet[k] = v
}
ext.aliases = aliasSet
@@ -132,8 +133,8 @@ func (c *Container) ResolveCandidateNames(name string) []string {
return append(candidates, name)
}
-// aliasSet returns the alias to fully-qualified name mapping stored in the container.
-func (c *Container) aliasSet() map[string]string {
+// AliasSet returns the alias to fully-qualified name mapping stored in the container.
+func (c *Container) AliasSet() map[string]string {
if c == nil || c.aliases == nil {
return noAliases
}
@@ -159,7 +160,7 @@ func (c *Container) findAlias(name string) (string, bool) {
simple = name[0:dot]
qualifier = name[dot:]
}
- alias, found := c.aliasSet()[simple]
+ alias, found := c.AliasSet()[simple]
if !found {
return "", false
}
@@ -212,6 +213,13 @@ type ContainerOption func(*Container) (*Container, error)
func Abbrevs(qualifiedNames ...string) ContainerOption {
return func(c *Container) (*Container, error) {
for _, qn := range qualifiedNames {
+ qn = strings.TrimSpace(qn)
+ for _, r := range qn {
+ if !isIdentifierChar(r) {
+ return nil, fmt.Errorf(
+ "invalid qualified name: %s, wanted name of the form 'qualified.name'", qn)
+ }
+ }
ind := strings.LastIndex(qn, ".")
if ind <= 0 || ind >= len(qn)-1 {
return nil, fmt.Errorf(
@@ -256,7 +264,7 @@ func aliasAs(kind, qualifiedName, alias string) ContainerOption {
return nil, fmt.Errorf("%s must refer to a valid qualified name: %s",
kind, qualifiedName)
}
- aliasRef, found := c.aliasSet()[alias]
+ aliasRef, found := c.AliasSet()[alias]
if found {
return nil, fmt.Errorf(
"%s collides with existing reference: name=%s, %s=%s, existing=%s",
@@ -278,6 +286,10 @@ func aliasAs(kind, qualifiedName, alias string) ContainerOption {
}
}
+func isIdentifierChar(r rune) bool {
+ return r <= unicode.MaxASCII && (r == '.' || r == '_' || unicode.IsLetter(r) || unicode.IsNumber(r))
+}
+
// Name sets the fully-qualified name of the Container.
func Name(name string) ContainerOption {
return func(c *Container) (*Container, error) {
@@ -297,19 +309,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 1f029839c713..724ed340458b 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 5dab156ef36c..75f5f0d6367e 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,67 @@ 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()
+ if comprehension.HasIterVar2() {
+ w.append(comprehension.IterVar2())
+ 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", strconv.Quote(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/decls/BUILD.bazel b/vendor/github.com/google/cel-go/common/decls/BUILD.bazel
index 17791dce6a0d..bd3f9ae70e17 100644
--- a/vendor/github.com/google/cel-go/common/decls/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/common/decls/BUILD.bazel
@@ -13,7 +13,9 @@ go_library(
importpath = "github.com/google/cel-go/common/decls",
deps = [
"//checker/decls:go_default_library",
+ "//common:go_default_library",
"//common/functions:go_default_library",
+ "//common/operators:go_default_library",
"//common/types:go_default_library",
"//common/types/ref:go_default_library",
"//common/types/traits:go_default_library",
diff --git a/vendor/github.com/google/cel-go/common/decls/decls.go b/vendor/github.com/google/cel-go/common/decls/decls.go
index 734ebe57e526..a4a51c3f282e 100644
--- a/vendor/github.com/google/cel-go/common/decls/decls.go
+++ b/vendor/github.com/google/cel-go/common/decls/decls.go
@@ -20,7 +20,9 @@ import (
"strings"
chkdecls "github.com/google/cel-go/checker/decls"
+ "github.com/google/cel-go/common"
"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"
@@ -54,6 +56,7 @@ func NewFunction(name string, opts ...FunctionOpt) (*FunctionDecl, error) {
// overload instances.
type FunctionDecl struct {
name string
+ doc string
// overloads associated with the function name.
overloads map[string]*OverloadDecl
@@ -84,6 +87,26 @@ const (
declarationEnabled
)
+// Documentation generates documentation about the Function and its overloads as a common.Doc object.
+func (f *FunctionDecl) Documentation() *common.Doc {
+ if f == nil {
+ return nil
+ }
+ children := make([]*common.Doc, len(f.OverloadDecls()))
+ for i, o := range f.OverloadDecls() {
+ var examples []*common.Doc
+ for _, ex := range o.Examples() {
+ examples = append(examples, common.NewExampleDoc(ex))
+ }
+ od := common.NewOverloadDoc(o.ID(), formatSignature(f.Name(), o), examples...)
+ children[i] = od
+ }
+ return common.NewFunctionDoc(
+ f.Name(),
+ f.Description(),
+ children...)
+}
+
// Name returns the function name in human-readable terms, e.g. 'contains' of 'math.least'
func (f *FunctionDecl) Name() string {
if f == nil {
@@ -92,9 +115,22 @@ func (f *FunctionDecl) Name() string {
return f.name
}
+// Description provides an overview of the function's purpose.
+//
+// Usage examples should be included on specific overloads.
+func (f *FunctionDecl) Description() string {
+ if f == nil {
+ return ""
+ }
+ return f.doc
+}
+
// IsDeclarationDisabled indicates that the function implementation should be added to the dispatcher, but the
// declaration should not be exposed for use in expressions.
func (f *FunctionDecl) IsDeclarationDisabled() bool {
+ if f == nil {
+ return true
+ }
return f.state == declarationDisabled
}
@@ -107,8 +143,8 @@ func (f *FunctionDecl) Merge(other *FunctionDecl) (*FunctionDecl, error) {
if f == other {
return f, nil
}
- if f.Name() != other.Name() {
- return nil, fmt.Errorf("cannot merge unrelated functions. %s and %s", f.Name(), other.Name())
+ if f == nil || other == nil || f.Name() != other.Name() {
+ return nil, fmt.Errorf("cannot merge unrelated functions. %q and %q", f.Name(), other.Name())
}
merged := &FunctionDecl{
name: f.Name(),
@@ -120,12 +156,17 @@ func (f *FunctionDecl) Merge(other *FunctionDecl) (*FunctionDecl, error) {
disableTypeGuards: f.disableTypeGuards && other.disableTypeGuards,
// default to the current functions declaration state.
state: f.state,
+ doc: f.doc,
}
// If the other state indicates that the declaration should be explicitly enabled or
// disabled, then update the merged state with the most recent value.
if other.state != declarationStateUnset {
merged.state = other.state
}
+ // Allow for non-empty overrides of documentation
+ if len(other.doc) != 0 && f.doc != other.doc {
+ merged.doc = other.doc
+ }
// baseline copy of the overloads and their ordinals
copy(merged.overloadOrdinals, f.overloadOrdinals)
for oID, o := range f.overloads {
@@ -148,6 +189,70 @@ func (f *FunctionDecl) Merge(other *FunctionDecl) (*FunctionDecl, error) {
return merged, nil
}
+// FunctionSubsetter subsets a function declaration or returns nil and false if the function
+// subset was empty.
+type FunctionSubsetter func(fn *FunctionDecl) (*FunctionDecl, bool)
+
+// OverloadSelector selects an overload associated with a given function when it returns true.
+//
+// Used in combination with the Subset method.
+type OverloadSelector func(overload *OverloadDecl) bool
+
+// IncludeOverloads defines an OverloadSelector which allow-lists a set of overloads by their ids.
+func IncludeOverloads(overloadIDs ...string) OverloadSelector {
+ return func(overload *OverloadDecl) bool {
+ for _, oID := range overloadIDs {
+ if overload.id == oID {
+ return true
+ }
+ }
+ return false
+ }
+}
+
+// ExcludeOverloads defines an OverloadSelector which deny-lists a set of overloads by their ids.
+func ExcludeOverloads(overloadIDs ...string) OverloadSelector {
+ return func(overload *OverloadDecl) bool {
+ for _, oID := range overloadIDs {
+ if overload.id == oID {
+ return false
+ }
+ }
+ return true
+ }
+}
+
+// Subset returns a new function declaration which contains only the overloads with the specified IDs.
+// If the subset function contains no overloads, then nil is returned to indicate the function is not
+// functional.
+func (f *FunctionDecl) Subset(selector OverloadSelector) *FunctionDecl {
+ if f == nil {
+ return nil
+ }
+ overloads := make(map[string]*OverloadDecl)
+ overloadOrdinals := make([]string, 0, len(f.overloadOrdinals))
+ for _, oID := range f.overloadOrdinals {
+ overload := f.overloads[oID]
+ if selector(overload) {
+ overloads[oID] = overload
+ overloadOrdinals = append(overloadOrdinals, oID)
+ }
+ }
+ if len(overloads) == 0 {
+ return nil
+ }
+ subset := &FunctionDecl{
+ name: f.Name(),
+ doc: f.doc,
+ overloads: overloads,
+ singleton: f.singleton,
+ disableTypeGuards: f.disableTypeGuards,
+ state: f.state,
+ overloadOrdinals: overloadOrdinals,
+ }
+ return subset
+}
+
// AddOverload ensures that the new overload does not collide with an existing overload signature;
// however, if the function signatures are identical, the implementation may be rewritten as its
// difficult to compare functions by object identity.
@@ -155,6 +260,9 @@ func (f *FunctionDecl) AddOverload(overload *OverloadDecl) error {
if f == nil {
return fmt.Errorf("nil function cannot add overload: %s", overload.ID())
}
+ if overload == nil {
+ return fmt.Errorf("cannot add nil overload to funciton: %s", f.Name())
+ }
for oID, o := range f.overloads {
if oID != overload.ID() && o.SignatureOverlaps(overload) {
return fmt.Errorf("overload signature collision in function %s: %s collides with %s", f.Name(), oID, overload.ID())
@@ -162,11 +270,20 @@ func (f *FunctionDecl) AddOverload(overload *OverloadDecl) error {
if oID == overload.ID() {
if o.SignatureEquals(overload) && o.IsNonStrict() == overload.IsNonStrict() {
// Allow redefinition of an overload implementation so long as the signatures match.
- f.overloads[oID] = overload
+ if overload.hasBinding() {
+ f.overloads[oID] = overload
+ }
+ // Allow redefinition of the doc string.
+ if len(overload.doc) != 0 && o.doc != overload.doc {
+ o.doc = overload.doc
+ }
return nil
}
return fmt.Errorf("overload redefinition in function. %s: %s has multiple definitions", f.Name(), oID)
}
+ if overload.HasLateBinding() != o.HasLateBinding() {
+ return fmt.Errorf("overload with late binding cannot be added to function %s: cannot mix late and non-late bindings", f.Name())
+ }
}
f.overloadOrdinals = append(f.overloadOrdinals, overload.ID())
f.overloads[overload.ID()] = overload
@@ -175,8 +292,9 @@ func (f *FunctionDecl) AddOverload(overload *OverloadDecl) error {
// OverloadDecls returns the overload declarations in the order in which they were declared.
func (f *FunctionDecl) OverloadDecls() []*OverloadDecl {
+ var emptySet []*OverloadDecl
if f == nil {
- return []*OverloadDecl{}
+ return emptySet
}
overloads := make([]*OverloadDecl, 0, len(f.overloads))
for _, oID := range f.overloadOrdinals {
@@ -185,15 +303,31 @@ func (f *FunctionDecl) OverloadDecls() []*OverloadDecl {
return overloads
}
+// HasLateBinding returns true if the function has late bindings. A function cannot mix late bindings with other bindings.
+func (f *FunctionDecl) HasLateBinding() bool {
+ if f == nil {
+ return false
+ }
+ for _, oID := range f.overloadOrdinals {
+ if f.overloads[oID].HasLateBinding() {
+ return true
+ }
+ }
+ return false
+}
+
// Bindings produces a set of function bindings, if any are defined.
func (f *FunctionDecl) Bindings() ([]*functions.Overload, error) {
+ var emptySet []*functions.Overload
if f == nil {
- return []*functions.Overload{}, nil
+ return emptySet, nil
}
overloads := []*functions.Overload{}
nonStrict := false
+ hasLateBinding := false
for _, oID := range f.overloadOrdinals {
o := f.overloads[oID]
+ hasLateBinding = hasLateBinding || o.HasLateBinding()
if o.hasBinding() {
overload := &functions.Overload{
Operator: o.ID(),
@@ -211,6 +345,9 @@ func (f *FunctionDecl) Bindings() ([]*functions.Overload, error) {
if len(overloads) != 0 {
return nil, fmt.Errorf("singleton function incompatible with specialized overloads: %s", f.Name())
}
+ if hasLateBinding {
+ return nil, fmt.Errorf("singleton function incompatible with late bindings: %s", f.Name())
+ }
overloads = []*functions.Overload{
{
Operator: f.Name(),
@@ -249,15 +386,15 @@ func (f *FunctionDecl) Bindings() ([]*functions.Overload, error) {
// are preserved in order to assist with the function resolution step.
switch len(args) {
case 1:
- if o.unaryOp != nil && o.matchesRuntimeSignature( /* disableTypeGuards=*/ false, args...) {
+ if o.unaryOp != nil && o.matchesRuntimeSignature(f.disableTypeGuards, args...) {
return o.unaryOp(args[0])
}
case 2:
- if o.binaryOp != nil && o.matchesRuntimeSignature( /* disableTypeGuards=*/ false, args...) {
+ if o.binaryOp != nil && o.matchesRuntimeSignature(f.disableTypeGuards, args...) {
return o.binaryOp(args[0], args[1])
}
}
- if o.functionOp != nil && o.matchesRuntimeSignature( /* disableTypeGuards=*/ false, args...) {
+ if o.functionOp != nil && o.matchesRuntimeSignature(f.disableTypeGuards, args...) {
return o.functionOp(args...)
}
// eventually this will fall through to the noSuchOverload below.
@@ -296,6 +433,14 @@ func MaybeNoSuchOverload(funcName string, args ...ref.Val) ref.Val {
// FunctionOpt defines a functional option for mutating a function declaration.
type FunctionOpt func(*FunctionDecl) (*FunctionDecl, error)
+// FunctionDocs configures documentation from a list of strings separated by newlines.
+func FunctionDocs(docs ...string) FunctionOpt {
+ return func(fn *FunctionDecl) (*FunctionDecl, error) {
+ fn.doc = common.MultilineDescription(docs...)
+ return fn, nil
+ }
+}
+
// DisableTypeGuards disables automatically generated function invocation guards on direct overload calls.
// Type guards remain on during dynamic dispatch for parsed-only expressions.
func DisableTypeGuards(value bool) FunctionOpt {
@@ -448,9 +593,13 @@ func newOverloadInternal(overloadID string,
// implementation.
type OverloadDecl struct {
id string
+ doc string
argTypes []*types.Type
resultType *types.Type
isMemberFunction bool
+ // hasLateBinding indicates that the function has a binding which is not known at compile time.
+ // This is useful for functions which have side-effects or are not deterministically computable.
+ hasLateBinding bool
// nonStrict indicates that the function will accept error and unknown arguments as inputs.
nonStrict bool
// operandTrait indicates whether the member argument should have a specific type-trait.
@@ -467,6 +616,15 @@ type OverloadDecl struct {
functionOp functions.FunctionOp
}
+// Examples returns a list of string examples for the overload.
+func (o *OverloadDecl) Examples() []string {
+ var emptySet []string
+ if o == nil || len(o.doc) == 0 {
+ return emptySet
+ }
+ return common.ParseDescriptions(o.doc)
+}
+
// ID mirrors the overload signature and provides a unique id which may be referenced within the type-checker
// and interpreter to optimize performance.
//
@@ -506,6 +664,14 @@ func (o *OverloadDecl) IsNonStrict() bool {
return o.nonStrict
}
+// HasLateBinding returns whether the overload has a binding which is not known at compile time.
+func (o *OverloadDecl) HasLateBinding() bool {
+ if o == nil {
+ return false
+ }
+ return o.hasLateBinding
+}
+
// OperandTrait returns the trait mask of the first operand to the overload call, e.g.
// `traits.Indexer`
func (o *OverloadDecl) OperandTrait() int {
@@ -664,6 +830,14 @@ func matchOperandTrait(trait int, arg ref.Val) bool {
// OverloadOpt is a functional option for configuring a function overload.
type OverloadOpt func(*OverloadDecl) (*OverloadDecl, error)
+// OverloadExamples configures example expressions for the overload.
+func OverloadExamples(examples ...string) OverloadOpt {
+ return func(o *OverloadDecl) (*OverloadDecl, error) {
+ o.doc = common.MultilineDescription(examples...)
+ return o, nil
+ }
+}
+
// UnaryBinding provides the implementation of a unary overload. The provided function is protected by a runtime
// type-guard which ensures runtime type agreement between the overload signature and runtime argument types.
func UnaryBinding(binding functions.UnaryOp) OverloadOpt {
@@ -674,6 +848,9 @@ func UnaryBinding(binding functions.UnaryOp) OverloadOpt {
if len(o.ArgTypes()) != 1 {
return nil, fmt.Errorf("unary function bound to non-unary overload: %s", o.ID())
}
+ if o.hasLateBinding {
+ return nil, fmt.Errorf("overload already has a late binding: %s", o.ID())
+ }
o.unaryOp = binding
return o, nil
}
@@ -689,6 +866,9 @@ func BinaryBinding(binding functions.BinaryOp) OverloadOpt {
if len(o.ArgTypes()) != 2 {
return nil, fmt.Errorf("binary function bound to non-binary overload: %s", o.ID())
}
+ if o.hasLateBinding {
+ return nil, fmt.Errorf("overload already has a late binding: %s", o.ID())
+ }
o.binaryOp = binding
return o, nil
}
@@ -701,11 +881,26 @@ func FunctionBinding(binding functions.FunctionOp) OverloadOpt {
if o.hasBinding() {
return nil, fmt.Errorf("overload already has a binding: %s", o.ID())
}
+ if o.hasLateBinding {
+ return nil, fmt.Errorf("overload already has a late binding: %s", o.ID())
+ }
o.functionOp = binding
return o, nil
}
}
+// LateFunctionBinding indicates that the function has a binding which is not known at compile time.
+// This is useful for functions which have side-effects or are not deterministically computable.
+func LateFunctionBinding() OverloadOpt {
+ return func(o *OverloadDecl) (*OverloadDecl, error) {
+ if o.hasBinding() {
+ return nil, fmt.Errorf("overload already has a binding: %s", o.ID())
+ }
+ o.hasLateBinding = true
+ return o, nil
+ }
+}
+
// OverloadIsNonStrict enables the function to be called with error and unknown argument values.
//
// Note: do not use this option unless absoluately necessary as it should be an uncommon feature.
@@ -735,13 +930,27 @@ func NewVariable(name string, t *types.Type) *VariableDecl {
return &VariableDecl{name: name, varType: t}
}
+// NewVariableWithDoc creates a new variable declaration with usage documentation.
+func NewVariableWithDoc(name string, t *types.Type, doc string) *VariableDecl {
+ return &VariableDecl{name: name, varType: t, doc: doc}
+}
+
// VariableDecl defines a variable declaration which may optionally have a constant value.
type VariableDecl struct {
name string
+ doc string
varType *types.Type
value ref.Val
}
+// Documentation returns name, type, and description for the variable.
+func (v *VariableDecl) Documentation() *common.Doc {
+ if v == nil {
+ return nil
+ }
+ return common.NewVariableDoc(v.Name(), describeCELType(v.Type()), v.Description())
+}
+
// Name returns the fully-qualified variable name
func (v *VariableDecl) Name() string {
if v == nil {
@@ -750,6 +959,16 @@ func (v *VariableDecl) Name() string {
return v.name
}
+// Description returns the usage documentation for the variable, if set.
+//
+// Good usage instructions provide information about the valid formats, ranges, sizes for the variable type.
+func (v *VariableDecl) Description() string {
+ if v == nil {
+ return ""
+ }
+ return v.doc
+}
+
// Type returns the types.Type value associated with the variable.
func (v *VariableDecl) Type() *types.Type {
if v == nil {
@@ -775,22 +994,32 @@ func (v *VariableDecl) DeclarationIsEquivalent(other *VariableDecl) bool {
return v.Name() == other.Name() && v.Type().IsEquivalentType(other.Type())
}
+// TypeVariable creates a new type identifier for use within a types.Provider
+func TypeVariable(t *types.Type) *VariableDecl {
+ return NewVariable(t.TypeName(), types.NewTypeTypeWithParam(t))
+}
+
// VariableDeclToExprDecl converts a go-native variable declaration into a protobuf-type variable declaration.
func VariableDeclToExprDecl(v *VariableDecl) (*exprpb.Decl, error) {
+ return variableDeclToExprDecl(v)
+}
+
+// variableDeclToExprDecl converts a go-native variable declaration into a protobuf-type variable declaration.
+func variableDeclToExprDecl(v *VariableDecl) (*exprpb.Decl, error) {
varType, err := types.TypeToExprType(v.Type())
if err != nil {
return nil, err
}
- return chkdecls.NewVar(v.Name(), varType), nil
-}
-
-// TypeVariable creates a new type identifier for use within a types.Provider
-func TypeVariable(t *types.Type) *VariableDecl {
- return NewVariable(t.TypeName(), types.NewTypeTypeWithParam(t))
+ return chkdecls.NewVarWithDoc(v.Name(), varType, v.doc), nil
}
// FunctionDeclToExprDecl converts a go-native function declaration into a protobuf-typed function declaration.
func FunctionDeclToExprDecl(f *FunctionDecl) (*exprpb.Decl, error) {
+ return functionDeclToExprDecl(f)
+}
+
+// functionDeclToExprDecl converts a go-native function declaration into a protobuf-typed function declaration.
+func functionDeclToExprDecl(f *FunctionDecl) (*exprpb.Decl, error) {
overloads := make([]*exprpb.Decl_FunctionDecl_Overload, len(f.overloads))
for i, oID := range f.overloadOrdinals {
o := f.overloads[oID]
@@ -826,8 +1055,10 @@ func FunctionDeclToExprDecl(f *FunctionDecl) (*exprpb.Decl, error) {
overloads[i] = chkdecls.NewParameterizedOverload(oID, argTypes, resultType, params)
}
}
+ doc := common.MultilineDescription(o.Examples()...)
+ overloads[i].Doc = doc
}
- return chkdecls.NewFunction(f.Name(), overloads...), nil
+ return chkdecls.NewFunctionWithDoc(f.Name(), f.Description(), overloads...), nil
}
func collectParamNames(paramNames map[string]struct{}, arg *types.Type) {
@@ -839,6 +1070,60 @@ func collectParamNames(paramNames map[string]struct{}, arg *types.Type) {
}
}
+func formatSignature(fnName string, o *OverloadDecl) string {
+ if opName, isOperator := operators.FindReverse(fnName); isOperator {
+ if opName == "" {
+ opName = fnName
+ }
+ return formatOperator(opName, o)
+ }
+ return formatCall(fnName, o)
+}
+
+func formatOperator(opName string, o *OverloadDecl) string {
+ args := o.ArgTypes()
+ argTypes := make([]string, len(o.ArgTypes()))
+ for j, a := range args {
+ argTypes[j] = describeCELType(a)
+ }
+ ret := describeCELType(o.ResultType())
+ switch len(args) {
+ case 1:
+ return fmt.Sprintf("%s%s -> %s", opName, argTypes[0], ret)
+ case 2:
+ if opName == operators.Index {
+ return fmt.Sprintf("%s[%s] -> %s", argTypes[0], argTypes[1], ret)
+ }
+ return fmt.Sprintf("%s %s %s -> %s", argTypes[0], opName, argTypes[1], ret)
+ default:
+ if opName == operators.Conditional {
+ return fmt.Sprint("bool ? : -> ")
+ }
+ return formatCall(opName, o)
+ }
+}
+
+func formatCall(funcName string, o *OverloadDecl) string {
+ args := make([]string, len(o.ArgTypes()))
+ ret := describeCELType(o.ResultType())
+ for j, a := range o.ArgTypes() {
+ args[j] = describeCELType(a)
+ }
+ if o.IsMemberFunction() {
+ target := args[0]
+ args = args[1:]
+ return fmt.Sprintf("%s.%s(%s) -> %s", target, funcName, strings.Join(args, ", "), ret)
+ }
+ return fmt.Sprintf("%s(%s) -> %s", funcName, strings.Join(args, ", "), ret)
+}
+
+func describeCELType(t *types.Type) string {
+ if t.Kind() == types.TypeKind {
+ return "type"
+ }
+ return t.String()
+}
+
var (
- emptyArgs = []*types.Type{}
+ emptyArgs []*types.Type
)
diff --git a/vendor/github.com/google/cel-go/common/doc.go b/vendor/github.com/google/cel-go/common/doc.go
index 5362fdfe4b3d..06eae3642acd 100644
--- a/vendor/github.com/google/cel-go/common/doc.go
+++ b/vendor/github.com/google/cel-go/common/doc.go
@@ -15,3 +15,157 @@
// Package common defines types and utilities common to expression parsing,
// checking, and interpretation
package common
+
+import (
+ "strings"
+ "unicode"
+)
+
+// DocKind indicates the type of documentation element.
+type DocKind int
+
+const (
+ // DocEnv represents environment variable documentation.
+ DocEnv DocKind = iota + 1
+ // DocFunction represents function documentation.
+ DocFunction
+ // DocOverload represents function overload documentation.
+ DocOverload
+ // DocVariable represents variable documentation.
+ DocVariable
+ // DocMacro represents macro documentation.
+ DocMacro
+ // DocExample represents example documentation.
+ DocExample
+)
+
+// Doc holds the documentation details for a specific program element like
+// a variable, function, macro, or example.
+type Doc struct {
+ // Kind specifies the type of documentation element (e.g., Function, Variable).
+ Kind DocKind
+
+ // Name is the identifier of the documented element (e.g., function name, variable name).
+ Name string
+
+ // Type is the data type associated with the element, primarily used for variables.
+ Type string
+
+ // Signature represents the function or overload signature.
+ Signature string
+
+ // Description holds the textual description of the element, potentially spanning multiple lines.
+ Description string
+
+ // Children holds nested documentation elements, such as overloads for a function
+ // or examples for a function/macro.
+ Children []*Doc
+}
+
+// MultilineDescription combines multiple lines into a newline separated string.
+func MultilineDescription(lines ...string) string {
+ return strings.Join(lines, "\n")
+}
+
+// ParseDescription takes a single string containing newline characters and splits
+// it into a multiline description. All empty lines will be skipped.
+//
+// Returns an empty string if the input string is empty.
+func ParseDescription(doc string) string {
+ var lines []string
+ if len(doc) != 0 {
+ // Split the input string by newline characters.
+ for _, line := range strings.Split(doc, "\n") {
+ l := strings.TrimRightFunc(line, unicode.IsSpace)
+ if len(l) == 0 {
+ continue
+ }
+ lines = append(lines, l)
+ }
+ }
+ // Return an empty slice if the input is empty.
+ return MultilineDescription(lines...)
+}
+
+// ParseDescriptions splits a documentation string into multiple multi-line description
+// sections, using blank lines as delimiters.
+func ParseDescriptions(doc string) []string {
+ var examples []string
+ if len(doc) != 0 {
+ lines := strings.Split(doc, "\n")
+ lineStart := 0
+ for i, l := range lines {
+ // Trim trailing whitespace to identify effectively blank lines.
+ l = strings.TrimRightFunc(l, unicode.IsSpace)
+ // If a line is blank, it marks the end of the current section.
+ if len(l) == 0 {
+ // Start the next section after the blank line.
+ ex := lines[lineStart:i]
+ if len(ex) != 0 {
+ examples = append(examples, MultilineDescription(ex...))
+ }
+ lineStart = i + 1
+ }
+ }
+ // Append the last section if it wasn't terminated by a blank line.
+ if lineStart < len(lines) {
+ examples = append(examples, MultilineDescription(lines[lineStart:]...))
+ }
+ }
+ return examples
+}
+
+// NewVariableDoc creates a new Doc struct specifically for documenting a variable.
+func NewVariableDoc(name, celType, description string) *Doc {
+ return &Doc{
+ Kind: DocVariable,
+ Name: name,
+ Type: celType,
+ Description: ParseDescription(description),
+ }
+}
+
+// NewFunctionDoc creates a new Doc struct for documenting a function.
+func NewFunctionDoc(name, description string, overloads ...*Doc) *Doc {
+ return &Doc{
+ Kind: DocFunction,
+ Name: name,
+ Description: ParseDescription(description),
+ Children: overloads,
+ }
+}
+
+// NewOverloadDoc creates a new Doc struct for a function example.
+func NewOverloadDoc(id, signature string, examples ...*Doc) *Doc {
+ return &Doc{
+ Kind: DocOverload,
+ Name: id,
+ Signature: signature,
+ Children: examples,
+ }
+}
+
+// NewMacroDoc creates a new Doc struct for documenting a macro.
+func NewMacroDoc(name, description string, examples ...*Doc) *Doc {
+ return &Doc{
+ Kind: DocMacro,
+ Name: name,
+ Description: ParseDescription(description),
+ Children: examples,
+ }
+}
+
+// NewExampleDoc creates a new Doc struct specifically for holding an example.
+func NewExampleDoc(ex string) *Doc {
+ return &Doc{
+ Kind: DocExample,
+ Description: ex,
+ }
+}
+
+// Documentor is an interface for types that can provide their own documentation.
+type Documentor interface {
+ // Documentation returns the documentation coded by the DocKind to assist
+ // with text formatting.
+ Documentation() *Doc
+}
diff --git a/vendor/github.com/google/cel-go/common/env/BUILD.bazel b/vendor/github.com/google/cel-go/common/env/BUILD.bazel
new file mode 100644
index 000000000000..aebe1e544c07
--- /dev/null
+++ b/vendor/github.com/google/cel-go/common/env/BUILD.bazel
@@ -0,0 +1,50 @@
+# Copyright 2025 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
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+package(
+ default_visibility = ["//visibility:public"],
+ licenses = ["notice"], # Apache 2.0
+)
+
+go_library(
+ name = "go_default_library",
+ srcs = [
+ "env.go",
+ ],
+ importpath = "github.com/google/cel-go/common/env",
+ deps = [
+ "//common:go_default_library",
+ "//common/decls:go_default_library",
+ "//common/types:go_default_library",
+ ],
+)
+
+go_test(
+ name = "go_default_test",
+ size = "small",
+ srcs = [
+ "env_test.go",
+ ],
+ data = glob(["testdata/**"]),
+ embed = [":go_default_library"],
+ deps = [
+ "//common/decls:go_default_library",
+ "//common/operators:go_default_library",
+ "//common/overloads:go_default_library",
+ "//common/types:go_default_library",
+ "@in_gopkg_yaml_v3//:go_default_library",
+ ],
+)
diff --git a/vendor/github.com/google/cel-go/common/env/env.go b/vendor/github.com/google/cel-go/common/env/env.go
new file mode 100644
index 000000000000..d848860c2c5f
--- /dev/null
+++ b/vendor/github.com/google/cel-go/common/env/env.go
@@ -0,0 +1,887 @@
+// Copyright 2025 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 env provides a representation of a CEL environment.
+package env
+
+import (
+ "errors"
+ "fmt"
+ "math"
+ "strconv"
+ "strings"
+
+ "github.com/google/cel-go/common/decls"
+ "github.com/google/cel-go/common/types"
+)
+
+// NewConfig creates an instance of a YAML serializable CEL environment configuration.
+func NewConfig(name string) *Config {
+ return &Config{
+ Name: name,
+ }
+}
+
+// Config represents a serializable form of the CEL environment configuration.
+//
+// Note: custom validations, feature flags, and performance tuning parameters are not (yet)
+// considered part of the core CEL environment configuration and should be managed separately
+// until a common convention for such settings is developed.
+type Config struct {
+ Name string `yaml:"name,omitempty"`
+ Description string `yaml:"description,omitempty"`
+ Container string `yaml:"container,omitempty"`
+ Imports []*Import `yaml:"imports,omitempty"`
+ StdLib *LibrarySubset `yaml:"stdlib,omitempty"`
+ Extensions []*Extension `yaml:"extensions,omitempty"`
+ ContextVariable *ContextVariable `yaml:"context_variable,omitempty"`
+ Variables []*Variable `yaml:"variables,omitempty"`
+ Functions []*Function `yaml:"functions,omitempty"`
+ Validators []*Validator `yaml:"validators,omitempty"`
+ Features []*Feature `yaml:"features,omitempty"`
+}
+
+// Validate validates the whole configuration is well-formed.
+func (c *Config) Validate() error {
+ if c == nil {
+ return nil
+ }
+ var errs []error
+ for _, imp := range c.Imports {
+ if err := imp.Validate(); err != nil {
+ errs = append(errs, err)
+ }
+ }
+ if err := c.StdLib.Validate(); err != nil {
+ errs = append(errs, err)
+ }
+ for _, ext := range c.Extensions {
+ if err := ext.Validate(); err != nil {
+ errs = append(errs, err)
+ }
+ }
+ if err := c.ContextVariable.Validate(); err != nil {
+ errs = append(errs, err)
+ }
+ if c.ContextVariable != nil && len(c.Variables) != 0 {
+ errs = append(errs, errors.New("invalid config: either context variable or variables may be set, but not both"))
+ }
+ for _, v := range c.Variables {
+ if err := v.Validate(); err != nil {
+ errs = append(errs, err)
+ }
+ }
+ for _, fn := range c.Functions {
+ if err := fn.Validate(); err != nil {
+ errs = append(errs, err)
+ }
+ }
+ for _, feat := range c.Features {
+ if err := feat.Validate(); err != nil {
+ errs = append(errs, err)
+ }
+ }
+ for _, val := range c.Validators {
+ if err := val.Validate(); err != nil {
+ errs = append(errs, err)
+ }
+ }
+ return errors.Join(errs...)
+}
+
+// SetContainer configures the container name for this configuration.
+func (c *Config) SetContainer(container string) *Config {
+ c.Container = container
+ return c
+}
+
+// AddVariableDecls adds one or more variables to the config, converting them to serializable values first.
+//
+// VariableDecl inputs are expected to be well-formed.
+func (c *Config) AddVariableDecls(vars ...*decls.VariableDecl) *Config {
+ convVars := make([]*Variable, len(vars))
+ for i, v := range vars {
+ if v == nil {
+ continue
+ }
+ cv := NewVariable(v.Name(), SerializeTypeDesc(v.Type()))
+ cv.Description = v.Description()
+ convVars[i] = cv
+ }
+ return c.AddVariables(convVars...)
+}
+
+// AddVariables adds one or more vairables to the config.
+func (c *Config) AddVariables(vars ...*Variable) *Config {
+ c.Variables = append(c.Variables, vars...)
+ return c
+}
+
+// SetContextVariable configures the ContextVariable for this configuration.
+func (c *Config) SetContextVariable(ctx *ContextVariable) *Config {
+ c.ContextVariable = ctx
+ return c
+}
+
+// AddFunctionDecls adds one or more functions to the config, converting them to serializable values first.
+//
+// FunctionDecl inputs are expected to be well-formed.
+func (c *Config) AddFunctionDecls(funcs ...*decls.FunctionDecl) *Config {
+ convFuncs := make([]*Function, len(funcs))
+ for i, fn := range funcs {
+ if fn == nil {
+ continue
+ }
+ overloads := make([]*Overload, 0, len(fn.OverloadDecls()))
+ for _, o := range fn.OverloadDecls() {
+ overloadID := o.ID()
+ args := make([]*TypeDesc, 0, len(o.ArgTypes()))
+ for _, a := range o.ArgTypes() {
+ args = append(args, SerializeTypeDesc(a))
+ }
+ ret := SerializeTypeDesc(o.ResultType())
+ var overload *Overload
+ if o.IsMemberFunction() {
+ overload = NewMemberOverload(overloadID, args[0], args[1:], ret)
+ } else {
+ overload = NewOverload(overloadID, args, ret)
+ }
+ exampleCount := len(o.Examples())
+ if exampleCount > 0 {
+ overload.Examples = o.Examples()
+ }
+ overloads = append(overloads, overload)
+ }
+ cf := NewFunction(fn.Name(), overloads...)
+ cf.Description = fn.Description()
+ convFuncs[i] = cf
+ }
+ return c.AddFunctions(convFuncs...)
+}
+
+// AddFunctions adds one or more functions to the config.
+func (c *Config) AddFunctions(funcs ...*Function) *Config {
+ c.Functions = append(c.Functions, funcs...)
+ return c
+}
+
+// SetStdLib configures the LibrarySubset for the standard library.
+func (c *Config) SetStdLib(subset *LibrarySubset) *Config {
+ c.StdLib = subset
+ return c
+}
+
+// AddImports appends a set of imports to the config.
+func (c *Config) AddImports(imps ...*Import) *Config {
+ c.Imports = append(c.Imports, imps...)
+ return c
+}
+
+// AddExtensions appends a set of extensions to the config.
+func (c *Config) AddExtensions(exts ...*Extension) *Config {
+ c.Extensions = append(c.Extensions, exts...)
+ return c
+}
+
+// AddValidators appends one or more validators to the config.
+func (c *Config) AddValidators(vals ...*Validator) *Config {
+ c.Validators = append(c.Validators, vals...)
+ return c
+}
+
+// AddFeatures appends one or more features to the config.
+func (c *Config) AddFeatures(feats ...*Feature) *Config {
+ c.Features = append(c.Features, feats...)
+ return c
+}
+
+// NewImport returns a serializable import value from the qualified type name.
+func NewImport(name string) *Import {
+ return &Import{Name: name}
+}
+
+// Import represents a type name that will be appreviated by its simple name using
+// the cel.Abbrevs() option.
+type Import struct {
+ Name string `yaml:"name"`
+}
+
+// Validate validates the import configuration is well-formed.
+func (imp *Import) Validate() error {
+ if imp == nil {
+ return errors.New("invalid import: nil")
+ }
+ if imp.Name == "" {
+ return errors.New("invalid import: missing type name")
+ }
+ return nil
+}
+
+// NewVariable returns a serializable variable from a name and type definition
+func NewVariable(name string, t *TypeDesc) *Variable {
+ return NewVariableWithDoc(name, t, "")
+}
+
+// NewVariableWithDoc returns a serializable variable from a name, type definition, and doc string.
+func NewVariableWithDoc(name string, t *TypeDesc, doc string) *Variable {
+ return &Variable{Name: name, TypeDesc: t, Description: doc}
+}
+
+// Variable represents a typed variable declaration which will be published via the
+// cel.VariableDecls() option.
+type Variable struct {
+ Name string `yaml:"name"`
+ Description string `yaml:"description,omitempty"`
+
+ // Type represents the type declaration for the variable.
+ //
+ // Deprecated: use the embedded *TypeDesc fields directly.
+ Type *TypeDesc `yaml:"type,omitempty"`
+
+ // TypeDesc is an embedded set of fields allowing for the specification of the Variable type.
+ *TypeDesc `yaml:",inline"`
+}
+
+// Validate validates the variable configuration is well-formed.
+func (v *Variable) Validate() error {
+ if v == nil {
+ return errors.New("invalid variable: nil")
+ }
+ if v.Name == "" {
+ return errors.New("invalid variable: missing variable name")
+ }
+ if err := v.GetType().Validate(); err != nil {
+ return fmt.Errorf("invalid variable %q: %w", v.Name, err)
+ }
+ return nil
+}
+
+// GetType returns the variable type description.
+//
+// Note, if both the embedded TypeDesc and the field Type are non-nil, the embedded TypeDesc will
+// take precedence.
+func (v *Variable) GetType() *TypeDesc {
+ if v == nil {
+ return nil
+ }
+ if v.TypeDesc != nil {
+ return v.TypeDesc
+ }
+ if v.Type != nil {
+ return v.Type
+ }
+ return nil
+}
+
+// AsCELVariable converts the serializable form of the Variable into a CEL environment declaration.
+func (v *Variable) AsCELVariable(tp types.Provider) (*decls.VariableDecl, error) {
+ if err := v.Validate(); err != nil {
+ return nil, err
+ }
+ t, err := v.GetType().AsCELType(tp)
+ if err != nil {
+ return nil, fmt.Errorf("invalid variable %q: %w", v.Name, err)
+ }
+ return decls.NewVariableWithDoc(v.Name, t, v.Description), nil
+}
+
+// NewContextVariable returns a serializable context variable with a specific type name.
+func NewContextVariable(typeName string) *ContextVariable {
+ return &ContextVariable{TypeName: typeName}
+}
+
+// ContextVariable represents a structured message whose fields are to be treated as the top-level
+// variable identifiers within CEL expressions.
+type ContextVariable struct {
+ // TypeName represents the fully qualified typename of the context variable.
+ // Currently, only protobuf types are supported.
+ TypeName string `yaml:"type_name"`
+}
+
+// Validate validates the context-variable configuration is well-formed.
+func (ctx *ContextVariable) Validate() error {
+ if ctx == nil {
+ return nil
+ }
+ if ctx.TypeName == "" {
+ return errors.New("invalid context variable: missing type name")
+ }
+ return nil
+}
+
+// NewFunction creates a serializable function and overload set.
+func NewFunction(name string, overloads ...*Overload) *Function {
+ return &Function{Name: name, Overloads: overloads}
+}
+
+// NewFunctionWithDoc creates a serializable function and overload set.
+func NewFunctionWithDoc(name, doc string, overloads ...*Overload) *Function {
+ return &Function{Name: name, Description: doc, Overloads: overloads}
+}
+
+// Function represents the serializable format of a function and its overloads.
+type Function struct {
+ Name string `yaml:"name"`
+ Description string `yaml:"description,omitempty"`
+ Overloads []*Overload `yaml:"overloads,omitempty"`
+}
+
+// Validate validates the function configuration is well-formed.
+func (fn *Function) Validate() error {
+ if fn == nil {
+ return errors.New("invalid function: nil")
+ }
+ if fn.Name == "" {
+ return errors.New("invalid function: missing function name")
+ }
+ if len(fn.Overloads) == 0 {
+ return fmt.Errorf("invalid function %q: missing overloads", fn.Name)
+ }
+ var errs []error
+ for _, o := range fn.Overloads {
+ if err := o.Validate(); err != nil {
+ errs = append(errs, fmt.Errorf("invalid function %q: %w", fn.Name, err))
+ }
+ }
+ return errors.Join(errs...)
+}
+
+// AsCELFunction converts the serializable form of the Function into CEL environment declaration.
+func (fn *Function) AsCELFunction(tp types.Provider) (*decls.FunctionDecl, error) {
+ if err := fn.Validate(); err != nil {
+ return nil, err
+ }
+ opts := make([]decls.FunctionOpt, 0, len(fn.Overloads)+1)
+ for _, o := range fn.Overloads {
+ opt, err := o.AsFunctionOption(tp)
+ opts = append(opts, opt)
+ if err != nil {
+ return nil, fmt.Errorf("invalid function %q: %w", fn.Name, err)
+ }
+ }
+ if len(fn.Description) != 0 {
+ opts = append(opts, decls.FunctionDocs(fn.Description))
+ }
+ return decls.NewFunction(fn.Name, opts...)
+}
+
+// NewOverload returns a new serializable representation of a global overload.
+func NewOverload(id string, args []*TypeDesc, ret *TypeDesc, examples ...string) *Overload {
+ return &Overload{ID: id, Args: args, Return: ret, Examples: examples}
+}
+
+// NewMemberOverload returns a new serializable representation of a member (receiver) overload.
+func NewMemberOverload(id string, target *TypeDesc, args []*TypeDesc, ret *TypeDesc, examples ...string) *Overload {
+ return &Overload{ID: id, Target: target, Args: args, Return: ret, Examples: examples}
+}
+
+// Overload represents the serializable format of a function overload.
+type Overload struct {
+ ID string `yaml:"id"`
+ Examples []string `yaml:"examples,omitempty"`
+ Target *TypeDesc `yaml:"target,omitempty"`
+ Args []*TypeDesc `yaml:"args,omitempty"`
+ Return *TypeDesc `yaml:"return,omitempty"`
+}
+
+// Validate validates the overload configuration is well-formed.
+func (od *Overload) Validate() error {
+ if od == nil {
+ return errors.New("invalid overload: nil")
+ }
+ if od.ID == "" {
+ return errors.New("invalid overload: missing overload id")
+ }
+ var errs []error
+ if od.Target != nil {
+ if err := od.Target.Validate(); err != nil {
+ errs = append(errs, fmt.Errorf("invalid overload %q target: %w", od.ID, err))
+ }
+ }
+ for i, arg := range od.Args {
+ if err := arg.Validate(); err != nil {
+ errs = append(errs, fmt.Errorf("invalid overload %q arg[%d]: %w", od.ID, i, err))
+ }
+ }
+ if err := od.Return.Validate(); err != nil {
+ errs = append(errs, fmt.Errorf("invalid overload %q return: %w", od.ID, err))
+ }
+ return errors.Join(errs...)
+}
+
+// AsFunctionOption converts the serializable form of the Overload into a function declaration option.
+func (od *Overload) AsFunctionOption(tp types.Provider) (decls.FunctionOpt, error) {
+ if err := od.Validate(); err != nil {
+ return nil, err
+ }
+ args := make([]*types.Type, len(od.Args))
+ var err error
+ var errs []error
+ for i, a := range od.Args {
+ args[i], err = a.AsCELType(tp)
+ if err != nil {
+ errs = append(errs, err)
+ }
+ }
+ result, err := od.Return.AsCELType(tp)
+ if err != nil {
+ errs = append(errs, err)
+ }
+ if od.Target != nil {
+ t, err := od.Target.AsCELType(tp)
+ if err != nil {
+ return nil, errors.Join(append(errs, err)...)
+ }
+ args = append([]*types.Type{t}, args...)
+ return decls.MemberOverload(od.ID, args, result), nil
+ }
+ if len(errs) != 0 {
+ return nil, errors.Join(errs...)
+ }
+ return decls.Overload(od.ID, args, result, decls.OverloadExamples(od.Examples...)), nil
+}
+
+// NewExtension creates a serializable Extension from a name and version string.
+func NewExtension(name string, version uint32) *Extension {
+ versionString := "latest"
+ if version < math.MaxUint32 {
+ versionString = strconv.FormatUint(uint64(version), 10)
+ }
+ return &Extension{
+ Name: name,
+ Version: versionString,
+ }
+}
+
+// Extension represents a named and optionally versioned extension library configured in the environment.
+type Extension struct {
+ // Name is either the LibraryName() or some short-hand simple identifier which is understood by the config-handler.
+ Name string `yaml:"name"`
+
+ // Version may either be an unsigned long value or the string 'latest'. If empty, the value is treated as '0'.
+ Version string `yaml:"version,omitempty"`
+}
+
+// Validate validates the extension configuration is well-formed.
+func (e *Extension) Validate() error {
+ _, err := e.VersionNumber()
+ return err
+}
+
+// VersionNumber returns the parsed version string, or an error if the version cannot be parsed.
+func (e *Extension) VersionNumber() (uint32, error) {
+ if e == nil {
+ return 0, fmt.Errorf("invalid extension: nil")
+ }
+ if e.Name == "" {
+ return 0, fmt.Errorf("invalid extension: missing name")
+ }
+ if e.Version == "latest" {
+ return math.MaxUint32, nil
+ }
+ if e.Version == "" {
+ return 0, nil
+ }
+ ver, err := strconv.ParseUint(e.Version, 10, 32)
+ if err != nil {
+ return 0, fmt.Errorf("invalid extension %q version: %w", e.Name, err)
+ }
+ return uint32(ver), nil
+}
+
+// NewLibrarySubset returns an empty library subsetting config which permits all library features.
+func NewLibrarySubset() *LibrarySubset {
+ return &LibrarySubset{}
+}
+
+// LibrarySubset indicates a subset of the macros and function supported by a subsettable library.
+type LibrarySubset struct {
+ // Disabled indicates whether the library has been disabled, typically only used for
+ // default-enabled libraries like stdlib.
+ Disabled bool `yaml:"disabled,omitempty"`
+
+ // DisableMacros disables macros for the given library.
+ DisableMacros bool `yaml:"disable_macros,omitempty"`
+
+ // IncludeMacros specifies a set of macro function names to include in the subset.
+ IncludeMacros []string `yaml:"include_macros,omitempty"`
+
+ // ExcludeMacros specifies a set of macro function names to exclude from the subset.
+ // Note: if IncludeMacros is non-empty, then ExcludeFunctions is ignored.
+ ExcludeMacros []string `yaml:"exclude_macros,omitempty"`
+
+ // IncludeFunctions specifies a set of functions to include in the subset.
+ //
+ // Note: the overloads specified in the subset need only specify their ID.
+ // Note: if IncludeFunctions is non-empty, then ExcludeFunctions is ignored.
+ IncludeFunctions []*Function `yaml:"include_functions,omitempty"`
+
+ // ExcludeFunctions specifies the set of functions to exclude from the subset.
+ //
+ // Note: the overloads specified in the subset need only specify their ID.
+ ExcludeFunctions []*Function `yaml:"exclude_functions,omitempty"`
+}
+
+// Validate validates the library configuration is well-formed.
+//
+// For example, setting both the IncludeMacros and ExcludeMacros together could be confusing
+// and create a broken expectation, likewise for IncludeFunctions and ExcludeFunctions.
+func (lib *LibrarySubset) Validate() error {
+ if lib == nil {
+ return nil
+ }
+ var errs []error
+ if len(lib.IncludeMacros) != 0 && len(lib.ExcludeMacros) != 0 {
+ errs = append(errs, errors.New("invalid subset: cannot both include and exclude macros"))
+ }
+ if len(lib.IncludeFunctions) != 0 && len(lib.ExcludeFunctions) != 0 {
+ errs = append(errs, errors.New("invalid subset: cannot both include and exclude functions"))
+ }
+ return errors.Join(errs...)
+}
+
+// SubsetFunction produces a function declaration which matches the supported subset, or nil
+// if the function is not supported by the LibrarySubset.
+//
+// For IncludeFunctions, if the function does not specify a set of overloads to include, the
+// whole function definition is included. If overloads are set, then a new function which
+// includes only the specified overloads is produced.
+//
+// For ExcludeFunctions, if the function does not specify a set of overloads to exclude, the
+// whole function definition is excluded. If overloads are set, then a new function which
+// includes only the permitted overloads is produced.
+func (lib *LibrarySubset) SubsetFunction(fn *decls.FunctionDecl) (*decls.FunctionDecl, bool) {
+ // When lib is null, it should indicate that all values are included in the subset.
+ if lib == nil {
+ return fn, true
+ }
+ if lib.Disabled {
+ return nil, false
+ }
+ if len(lib.IncludeFunctions) != 0 {
+ for _, include := range lib.IncludeFunctions {
+ if include.Name != fn.Name() {
+ continue
+ }
+ if len(include.Overloads) == 0 {
+ return fn, true
+ }
+ overloadIDs := make([]string, len(include.Overloads))
+ for i, o := range include.Overloads {
+ overloadIDs[i] = o.ID
+ }
+ return fn.Subset(decls.IncludeOverloads(overloadIDs...)), true
+ }
+ return nil, false
+ }
+ if len(lib.ExcludeFunctions) != 0 {
+ for _, exclude := range lib.ExcludeFunctions {
+ if exclude.Name != fn.Name() {
+ continue
+ }
+ if len(exclude.Overloads) == 0 {
+ return nil, false
+ }
+ overloadIDs := make([]string, len(exclude.Overloads))
+ for i, o := range exclude.Overloads {
+ overloadIDs[i] = o.ID
+ }
+ return fn.Subset(decls.ExcludeOverloads(overloadIDs...)), true
+ }
+ return fn, true
+ }
+ return fn, true
+}
+
+// SubsetMacro indicates whether the macro function should be included in the library subset.
+func (lib *LibrarySubset) SubsetMacro(macroFunction string) bool {
+ // When lib is null, it should indicate that all values are included in the subset.
+ if lib == nil {
+ return true
+ }
+ if lib.Disabled || lib.DisableMacros {
+ return false
+ }
+ if len(lib.IncludeMacros) != 0 {
+ for _, name := range lib.IncludeMacros {
+ if name == macroFunction {
+ return true
+ }
+ }
+ return false
+ }
+ if len(lib.ExcludeMacros) != 0 {
+ for _, name := range lib.ExcludeMacros {
+ if name == macroFunction {
+ return false
+ }
+ }
+ return true
+ }
+ return true
+}
+
+// SetDisabled disables or enables the library.
+func (lib *LibrarySubset) SetDisabled(value bool) *LibrarySubset {
+ lib.Disabled = value
+ return lib
+}
+
+// SetDisableMacros disables the macros for the library.
+func (lib *LibrarySubset) SetDisableMacros(value bool) *LibrarySubset {
+ lib.DisableMacros = value
+ return lib
+}
+
+// AddIncludedMacros allow-lists one or more macros by function name.
+//
+// Note, this option will override any excluded macros.
+func (lib *LibrarySubset) AddIncludedMacros(macros ...string) *LibrarySubset {
+ lib.IncludeMacros = append(lib.IncludeMacros, macros...)
+ return lib
+}
+
+// AddExcludedMacros deny-lists one or more macros by function name.
+func (lib *LibrarySubset) AddExcludedMacros(macros ...string) *LibrarySubset {
+ lib.ExcludeMacros = append(lib.ExcludeMacros, macros...)
+ return lib
+}
+
+// AddIncludedFunctions allow-lists one or more functions from the subset.
+//
+// Note, this option will override any excluded functions.
+func (lib *LibrarySubset) AddIncludedFunctions(funcs ...*Function) *LibrarySubset {
+ lib.IncludeFunctions = append(lib.IncludeFunctions, funcs...)
+ return lib
+}
+
+// AddExcludedFunctions deny-lists one or more functions from the subset.
+func (lib *LibrarySubset) AddExcludedFunctions(funcs ...*Function) *LibrarySubset {
+ lib.ExcludeFunctions = append(lib.ExcludeFunctions, funcs...)
+ return lib
+}
+
+// NewValidator returns a named Validator instance.
+func NewValidator(name string) *Validator {
+ return &Validator{Name: name}
+}
+
+// Validator represents a named validator with an optional map-based configuration object.
+//
+// Note: the map-keys must directly correspond to the internal representation of the original
+// validator, and should only use primitive scalar types as values at this time.
+type Validator struct {
+ Name string `yaml:"name"`
+ Config map[string]any `yaml:"config,omitempty"`
+}
+
+// Validate validates the configuration of the validator object.
+func (v *Validator) Validate() error {
+ if v == nil {
+ return errors.New("invalid validator: nil")
+ }
+ if v.Name == "" {
+ return errors.New("invalid validator: missing name")
+ }
+ return nil
+}
+
+// SetConfig sets the set of map key-value pairs associated with this validator's configuration.
+func (v *Validator) SetConfig(config map[string]any) *Validator {
+ v.Config = config
+ return v
+}
+
+// ConfigValue retrieves the value associated with the config key name, if one exists.
+func (v *Validator) ConfigValue(name string) (any, bool) {
+ if v == nil {
+ return nil, false
+ }
+ value, found := v.Config[name]
+ return value, found
+}
+
+// NewFeature creates a new feature flag with a boolean enablement flag.
+func NewFeature(name string, enabled bool) *Feature {
+ return &Feature{Name: name, Enabled: enabled}
+}
+
+// Feature represents a named boolean feature flag supported by CEL.
+type Feature struct {
+ Name string `yaml:"name"`
+ Enabled bool `yaml:"enabled"`
+}
+
+// Validate validates whether the feature is well-configured.
+func (feat *Feature) Validate() error {
+ if feat == nil {
+ return errors.New("invalid feature: nil")
+ }
+ if feat.Name == "" {
+ return errors.New("invalid feature: missing name")
+ }
+ return nil
+}
+
+// NewTypeDesc describes a simple or complex type with parameters.
+func NewTypeDesc(typeName string, params ...*TypeDesc) *TypeDesc {
+ return &TypeDesc{TypeName: typeName, Params: params}
+}
+
+// NewTypeParam describe a type-param type.
+func NewTypeParam(paramName string) *TypeDesc {
+ return &TypeDesc{TypeName: paramName, IsTypeParam: true}
+}
+
+// TypeDesc represents the serializable format of a CEL *types.Type value.
+type TypeDesc struct {
+ TypeName string `yaml:"type_name"`
+ Params []*TypeDesc `yaml:"params,omitempty"`
+ IsTypeParam bool `yaml:"is_type_param,omitempty"`
+}
+
+// String implements the strings.Stringer interface method.
+func (td *TypeDesc) String() string {
+ ps := make([]string, len(td.Params))
+ for i, p := range td.Params {
+ ps[i] = p.String()
+ }
+ typeName := td.TypeName
+ if len(ps) != 0 {
+ typeName = fmt.Sprintf("%s(%s)", typeName, strings.Join(ps, ","))
+ }
+ return typeName
+}
+
+// Validate validates the type configuration is well-formed.
+func (td *TypeDesc) Validate() error {
+ if td == nil {
+ return errors.New("invalid type: nil")
+ }
+ if td.TypeName == "" {
+ return errors.New("invalid type: missing type name")
+ }
+ if td.IsTypeParam && len(td.Params) != 0 {
+ return errors.New("invalid type: param type cannot have parameters")
+ }
+ switch td.TypeName {
+ case "list":
+ if len(td.Params) != 1 {
+ return fmt.Errorf("invalid type: list expects 1 parameter, got %d", len(td.Params))
+ }
+ return td.Params[0].Validate()
+ case "map":
+ if len(td.Params) != 2 {
+ return fmt.Errorf("invalid type: map expects 2 parameters, got %d", len(td.Params))
+ }
+ if err := td.Params[0].Validate(); err != nil {
+ return err
+ }
+ if err := td.Params[1].Validate(); err != nil {
+ return err
+ }
+ case "optional_type":
+ if len(td.Params) != 1 {
+ return fmt.Errorf("invalid type: optional_type expects 1 parameter, got %d", len(td.Params))
+ }
+ return td.Params[0].Validate()
+ default:
+ }
+ return nil
+}
+
+// AsCELType converts the serializable object to a *types.Type value.
+func (td *TypeDesc) AsCELType(tp types.Provider) (*types.Type, error) {
+ err := td.Validate()
+ if err != nil {
+ return nil, err
+ }
+ switch td.TypeName {
+ case "dyn":
+ return types.DynType, nil
+ case "map":
+ kt, err := td.Params[0].AsCELType(tp)
+ if err != nil {
+ return nil, err
+ }
+ vt, err := td.Params[1].AsCELType(tp)
+ if err != nil {
+ return nil, err
+ }
+ return types.NewMapType(kt, vt), nil
+ case "list":
+ et, err := td.Params[0].AsCELType(tp)
+ if err != nil {
+ return nil, err
+ }
+ return types.NewListType(et), nil
+ case "optional_type":
+ et, err := td.Params[0].AsCELType(tp)
+ if err != nil {
+ return nil, err
+ }
+ return types.NewOptionalType(et), nil
+ default:
+ if td.IsTypeParam {
+ return types.NewTypeParamType(td.TypeName), nil
+ }
+ if msgType, found := tp.FindStructType(td.TypeName); found {
+ // First parameter is the type name.
+ return msgType.Parameters()[0], nil
+ }
+ t, found := tp.FindIdent(td.TypeName)
+ if !found {
+ return nil, fmt.Errorf("undefined type name: %q", td.TypeName)
+ }
+ _, ok := t.(*types.Type)
+ if ok && len(td.Params) == 0 {
+ return t.(*types.Type), nil
+ }
+ params := make([]*types.Type, len(td.Params))
+ for i, p := range td.Params {
+ params[i], err = p.AsCELType(tp)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return types.NewOpaqueType(td.TypeName, params...), nil
+ }
+}
+
+// SerializeTypeDesc converts a CEL native *types.Type to a serializable TypeDesc.
+func SerializeTypeDesc(t *types.Type) *TypeDesc {
+ typeName := t.TypeName()
+ if t.Kind() == types.TypeParamKind {
+ return NewTypeParam(typeName)
+ }
+ if t != types.NullType && t.IsAssignableType(types.NullType) {
+ if wrapperTypeName, found := wrapperTypes[t.Kind()]; found {
+ return NewTypeDesc(wrapperTypeName)
+ }
+ }
+ var params []*TypeDesc
+ for _, p := range t.Parameters() {
+ params = append(params, SerializeTypeDesc(p))
+ }
+ return NewTypeDesc(typeName, params...)
+}
+
+var wrapperTypes = map[types.Kind]string{
+ types.BoolKind: "google.protobuf.BoolValue",
+ types.BytesKind: "google.protobuf.BytesValue",
+ types.DoubleKind: "google.protobuf.DoubleValue",
+ types.IntKind: "google.protobuf.Int64Value",
+ types.StringKind: "google.protobuf.StringValue",
+ types.UintKind: "google.protobuf.UInt64Value",
+}
diff --git a/vendor/github.com/google/cel-go/common/error.go b/vendor/github.com/google/cel-go/common/error.go
index 774dcb5b48ad..0cf21345e6fe 100644
--- a/vendor/github.com/google/cel-go/common/error.go
+++ b/vendor/github.com/google/cel-go/common/error.go
@@ -18,8 +18,6 @@ import (
"fmt"
"strings"
"unicode/utf8"
-
- "golang.org/x/text/width"
)
// NewError creates an error associated with an expression id with the given message at the given location.
@@ -35,18 +33,15 @@ type Error struct {
}
const (
- dot = "."
- ind = "^"
+ dot = "."
+ ind = "^"
+ wideDot = "\uff0e"
+ wideInd = "\uff3e"
// maxSnippetLength is the largest number of characters which can be rendered in an error message snippet.
maxSnippetLength = 16384
)
-var (
- wideDot = width.Widen.String(dot)
- wideInd = width.Widen.String(ind)
-)
-
// ToDisplayString decorates the error message with the source location.
func (e *Error) ToDisplayString(source Source) string {
var result = fmt.Sprintf("ERROR: %s:%d:%d: %s",
diff --git a/vendor/github.com/google/cel-go/common/errors.go b/vendor/github.com/google/cel-go/common/errors.go
index 63919714ea7a..c8865df8cd40 100644
--- a/vendor/github.com/google/cel-go/common/errors.go
+++ b/vendor/github.com/google/cel-go/common/errors.go
@@ -30,9 +30,13 @@ type Errors struct {
// NewErrors creates a new instance of the Errors type.
func NewErrors(source Source) *Errors {
+ src := source
+ if src == nil {
+ src = NewTextSource("")
+ }
return &Errors{
errors: []*Error{},
- source: source,
+ source: src,
maxErrorsToReport: 100,
}
}
@@ -42,6 +46,11 @@ func (e *Errors) ReportError(l Location, format string, args ...any) {
e.ReportErrorAtID(0, l, format, args...)
}
+// ReportErrorString records an error at a source location.
+func (e *Errors) ReportErrorString(l Location, message string) {
+ e.ReportErrorAtID(0, l, "%s", message)
+}
+
// ReportErrorAtID records an error at a source location and expression id.
func (e *Errors) ReportErrorAtID(id int64, l Location, format string, args ...any) {
e.numErrors++
@@ -64,7 +73,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/runes/buffer.go b/vendor/github.com/google/cel-go/common/runes/buffer.go
index 50aac0b273ad..021198224dc8 100644
--- a/vendor/github.com/google/cel-go/common/runes/buffer.go
+++ b/vendor/github.com/google/cel-go/common/runes/buffer.go
@@ -127,20 +127,48 @@ var nilBuffer = &emptyBuffer{}
// elements of the byte or uint16 array, and continue. The underlying storage is an rune array
// containing any Unicode character.
func NewBuffer(data string) Buffer {
+ buf, _ := newBuffer(data, false)
+ return buf
+}
+
+// NewBufferAndLineOffsets returns an efficient implementation of Buffer for the given text based on
+// the ranges of the encoded code points contained within, as well as returning the line offsets.
+//
+// Code points are represented as an array of byte, uint16, or rune. This approach ensures that
+// each index represents a code point by itself without needing to use an array of rune. At first
+// we assume all code points are less than or equal to '\u007f'. If this holds true, the
+// underlying storage is a byte array containing only ASCII characters. If we encountered a code
+// point above this range but less than or equal to '\uffff' we allocate a uint16 array, copy the
+// elements of previous byte array to the uint16 array, and continue. If this holds true, the
+// underlying storage is a uint16 array containing only Unicode characters in the Basic Multilingual
+// Plane. If we encounter a code point above '\uffff' we allocate an rune array, copy the previous
+// elements of the byte or uint16 array, and continue. The underlying storage is an rune array
+// containing any Unicode character.
+func NewBufferAndLineOffsets(data string) (Buffer, []int32) {
+ return newBuffer(data, true)
+}
+
+func newBuffer(data string, lines bool) (Buffer, []int32) {
if len(data) == 0 {
- return nilBuffer
+ return nilBuffer, []int32{0}
}
var (
- idx = 0
- buf8 = make([]byte, 0, len(data))
+ idx = 0
+ off int32 = 0
+ buf8 = make([]byte, 0, len(data))
buf16 []uint16
buf32 []rune
+ offs []int32
)
for idx < len(data) {
r, s := utf8.DecodeRuneInString(data[idx:])
idx += s
+ if lines && r == '\n' {
+ offs = append(offs, off+1)
+ }
if r < utf8.RuneSelf {
buf8 = append(buf8, byte(r))
+ off++
continue
}
if r <= 0xffff {
@@ -150,6 +178,7 @@ func NewBuffer(data string) Buffer {
}
buf8 = nil
buf16 = append(buf16, uint16(r))
+ off++
goto copy16
}
buf32 = make([]rune, len(buf8), len(data))
@@ -158,17 +187,25 @@ func NewBuffer(data string) Buffer {
}
buf8 = nil
buf32 = append(buf32, r)
+ off++
goto copy32
}
+ if lines {
+ offs = append(offs, off+1)
+ }
return &asciiBuffer{
arr: buf8,
- }
+ }, offs
copy16:
for idx < len(data) {
r, s := utf8.DecodeRuneInString(data[idx:])
idx += s
+ if lines && r == '\n' {
+ offs = append(offs, off+1)
+ }
if r <= 0xffff {
buf16 = append(buf16, uint16(r))
+ off++
continue
}
buf32 = make([]rune, len(buf16), len(data))
@@ -177,18 +214,29 @@ copy16:
}
buf16 = nil
buf32 = append(buf32, r)
+ off++
goto copy32
}
+ if lines {
+ offs = append(offs, off+1)
+ }
return &basicBuffer{
arr: buf16,
- }
+ }, offs
copy32:
for idx < len(data) {
r, s := utf8.DecodeRuneInString(data[idx:])
idx += s
+ if lines && r == '\n' {
+ offs = append(offs, off+1)
+ }
buf32 = append(buf32, r)
+ off++
+ }
+ if lines {
+ offs = append(offs, off+1)
}
return &supplementalBuffer{
arr: buf32,
- }
+ }, offs
}
diff --git a/vendor/github.com/google/cel-go/common/source.go b/vendor/github.com/google/cel-go/common/source.go
index acf22bdf15ea..ec79cb5454e5 100644
--- a/vendor/github.com/google/cel-go/common/source.go
+++ b/vendor/github.com/google/cel-go/common/source.go
@@ -15,9 +15,6 @@
package common
import (
- "strings"
- "unicode/utf8"
-
"github.com/google/cel-go/common/runes"
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
@@ -80,17 +77,11 @@ func NewTextSource(text string) Source {
// NewStringSource creates a new Source from the given contents and description.
func NewStringSource(contents string, description string) Source {
// Compute line offsets up front as they are referred to frequently.
- lines := strings.Split(contents, "\n")
- offsets := make([]int32, len(lines))
- var offset int32
- for i, line := range lines {
- offset = offset + int32(utf8.RuneCountInString(line)) + 1
- offsets[int32(i)] = offset
- }
+ buf, offs := runes.NewBufferAndLineOffsets(contents)
return &sourceImpl{
- Buffer: runes.NewBuffer(contents),
+ Buffer: buf,
description: description,
- lineOffsets: offsets,
+ lineOffsets: offs,
}
}
@@ -172,9 +163,8 @@ func (s *sourceImpl) findLine(characterOffset int32) (int32, int32) {
for _, lineOffset := range s.lineOffsets {
if lineOffset > characterOffset {
break
- } else {
- line++
}
+ line++
}
if line == 1 {
return line, 0
diff --git a/vendor/github.com/google/cel-go/common/stdlib/BUILD.bazel b/vendor/github.com/google/cel-go/common/stdlib/BUILD.bazel
index c130a93f63fe..124dbea8195a 100644
--- a/vendor/github.com/google/cel-go/common/stdlib/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/common/stdlib/BUILD.bazel
@@ -12,7 +12,7 @@ go_library(
],
importpath = "github.com/google/cel-go/common/stdlib",
deps = [
- "//checker/decls:go_default_library",
+ "//common:go_default_library",
"//common/decls:go_default_library",
"//common/functions:go_default_library",
"//common/operators:go_default_library",
@@ -20,6 +20,5 @@ go_library(
"//common/types:go_default_library",
"//common/types/ref:go_default_library",
"//common/types/traits:go_default_library",
- "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
],
)
\ No newline at end of file
diff --git a/vendor/github.com/google/cel-go/common/stdlib/standard.go b/vendor/github.com/google/cel-go/common/stdlib/standard.go
index d02cb64bf1f9..4040a4f5c598 100644
--- a/vendor/github.com/google/cel-go/common/stdlib/standard.go
+++ b/vendor/github.com/google/cel-go/common/stdlib/standard.go
@@ -16,6 +16,11 @@
package stdlib
import (
+ "strconv"
+ "strings"
+ "time"
+
+ "github.com/google/cel-go/common"
"github.com/google/cel-go/common/decls"
"github.com/google/cel-go/common/functions"
"github.com/google/cel-go/common/operators"
@@ -23,15 +28,12 @@ import (
"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"
)
var (
stdFunctions []*decls.FunctionDecl
- stdFnDecls []*exprpb.Decl
stdTypes []*decls.VariableDecl
- stdTypeDecls []*exprpb.Decl
+ utcTZ = types.String("UTC")
)
func init() {
@@ -55,32 +57,53 @@ func init() {
decls.TypeVariable(types.UintType),
}
- stdTypeDecls = make([]*exprpb.Decl, 0, len(stdTypes))
- for _, stdType := range stdTypes {
- typeVar, err := decls.VariableDeclToExprDecl(stdType)
- if err != nil {
- panic(err)
- }
- stdTypeDecls = append(stdTypeDecls, typeVar)
- }
-
stdFunctions = []*decls.FunctionDecl{
// Logical operators. Special-cased within the interpreter.
// Note, the singleton binding prevents extensions from overriding the operator behavior.
function(operators.Conditional,
+ decls.FunctionDocs(
+ `The ternary operator tests a boolean predicate and returns the left-hand side `+
+ `(truthy) expression if true, or the right-hand side (falsy) expression if false`),
decls.Overload(overloads.Conditional, argTypes(types.BoolType, paramA, paramA), paramA,
- decls.OverloadIsNonStrict()),
+ decls.OverloadIsNonStrict(),
+ decls.OverloadExamples(
+ `'hello'.contains('lo') ? 'hi' : 'bye' // 'hi'`,
+ `32 % 3 == 0 ? 'divisible' : 'not divisible' // 'not divisible'`)),
decls.SingletonFunctionBinding(noFunctionOverrides)),
+
function(operators.LogicalAnd,
+ decls.FunctionDocs(
+ `logically AND two boolean values. Errors and unknown values`,
+ `are valid inputs and will not halt evaluation.`),
decls.Overload(overloads.LogicalAnd, argTypes(types.BoolType, types.BoolType), types.BoolType,
- decls.OverloadIsNonStrict()),
+ decls.OverloadIsNonStrict(),
+ decls.OverloadExamples(
+ `true && true // true`,
+ `true && false // false`,
+ `error && true // error`,
+ `error && false // false`)),
decls.SingletonBinaryBinding(noBinaryOverrides)),
+
function(operators.LogicalOr,
+ decls.FunctionDocs(
+ `logically OR two boolean values. Errors and unknown values`,
+ `are valid inputs and will not halt evaluation.`),
decls.Overload(overloads.LogicalOr, argTypes(types.BoolType, types.BoolType), types.BoolType,
- decls.OverloadIsNonStrict()),
+ decls.OverloadIsNonStrict(),
+ decls.OverloadExamples(
+ `true || false // true`,
+ `false || false // false`,
+ `error || true // true`,
+ `error || error // true`)),
decls.SingletonBinaryBinding(noBinaryOverrides)),
+
function(operators.LogicalNot,
- decls.Overload(overloads.LogicalNot, argTypes(types.BoolType), types.BoolType),
+ decls.FunctionDocs(`logically negate a boolean value.`),
+ decls.Overload(overloads.LogicalNot, argTypes(types.BoolType), types.BoolType,
+ decls.OverloadExamples(
+ `!true // false`,
+ `!false // true`,
+ `!error // error`)),
decls.SingletonUnaryBinding(func(val ref.Val) ref.Val {
b, ok := val.(types.Bool)
if !ok {
@@ -103,66 +126,104 @@ func init() {
// Equality / inequality. Special-cased in the interpreter
function(operators.Equals,
- decls.Overload(overloads.Equals, argTypes(paramA, paramA), types.BoolType),
+ decls.FunctionDocs(`compare two values of the same type for equality`),
+ decls.Overload(overloads.Equals, argTypes(paramA, paramA), types.BoolType,
+ decls.OverloadExamples(
+ `1 == 1 // true`,
+ `'hello' == 'world' // false`,
+ `bytes('hello') == b'hello' // true`,
+ `duration('1h') == duration('60m') // true`,
+ `dyn(3.0) == 3 // true`)),
decls.SingletonBinaryBinding(noBinaryOverrides)),
function(operators.NotEquals,
- decls.Overload(overloads.NotEquals, argTypes(paramA, paramA), types.BoolType),
+ decls.FunctionDocs(`compare two values of the same type for inequality`),
+ decls.Overload(overloads.NotEquals, argTypes(paramA, paramA), types.BoolType,
+ decls.OverloadExamples(
+ `1 != 2 // true`,
+ `"a" != "a" // false`,
+ `3.0 != 3.1 // true`)),
decls.SingletonBinaryBinding(noBinaryOverrides)),
// Mathematical operators
function(operators.Add,
+ decls.FunctionDocs(
+ `adds two numeric values or concatenates two strings, bytes,`,
+ `or lists.`),
decls.Overload(overloads.AddBytes,
- argTypes(types.BytesType, types.BytesType), types.BytesType),
+ argTypes(types.BytesType, types.BytesType), types.BytesType,
+ decls.OverloadExamples(`b'hi' + bytes('ya') // b'hiya'`)),
decls.Overload(overloads.AddDouble,
- argTypes(types.DoubleType, types.DoubleType), types.DoubleType),
+ argTypes(types.DoubleType, types.DoubleType), types.DoubleType,
+ decls.OverloadExamples(`3.14 + 1.59 // 4.73`)),
decls.Overload(overloads.AddDurationDuration,
- argTypes(types.DurationType, types.DurationType), types.DurationType),
+ argTypes(types.DurationType, types.DurationType), types.DurationType,
+ decls.OverloadExamples(`duration('1m') + duration('1s') // duration('1m1s')`)),
decls.Overload(overloads.AddDurationTimestamp,
- argTypes(types.DurationType, types.TimestampType), types.TimestampType),
+ argTypes(types.DurationType, types.TimestampType), types.TimestampType,
+ decls.OverloadExamples(`duration('24h') + timestamp('2023-01-01T00:00:00Z') // timestamp('2023-01-02T00:00:00Z')`)),
decls.Overload(overloads.AddTimestampDuration,
- argTypes(types.TimestampType, types.DurationType), types.TimestampType),
+ argTypes(types.TimestampType, types.DurationType), types.TimestampType,
+ decls.OverloadExamples(`timestamp('2023-01-01T00:00:00Z') + duration('24h1m2s') // timestamp('2023-01-02T00:01:02Z')`)),
decls.Overload(overloads.AddInt64,
- argTypes(types.IntType, types.IntType), types.IntType),
+ argTypes(types.IntType, types.IntType), types.IntType,
+ decls.OverloadExamples(`1 + 2 // 3`)),
decls.Overload(overloads.AddList,
- argTypes(listOfA, listOfA), listOfA),
+ argTypes(listOfA, listOfA), listOfA,
+ decls.OverloadExamples(`[1] + [2, 3] // [1, 2, 3]`)),
decls.Overload(overloads.AddString,
- argTypes(types.StringType, types.StringType), types.StringType),
+ argTypes(types.StringType, types.StringType), types.StringType,
+ decls.OverloadExamples(`"Hello, " + "world!" // "Hello, world!"`)),
decls.Overload(overloads.AddUint64,
- argTypes(types.UintType, types.UintType), types.UintType),
+ argTypes(types.UintType, types.UintType), types.UintType,
+ decls.OverloadExamples(`22u + 33u // 55u`)),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
return lhs.(traits.Adder).Add(rhs)
}, traits.AdderType)),
function(operators.Divide,
+ decls.FunctionDocs(`divide two numbers`),
decls.Overload(overloads.DivideDouble,
- argTypes(types.DoubleType, types.DoubleType), types.DoubleType),
+ argTypes(types.DoubleType, types.DoubleType), types.DoubleType,
+ decls.OverloadExamples(`7.0 / 2.0 // 3.5`)),
decls.Overload(overloads.DivideInt64,
- argTypes(types.IntType, types.IntType), types.IntType),
+ argTypes(types.IntType, types.IntType), types.IntType,
+ decls.OverloadExamples(`10 / 2 // 5`)),
decls.Overload(overloads.DivideUint64,
- argTypes(types.UintType, types.UintType), types.UintType),
+ argTypes(types.UintType, types.UintType), types.UintType,
+ decls.OverloadExamples(`42u / 2u // 21u`)),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
return lhs.(traits.Divider).Divide(rhs)
}, traits.DividerType)),
function(operators.Modulo,
+ decls.FunctionDocs(`compute the modulus of one integer into another`),
decls.Overload(overloads.ModuloInt64,
- argTypes(types.IntType, types.IntType), types.IntType),
+ argTypes(types.IntType, types.IntType), types.IntType,
+ decls.OverloadExamples(`3 % 2 // 1`)),
decls.Overload(overloads.ModuloUint64,
- argTypes(types.UintType, types.UintType), types.UintType),
+ argTypes(types.UintType, types.UintType), types.UintType,
+ decls.OverloadExamples(`6u % 3u // 0u`)),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
return lhs.(traits.Modder).Modulo(rhs)
}, traits.ModderType)),
function(operators.Multiply,
+ decls.FunctionDocs(`multiply two numbers`),
decls.Overload(overloads.MultiplyDouble,
- argTypes(types.DoubleType, types.DoubleType), types.DoubleType),
+ argTypes(types.DoubleType, types.DoubleType), types.DoubleType,
+ decls.OverloadExamples(`3.5 * 40.0 // 140.0`)),
decls.Overload(overloads.MultiplyInt64,
- argTypes(types.IntType, types.IntType), types.IntType),
+ argTypes(types.IntType, types.IntType), types.IntType,
+ decls.OverloadExamples(`-2 * 6 // -12`)),
decls.Overload(overloads.MultiplyUint64,
- argTypes(types.UintType, types.UintType), types.UintType),
+ argTypes(types.UintType, types.UintType), types.UintType,
+ decls.OverloadExamples(`13u * 3u // 39u`)),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
return lhs.(traits.Multiplier).Multiply(rhs)
}, traits.MultiplierType)),
function(operators.Negate,
- decls.Overload(overloads.NegateDouble, argTypes(types.DoubleType), types.DoubleType),
- decls.Overload(overloads.NegateInt64, argTypes(types.IntType), types.IntType),
+ decls.FunctionDocs(`negate a numeric value`),
+ decls.Overload(overloads.NegateDouble, argTypes(types.DoubleType), types.DoubleType,
+ decls.OverloadExamples(`-(3.14) // -3.14`)),
+ decls.Overload(overloads.NegateInt64, argTypes(types.IntType), types.IntType,
+ decls.OverloadExamples(`-(5) // -5`)),
decls.SingletonUnaryBinding(func(val ref.Val) ref.Val {
if types.IsBool(val) {
return types.MaybeNoSuchOverloadErr(val)
@@ -170,18 +231,32 @@ func init() {
return val.(traits.Negater).Negate()
}, traits.NegatorType)),
function(operators.Subtract,
+ decls.FunctionDocs(`subtract two numbers, or two time-related values`),
decls.Overload(overloads.SubtractDouble,
- argTypes(types.DoubleType, types.DoubleType), types.DoubleType),
+ argTypes(types.DoubleType, types.DoubleType), types.DoubleType,
+ decls.OverloadExamples(`10.5 - 2.0 // 8.5`)),
decls.Overload(overloads.SubtractDurationDuration,
- argTypes(types.DurationType, types.DurationType), types.DurationType),
+ argTypes(types.DurationType, types.DurationType), types.DurationType,
+ decls.OverloadExamples(`duration('1m') - duration('1s') // duration('59s')`)),
decls.Overload(overloads.SubtractInt64,
- argTypes(types.IntType, types.IntType), types.IntType),
+ argTypes(types.IntType, types.IntType), types.IntType,
+ decls.OverloadExamples(`5 - 3 // 2`)),
decls.Overload(overloads.SubtractTimestampDuration,
- argTypes(types.TimestampType, types.DurationType), types.TimestampType),
+ argTypes(types.TimestampType, types.DurationType), types.TimestampType,
+ decls.OverloadExamples(common.MultilineDescription(
+ `timestamp('2023-01-10T12:00:00Z')`,
+ ` - duration('12h') // timestamp('2023-01-10T00:00:00Z')`))),
decls.Overload(overloads.SubtractTimestampTimestamp,
- argTypes(types.TimestampType, types.TimestampType), types.DurationType),
+ argTypes(types.TimestampType, types.TimestampType), types.DurationType,
+ decls.OverloadExamples(common.MultilineDescription(
+ `timestamp('2023-01-10T12:00:00Z')`,
+ ` - timestamp('2023-01-10T00:00:00Z') // duration('12h')`))),
decls.Overload(overloads.SubtractUint64,
- argTypes(types.UintType, types.UintType), types.UintType),
+ argTypes(types.UintType, types.UintType), types.UintType,
+ decls.OverloadExamples(common.MultilineDescription(
+ `// the subtraction result must be positive, otherwise an overflow`,
+ `// error is generated.`,
+ `42u - 3u // 39u`))),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
return lhs.(traits.Subtractor).Subtract(rhs)
}, traits.SubtractorType)),
@@ -189,34 +264,51 @@ func init() {
// Relations operators
function(operators.Less,
+ decls.FunctionDocs(
+ `compare two values and return true if the first value is`,
+ `less than the second`),
decls.Overload(overloads.LessBool,
- argTypes(types.BoolType, types.BoolType), types.BoolType),
+ argTypes(types.BoolType, types.BoolType), types.BoolType,
+ decls.OverloadExamples(`false < true // true`)),
decls.Overload(overloads.LessInt64,
- argTypes(types.IntType, types.IntType), types.BoolType),
+ argTypes(types.IntType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`-2 < 3 // true`, `1 < 0 // false`)),
decls.Overload(overloads.LessInt64Double,
- argTypes(types.IntType, types.DoubleType), types.BoolType),
+ argTypes(types.IntType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`1 < 1.1 // true`)),
decls.Overload(overloads.LessInt64Uint64,
- argTypes(types.IntType, types.UintType), types.BoolType),
+ argTypes(types.IntType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`1 < 2u // true`)),
decls.Overload(overloads.LessUint64,
- argTypes(types.UintType, types.UintType), types.BoolType),
+ argTypes(types.UintType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`1u < 2u // true`)),
decls.Overload(overloads.LessUint64Double,
- argTypes(types.UintType, types.DoubleType), types.BoolType),
+ argTypes(types.UintType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`1u < 0.9 // false`)),
decls.Overload(overloads.LessUint64Int64,
- argTypes(types.UintType, types.IntType), types.BoolType),
+ argTypes(types.UintType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`1u < 23 // true`, `1u < -1 // false`)),
decls.Overload(overloads.LessDouble,
- argTypes(types.DoubleType, types.DoubleType), types.BoolType),
+ argTypes(types.DoubleType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`2.0 < 2.4 // true`)),
decls.Overload(overloads.LessDoubleInt64,
- argTypes(types.DoubleType, types.IntType), types.BoolType),
+ argTypes(types.DoubleType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`2.1 < 3 // true`)),
decls.Overload(overloads.LessDoubleUint64,
- argTypes(types.DoubleType, types.UintType), types.BoolType),
+ argTypes(types.DoubleType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`2.3 < 2u // false`, `-1.0 < 1u // true`)),
decls.Overload(overloads.LessString,
- argTypes(types.StringType, types.StringType), types.BoolType),
+ argTypes(types.StringType, types.StringType), types.BoolType,
+ decls.OverloadExamples(`'a' < 'b' // true`, `'cat' < 'cab' // false`)),
decls.Overload(overloads.LessBytes,
- argTypes(types.BytesType, types.BytesType), types.BoolType),
+ argTypes(types.BytesType, types.BytesType), types.BoolType,
+ decls.OverloadExamples(`b'hello' < b'world' // true`)),
decls.Overload(overloads.LessTimestamp,
- argTypes(types.TimestampType, types.TimestampType), types.BoolType),
+ argTypes(types.TimestampType, types.TimestampType), types.BoolType,
+ decls.OverloadExamples(`timestamp('2001-01-01T02:03:04Z') < timestamp('2002-02-02T02:03:04Z') // true`)),
decls.Overload(overloads.LessDuration,
- argTypes(types.DurationType, types.DurationType), types.BoolType),
+ argTypes(types.DurationType, types.DurationType), types.BoolType,
+ decls.OverloadExamples(`duration('1ms') < duration('1s') // true`)),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
cmp := lhs.(traits.Comparer).Compare(rhs)
if cmp == types.IntNegOne {
@@ -229,34 +321,51 @@ func init() {
}, traits.ComparerType)),
function(operators.LessEquals,
+ decls.FunctionDocs(
+ `compare two values and return true if the first value is`,
+ `less than or equal to the second`),
decls.Overload(overloads.LessEqualsBool,
- argTypes(types.BoolType, types.BoolType), types.BoolType),
+ argTypes(types.BoolType, types.BoolType), types.BoolType,
+ decls.OverloadExamples(`false <= true // true`)),
decls.Overload(overloads.LessEqualsInt64,
- argTypes(types.IntType, types.IntType), types.BoolType),
+ argTypes(types.IntType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`-2 <= 3 // true`)),
decls.Overload(overloads.LessEqualsInt64Double,
- argTypes(types.IntType, types.DoubleType), types.BoolType),
+ argTypes(types.IntType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`1 <= 1.1 // true`)),
decls.Overload(overloads.LessEqualsInt64Uint64,
- argTypes(types.IntType, types.UintType), types.BoolType),
+ argTypes(types.IntType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`1 <= 2u // true`, `-1 <= 0u // true`)),
decls.Overload(overloads.LessEqualsUint64,
- argTypes(types.UintType, types.UintType), types.BoolType),
+ argTypes(types.UintType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`1u <= 2u // true`)),
decls.Overload(overloads.LessEqualsUint64Double,
- argTypes(types.UintType, types.DoubleType), types.BoolType),
+ argTypes(types.UintType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`1u <= 1.0 // true`, `1u <= 1.1 // true`)),
decls.Overload(overloads.LessEqualsUint64Int64,
- argTypes(types.UintType, types.IntType), types.BoolType),
+ argTypes(types.UintType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`1u <= 23 // true`)),
decls.Overload(overloads.LessEqualsDouble,
- argTypes(types.DoubleType, types.DoubleType), types.BoolType),
+ argTypes(types.DoubleType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`2.0 <= 2.4 // true`)),
decls.Overload(overloads.LessEqualsDoubleInt64,
- argTypes(types.DoubleType, types.IntType), types.BoolType),
+ argTypes(types.DoubleType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`2.1 <= 3 // true`)),
decls.Overload(overloads.LessEqualsDoubleUint64,
- argTypes(types.DoubleType, types.UintType), types.BoolType),
+ argTypes(types.DoubleType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`2.0 <= 2u // true`, `-1.0 <= 1u // true`)),
decls.Overload(overloads.LessEqualsString,
- argTypes(types.StringType, types.StringType), types.BoolType),
+ argTypes(types.StringType, types.StringType), types.BoolType,
+ decls.OverloadExamples(`'a' <= 'b' // true`, `'a' <= 'a' // true`, `'cat' <= 'cab' // false`)),
decls.Overload(overloads.LessEqualsBytes,
- argTypes(types.BytesType, types.BytesType), types.BoolType),
+ argTypes(types.BytesType, types.BytesType), types.BoolType,
+ decls.OverloadExamples(`b'hello' <= b'world' // true`)),
decls.Overload(overloads.LessEqualsTimestamp,
- argTypes(types.TimestampType, types.TimestampType), types.BoolType),
+ argTypes(types.TimestampType, types.TimestampType), types.BoolType,
+ decls.OverloadExamples(`timestamp('2001-01-01T02:03:04Z') <= timestamp('2002-02-02T02:03:04Z') // true`)),
decls.Overload(overloads.LessEqualsDuration,
- argTypes(types.DurationType, types.DurationType), types.BoolType),
+ argTypes(types.DurationType, types.DurationType), types.BoolType,
+ decls.OverloadExamples(`duration('1ms') <= duration('1s') // true`)),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
cmp := lhs.(traits.Comparer).Compare(rhs)
if cmp == types.IntNegOne || cmp == types.IntZero {
@@ -269,34 +378,51 @@ func init() {
}, traits.ComparerType)),
function(operators.Greater,
+ decls.FunctionDocs(
+ `compare two values and return true if the first value is`,
+ `greater than the second`),
decls.Overload(overloads.GreaterBool,
- argTypes(types.BoolType, types.BoolType), types.BoolType),
+ argTypes(types.BoolType, types.BoolType), types.BoolType,
+ decls.OverloadExamples(`true > false // true`)),
decls.Overload(overloads.GreaterInt64,
- argTypes(types.IntType, types.IntType), types.BoolType),
+ argTypes(types.IntType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`3 > -2 // true`)),
decls.Overload(overloads.GreaterInt64Double,
- argTypes(types.IntType, types.DoubleType), types.BoolType),
+ argTypes(types.IntType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`2 > 1.1 // true`)),
decls.Overload(overloads.GreaterInt64Uint64,
- argTypes(types.IntType, types.UintType), types.BoolType),
+ argTypes(types.IntType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`3 > 2u // true`)),
decls.Overload(overloads.GreaterUint64,
- argTypes(types.UintType, types.UintType), types.BoolType),
+ argTypes(types.UintType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`2u > 1u // true`)),
decls.Overload(overloads.GreaterUint64Double,
- argTypes(types.UintType, types.DoubleType), types.BoolType),
+ argTypes(types.UintType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`2u > 1.9 // true`)),
decls.Overload(overloads.GreaterUint64Int64,
- argTypes(types.UintType, types.IntType), types.BoolType),
+ argTypes(types.UintType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`23u > 1 // true`, `0u > -1 // true`)),
decls.Overload(overloads.GreaterDouble,
- argTypes(types.DoubleType, types.DoubleType), types.BoolType),
+ argTypes(types.DoubleType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`2.4 > 2.0 // true`)),
decls.Overload(overloads.GreaterDoubleInt64,
- argTypes(types.DoubleType, types.IntType), types.BoolType),
+ argTypes(types.DoubleType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`3.1 > 3 // true`, `3.0 > 3 // false`)),
decls.Overload(overloads.GreaterDoubleUint64,
- argTypes(types.DoubleType, types.UintType), types.BoolType),
+ argTypes(types.DoubleType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`2.3 > 2u // true`)),
decls.Overload(overloads.GreaterString,
- argTypes(types.StringType, types.StringType), types.BoolType),
+ argTypes(types.StringType, types.StringType), types.BoolType,
+ decls.OverloadExamples(`'b' > 'a' // true`)),
decls.Overload(overloads.GreaterBytes,
- argTypes(types.BytesType, types.BytesType), types.BoolType),
+ argTypes(types.BytesType, types.BytesType), types.BoolType,
+ decls.OverloadExamples(`b'world' > b'hello' // true`)),
decls.Overload(overloads.GreaterTimestamp,
- argTypes(types.TimestampType, types.TimestampType), types.BoolType),
+ argTypes(types.TimestampType, types.TimestampType), types.BoolType,
+ decls.OverloadExamples(`timestamp('2002-02-02T02:03:04Z') > timestamp('2001-01-01T02:03:04Z') // true`)),
decls.Overload(overloads.GreaterDuration,
- argTypes(types.DurationType, types.DurationType), types.BoolType),
+ argTypes(types.DurationType, types.DurationType), types.BoolType,
+ decls.OverloadExamples(`duration('1ms') > duration('1us') // true`)),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
cmp := lhs.(traits.Comparer).Compare(rhs)
if cmp == types.IntOne {
@@ -309,34 +435,51 @@ func init() {
}, traits.ComparerType)),
function(operators.GreaterEquals,
+ decls.FunctionDocs(
+ `compare two values and return true if the first value is`,
+ `greater than or equal to the second`),
decls.Overload(overloads.GreaterEqualsBool,
- argTypes(types.BoolType, types.BoolType), types.BoolType),
+ argTypes(types.BoolType, types.BoolType), types.BoolType,
+ decls.OverloadExamples(`true >= false // true`)),
decls.Overload(overloads.GreaterEqualsInt64,
- argTypes(types.IntType, types.IntType), types.BoolType),
+ argTypes(types.IntType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`3 >= -2 // true`)),
decls.Overload(overloads.GreaterEqualsInt64Double,
- argTypes(types.IntType, types.DoubleType), types.BoolType),
+ argTypes(types.IntType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`2 >= 1.1 // true`, `1 >= 1.0 // true`)),
decls.Overload(overloads.GreaterEqualsInt64Uint64,
- argTypes(types.IntType, types.UintType), types.BoolType),
+ argTypes(types.IntType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`3 >= 2u // true`)),
decls.Overload(overloads.GreaterEqualsUint64,
- argTypes(types.UintType, types.UintType), types.BoolType),
+ argTypes(types.UintType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`2u >= 1u // true`)),
decls.Overload(overloads.GreaterEqualsUint64Double,
- argTypes(types.UintType, types.DoubleType), types.BoolType),
+ argTypes(types.UintType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`2u >= 1.9 // true`)),
decls.Overload(overloads.GreaterEqualsUint64Int64,
- argTypes(types.UintType, types.IntType), types.BoolType),
+ argTypes(types.UintType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`23u >= 1 // true`, `1u >= 1 // true`)),
decls.Overload(overloads.GreaterEqualsDouble,
- argTypes(types.DoubleType, types.DoubleType), types.BoolType),
+ argTypes(types.DoubleType, types.DoubleType), types.BoolType,
+ decls.OverloadExamples(`2.4 >= 2.0 // true`)),
decls.Overload(overloads.GreaterEqualsDoubleInt64,
- argTypes(types.DoubleType, types.IntType), types.BoolType),
+ argTypes(types.DoubleType, types.IntType), types.BoolType,
+ decls.OverloadExamples(`3.1 >= 3 // true`)),
decls.Overload(overloads.GreaterEqualsDoubleUint64,
- argTypes(types.DoubleType, types.UintType), types.BoolType),
+ argTypes(types.DoubleType, types.UintType), types.BoolType,
+ decls.OverloadExamples(`2.3 >= 2u // true`)),
decls.Overload(overloads.GreaterEqualsString,
- argTypes(types.StringType, types.StringType), types.BoolType),
+ argTypes(types.StringType, types.StringType), types.BoolType,
+ decls.OverloadExamples(`'b' >= 'a' // true`)),
decls.Overload(overloads.GreaterEqualsBytes,
- argTypes(types.BytesType, types.BytesType), types.BoolType),
+ argTypes(types.BytesType, types.BytesType), types.BoolType,
+ decls.OverloadExamples(`b'world' >= b'hello' // true`)),
decls.Overload(overloads.GreaterEqualsTimestamp,
- argTypes(types.TimestampType, types.TimestampType), types.BoolType),
+ argTypes(types.TimestampType, types.TimestampType), types.BoolType,
+ decls.OverloadExamples(`timestamp('2001-01-01T02:03:04Z') >= timestamp('2001-01-01T02:03:04Z') // true`)),
decls.Overload(overloads.GreaterEqualsDuration,
- argTypes(types.DurationType, types.DurationType), types.BoolType),
+ argTypes(types.DurationType, types.DurationType), types.BoolType,
+ decls.OverloadExamples(`duration('60s') >= duration('1m') // true`)),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
cmp := lhs.(traits.Comparer).Compare(rhs)
if cmp == types.IntOne || cmp == types.IntZero {
@@ -350,16 +493,28 @@ func init() {
// Indexing
function(operators.Index,
- decls.Overload(overloads.IndexList, argTypes(listOfA, types.IntType), paramA),
- decls.Overload(overloads.IndexMap, argTypes(mapOfAB, paramA), paramB),
+ decls.FunctionDocs(`select a value from a list by index, or value from a map by key`),
+ decls.Overload(overloads.IndexList, argTypes(listOfA, types.IntType), paramA,
+ decls.OverloadExamples(`[1, 2, 3][1] // 2`)),
+ decls.Overload(overloads.IndexMap, argTypes(mapOfAB, paramA), paramB,
+ decls.OverloadExamples(
+ `{'key': 'value'}['key'] // 'value'`,
+ `{'key': 'value'}['missing'] // error`)),
decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val {
return lhs.(traits.Indexer).Get(rhs)
}, traits.IndexerType)),
// Collections operators
function(operators.In,
- decls.Overload(overloads.InList, argTypes(paramA, listOfA), types.BoolType),
- decls.Overload(overloads.InMap, argTypes(paramA, mapOfAB), types.BoolType),
+ decls.FunctionDocs(`test whether a value exists in a list, or a key exists in a map`),
+ decls.Overload(overloads.InList, argTypes(paramA, listOfA), types.BoolType,
+ decls.OverloadExamples(
+ `2 in [1, 2, 3] // true`,
+ `"a" in ["b", "c"] // false`)),
+ decls.Overload(overloads.InMap, argTypes(paramA, mapOfAB), types.BoolType,
+ decls.OverloadExamples(
+ `'key1' in {'key1': 'value1', 'key2': 'value2'} // true`,
+ `3 in {1: "one", 2: "two"} // false`)),
decls.SingletonBinaryBinding(inAggregate)),
function(operators.OldIn,
decls.DisableDeclaration(true), // safe deprecation
@@ -372,221 +527,364 @@ func init() {
decls.Overload(overloads.InMap, argTypes(paramA, mapOfAB), types.BoolType),
decls.SingletonBinaryBinding(inAggregate)),
function(overloads.Size,
- decls.Overload(overloads.SizeBytes, argTypes(types.BytesType), types.IntType),
- decls.MemberOverload(overloads.SizeBytesInst, argTypes(types.BytesType), types.IntType),
- decls.Overload(overloads.SizeList, argTypes(listOfA), types.IntType),
- decls.MemberOverload(overloads.SizeListInst, argTypes(listOfA), types.IntType),
- decls.Overload(overloads.SizeMap, argTypes(mapOfAB), types.IntType),
- decls.MemberOverload(overloads.SizeMapInst, argTypes(mapOfAB), types.IntType),
- decls.Overload(overloads.SizeString, argTypes(types.StringType), types.IntType),
- decls.MemberOverload(overloads.SizeStringInst, argTypes(types.StringType), types.IntType),
+ decls.FunctionDocs(
+ `compute the size of a list or map, the number of characters in a string,`,
+ `or the number of bytes in a sequence`),
+ decls.Overload(overloads.SizeBytes, argTypes(types.BytesType), types.IntType,
+ decls.OverloadExamples(`size(b'123') // 3`)),
+ decls.MemberOverload(overloads.SizeBytesInst, argTypes(types.BytesType), types.IntType,
+ decls.OverloadExamples(`b'123'.size() // 3`)),
+ decls.Overload(overloads.SizeList, argTypes(listOfA), types.IntType,
+ decls.OverloadExamples(`size([1, 2, 3]) // 3`)),
+ decls.MemberOverload(overloads.SizeListInst, argTypes(listOfA), types.IntType,
+ decls.OverloadExamples(`[1, 2, 3].size() // 3`)),
+ decls.Overload(overloads.SizeMap, argTypes(mapOfAB), types.IntType,
+ decls.OverloadExamples(`size({'a': 1, 'b': 2}) // 2`)),
+ decls.MemberOverload(overloads.SizeMapInst, argTypes(mapOfAB), types.IntType,
+ decls.OverloadExamples(`{'a': 1, 'b': 2}.size() // 2`)),
+ decls.Overload(overloads.SizeString, argTypes(types.StringType), types.IntType,
+ decls.OverloadExamples(`size('hello') // 5`)),
+ decls.MemberOverload(overloads.SizeStringInst, argTypes(types.StringType), types.IntType,
+ decls.OverloadExamples(`'hello'.size() // 5`)),
decls.SingletonUnaryBinding(func(val ref.Val) ref.Val {
return val.(traits.Sizer).Size()
}, traits.SizerType)),
// Type conversions
function(overloads.TypeConvertType,
- decls.Overload(overloads.TypeConvertType, argTypes(paramA), types.NewTypeTypeWithParam(paramA)),
+ decls.FunctionDocs(`convert a value to its type identifier`),
+ decls.Overload(overloads.TypeConvertType, argTypes(paramA), types.NewTypeTypeWithParam(paramA),
+ decls.OverloadExamples(
+ `type(1) // int`,
+ `type('hello') // string`,
+ `type(int) // type`,
+ `type(type) // type`)),
decls.SingletonUnaryBinding(convertToType(types.TypeType))),
// Bool conversions
function(overloads.TypeConvertBool,
+ decls.FunctionDocs(`convert a value to a boolean`),
decls.Overload(overloads.BoolToBool, argTypes(types.BoolType), types.BoolType,
+
+ decls.OverloadExamples(`bool(true) // true`),
decls.UnaryBinding(identity)),
decls.Overload(overloads.StringToBool, argTypes(types.StringType), types.BoolType,
+
+ decls.OverloadExamples(`bool('true') // true`, `bool('false') // false`),
decls.UnaryBinding(convertToType(types.BoolType)))),
// Bytes conversions
function(overloads.TypeConvertBytes,
+ decls.FunctionDocs(`convert a value to bytes`),
decls.Overload(overloads.BytesToBytes, argTypes(types.BytesType), types.BytesType,
+ decls.OverloadExamples(`bytes(b'abc') // b'abc'`),
decls.UnaryBinding(identity)),
decls.Overload(overloads.StringToBytes, argTypes(types.StringType), types.BytesType,
+ decls.OverloadExamples(`bytes('hello') // b'hello'`),
decls.UnaryBinding(convertToType(types.BytesType)))),
// Double conversions
function(overloads.TypeConvertDouble,
+ decls.FunctionDocs(`convert a value to a double`),
decls.Overload(overloads.DoubleToDouble, argTypes(types.DoubleType), types.DoubleType,
+ decls.OverloadExamples(`double(1.23) // 1.23`),
decls.UnaryBinding(identity)),
decls.Overload(overloads.IntToDouble, argTypes(types.IntType), types.DoubleType,
+ decls.OverloadExamples(`double(123) // 123.0`),
decls.UnaryBinding(convertToType(types.DoubleType))),
decls.Overload(overloads.StringToDouble, argTypes(types.StringType), types.DoubleType,
+ decls.OverloadExamples(`double('1.23') // 1.23`),
decls.UnaryBinding(convertToType(types.DoubleType))),
decls.Overload(overloads.UintToDouble, argTypes(types.UintType), types.DoubleType,
+ decls.OverloadExamples(`double(123u) // 123.0`),
decls.UnaryBinding(convertToType(types.DoubleType)))),
// Duration conversions
function(overloads.TypeConvertDuration,
+ decls.FunctionDocs(`convert a value to a google.protobuf.Duration`),
decls.Overload(overloads.DurationToDuration, argTypes(types.DurationType), types.DurationType,
+ decls.OverloadExamples(`duration(duration('1s')) // duration('1s')`),
decls.UnaryBinding(identity)),
decls.Overload(overloads.IntToDuration, argTypes(types.IntType), types.DurationType,
decls.UnaryBinding(convertToType(types.DurationType))),
decls.Overload(overloads.StringToDuration, argTypes(types.StringType), types.DurationType,
+ decls.OverloadExamples(`duration('1h2m3s') // duration('3723s')`),
decls.UnaryBinding(convertToType(types.DurationType)))),
// Dyn conversions
function(overloads.TypeConvertDyn,
- decls.Overload(overloads.ToDyn, argTypes(paramA), types.DynType),
+ decls.FunctionDocs(`indicate that the type is dynamic for type-checking purposes`),
+ decls.Overload(overloads.ToDyn, argTypes(paramA), types.DynType,
+ decls.OverloadExamples(`dyn(1) // 1`)),
decls.SingletonUnaryBinding(identity)),
// Int conversions
function(overloads.TypeConvertInt,
+ decls.FunctionDocs(`convert a value to an int`),
decls.Overload(overloads.IntToInt, argTypes(types.IntType), types.IntType,
+ decls.OverloadExamples(`int(123) // 123`),
decls.UnaryBinding(identity)),
decls.Overload(overloads.DoubleToInt, argTypes(types.DoubleType), types.IntType,
+ decls.OverloadExamples(`int(123.45) // 123`),
decls.UnaryBinding(convertToType(types.IntType))),
decls.Overload(overloads.DurationToInt, argTypes(types.DurationType), types.IntType,
- decls.UnaryBinding(convertToType(types.IntType))),
+ decls.OverloadExamples(`int(duration('1s')) // 1000000000`),
+ decls.UnaryBinding(convertToType(types.IntType))), // Duration to nanoseconds
decls.Overload(overloads.StringToInt, argTypes(types.StringType), types.IntType,
+ decls.OverloadExamples(`int('123') // 123`, `int('-456') // -456`),
decls.UnaryBinding(convertToType(types.IntType))),
decls.Overload(overloads.TimestampToInt, argTypes(types.TimestampType), types.IntType,
- decls.UnaryBinding(convertToType(types.IntType))),
+ decls.OverloadExamples(`int(timestamp('1970-01-01T00:00:01Z')) // 1`),
+ decls.UnaryBinding(convertToType(types.IntType))), // Timestamp to epoch seconds
decls.Overload(overloads.UintToInt, argTypes(types.UintType), types.IntType,
- decls.UnaryBinding(convertToType(types.IntType))),
- ),
+ decls.OverloadExamples(`int(123u) // 123`),
+ decls.UnaryBinding(convertToType(types.IntType)))),
// String conversions
function(overloads.TypeConvertString,
+ decls.FunctionDocs(`convert a value to a string`),
decls.Overload(overloads.StringToString, argTypes(types.StringType), types.StringType,
+ decls.OverloadExamples(`string('hello') // 'hello'`),
decls.UnaryBinding(identity)),
decls.Overload(overloads.BoolToString, argTypes(types.BoolType), types.StringType,
+ decls.OverloadExamples(`string(true) // 'true'`),
decls.UnaryBinding(convertToType(types.StringType))),
decls.Overload(overloads.BytesToString, argTypes(types.BytesType), types.StringType,
+ decls.OverloadExamples(`string(b'hello') // 'hello'`),
decls.UnaryBinding(convertToType(types.StringType))),
decls.Overload(overloads.DoubleToString, argTypes(types.DoubleType), types.StringType,
- decls.UnaryBinding(convertToType(types.StringType))),
+ decls.UnaryBinding(convertToType(types.StringType)),
+ decls.OverloadExamples(`string(-1.23e4) // '-12300'`)),
decls.Overload(overloads.DurationToString, argTypes(types.DurationType), types.StringType,
+ decls.OverloadExamples(`string(duration('1h30m')) // '5400s'`),
decls.UnaryBinding(convertToType(types.StringType))),
decls.Overload(overloads.IntToString, argTypes(types.IntType), types.StringType,
+ decls.OverloadExamples(`string(-123) // '-123'`),
decls.UnaryBinding(convertToType(types.StringType))),
decls.Overload(overloads.TimestampToString, argTypes(types.TimestampType), types.StringType,
+ decls.OverloadExamples(`string(timestamp('1970-01-01T00:00:00Z')) // '1970-01-01T00:00:00Z'`),
decls.UnaryBinding(convertToType(types.StringType))),
decls.Overload(overloads.UintToString, argTypes(types.UintType), types.StringType,
+ decls.OverloadExamples(`string(123u) // '123'`),
decls.UnaryBinding(convertToType(types.StringType)))),
// Timestamp conversions
function(overloads.TypeConvertTimestamp,
+ decls.FunctionDocs(`convert a value to a google.protobuf.Timestamp`),
decls.Overload(overloads.TimestampToTimestamp, argTypes(types.TimestampType), types.TimestampType,
+ decls.OverloadExamples(`timestamp(timestamp('2023-01-01T00:00:00Z')) // timestamp('2023-01-01T00:00:00Z')`),
decls.UnaryBinding(identity)),
decls.Overload(overloads.IntToTimestamp, argTypes(types.IntType), types.TimestampType,
+ decls.OverloadExamples(`timestamp(1) // timestamp('1970-01-01T00:00:01Z')`), // Epoch seconds to Timestamp
decls.UnaryBinding(convertToType(types.TimestampType))),
decls.Overload(overloads.StringToTimestamp, argTypes(types.StringType), types.TimestampType,
+ decls.OverloadExamples(`timestamp('2025-01-01T12:34:56Z') // timestamp('2025-01-01T12:34:56Z')`),
decls.UnaryBinding(convertToType(types.TimestampType)))),
// Uint conversions
function(overloads.TypeConvertUint,
+ decls.FunctionDocs(`convert a value to a uint`),
decls.Overload(overloads.UintToUint, argTypes(types.UintType), types.UintType,
+ decls.OverloadExamples(`uint(123u) // 123u`),
decls.UnaryBinding(identity)),
decls.Overload(overloads.DoubleToUint, argTypes(types.DoubleType), types.UintType,
+ decls.OverloadExamples(`uint(123.45) // 123u`),
decls.UnaryBinding(convertToType(types.UintType))),
decls.Overload(overloads.IntToUint, argTypes(types.IntType), types.UintType,
+ decls.OverloadExamples(`uint(123) // 123u`),
decls.UnaryBinding(convertToType(types.UintType))),
decls.Overload(overloads.StringToUint, argTypes(types.StringType), types.UintType,
+ decls.OverloadExamples(`uint('123') // 123u`),
decls.UnaryBinding(convertToType(types.UintType)))),
// String functions
function(overloads.Contains,
+ decls.FunctionDocs(`test whether a string contains a substring`),
decls.MemberOverload(overloads.ContainsString,
argTypes(types.StringType, types.StringType), types.BoolType,
+ decls.OverloadExamples(
+ `'hello world'.contains('o w') // true`,
+ `'hello world'.contains('goodbye') // false`),
decls.BinaryBinding(types.StringContains)),
decls.DisableTypeGuards(true)),
function(overloads.EndsWith,
+ decls.FunctionDocs(`test whether a string ends with a substring suffix`),
decls.MemberOverload(overloads.EndsWithString,
argTypes(types.StringType, types.StringType), types.BoolType,
+ decls.OverloadExamples(
+ `'hello world'.endsWith('world') // true`,
+ `'hello world'.endsWith('hello') // false`),
decls.BinaryBinding(types.StringEndsWith)),
decls.DisableTypeGuards(true)),
function(overloads.StartsWith,
+ decls.FunctionDocs(`test whether a string starts with a substring prefix`),
decls.MemberOverload(overloads.StartsWithString,
argTypes(types.StringType, types.StringType), types.BoolType,
+ decls.OverloadExamples(
+ `'hello world'.startsWith('hello') // true`,
+ `'hello world'.startsWith('world') // false`),
decls.BinaryBinding(types.StringStartsWith)),
decls.DisableTypeGuards(true)),
function(overloads.Matches,
- decls.Overload(overloads.Matches, argTypes(types.StringType, types.StringType), types.BoolType),
+ decls.FunctionDocs(`test whether a string matches an RE2 regular expression`),
+ decls.Overload(overloads.Matches, argTypes(types.StringType, types.StringType), types.BoolType,
+ decls.OverloadExamples(
+ `matches('123-456', '^[0-9]+(-[0-9]+)?$') // true`,
+ `matches('hello', '^h.*o$') // true`)),
decls.MemberOverload(overloads.MatchesString,
- argTypes(types.StringType, types.StringType), types.BoolType),
+ argTypes(types.StringType, types.StringType), types.BoolType,
+ decls.OverloadExamples(
+ `'123-456'.matches('^[0-9]+(-[0-9]+)?$') // true`,
+ `'hello'.matches('^h.*o$') // true`)),
decls.SingletonBinaryBinding(func(str, pat ref.Val) ref.Val {
return str.(traits.Matcher).Match(pat)
}, traits.MatcherType)),
// Timestamp / duration functions
function(overloads.TimeGetFullYear,
+ decls.FunctionDocs(`get the 0-based full year from a timestamp, UTC unless an IANA timezone is specified.`),
decls.MemberOverload(overloads.TimestampToYear,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getFullYear() // 2023`),
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetFullYear(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToYearWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType)),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-01-01T05:30:00Z').getFullYear('-08:00') // 2022`),
+ decls.BinaryBinding(timestampGetFullYear))),
function(overloads.TimeGetMonth,
+ decls.FunctionDocs(`get the 0-based month from a timestamp, UTC unless an IANA timezone is specified.`),
decls.MemberOverload(overloads.TimestampToMonth,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getMonth() // 6`), // July is month 6
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetMonth(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToMonthWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType)),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-01-01T05:30:00Z').getMonth('America/Los_Angeles') // 11`), // December is month 11
+ decls.BinaryBinding(timestampGetMonth))),
function(overloads.TimeGetDayOfYear,
+ decls.FunctionDocs(`get the 0-based day of the year from a timestamp, UTC unless an IANA timezone is specified.`),
decls.MemberOverload(overloads.TimestampToDayOfYear,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-01-02T00:00:00Z').getDayOfYear() // 1`),
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetDayOfYear(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToDayOfYearWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType)),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-01-01T05:00:00Z').getDayOfYear('America/Los_Angeles') // 364`),
+ decls.BinaryBinding(timestampGetDayOfYear))),
function(overloads.TimeGetDayOfMonth,
+ decls.FunctionDocs(`get the 0-based day of the month from a timestamp, UTC unless an IANA timezone is specified.`),
decls.MemberOverload(overloads.TimestampToDayOfMonthZeroBased,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getDayOfMonth() // 13`),
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetDayOfMonthZeroBased(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToDayOfMonthZeroBasedWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType)),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-01T05:00:00Z').getDayOfMonth('America/Los_Angeles') // 29`),
+ decls.BinaryBinding(timestampGetDayOfMonthZeroBased))),
function(overloads.TimeGetDate,
+ decls.FunctionDocs(`get the 1-based day of the month from a timestamp, UTC unless an IANA timezone is specified.`),
decls.MemberOverload(overloads.TimestampToDayOfMonthOneBased,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getDate() // 14`),
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetDayOfMonthOneBased(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToDayOfMonthOneBasedWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType)),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-01T05:00:00Z').getDate('America/Los_Angeles') // 30`),
+ decls.BinaryBinding(timestampGetDayOfMonthOneBased))),
function(overloads.TimeGetDayOfWeek,
+ decls.FunctionDocs(`get the 0-based day of the week from a timestamp, UTC unless an IANA timezone is specified.`),
decls.MemberOverload(overloads.TimestampToDayOfWeek,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getDayOfWeek() // 5`), // Friday is day 5
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetDayOfWeek(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToDayOfWeekWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType)),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-16T05:00:00Z').getDayOfWeek('America/Los_Angeles') // 6`), // Saturday is day 6
+ decls.BinaryBinding(timestampGetDayOfWeek))),
function(overloads.TimeGetHours,
+ decls.FunctionDocs(`get the hours portion from a timestamp, or convert a duration to hours`),
decls.MemberOverload(overloads.TimestampToHours,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getHours() // 10`),
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetHours(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToHoursWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getHours('America/Los_Angeles') // 2`),
+ decls.BinaryBinding(timestampGetHours)),
decls.MemberOverload(overloads.DurationToHours,
- argTypes(types.DurationType), types.IntType)),
+ argTypes(types.DurationType), types.IntType,
+ decls.OverloadExamples(`duration('3723s').getHours() // 1`),
+ decls.UnaryBinding(types.DurationGetHours))),
function(overloads.TimeGetMinutes,
+ decls.FunctionDocs(`get the minutes portion from a timestamp, or convert a duration to minutes`),
decls.MemberOverload(overloads.TimestampToMinutes,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getMinutes() // 30`),
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetMinutes(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToMinutesWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getMinutes('America/Los_Angeles') // 30`),
+ decls.BinaryBinding(timestampGetMinutes)),
decls.MemberOverload(overloads.DurationToMinutes,
- argTypes(types.DurationType), types.IntType)),
+ argTypes(types.DurationType), types.IntType,
+ decls.OverloadExamples(`duration('3723s').getMinutes() // 62`),
+ decls.UnaryBinding(types.DurationGetMinutes))),
function(overloads.TimeGetSeconds,
+ decls.FunctionDocs(`get the seconds portion from a timestamp, or convert a duration to seconds`),
decls.MemberOverload(overloads.TimestampToSeconds,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getSeconds() // 45`),
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetSeconds(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToSecondsWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getSeconds('America/Los_Angeles') // 45`),
+ decls.BinaryBinding(timestampGetSeconds)),
decls.MemberOverload(overloads.DurationToSeconds,
- argTypes(types.DurationType), types.IntType)),
+ argTypes(types.DurationType), types.IntType,
+ decls.OverloadExamples(`duration('3723.456s').getSeconds() // 3723`),
+ decls.UnaryBinding(types.DurationGetSeconds))),
function(overloads.TimeGetMilliseconds,
+ decls.FunctionDocs(`get the milliseconds portion from a timestamp`),
decls.MemberOverload(overloads.TimestampToMilliseconds,
- argTypes(types.TimestampType), types.IntType),
+ argTypes(types.TimestampType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getMilliseconds() // 123`),
+ decls.UnaryBinding(func(ts ref.Val) ref.Val {
+ return timestampGetMilliseconds(ts, utcTZ)
+ })),
decls.MemberOverload(overloads.TimestampToMillisecondsWithTz,
- argTypes(types.TimestampType, types.StringType), types.IntType),
+ argTypes(types.TimestampType, types.StringType), types.IntType,
+ decls.OverloadExamples(`timestamp('2023-07-14T10:30:45.123Z').getMilliseconds('America/Los_Angeles') // 123`),
+ decls.BinaryBinding(timestampGetMilliseconds)),
decls.MemberOverload(overloads.DurationToMilliseconds,
- argTypes(types.DurationType), types.IntType)),
- }
-
- stdFnDecls = make([]*exprpb.Decl, 0, len(stdFunctions))
- for _, fn := range stdFunctions {
- if fn.IsDeclarationDisabled() {
- continue
- }
- ed, err := decls.FunctionDeclToExprDecl(fn)
- if err != nil {
- panic(err)
- }
- stdFnDecls = append(stdFnDecls, ed)
+ argTypes(types.DurationType), types.IntType,
+ decls.UnaryBinding(types.DurationGetMilliseconds))),
}
}
@@ -595,27 +893,11 @@ func Functions() []*decls.FunctionDecl {
return stdFunctions
}
-// FunctionExprDecls returns the legacy style protobuf-typed declarations for all functions and overloads
-// in the CEL standard environment.
-//
-// Deprecated: use Functions
-func FunctionExprDecls() []*exprpb.Decl {
- return stdFnDecls
-}
-
// Types returns the set of standard library types for CEL.
func Types() []*decls.VariableDecl {
return stdTypes
}
-// TypeExprDecls returns the legacy style protobuf-typed declarations for all types in the CEL
-// standard environment.
-//
-// Deprecated: use Types
-func TypeExprDecls() []*exprpb.Decl {
- return stdTypeDecls
-}
-
func notStrictlyFalse(value ref.Val) ref.Val {
if types.IsBool(value) {
return value
@@ -659,3 +941,118 @@ func convertToType(t ref.Type) functions.UnaryOp {
return val.ConvertToType(t)
}
}
+
+func timestampGetFullYear(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ return types.Int(t.Year())
+}
+
+func timestampGetMonth(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ // CEL spec indicates that the month should be 0-based, but the Time value
+ // for Month() is 1-based.
+ return types.Int(t.Month() - 1)
+}
+
+func timestampGetDayOfYear(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ return types.Int(t.YearDay() - 1)
+}
+
+func timestampGetDayOfMonthZeroBased(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ return types.Int(t.Day() - 1)
+}
+
+func timestampGetDayOfMonthOneBased(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ return types.Int(t.Day())
+}
+
+func timestampGetDayOfWeek(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ return types.Int(t.Weekday())
+}
+
+func timestampGetHours(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ return types.Int(t.Hour())
+}
+
+func timestampGetMinutes(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ return types.Int(t.Minute())
+}
+
+func timestampGetSeconds(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ return types.Int(t.Second())
+}
+
+func timestampGetMilliseconds(ts, tz ref.Val) ref.Val {
+ t, err := inTimeZone(ts, tz)
+ if err != nil {
+ return types.NewErrFromString(err.Error())
+ }
+ return types.Int(t.Nanosecond() / 1000000)
+}
+
+func inTimeZone(ts, tz ref.Val) (time.Time, error) {
+ t := ts.(types.Timestamp)
+ val := string(tz.(types.String))
+ ind := strings.Index(val, ":")
+ if ind == -1 {
+ loc, err := time.LoadLocation(val)
+ if err != nil {
+ return time.Time{}, err
+ }
+ return t.In(loc), nil
+ }
+
+ // If the input is not the name of a timezone (for example, 'US/Central'), it should be a numerical offset from UTC
+ // in the format ^(+|-)(0[0-9]|1[0-4]):[0-5][0-9]$. The numerical input is parsed in terms of hours and minutes.
+ hr, err := strconv.Atoi(string(val[0:ind]))
+ if err != nil {
+ return time.Time{}, err
+ }
+ min, err := strconv.Atoi(string(val[ind+1:]))
+ if err != nil {
+ return time.Time{}, err
+ }
+ var offset int
+ if string(val[0]) == "-" {
+ offset = hr*60 - min
+ } else {
+ offset = hr*60 + min
+ }
+ secondsEastOfUTC := int((time.Duration(offset) * time.Minute).Seconds())
+ timezone := time.FixedZone("", secondsEastOfUTC)
+ return t.In(timezone), nil
+}
diff --git a/vendor/github.com/google/cel-go/common/types/BUILD.bazel b/vendor/github.com/google/cel-go/common/types/BUILD.bazel
index b5e44ffbf149..7082bc7550d1 100644
--- a/vendor/github.com/google/cel-go/common/types/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/common/types/BUILD.bazel
@@ -18,6 +18,7 @@ go_library(
"int.go",
"iterator.go",
"json_value.go",
+ "format.go",
"list.go",
"map.go",
"null.go",
@@ -40,10 +41,12 @@ go_library(
"//common/types/ref:go_default_library",
"//common/types/traits:go_default_library",
"@com_github_stoewer_go_strcase//:go_default_library",
+ "@dev_cel_expr//:expr",
"@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
"@org_golang_google_protobuf//encoding/protojson: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/dynamicpb:go_default_library",
"@org_golang_google_protobuf//types/known/anypb:go_default_library",
"@org_golang_google_protobuf//types/known/durationpb:go_default_library",
"@org_golang_google_protobuf//types/known/structpb:go_default_library",
diff --git a/vendor/github.com/google/cel-go/common/types/bool.go b/vendor/github.com/google/cel-go/common/types/bool.go
index 565734f3ff5b..1f9e1073928b 100644
--- a/vendor/github.com/google/cel-go/common/types/bool.go
+++ b/vendor/github.com/google/cel-go/common/types/bool.go
@@ -18,6 +18,7 @@ import (
"fmt"
"reflect"
"strconv"
+ "strings"
"github.com/google/cel-go/common/types/ref"
@@ -128,6 +129,14 @@ func (b Bool) Value() any {
return bool(b)
}
+func (b Bool) format(sb *strings.Builder) {
+ if b {
+ sb.WriteString("true")
+ } else {
+ sb.WriteString("false")
+ }
+}
+
// IsBool returns whether the input ref.Val or ref.Type is equal to BoolType.
func IsBool(elem ref.Val) bool {
switch v := elem.(type) {
diff --git a/vendor/github.com/google/cel-go/common/types/bytes.go b/vendor/github.com/google/cel-go/common/types/bytes.go
index 5838755f8b35..b59e1fc20890 100644
--- a/vendor/github.com/google/cel-go/common/types/bytes.go
+++ b/vendor/github.com/google/cel-go/common/types/bytes.go
@@ -19,6 +19,7 @@ import (
"encoding/base64"
"fmt"
"reflect"
+ "strings"
"unicode/utf8"
"github.com/google/cel-go/common/types/ref"
@@ -58,7 +59,17 @@ func (b Bytes) Compare(other ref.Val) ref.Val {
// ConvertToNative implements the ref.Val interface method.
func (b Bytes) ConvertToNative(typeDesc reflect.Type) (any, error) {
switch typeDesc.Kind() {
- case reflect.Array, reflect.Slice:
+ case reflect.Array:
+ if len(b) != typeDesc.Len() {
+ return nil, fmt.Errorf("[%d]byte not assignable to [%d]byte array", len(b), typeDesc.Len())
+ }
+ refArrPtr := reflect.New(reflect.ArrayOf(len(b), typeDesc.Elem()))
+ refArr := refArrPtr.Elem()
+ for i, byt := range b {
+ refArr.Index(i).Set(reflect.ValueOf(byt).Convert(typeDesc.Elem()))
+ }
+ return refArr.Interface(), nil
+ case reflect.Slice:
return reflect.ValueOf(b).Convert(typeDesc).Interface(), nil
case reflect.Ptr:
switch typeDesc {
@@ -128,3 +139,17 @@ func (b Bytes) Type() ref.Type {
func (b Bytes) Value() any {
return []byte(b)
}
+
+func (b Bytes) format(sb *strings.Builder) {
+ fmt.Fprintf(sb, "b\"%s\"", bytesToOctets([]byte(b)))
+}
+
+// bytesToOctets converts byte sequences to a string using a three digit octal encoded value
+// per byte.
+func bytesToOctets(byteVal []byte) string {
+ var b strings.Builder
+ for _, c := range byteVal {
+ fmt.Fprintf(&b, "\\%03o", c)
+ }
+ return b.String()
+}
diff --git a/vendor/github.com/google/cel-go/common/types/double.go b/vendor/github.com/google/cel-go/common/types/double.go
index 027e789786b9..1e7de9d6e148 100644
--- a/vendor/github.com/google/cel-go/common/types/double.go
+++ b/vendor/github.com/google/cel-go/common/types/double.go
@@ -18,6 +18,8 @@ import (
"fmt"
"math"
"reflect"
+ "strconv"
+ "strings"
"github.com/google/cel-go/common/types/ref"
@@ -209,3 +211,23 @@ func (d Double) Type() ref.Type {
func (d Double) Value() any {
return float64(d)
}
+
+func (d Double) format(sb *strings.Builder) {
+ if math.IsNaN(float64(d)) {
+ sb.WriteString(`double("NaN")`)
+ return
+ }
+ if math.IsInf(float64(d), -1) {
+ sb.WriteString(`double("-Infinity")`)
+ return
+ }
+ if math.IsInf(float64(d), 1) {
+ sb.WriteString(`double("Infinity")`)
+ return
+ }
+ s := strconv.FormatFloat(float64(d), 'f', -1, 64)
+ sb.WriteString(s)
+ if !strings.ContainsRune(s, '.') {
+ sb.WriteString(".0")
+ }
+}
diff --git a/vendor/github.com/google/cel-go/common/types/duration.go b/vendor/github.com/google/cel-go/common/types/duration.go
index 596e56d6b03e..be58d567eddb 100644
--- a/vendor/github.com/google/cel-go/common/types/duration.go
+++ b/vendor/github.com/google/cel-go/common/types/duration.go
@@ -18,6 +18,7 @@ import (
"fmt"
"reflect"
"strconv"
+ "strings"
"time"
"github.com/google/cel-go/common/overloads"
@@ -185,6 +186,10 @@ func (d Duration) Value() any {
return d.Duration
}
+func (d Duration) format(sb *strings.Builder) {
+ fmt.Fprintf(sb, `duration("%ss")`, strconv.FormatFloat(d.Seconds(), 'f', -1, 64))
+}
+
// DurationGetHours returns the duration in hours.
func DurationGetHours(val ref.Val) ref.Val {
dur, ok := val.(Duration)
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 aa8f94b4f855..17ab1a95e533 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,30 @@ 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...)}
+}
+
+// NewErrFromString creates a new Err with the provided message.
+// TODO: Audit the use of this function and standardize the error messages and codes.
+func NewErrFromString(message string) ref.Val {
+ return &Err{error: errors.New(message)}
+}
+
+// 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 +148,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/format.go b/vendor/github.com/google/cel-go/common/types/format.go
new file mode 100644
index 000000000000..174a2bd04056
--- /dev/null
+++ b/vendor/github.com/google/cel-go/common/types/format.go
@@ -0,0 +1,42 @@
+package types
+
+import (
+ "fmt"
+ "strings"
+
+ "github.com/google/cel-go/common/types/ref"
+ "github.com/google/cel-go/common/types/traits"
+)
+
+type formattable interface {
+ format(*strings.Builder)
+}
+
+// Format formats the value as a string. The result is only intended for human consumption and ignores errors.
+// Do not depend on the output being stable. It may change at any time.
+func Format(val ref.Val) string {
+ var sb strings.Builder
+ formatTo(&sb, val)
+ return sb.String()
+}
+
+func formatTo(sb *strings.Builder, val ref.Val) {
+ if fmtable, ok := val.(formattable); ok {
+ fmtable.format(sb)
+ return
+ }
+ // All of the builtins implement formattable. Try to deal with traits.
+ if l, ok := val.(traits.Lister); ok {
+ formatList(l, sb)
+ return
+ }
+ if m, ok := val.(traits.Mapper); ok {
+ formatMap(m, sb)
+ return
+ }
+ // This could be an error, unknown, opaque or object.
+ // Unfortunately we have no consistent way of inspecting
+ // opaque and object. So we just fallback to fmt.Stringer
+ // and hope it is relavent.
+ fmt.Fprintf(sb, "%s", val)
+}
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 940772aed1f0..0ac1997b7029 100644
--- a/vendor/github.com/google/cel-go/common/types/int.go
+++ b/vendor/github.com/google/cel-go/common/types/int.go
@@ -19,6 +19,7 @@ import (
"math"
"reflect"
"strconv"
+ "strings"
"time"
"github.com/google/cel-go/common/types/ref"
@@ -90,6 +91,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:
@@ -278,6 +291,10 @@ func (i Int) Value() any {
return int64(i)
}
+func (i Int) format(sb *strings.Builder) {
+ sb.WriteString(strconv.FormatInt(int64(i), 10))
+}
+
// isJSONSafe indicates whether the int is safely representable as a floating point value in JSON.
func (i Int) isJSONSafe() bool {
return i >= minIntJSON && i <= maxIntJSON
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 d4932b4a90c5..8c023f89104c 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)
@@ -237,7 +243,7 @@ func (l *baseList) Equal(other ref.Val) ref.Val {
func (l *baseList) Get(index ref.Val) ref.Val {
ind, err := IndexOrError(index)
if err != nil {
- return ValOrErr(index, err.Error())
+ return ValOrErr(index, "%v", err)
}
if ind < 0 || ind >= l.size {
return NewErr("index '%d' out of range in list size '%d'", ind, l.Size())
@@ -250,6 +256,15 @@ func (l *baseList) IsZeroValue() bool {
return l.size == 0
}
+// Fold calls the FoldEntry method for each (index, value) pair in the list.
+func (l *baseList) Fold(f traits.Folder) {
+ for i := 0; i < l.size; i++ {
+ if !f.FoldEntry(i, l.get(i)) {
+ break
+ }
+ }
+}
+
// Iterator implements the traits.Iterable interface method.
func (l *baseList) Iterator() traits.Iterator {
return newListIterator(l)
@@ -284,6 +299,22 @@ func (l *baseList) String() string {
return sb.String()
}
+func formatList(l traits.Lister, sb *strings.Builder) {
+ sb.WriteString("[")
+ n, _ := l.Size().(Int)
+ for i := 0; i < int(n); i++ {
+ formatTo(sb, l.Get(Int(i)))
+ if i != int(n)-1 {
+ sb.WriteString(", ")
+ }
+ }
+ sb.WriteString("]")
+}
+
+func (l *baseList) format(sb *strings.Builder) {
+ formatList(l, sb)
+}
+
// mutableList aggregates values into its internal storage. For use with internal CEL variables only.
type mutableList struct {
*baseList
@@ -412,7 +443,7 @@ func (l *concatList) Equal(other ref.Val) ref.Val {
func (l *concatList) Get(index ref.Val) ref.Val {
ind, err := IndexOrError(index)
if err != nil {
- return ValOrErr(index, err.Error())
+ return ValOrErr(index, "%v", err)
}
i := Int(ind)
if i < l.prevList.Size().(Int) {
@@ -427,6 +458,15 @@ func (l *concatList) IsZeroValue() bool {
return l.Size().(Int) == 0
}
+// Fold calls the FoldEntry method for each (index, value) pair in the list.
+func (l *concatList) Fold(f traits.Folder) {
+ for i := Int(0); i < l.Size().(Int); i++ {
+ if !f.FoldEntry(i, l.Get(i)) {
+ break
+ }
+ }
+}
+
// Iterator implements the traits.Iterable interface method.
func (l *concatList) Iterator() traits.Iterator {
return newListIterator(l)
@@ -521,3 +561,30 @@ func IndexOrError(index ref.Val) (int, error) {
return -1, fmt.Errorf("unsupported index type '%s' in list", index.Type())
}
}
+
+// ToFoldableList will create a Foldable version of a list suitable for key-value pair iteration.
+//
+// For values which are already Foldable, this call is a no-op. For all other values, the fold is
+// driven via the Size() and Get() calls which means that the folding will function, but take a
+// performance hit.
+func ToFoldableList(l traits.Lister) traits.Foldable {
+ if f, ok := l.(traits.Foldable); ok {
+ return f
+ }
+ return interopFoldableList{Lister: l}
+}
+
+type interopFoldableList struct {
+ traits.Lister
+}
+
+// Fold implements the traits.Foldable interface method and performs an iteration over the
+// range of elements of the list.
+func (l interopFoldableList) Fold(f traits.Folder) {
+ sz := l.Size().(Int)
+ for i := Int(0); i < sz; i++ {
+ if !f.FoldEntry(i, l.Get(i)) {
+ break
+ }
+ }
+}
diff --git a/vendor/github.com/google/cel-go/common/types/map.go b/vendor/github.com/google/cel-go/common/types/map.go
index 739b7aab00d9..b33096197ca3 100644
--- a/vendor/github.com/google/cel-go/common/types/map.go
+++ b/vendor/github.com/google/cel-go/common/types/map.go
@@ -17,6 +17,7 @@ package types
import (
"fmt"
"reflect"
+ "sort"
"strings"
"github.com/stoewer/go-strcase"
@@ -94,6 +95,24 @@ func NewProtoMap(adapter Adapter, value *pb.Map) traits.Mapper {
}
}
+// NewMutableMap constructs a mutable map from an adapter and a set of map values.
+func NewMutableMap(adapter Adapter, mutableValues map[ref.Val]ref.Val) traits.MutableMapper {
+ mutableCopy := make(map[ref.Val]ref.Val, len(mutableValues))
+ for k, v := range mutableValues {
+ mutableCopy[k] = v
+ }
+ m := &mutableMap{
+ baseMap: &baseMap{
+ Adapter: adapter,
+ mapAccessor: newRefValMapAccessor(mutableCopy),
+ value: mutableCopy,
+ size: len(mutableCopy),
+ },
+ mutableValues: mutableCopy,
+ }
+ return m
+}
+
// mapAccessor is a private interface for finding values within a map and iterating over the keys.
// This interface implements portions of the API surface area required by the traits.Mapper
// interface.
@@ -105,6 +124,9 @@ type mapAccessor interface {
// Iterator returns an Iterator over the map key set.
Iterator() traits.Iterator
+
+ // Fold calls the FoldEntry method for each (key, value) pair in the map.
+ Fold(traits.Folder)
}
// baseMap is a reflection based map implementation designed to handle a variety of map-like types.
@@ -297,6 +319,41 @@ func (m *baseMap) String() string {
return sb.String()
}
+type baseMapEntry struct {
+ key string
+ val string
+}
+
+func formatMap(m traits.Mapper, sb *strings.Builder) {
+ it := m.Iterator()
+ var ents []baseMapEntry
+ if s, ok := m.Size().(Int); ok {
+ ents = make([]baseMapEntry, 0, int(s))
+ }
+ for it.HasNext() == True {
+ k := it.Next()
+ v, _ := m.Find(k)
+ ents = append(ents, baseMapEntry{Format(k), Format(v)})
+ }
+ sort.SliceStable(ents, func(i, j int) bool {
+ return ents[i].key < ents[j].key
+ })
+ sb.WriteString("{")
+ for i, ent := range ents {
+ if i > 0 {
+ sb.WriteString(", ")
+ }
+ sb.WriteString(ent.key)
+ sb.WriteString(": ")
+ sb.WriteString(ent.val)
+ }
+ sb.WriteString("}")
+}
+
+func (m *baseMap) format(sb *strings.Builder) {
+ formatMap(m, sb)
+}
+
// Type implements the ref.Val interface method.
func (m *baseMap) Type() ref.Type {
return MapType
@@ -307,6 +364,28 @@ func (m *baseMap) Value() any {
return m.value
}
+// mutableMap holds onto a set of mutable values which are used for intermediate computations.
+type mutableMap struct {
+ *baseMap
+ mutableValues map[ref.Val]ref.Val
+}
+
+// Insert implements the traits.MutableMapper interface method, returning true if the key insertion
+// succeeds.
+func (m *mutableMap) Insert(k, v ref.Val) ref.Val {
+ if _, found := m.Find(k); found {
+ return NewErr("insert failed: key %v already exists", k)
+ }
+ m.mutableValues[k] = v
+ return m
+}
+
+// ToImmutableMap implements the traits.MutableMapper interface method, converting a mutable map
+// an immutable map implementation.
+func (m *mutableMap) ToImmutableMap() traits.Mapper {
+ return NewRefValMap(m.Adapter, m.mutableValues)
+}
+
func newJSONStructAccessor(adapter Adapter, st map[string]*structpb.Value) mapAccessor {
return &jsonStructAccessor{
Adapter: adapter,
@@ -350,6 +429,15 @@ func (a *jsonStructAccessor) Iterator() traits.Iterator {
}
}
+// Fold calls the FoldEntry method for each (key, value) pair in the map.
+func (a *jsonStructAccessor) Fold(f traits.Folder) {
+ for k, v := range a.st {
+ if !f.FoldEntry(k, v) {
+ break
+ }
+ }
+}
+
func newReflectMapAccessor(adapter Adapter, value reflect.Value) mapAccessor {
keyType := value.Type().Key()
return &reflectMapAccessor{
@@ -424,6 +512,16 @@ func (m *reflectMapAccessor) Iterator() traits.Iterator {
}
}
+// Fold calls the FoldEntry method for each (key, value) pair in the map.
+func (m *reflectMapAccessor) Fold(f traits.Folder) {
+ mapRange := m.refValue.MapRange()
+ for mapRange.Next() {
+ if !f.FoldEntry(mapRange.Key().Interface(), mapRange.Value().Interface()) {
+ break
+ }
+ }
+}
+
func newRefValMapAccessor(mapVal map[ref.Val]ref.Val) mapAccessor {
return &refValMapAccessor{mapVal: mapVal}
}
@@ -477,6 +575,15 @@ func (a *refValMapAccessor) Iterator() traits.Iterator {
}
}
+// Fold calls the FoldEntry method for each (key, value) pair in the map.
+func (a *refValMapAccessor) Fold(f traits.Folder) {
+ for k, v := range a.mapVal {
+ if !f.FoldEntry(k, v) {
+ break
+ }
+ }
+}
+
func newStringMapAccessor(strMap map[string]string) mapAccessor {
return &stringMapAccessor{mapVal: strMap}
}
@@ -515,6 +622,15 @@ func (a *stringMapAccessor) Iterator() traits.Iterator {
}
}
+// Fold calls the FoldEntry method for each (key, value) pair in the map.
+func (a *stringMapAccessor) Fold(f traits.Folder) {
+ for k, v := range a.mapVal {
+ if !f.FoldEntry(k, v) {
+ break
+ }
+ }
+}
+
func newStringIfaceMapAccessor(adapter Adapter, mapVal map[string]any) mapAccessor {
return &stringIfaceMapAccessor{
Adapter: adapter,
@@ -557,6 +673,15 @@ func (a *stringIfaceMapAccessor) Iterator() traits.Iterator {
}
}
+// Fold calls the FoldEntry method for each (key, value) pair in the map.
+func (a *stringIfaceMapAccessor) Fold(f traits.Folder) {
+ for k, v := range a.mapVal {
+ if !f.FoldEntry(k, v) {
+ break
+ }
+ }
+}
+
// protoMap is a specialized, separate implementation of the traits.Mapper interfaces tailored to
// accessing protoreflect.Map values.
type protoMap struct {
@@ -769,6 +894,13 @@ func (m *protoMap) Iterator() traits.Iterator {
}
}
+// Fold calls the FoldEntry method for each (key, value) pair in the map.
+func (m *protoMap) Fold(f traits.Folder) {
+ m.value.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool {
+ return f.FoldEntry(k.Interface(), v.Interface())
+ })
+}
+
// Size returns the number of entries in the protoreflect.Map.
func (m *protoMap) Size() ref.Val {
return Int(m.value.Len())
@@ -852,3 +984,55 @@ func (it *stringKeyIterator) Next() ref.Val {
}
return nil
}
+
+// ToFoldableMap will create a Foldable version of a map suitable for key-value pair iteration.
+//
+// For values which are already Foldable, this call is a no-op. For all other values, the fold
+// is driven via the Iterator HasNext() and Next() calls as well as the map's Get() method
+// which means that the folding will function, but take a performance hit.
+func ToFoldableMap(m traits.Mapper) traits.Foldable {
+ if f, ok := m.(traits.Foldable); ok {
+ return f
+ }
+ return interopFoldableMap{Mapper: m}
+}
+
+type interopFoldableMap struct {
+ traits.Mapper
+}
+
+func (m interopFoldableMap) Fold(f traits.Folder) {
+ it := m.Iterator()
+ for it.HasNext() == True {
+ k := it.Next()
+ if !f.FoldEntry(k, m.Get(k)) {
+ break
+ }
+ }
+}
+
+// InsertMapKeyValue inserts a key, value pair into the target map if the target map does not
+// already contain the given key.
+//
+// If the map is mutable, it is modified in-place per the MutableMapper contract.
+// If the map is not mutable, a copy containing the new key, value pair is made.
+func InsertMapKeyValue(m traits.Mapper, k, v ref.Val) ref.Val {
+ if mutable, ok := m.(traits.MutableMapper); ok {
+ return mutable.Insert(k, v)
+ }
+
+ // Otherwise perform the slow version of the insertion which makes a copy of the incoming map.
+ if _, found := m.Find(k); !found {
+ size := m.Size().(Int)
+ copy := make(map[ref.Val]ref.Val, size+1)
+ copy[k] = v
+ it := m.Iterator()
+ for it.HasNext() == True {
+ nextK := it.Next()
+ nextV := m.Get(nextK)
+ copy[nextK] = nextV
+ }
+ return DefaultTypeAdapter.NativeToValue(copy)
+ }
+ return NewErr("insert failed: key %v already exists", k)
+}
diff --git a/vendor/github.com/google/cel-go/common/types/null.go b/vendor/github.com/google/cel-go/common/types/null.go
index 926ca3dc980b..2c0297fe65b4 100644
--- a/vendor/github.com/google/cel-go/common/types/null.go
+++ b/vendor/github.com/google/cel-go/common/types/null.go
@@ -17,6 +17,7 @@ package types
import (
"fmt"
"reflect"
+ "strings"
"google.golang.org/protobuf/proto"
@@ -35,6 +36,8 @@ var (
// golang reflect type for Null values.
nullReflectType = reflect.TypeOf(NullValue)
+
+ protoIfaceType = reflect.TypeOf((*proto.Message)(nil)).Elem()
)
// ConvertToNative implements ref.Val.ConvertToNative.
@@ -61,8 +64,14 @@ func (n Null) ConvertToNative(typeDesc reflect.Type) (any, error) {
return structpb.NewNullValue(), nil
case boolWrapperType, byteWrapperType, doubleWrapperType, floatWrapperType,
int32WrapperType, int64WrapperType, stringWrapperType, uint32WrapperType,
- uint64WrapperType:
+ uint64WrapperType, durationValueType, timestampValueType, protoIfaceType:
return nil, nil
+ case jsonListValueType, jsonStructType:
+ // skip handling
+ default:
+ if typeDesc.Implements(protoIfaceType) {
+ return nil, nil
+ }
}
case reflect.Interface:
nv := n.Value()
@@ -109,3 +118,7 @@ func (n Null) Type() ref.Type {
func (n Null) Value() any {
return structpb.NullValue_NULL_VALUE
}
+
+func (n Null) format(sb *strings.Builder) {
+ sb.WriteString("null")
+}
diff --git a/vendor/github.com/google/cel-go/common/types/object.go b/vendor/github.com/google/cel-go/common/types/object.go
index 8ba0af9fbe1c..776f6954a9c0 100644
--- a/vendor/github.com/google/cel-go/common/types/object.go
+++ b/vendor/github.com/google/cel-go/common/types/object.go
@@ -17,9 +17,12 @@ package types
import (
"fmt"
"reflect"
+ "sort"
+ "strings"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
+ "google.golang.org/protobuf/reflect/protoreflect"
"github.com/google/cel-go/common/types/pb"
"github.com/google/cel-go/common/types/ref"
@@ -151,7 +154,7 @@ func (o *protoObj) Get(index ref.Val) ref.Val {
}
fv, err := fd.GetFrom(o.value)
if err != nil {
- return NewErr(err.Error())
+ return NewErrFromString(err.Error())
}
return o.NativeToValue(fv)
}
@@ -163,3 +166,29 @@ func (o *protoObj) Type() ref.Type {
func (o *protoObj) Value() any {
return o.value
}
+
+type protoObjField struct {
+ fd protoreflect.FieldDescriptor
+ v protoreflect.Value
+}
+
+func (o *protoObj) format(sb *strings.Builder) {
+ var fields []protoreflect.FieldDescriptor
+ o.value.ProtoReflect().Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool {
+ fields = append(fields, fd)
+ return true
+ })
+ sort.SliceStable(fields, func(i, j int) bool {
+ return fields[i].Number() < fields[j].Number()
+ })
+ sb.WriteString(o.Type().TypeName())
+ sb.WriteString("{")
+ for i, field := range fields {
+ if i > 0 {
+ sb.WriteString(", ")
+ }
+ sb.WriteString(fmt.Sprintf("%s: ", field.Name()))
+ formatTo(sb, o.Get(String(field.Name())))
+ }
+ sb.WriteString("}")
+}
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 a9f30aed0157..b8685ebf5584 100644
--- a/vendor/github.com/google/cel-go/common/types/optional.go
+++ b/vendor/github.com/google/cel-go/common/types/optional.go
@@ -18,13 +18,14 @@ import (
"errors"
"fmt"
"reflect"
+ "strings"
"github.com/google/cel-go/common/types/ref"
)
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{}
@@ -94,6 +95,16 @@ func (o *Optional) String() string {
return "optional.none()"
}
+func (o *Optional) format(sb *strings.Builder) {
+ if o.HasValue() {
+ sb.WriteString(`optional.of(`)
+ formatTo(sb, o.GetValue())
+ sb.WriteString(`)`)
+ } else {
+ sb.WriteString("optional.none()")
+ }
+}
+
// Type implements the ref.Val interface method.
func (o *Optional) Type() ref.Type {
return OptionalType
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 c68a921826bd..dcb66ef59613 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/pb/type.go b/vendor/github.com/google/cel-go/common/types/pb/type.go
index 6cc95c276dda..bdd474c95af9 100644
--- a/vendor/github.com/google/cel-go/common/types/pb/type.go
+++ b/vendor/github.com/google/cel-go/common/types/pb/type.go
@@ -427,22 +427,49 @@ func unwrap(desc description, msg proto.Message) (any, bool, error) {
return structpb.NullValue_NULL_VALUE, true, nil
}
case *wrapperspb.BoolValue:
+ if v == nil {
+ return nil, true, nil
+ }
return v.GetValue(), true, nil
case *wrapperspb.BytesValue:
+ if v == nil {
+ return nil, true, nil
+ }
return v.GetValue(), true, nil
case *wrapperspb.DoubleValue:
+ if v == nil {
+ return nil, true, nil
+ }
return v.GetValue(), true, nil
case *wrapperspb.FloatValue:
+ if v == nil {
+ return nil, true, nil
+ }
return float64(v.GetValue()), true, nil
case *wrapperspb.Int32Value:
+ if v == nil {
+ return nil, true, nil
+ }
return int64(v.GetValue()), true, nil
case *wrapperspb.Int64Value:
+ if v == nil {
+ return nil, true, nil
+ }
return v.GetValue(), true, nil
case *wrapperspb.StringValue:
+ if v == nil {
+ return nil, true, nil
+ }
return v.GetValue(), true, nil
case *wrapperspb.UInt32Value:
+ if v == nil {
+ return nil, true, nil
+ }
return uint64(v.GetValue()), true, nil
case *wrapperspb.UInt64Value:
+ if v == nil {
+ return nil, true, nil
+ }
return v.GetValue(), true, nil
}
return msg, false, 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 e80b4622e244..936a4e28b206 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())
@@ -564,17 +585,46 @@ func nativeToValue(a Adapter, value any) (ref.Val, bool) {
refKind := refValue.Kind()
switch refKind {
case reflect.Array, reflect.Slice:
+ if refValue.Type().Elem() == reflect.TypeOf(byte(0)) {
+ if refValue.CanAddr() {
+ return Bytes(refValue.Bytes()), true
+ }
+ tmp := reflect.New(refValue.Type())
+ tmp.Elem().Set(refValue)
+ return Bytes(tmp.Elem().Bytes()), true
+ }
return NewDynamicList(a, v), true
case reflect.Map:
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 +637,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 028e6824d220..8aad4701ccc4 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)
}
@@ -189,6 +186,10 @@ func (s String) Value() any {
return string(s)
}
+func (s String) format(sb *strings.Builder) {
+ sb.WriteString(strconv.Quote(string(s)))
+}
+
// StringContains returns whether the string contains a substring.
func StringContains(s, sub ref.Val) ref.Val {
str, ok := s.(String)
diff --git a/vendor/github.com/google/cel-go/common/types/timestamp.go b/vendor/github.com/google/cel-go/common/types/timestamp.go
index 33acdea8ef7c..f7be58591616 100644
--- a/vendor/github.com/google/cel-go/common/types/timestamp.go
+++ b/vendor/github.com/google/cel-go/common/types/timestamp.go
@@ -179,6 +179,10 @@ func (t Timestamp) Value() any {
return t.Time
}
+func (t Timestamp) format(sb *strings.Builder) {
+ fmt.Fprintf(sb, `timestamp("%s")`, t.Time.UTC().Format(time.RFC3339Nano))
+}
+
var (
timestampValueType = reflect.TypeOf(&tpb.Timestamp{})
diff --git a/vendor/github.com/google/cel-go/common/types/traits/iterator.go b/vendor/github.com/google/cel-go/common/types/traits/iterator.go
index 42dd371aa49b..91c10f08fcf8 100644
--- a/vendor/github.com/google/cel-go/common/types/traits/iterator.go
+++ b/vendor/github.com/google/cel-go/common/types/traits/iterator.go
@@ -34,3 +34,16 @@ type Iterator interface {
// Next returns the next element.
Next() ref.Val
}
+
+// Foldable aggregate types support iteration over (key, value) or (index, value) pairs.
+type Foldable interface {
+ // Fold invokes the Folder.FoldEntry for all entries in the type
+ Fold(Folder)
+}
+
+// Folder performs a fold on a given entry and indicates whether to continue folding.
+type Folder interface {
+ // FoldEntry indicates the key, value pair associated with the entry.
+ // If the output is true, continue folding. Otherwise, terminate the fold.
+ FoldEntry(key, val any) bool
+}
diff --git a/vendor/github.com/google/cel-go/common/types/traits/lister.go b/vendor/github.com/google/cel-go/common/types/traits/lister.go
index 5cf2593f3b94..e54781a602f4 100644
--- a/vendor/github.com/google/cel-go/common/types/traits/lister.go
+++ b/vendor/github.com/google/cel-go/common/types/traits/lister.go
@@ -27,6 +27,9 @@ type Lister interface {
}
// MutableLister interface which emits an immutable result after an intermediate computation.
+//
+// Note, this interface is intended only to be used within Comprehensions where the mutable
+// value is not directly observable within the user-authored CEL expression.
type MutableLister interface {
Lister
ToImmutableList() Lister
diff --git a/vendor/github.com/google/cel-go/common/types/traits/mapper.go b/vendor/github.com/google/cel-go/common/types/traits/mapper.go
index 2f7c919a8bd8..d13333f3f603 100644
--- a/vendor/github.com/google/cel-go/common/types/traits/mapper.go
+++ b/vendor/github.com/google/cel-go/common/types/traits/mapper.go
@@ -31,3 +31,18 @@ type Mapper interface {
// (Unknown|Err, false).
Find(key ref.Val) (ref.Val, bool)
}
+
+// MutableMapper interface which emits an immutable result after an intermediate computation.
+//
+// Note, this interface is intended only to be used within Comprehensions where the mutable
+// value is not directly observable within the user-authored CEL expression.
+type MutableMapper interface {
+ Mapper
+
+ // Insert a key, value pair into the map, returning the map if the insert is successful
+ // and an error if key already exists in the mutable map.
+ Insert(k, v ref.Val) ref.Val
+
+ // ToImmutableMap converts a mutable map into an immutable map.
+ ToImmutableMap() Mapper
+}
diff --git a/vendor/github.com/google/cel-go/common/types/traits/traits.go b/vendor/github.com/google/cel-go/common/types/traits/traits.go
index 6da3e6a3e1f8..51a09df5640b 100644
--- a/vendor/github.com/google/cel-go/common/types/traits/traits.go
+++ b/vendor/github.com/google/cel-go/common/types/traits/traits.go
@@ -59,6 +59,21 @@ const (
// SizerType types support the size() method.
SizerType
- // SubtractorType type support '-' operations.
+ // SubtractorType types support '-' operations.
SubtractorType
+
+ // FoldableType types support comprehensions v2 macros which iterate over (key, value) pairs.
+ FoldableType
+)
+
+const (
+ // ListerType supports a set of traits necessary for list operations.
+ //
+ // The ListerType is syntactic sugar and not intended to be a perfect reflection of all List operators.
+ ListerType = AdderType | ContainerType | IndexerType | IterableType | SizerType
+
+ // MapperType supports a set of traits necessary for map operations.
+ //
+ // The MapperType is syntactic sugar and not intended to be a perfect reflection of all Map operators.
+ MapperType = ContainerType | IndexerType | IterableType | SizerType
)
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 76624eefdee3..78c77a9b5d36 100644
--- a/vendor/github.com/google/cel-go/common/types/types.go
+++ b/vendor/github.com/google/cel-go/common/types/types.go
@@ -19,10 +19,13 @@ import (
"reflect"
"strings"
+ "google.golang.org/protobuf/proto"
+
chkdecls "github.com/google/cel-go/checker/decls"
"github.com/google/cel-go/common/types/ref"
"github.com/google/cel-go/common/types/traits"
+ celpb "cel.dev/expr"
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
@@ -161,9 +164,9 @@ var (
traits.SubtractorType,
}
// ListType represents the runtime list type.
- ListType = NewListType(nil)
+ ListType = NewListType(DynType)
// MapType represents the runtime map type.
- MapType = NewMapType(nil, nil)
+ MapType = NewMapType(DynType, DynType)
// NullType represents the type of a null value.
NullType = &Type{
kind: NullTypeKind,
@@ -373,8 +376,32 @@ func (t *Type) TypeName() string {
return t.runtimeTypeName
}
+func (t *Type) format(sb *strings.Builder) {
+ sb.WriteString(t.TypeName())
+}
+
+// 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 t.Kind() == TypeParamKind {
+ return fmt.Sprintf("<%s>", t.DeclaredTypeName())
+ }
if len(t.Parameters()) == 0 {
return t.DeclaredTypeName()
}
@@ -496,7 +523,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.
@@ -649,91 +676,118 @@ func TypeToExprType(t *Type) (*exprpb.Type, error) {
// ExprTypeToType converts a protobuf CEL type representation to a CEL-native type representation.
func ExprTypeToType(t *exprpb.Type) (*Type, error) {
+ return AlphaProtoAsType(t)
+}
+
+// AlphaProtoAsType converts a CEL v1alpha1.Type protobuf type to a CEL-native type representation.
+func AlphaProtoAsType(t *exprpb.Type) (*Type, error) {
+ canonical := &celpb.Type{}
+ if err := convertProto(t, canonical); err != nil {
+ return nil, err
+ }
+ return ProtoAsType(canonical)
+}
+
+// ProtoAsType converts a canonical CEL celpb.Type protobuf type to a CEL-native type representation.
+func ProtoAsType(t *celpb.Type) (*Type, error) {
switch t.GetTypeKind().(type) {
- case *exprpb.Type_Dyn:
+ case *celpb.Type_Dyn:
return DynType, nil
- case *exprpb.Type_AbstractType_:
+ case *celpb.Type_AbstractType_:
paramTypes := make([]*Type, len(t.GetAbstractType().GetParameterTypes()))
for i, p := range t.GetAbstractType().GetParameterTypes() {
- pt, err := ExprTypeToType(p)
+ pt, err := ProtoAsType(p)
if err != nil {
return nil, err
}
paramTypes[i] = pt
}
return NewOpaqueType(t.GetAbstractType().GetName(), paramTypes...), nil
- case *exprpb.Type_ListType_:
- et, err := ExprTypeToType(t.GetListType().GetElemType())
+ case *celpb.Type_ListType_:
+ et, err := ProtoAsType(t.GetListType().GetElemType())
if err != nil {
return nil, err
}
return NewListType(et), nil
- case *exprpb.Type_MapType_:
- kt, err := ExprTypeToType(t.GetMapType().GetKeyType())
+ case *celpb.Type_MapType_:
+ kt, err := ProtoAsType(t.GetMapType().GetKeyType())
if err != nil {
return nil, err
}
- vt, err := ExprTypeToType(t.GetMapType().GetValueType())
+ vt, err := ProtoAsType(t.GetMapType().GetValueType())
if err != nil {
return nil, err
}
return NewMapType(kt, vt), nil
- case *exprpb.Type_MessageType:
+ case *celpb.Type_MessageType:
return NewObjectType(t.GetMessageType()), nil
- case *exprpb.Type_Null:
+ case *celpb.Type_Null:
return NullType, nil
- case *exprpb.Type_Primitive:
+ case *celpb.Type_Primitive:
switch t.GetPrimitive() {
- case exprpb.Type_BOOL:
+ case celpb.Type_BOOL:
return BoolType, nil
- case exprpb.Type_BYTES:
+ case celpb.Type_BYTES:
return BytesType, nil
- case exprpb.Type_DOUBLE:
+ case celpb.Type_DOUBLE:
return DoubleType, nil
- case exprpb.Type_INT64:
+ case celpb.Type_INT64:
return IntType, nil
- case exprpb.Type_STRING:
+ case celpb.Type_STRING:
return StringType, nil
- case exprpb.Type_UINT64:
+ case celpb.Type_UINT64:
return UintType, nil
default:
return nil, fmt.Errorf("unsupported primitive type: %v", t)
}
- case *exprpb.Type_TypeParam:
+ case *celpb.Type_TypeParam:
return NewTypeParamType(t.GetTypeParam()), nil
- case *exprpb.Type_Type:
+ case *celpb.Type_Type:
if t.GetType().GetTypeKind() != nil {
- p, err := ExprTypeToType(t.GetType())
+ p, err := ProtoAsType(t.GetType())
if err != nil {
return nil, err
}
return NewTypeTypeWithParam(p), nil
}
return TypeType, nil
- case *exprpb.Type_WellKnown:
+ case *celpb.Type_WellKnown:
switch t.GetWellKnown() {
- case exprpb.Type_ANY:
+ case celpb.Type_ANY:
return AnyType, nil
- case exprpb.Type_DURATION:
+ case celpb.Type_DURATION:
return DurationType, nil
- case exprpb.Type_TIMESTAMP:
+ case celpb.Type_TIMESTAMP:
return TimestampType, nil
default:
return nil, fmt.Errorf("unsupported well-known type: %v", t)
}
- case *exprpb.Type_Wrapper:
- t, err := ExprTypeToType(&exprpb.Type{TypeKind: &exprpb.Type_Primitive{Primitive: t.GetWrapper()}})
+ case *celpb.Type_Wrapper:
+ t, err := ProtoAsType(&celpb.Type{TypeKind: &celpb.Type_Primitive{Primitive: t.GetWrapper()}})
if err != nil {
return nil, err
}
return NewNullableType(t), nil
- case *exprpb.Type_Error:
+ case *celpb.Type_Error:
return ErrorType, nil
default:
return nil, fmt.Errorf("unsupported type: %v", t)
}
}
+// TypeToProto converts from a CEL-native type representation to canonical CEL celpb.Type protobuf type.
+func TypeToProto(t *Type) (*celpb.Type, error) {
+ exprType, err := TypeToExprType(t)
+ if err != nil {
+ return nil, err
+ }
+ var pbtype celpb.Type
+ if err = convertProto(exprType, &pbtype); err != nil {
+ return nil, err
+ }
+ return &pbtype, nil
+}
+
func maybeWrapper(t *Type, pbType *exprpb.Type) *exprpb.Type {
if t.IsAssignableType(NullType) {
return chkdecls.NewWrapperType(pbType)
@@ -759,6 +813,23 @@ func maybeForeignType(t ref.Type) *Type {
return NewObjectType(t.TypeName(), traitMask)
}
+func convertProto(src, dst proto.Message) error {
+ pb, err := proto.Marshal(src)
+ if err != nil {
+ return err
+ }
+ err = proto.Unmarshal(pb, dst)
+ return err
+}
+
+func primitiveType(primitive celpb.Type_PrimitiveType) *celpb.Type {
+ return &celpb.Type{
+ TypeKind: &celpb.Type_Primitive{
+ Primitive: primitive,
+ },
+ }
+}
+
var (
checkedWellKnowns = map[string]*Type{
// Wrapper types.
@@ -803,4 +874,11 @@ var (
}
structTypeTraitMask = traits.FieldTesterType | traits.IndexerType
+
+ boolType = primitiveType(celpb.Type_BOOL)
+ bytesType = primitiveType(celpb.Type_BYTES)
+ doubleType = primitiveType(celpb.Type_DOUBLE)
+ intType = primitiveType(celpb.Type_INT64)
+ stringType = primitiveType(celpb.Type_STRING)
+ uintType = primitiveType(celpb.Type_UINT64)
)
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 3257f9ade977..a93405a13489 100644
--- a/vendor/github.com/google/cel-go/common/types/uint.go
+++ b/vendor/github.com/google/cel-go/common/types/uint.go
@@ -19,6 +19,7 @@ import (
"math"
"reflect"
"strconv"
+ "strings"
"github.com/google/cel-go/common/types/ref"
@@ -80,6 +81,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:
@@ -238,6 +251,11 @@ func (i Uint) Value() any {
return uint64(i)
}
+func (i Uint) format(sb *strings.Builder) {
+ sb.WriteString(strconv.FormatUint(uint64(i), 10))
+ sb.WriteString("u")
+}
+
// isJSONSafe indicates whether the uint is safely representable as a floating point value in JSON.
func (i Uint) isJSONSafe() bool {
return i <= maxIntJSON
diff --git a/vendor/github.com/google/cel-go/ext/BUILD.bazel b/vendor/github.com/google/cel-go/ext/BUILD.bazel
index 6fdcc60c6583..ef4f4ec3db9d 100644
--- a/vendor/github.com/google/cel-go/ext/BUILD.bazel
+++ b/vendor/github.com/google/cel-go/ext/BUILD.bazel
@@ -7,12 +7,18 @@ package(
go_library(
name = "go_default_library",
srcs = [
+ "bindings.go",
+ "comprehensions.go",
"encoders.go",
+ "extension_option_factory.go",
+ "formatting.go",
+ "formatting_v2.go",
"guards.go",
"lists.go",
"math.go",
"native.go",
"protos.go",
+ "regex.go",
"sets.go",
"strings.go",
],
@@ -21,14 +27,18 @@ go_library(
deps = [
"//cel:go_default_library",
"//checker:go_default_library",
- "//checker/decls:go_default_library",
+ "//common:go_default_library",
+ "//common/ast:go_default_library",
+ "//common/decls:go_default_library",
+ "//common/env:go_default_library",
+ "//common/operators:go_default_library",
"//common/overloads: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",
+ "//parser: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",
@@ -41,11 +51,17 @@ go_test(
name = "go_default_test",
size = "small",
srcs = [
+ "bindings_test.go",
+ "comprehensions_test.go",
"encoders_test.go",
+ "extension_option_factory_test.go",
+ "formatting_test.go",
+ "formatting_v2_test.go",
"lists_test.go",
"math_test.go",
"native_test.go",
"protos_test.go",
+ "regex_test.go",
"sets_test.go",
"strings_test.go",
],
@@ -55,15 +71,16 @@ go_test(
deps = [
"//cel:go_default_library",
"//checker:go_default_library",
+ "//common:go_default_library",
+ "//common/env:go_default_library",
"//common/types:go_default_library",
"//common/types/ref:go_default_library",
"//common/types/traits:go_default_library",
"//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",
+ "//test/proto2pb:go_default_library",
+ "//test/proto3pb:go_default_library",
+ "@org_golang_google_protobuf//encoding/protojson: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 6f621ac4af64..41ae6a3143f7 100644
--- a/vendor/github.com/google/cel-go/ext/README.md
+++ b/vendor/github.com/google/cel-go/ext/README.md
@@ -3,15 +3,15 @@
CEL extensions are a related set of constants, functions, macros, or other
features which may not be covered by the core CEL spec.
-## Bindings
+## Bindings
Returns a cel.EnvOption to configure support for local variable bindings
in expressions.
-# Cel.Bind
+### Cel.Bind
Binds a simple identifier to an initialization expression which may be used
-in a subsequenct result expression. Bindings may also be nested within each
+in a subsequent result expression. Bindings may also be nested within each
other.
cel.bind(, , )
@@ -19,17 +19,17 @@ other.
Examples:
cel.bind(a, 'hello',
- cel.bind(b, 'world', a + b + b + a)) // "helloworldworldhello"
+ cel.bind(b, 'world', a + b + b + a)) // "helloworldworldhello"
// Avoid a list allocation within the exists comprehension.
cel.bind(valid_values, [a, b, c],
- [d, e, f].exists(elem, elem in valid_values))
+ [d, e, f].exists(elem, elem in valid_values))
Local bindings are not guaranteed to be evaluated before use.
## Encoders
-Encoding utilies for marshalling data into standardized representations.
+Encoding utilities for marshalling data into standardized representations.
### Base64.Decode
@@ -100,7 +100,8 @@ argument. Simple numeric and list literals are supported as valid argument
types; however, other literals will be flagged as errors during macro
expansion. If the argument expression does not resolve to a numeric or
list(numeric) type during type-checking, or during runtime then an error
-will be produced. If a list argument is empty, this too will produce an error.
+will be produced. If a list argument is empty, this too will produce an
+error.
math.least(, ...) ->
@@ -117,6 +118,261 @@ Examples:
math.least(a, b) // check-time error if a or b is non-numeric
math.least(dyn('string')) // runtime error
+### Math.BitOr
+
+Introduced at version: 1
+
+Performs a bitwise-OR operation over two int or uint values.
+
+ math.bitOr(, ) ->
+ math.bitOr(, ) ->
+
+Examples:
+
+ math.bitOr(1u, 2u) // returns 3u
+ math.bitOr(-2, -4) // returns -2
+
+### Math.BitAnd
+
+Introduced at version: 1
+
+Performs a bitwise-AND operation over two int or uint values.
+
+ math.bitAnd(, ) ->
+ math.bitAnd(, ) ->
+
+Examples:
+
+ math.bitAnd(3u, 2u) // return 2u
+ math.bitAnd(3, 5) // returns 3
+ math.bitAnd(-3, -5) // returns -7
+
+### Math.BitXor
+
+Introduced at version: 1
+
+ math.bitXor(, ) ->
+ math.bitXor(, ) ->
+
+Performs a bitwise-XOR operation over two int or uint values.
+
+Examples:
+
+ math.bitXor(3u, 5u) // returns 6u
+ math.bitXor(1, 3) // returns 2
+
+### Math.BitNot
+
+Introduced at version: 1
+
+Function which accepts a single int or uint and performs a bitwise-NOT
+ones-complement of the given binary value.
+
+ math.bitNot() ->
+ math.bitNot() ->
+
+Examples
+
+ math.bitNot(1) // returns -1
+ math.bitNot(-1) // return 0
+ math.bitNot(0u) // returns 18446744073709551615u
+
+### Math.BitShiftLeft
+
+Introduced at version: 1
+
+Perform a left shift of bits on the first parameter, by the amount of bits
+specified in the second parameter. The first parameter is either a uint or
+an int. The second parameter must be an int.
+
+When the second parameter is 64 or greater, 0 will be always be returned
+since the number of bits shifted is greater than or equal to the total bit
+length of the number being shifted. Negative valued bit shifts will result
+in a runtime error.
+
+ math.bitShiftLeft(, ) ->
+ math.bitShiftLeft(, ) ->
+
+Examples
+
+ math.bitShiftLeft(1, 2) // returns 4
+ math.bitShiftLeft(-1, 2) // returns -4
+ math.bitShiftLeft(1u, 2) // return 4u
+ math.bitShiftLeft(1u, 200) // returns 0u
+
+### Math.BitShiftRight
+
+Introduced at version: 1
+
+Perform a right shift of bits on the first parameter, by the amount of bits
+specified in the second parameter. The first parameter is either a uint or
+an int. The second parameter must be an int.
+
+When the second parameter is 64 or greater, 0 will always be returned since
+the number of bits shifted is greater than or equal to the total bit length
+of the number being shifted. Negative valued bit shifts will result in a
+runtime error.
+
+The sign bit extension will not be preserved for this operation: vacant bits
+on the left are filled with 0.
+
+ math.bitShiftRight(, ) ->
+ math.bitShiftRight(, ) ->
+
+Examples
+
+ math.bitShiftRight(1024, 2) // returns 256
+ math.bitShiftRight(1024u, 2) // returns 256u
+ math.bitShiftRight(1024u, 64) // returns 0u
+
+### Math.Ceil
+
+Introduced at version: 1
+
+Compute the ceiling of a double value.
+
+ math.ceil() ->
+
+Examples:
+
+ math.ceil(1.2) // returns 2.0
+ math.ceil(-1.2) // returns -1.0
+
+### Math.Floor
+
+Introduced at version: 1
+
+Compute the floor of a double value.
+
+ math.floor() ->
+
+Examples:
+
+ math.floor(1.2) // returns 1.0
+ math.floor(-1.2) // returns -2.0
+
+### Math.Round
+
+Introduced at version: 1
+
+Rounds the double value to the nearest whole number with ties rounding away
+from zero, e.g. 1.5 -> 2.0, -1.5 -> -2.0.
+
+ math.round() ->
+
+Examples:
+
+ math.round(1.2) // returns 1.0
+ math.round(1.5) // returns 2.0
+ math.round(-1.5) // returns -2.0
+
+### Math.Trunc
+
+Introduced at version: 1
+
+Truncates the fractional portion of the double value.
+
+ math.trunc() ->
+
+Examples:
+
+ math.trunc(-1.3) // returns -1.0
+ math.trunc(1.3) // returns 1.0
+
+### Math.Abs
+
+Introduced at version: 1
+
+Returns the absolute value of the numeric type provided as input. If the
+value is NaN, the output is NaN. If the input is int64 min, the function
+will result in an overflow error.
+
+ math.abs() ->
+ math.abs() ->
+ math.abs() ->
+
+Examples:
+
+ math.abs(-1) // returns 1
+ math.abs(1) // returns 1
+ math.abs(-9223372036854775808) // overlflow error
+
+### Math.Sign
+
+Introduced at version: 1
+
+Returns the sign of the numeric type, either -1, 0, 1 as an int, double, or
+uint depending on the overload. For floating point values, if NaN is
+provided as input, the output is also NaN. The implementation does not
+differentiate between positive and negative zero.
+
+ math.sign() ->
+ math.sign() ->
+ math.sign() ->
+
+Examples:
+
+ math.sign(-42) // returns -1
+ math.sign(0) // returns 0
+ math.sign(42) // returns 1
+
+### Math.IsInf
+
+Introduced at version: 1
+
+Returns true if the input double value is -Inf or +Inf.
+
+ math.isInf() ->
+
+Examples:
+
+ math.isInf(1.0/0.0) // returns true
+ math.isInf(1.2) // returns false
+
+### Math.IsNaN
+
+Introduced at version: 1
+
+Returns true if the input double value is NaN, false otherwise.
+
+ math.isNaN() ->
+
+Examples:
+
+ math.isNaN(0.0/0.0) // returns true
+ math.isNaN(1.2) // returns false
+
+### Math.IsFinite
+
+Introduced at version: 1
+
+Returns true if the value is a finite number. Equivalent in behavior to:
+!math.isNaN(double) && !math.isInf(double)
+
+ math.isFinite() ->
+
+Examples:
+
+ math.isFinite(0.0/0.0) // returns false
+ math.isFinite(1.2) // returns true
+
+### Math.Sqrt
+
+Introduced at version: 2
+
+Returns the square root of the given input as double
+Throws error for negative or non-numeric inputs
+
+ math.sqrt() ->
+ math.sqrt() ->
+ math.sqrt() ->
+
+Examples:
+
+ math.sqrt(81) // returns 9.0
+ math.sqrt(985.25) // returns 31.388692231439016
+ math.sqrt(-15) // returns NaN
+
## Protos
Protos configure extended macros and functions for proto manipulation.
@@ -154,8 +410,68 @@ Example:
Extended functions for list manipulation. As a general note, all indices are
zero-based.
+### Distinct
+
+**Introduced in version 2 (cost support in version 3)**
+
+Returns the distinct elements of a list.
+
+ .distinct() ->
+
+Examples:
+
+ [1, 2, 2, 3, 3, 3].distinct() // return [1, 2, 3]
+ ["b", "b", "c", "a", "c"].distinct() // return ["b", "c", "a"]
+ [1, "b", 2, "b"].distinct() // return [1, "b", 2]
+
+### Flatten
+
+**Introduced in version 1 (cost support in version 3)**
+
+Flattens a list recursively.
+If an optional depth is provided, the list is flattened to a the specificied level.
+A negative depth value will result in an error.
+
+ .flatten() ->
+ .flatten(, ) ->
+
+Examples:
+
+ [1,[2,3],[4]].flatten() // return [1, 2, 3, 4]
+ [1,[2,[3,4]]].flatten() // return [1, 2, [3, 4]]
+ [1,2,[],[],[3,4]].flatten() // return [1, 2, 3, 4]
+ [1,[2,[3,[4]]]].flatten(2) // return [1, 2, 3, [4]]
+ [1,[2,[3,[4]]]].flatten(-1) // error
+
+### Range
+
+**Introduced in version 2 (cost support in version 3)**
+
+Returns a list of integers from 0 to n-1.
+
+ lists.range() ->
+
+Examples:
+
+ lists.range(5) -> [0, 1, 2, 3, 4]
+
+
+### Reverse
+
+**Introduced in version 2 (cost support in version 3)**
+
+Returns the elements of a list in reverse order.
+
+ .reverse() ->
+
+Examples:
+
+ [5, 3, 1, 2].reverse() // return [2, 1, 3, 5]
+
+
### Slice
+**Introduced in version 0 (cost support in version 3)**
Returns a new sub-list using the indexes provided.
@@ -164,7 +480,73 @@ Returns a new sub-list using the indexes provided.
Examples:
[1,2,3,4].slice(1, 3) // return [2, 3]
- [1,2,3,4].slice(2, 4) // return [3 ,4]
+ [1,2,3,4].slice(2, 4) // return [3, 4]
+
+### Sort
+
+**Introduced in version 2 (cost support in version 3)**
+
+Sorts a list with comparable elements. If the element type is not comparable
+or the element types are not the same, the function will produce an error.
+
+ .sort() ->
+ T in {int, uint, double, bool, duration, timestamp, string, bytes}
+
+Examples:
+
+ [3, 2, 1].sort() // return [1, 2, 3]
+ ["b", "c", "a"].sort() // return ["a", "b", "c"]
+ [1, "b"].sort() // error
+ [[1, 2, 3]].sort() // error
+
+### SortBy
+
+**Introduced in version 2 (cost support in version 3)**
+
+Sorts a list by a key value, i.e., the order is determined by the result of
+an expression applied to each element of the list.
+
+ .sortBy(, ) ->
+ keyExpr returns a value in {int, uint, double, bool, duration, timestamp, string, bytes}
+
+Examples:
+
+ [
+ Player { name: "foo", score: 0 },
+ Player { name: "bar", score: -10 },
+ Player { name: "baz", score: 1000 },
+ ].sortBy(e, e.score).map(e, e.name)
+ == ["bar", "foo", "baz"]
+
+### Last
+
+**Introduced in the OptionalTypes library version 2**
+
+Returns an optional with the last value from the list or `optional.None` if the
+list is empty.
+
+ .last() ->
+
+Examples:
+
+ [1, 2, 3].last().value() == 3
+ [].last().orValue('test') == 'test'
+
+This is syntactic sugar for list[list.size()-1].
+
+### First
+
+**Introduced in the OptionalTypes library version 2**
+
+Returns an optional with the first value from the list or `optional.None` if the
+list is empty.
+
+ .first() ->
+
+Examples:
+
+ [1, 2, 3].first().value() == 1
+ [].first().orValue('test') == 'test'
## Sets
@@ -259,7 +641,8 @@ Examples:
'hello mellow'.indexOf('jello') // returns -1
'hello mellow'.indexOf('', 2) // returns 2
'hello mellow'.indexOf('ello', 2) // returns 7
- 'hello mellow'.indexOf('ello', 20) // error
+ 'hello mellow'.indexOf('ello', 20) // returns -1
+ 'hello mellow'.indexOf('ello', -1) // error
### Join
@@ -273,10 +656,10 @@ elements in the resulting string.
Examples:
- ['hello', 'mellow'].join() // returns 'hellomellow'
- ['hello', 'mellow'].join(' ') // returns 'hello mellow'
- [].join() // returns ''
- [].join('/') // returns ''
+ ['hello', 'mellow'].join() // returns 'hellomellow'
+ ['hello', 'mellow'].join(' ') // returns 'hello mellow'
+ [].join() // returns ''
+ [].join('/') // returns ''
### LastIndexOf
@@ -297,6 +680,7 @@ Examples:
'hello mellow'.lastIndexOf('ello') // returns 7
'hello mellow'.lastIndexOf('jello') // returns -1
'hello mellow'.lastIndexOf('ello', 6) // returns 1
+ 'hello mellow'.lastIndexOf('ello', 20) // returns -1
'hello mellow'.lastIndexOf('ello', -1) // error
### LowerAscii
@@ -414,3 +798,150 @@ 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'
+
+## TwoVarComprehensions
+
+TwoVarComprehensions introduces support for two-variable comprehensions.
+
+The two-variable form of comprehensions looks similar to the one-variable
+counterparts. Where possible, the same macro names were used and additional
+macro signatures added. The notable distinction for two-variable comprehensions
+is the introduction of `transformList`, `transformMap`, and `transformMapEntry`
+support for list and map types rather than the more traditional `map` and
+`filter` macros.
+
+### All
+
+Comprehension which tests whether all elements in the list or map satisfy a
+given predicate. The `all` macro evaluates in a manner consistent with logical
+AND and will short-circuit when encountering a `false` value.
+
+ .all(indexVar, valueVar, ) -> bool
+